Debug v18

This commit is contained in:
Laurent Destailleur 2023-08-15 17:47:11 +02:00
parent 6ed243ba1f
commit e1c1172da8
7 changed files with 89 additions and 32 deletions

View file

@ -262,11 +262,14 @@ if (isModEnabled('accounting')) {
print $boxlist;
print '</div>';
} else {
} elseif (isModEnabled('compta')) {
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
print '<span class="opacitymedium">'.$langs->trans("Module10Desc")."</span>\n";
print "<br>";
} else {
// This case can happen mode no accounting module is on but module "intracommreport" is on
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
}
// End of page

View file

@ -178,7 +178,9 @@ if (($action == 'searchfiles' || $action == 'dl')) {
if (!empty($sql)) {
$sql .= " UNION ALL";
}
$sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.multicurrency_code as currency, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_CREDIT." as sens";
$sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat,";
$sql .= " t.localtax1, t.localtax2, t.revenuestamp,";
$sql .= " t.multicurrency_code as currency, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_CREDIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays";
$sql .= " WHERE datef between ".$wheretail;
$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
@ -190,7 +192,9 @@ if (($action == 'searchfiles' || $action == 'dl')) {
if (!empty($sql)) {
$sql .= " UNION ALL";
}
$sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.multicurrency_code as currency, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'SupplierInvoice' as item, s.nom as thirdparty_name, s.code_fournisseur as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_DEBIT." as sens";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat,";
$sql .= " t.localtax1, t.localtax2, 0 as revenuestamp,";
$sql .= " t.multicurrency_code as currency, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'SupplierInvoice' as item, s.nom as thirdparty_name, s.code_fournisseur as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays";
$sql .= " WHERE datef between ".$wheretail;
$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
@ -202,7 +206,9 @@ if (($action == 'searchfiles' || $action == 'dl')) {
if (!empty($sql)) {
$sql .= " UNION ALL";
}
$sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.multicurrency_code as currency, t.fk_user_author as fk_soc, t.date_fin as date, t.date_fin as date_due, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paid, t.total_ht, t.total_ttc, t.total_tva as total_vat,";
$sql .= " 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
$sql .= " t.multicurrency_code as currency, t.fk_user_author as fk_soc, t.date_fin as date, t.date_fin as date_due, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user_author LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country";
$sql .= " WHERE date_fin between ".$wheretail;
$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
@ -213,7 +219,9 @@ if (($action == 'searchfiles' || $action == 'dl')) {
if (!empty($sql)) {
$sql .= " UNION ALL";
}
$sql .= " SELECT t.rowid as id, t.entity, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat, '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.datedon as date, t.datedon as date_due, 'Donation' as item, t.societe as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_CREDIT." as sens";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat,";
$sql .= " 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
$sql .= " '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.datedon as date, t.datedon as date_due, 'Donation' as item, t.societe as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_CREDIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."don as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = t.fk_country";
$sql .= " WHERE datedon between ".$wheretail;
$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
@ -225,7 +233,9 @@ if (($action == 'searchfiles' || $action == 'dl')) {
if (!empty($sql)) {
$sql .= " UNION ALL";
}
$sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, '".$db->escape($conf->currency)."' as currency, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat,";
$sql .= " 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
$sql .= " '".$db->escape($conf->currency)."' as currency, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country";
$sql .= " WHERE datep between ".$wheretail;
$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
@ -237,7 +247,9 @@ if (($action == 'searchfiles' || $action == 'dl')) {
if (!empty($sql)) {
$sql .= " UNION ALL";
}
$sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_vat, '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.date_ech as date, t.periode as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_vat,";
$sql .= " 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
$sql .= " '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.date_ech as date, t.periode as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as t";
$sql .= " WHERE t.date_ech between ".$wheretail;
$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
@ -249,7 +261,9 @@ if (($action == 'searchfiles' || $action == 'dl')) {
if (!empty($sql)) {
$sql .= " UNION ALL";
}
$sql .= " SELECT t.rowid as id, t.entity, t.ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_vat, '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.datep as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, sens";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_vat,";
$sql .= " 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
$sql .= " '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.datep as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, sens";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_various as t";
$sql .= " WHERE datep between ".$wheretail;
$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
@ -260,7 +274,9 @@ if (($action == 'searchfiles' || $action == 'dl')) {
if (!empty($sql)) {
$sql .= " UNION ALL";
}
$sql .= " SELECT t.rowid as id, l.entity, l.label as ref, 1 as paid, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ht, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ttc, 0 as total_vat, '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.datep as date, t.datep as date_due, 'LoanPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " SELECT t.rowid as id, l.entity, l.label as ref, 1 as paid, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ht, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ttc, 0 as total_vat,";
$sql .= " 0 as localtax1, 0 as localtax2, 0 as revenuestamp,";
$sql .= " '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.datep as date, t.datep as date_due, 'LoanPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_loan as t LEFT JOIN ".MAIN_DB_PREFIX."loan as l ON l.rowid = t.fk_loan";
$sql .= " WHERE datep between ".$wheretail;
$sql .= " AND l.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
@ -368,6 +384,9 @@ if (($action == 'searchfiles' || $action == 'dl')) {
$nofile['amount_ht'] = $objd->total_ht;
$nofile['amount_ttc'] = $objd->total_ttc;
$nofile['amount_vat'] = $objd->total_vat;
$nofile['amount_localtax1'] = $objd->localtax1;
$nofile['amount_localtax2'] = $objd->localtax2;
$nofile['amount_revenuestamp'] = $objd->revenuestamp;
$nofile['ref'] = ($objd->ref ? $objd->ref : $objd->id);
$nofile['fk'] = $objd->fk_soc;
$nofile['item'] = $objd->item;
@ -391,6 +410,9 @@ if (($action == 'searchfiles' || $action == 'dl')) {
$file['amount_ht'] = $objd->total_ht;
$file['amount_ttc'] = $objd->total_ttc;
$file['amount_vat'] = $objd->total_vat;
$file['amount_localtax1'] = $objd->localtax1;
$file['amount_localtax2'] = $objd->localtax2;
$file['amount_revenuestamp'] = $objd->revenuestamp;
$file['ref'] = ($objd->ref ? $objd->ref : $objd->id);
$file['fk'] = $objd->fk_soc;
$file['item'] = $objd->item;
@ -469,6 +491,9 @@ if ($result && $action == "dl" && !$error) {
$log .= ','.$langs->transnoentitiesnoconv("TotalHT");
$log .= ','.$langs->transnoentitiesnoconv("TotalTTC");
$log .= ','.$langs->transnoentitiesnoconv("TotalVAT");
$log .= ','.$langs->transcountrynoentities("TotalLT1", $mysoc->country_code);
$log .= ','.$langs->transcountrynoentities("TotalLT2", $mysoc->country_code);
$log .= ','.$langs->transnoentitiesnoconv("Revenuestamp");
$log .= ','.$langs->transnoentitiesnoconv("Paid");
$log .= ','.$langs->transnoentitiesnoconv("Document");
$log .= ','.$langs->transnoentitiesnoconv("ItemID");
@ -511,6 +536,9 @@ if ($result && $action == "dl" && !$error) {
$log .= ','.$file['amount_ht'];
$log .= ','.$file['amount_ttc'];
$log .= ','.$file['amount_vat'];
$log .= ','.$file['amount_localtax1'];
$log .= ','.$file['amount_localtax2'];
$log .= ','.$file['amount_revenuestamp'];
$log .= ','.$file['paid'];
$log .= ',"'.$file["name"].'"';
$log .= ','.$file['fk'];
@ -698,9 +726,10 @@ if (!empty($date_start) && !empty($date_stop)) {
print_liste_field_titre($arrayfields['ref']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'nowraponall ');
print '<td>'.$langs->trans("Document").'</td>';
print '<td>'.$langs->trans("Paid").'</td>';
print '<td align="right">'.$langs->trans("TotalHT").(isModEnabled('multicurrency') ? ' ('.$conf->currency.')' : '').'</td>';
print '<td align="right">'.$langs->trans("TotalTTC").(isModEnabled('multicurrency') ? ' ('.$conf->currency.')' : '').'</td>';
print '<td align="right">'.$langs->trans("TotalVAT").(isModEnabled('multicurrency') ? ' ('.$conf->currency.')' : '').'</td>';
print '<td align="right">'.$langs->trans("TotalHT").(isModEnabled('multicurrency') ? ' ('.$langs->getCurrencySymbol($conf->currency).')' : '').'</td>';
print '<td align="right">'.$langs->trans("TotalTTC").(isModEnabled('multicurrency') ? ' ('.$langs->getCurrencySymbol($conf->currency).')' : '').'</td>';
print '<td align="right">'.$langs->trans("TotalVAT").(isModEnabled('multicurrency') ? ' ('.$langs->getCurrencySymbol($conf->currency).')' : '').'</td>';
print '<td>'.$langs->trans("ThirdParty").'</td>';
print '<td class="center">'.$langs->trans("Code").'</td>';
print '<td class="center">'.$langs->trans("Country").'</td>';
@ -755,6 +784,9 @@ if (!empty($date_start) && !empty($date_stop)) {
$invoice->total_ht = $data['amount_ht'];
$invoice->total_ttc = $data['amount_ttc'];
$invoice->total_tva = $data['amount_vat'];
$invoice->total_localtax1 = $data['amount_localtax1'];
$invoice->total_localtax2 = $data['amount_localtax2'];
$invoice->revenuestamp = $data['amount_revenuestamp'];
$invoice->multicurrency_code = $data['currency'];
print $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
} elseif ($data['item'] == 'SupplierInvoice') {
@ -763,6 +795,9 @@ if (!empty($date_start) && !empty($date_stop)) {
$supplier_invoice->total_ht = $data['amount_ht'];
$supplier_invoice->total_ttc = $data['amount_ttc'];
$supplier_invoice->total_tva = $data['amount_vat'];
$supplier_invoice->total_localtax1 = $data['amount_localtax1'];
$supplier_invoice->total_localtax2 = $data['amount_localtax2'];
$supplier_invoice->revenuestamp = $data['amount_revenuestamp'];
$supplier_invoice->multicurrency_code = $data['currency'];
print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
} elseif ($data['item'] == 'ExpenseReport') {
@ -816,10 +851,16 @@ if (!empty($date_start) && !empty($date_stop)) {
// Paid
print '<td class="center">'.($data['paid'] ? yn($data['paid']) : '').'</td>';
// Total ET
// Total WOT
print '<td align="right"><span class="amount">'.price(price2num($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'], 'MT'))."</span></td>\n";
// Total IT
print '<td align="right"><span class="amount">'.price(price2num($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'], 'MT'))."</span></td>\n";
// Total INCT
print '<td align="right"><span class="amount">';
$tooltip = $langs->trans("TotalVAT").' : '.price(price2num($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'], 'MT'));
if (!empty($data['amount_revenuestamp'])) {
$tooltip .= '<br>'.$langs->trans("RevenueStamp").' : '.price(price2num($data['sens'] ? $data['amount_revenuestamp'] : -$data['amount_revenuestamp'], 'MT'));
}
print '<span class="classfortooltip" title="'.dol_escape_htmltag($tooltip).'">'.price(price2num($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'], 'MT')).'</span>';
print "</span></td>\n";
// Total VAT
print '<td align="right"><span class="amount">'.price(price2num($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'], 'MT'))."</span></td>\n";

View file

@ -1982,6 +1982,9 @@ class Facture extends CommonInvoice
if (!empty($this->total_tva)) {
$datas['amountvat'] = '<br><b>'.$langs->trans('AmountVAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->revenuestamp)) {
$datas['amountrevenustamp'] = '<br><b>'.$langs->trans('RevenueStamp').':</b> '.price($this->revenuestamp, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->total_localtax1) && $this->total_localtax1 != 0) {
// We keep test != 0 because $this->total_localtax1 can be '0.00000000'
$datas['amountlt1'] = '<br><b>'.$langs->transcountry('AmountLT1', $mysoc->country_code).':</b> '.price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency);

View file

@ -895,7 +895,7 @@ class pdf_crabe extends ModelePDFFactures
}
// Pagefoot
$this->_pagefoot($pdf, $object, $outputlangs, 0, $this->getHeightForQRInvoice($pageposbefore, $object, $langs));
$this->_pagefoot($pdf, $object, $outputlangs, 0, $this->getHeightForQRInvoice($pdf->getPage(), $object, $langs));
if (method_exists($pdf, 'AliasNbPages')) {
$pdf->AliasNbPages();
}

View file

@ -658,7 +658,7 @@ class pdf_sponge extends ModelePDFFactures
// Add footer
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$this->_pagefoot($pdf, $object, $outputlangs, 1, $this->getHeightForQRInvoice($pdf->getPage(), $object, $outputlangs));
$this->_pagefoot($pdf, $object, $outputlangs, 1, $this->getHeightForQRInvoice($i, $object, $outputlangs));
$i++;
}
@ -1053,7 +1053,7 @@ class pdf_sponge extends ModelePDFFactures
}
// Pagefoot
$this->_pagefoot($pdf, $object, $outputlangs, 0, $this->getHeightForQRInvoice($pageposbefore, $object, $langs));
$this->_pagefoot($pdf, $object, $outputlangs, 0, $this->getHeightForQRInvoice($pdf->getPage(), $object, $langs));
if (method_exists($pdf, 'AliasNbPages')) {
$pdf->AliasNbPages();
}

View file

@ -2766,6 +2766,16 @@ class FactureFournisseur extends CommonInvoice
if (!empty($this->total_tva)) {
$datas['totaltva'] = '<br><b>'.$langs->trans('AmountVAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->total_localtax1) && $this->total_localtax1 != 0) {
// We keep test != 0 because $this->total_localtax1 can be '0.00000000'
$datas['amountlt1'] = '<br><b>'.$langs->transcountry('AmountLT1', $mysoc->country_code).':</b> '.price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->total_localtax2) && $this->total_localtax2 != 0) {
$datas['amountlt2'] = '<br><b>'.$langs->transcountry('AmountLT2', $mysoc->country_code).':</b> '.price($this->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->revenuestamp)) {
$datas['amountrevenustamp'] = '<br><b>'.$langs->trans('RevenueStamp').':</b> '.price($this->revenuestamp, 0, $langs, 0, -1, -1, $conf->currency);
}
if (!empty($this->total_ttc)) {
$datas['totalttc'] = '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
}

View file

@ -173,13 +173,13 @@ $arrayfields = array(
'f.datef'=>array('label'=>"DateInvoice", 'checked'=>1),
'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1),
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>0),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>0),
's.town'=>array('label'=>"Town", 'checked'=>-1),
's.zip'=>array('label'=>"Zip", 'checked'=>1),
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>41),
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>0, 'position'=>42),
's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>43),
's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>44),
'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>45),
'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>46),
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>49),
'f.fk_cond_reglement'=>array('label'=>"PaymentTerm", 'checked'=>1, 'position'=>50),
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>52),
'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>105),
@ -189,13 +189,13 @@ $arrayfields = array(
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>115),
'dynamount_payed'=>array('label'=>"Paid", 'checked'=>0, 'position'=>116),
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>117),
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), // Not enabled by default because slow
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'position'=>205, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'position'=>206, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'position'=>207, 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'position'=>208, 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'position'=>209, 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'position'=>210, 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'position'=>211, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), // Not enabled by default because slow
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>500),
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>501),
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502),