From e1c1172da820ea89f0dc5fb2efbe5971e5b3a7c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 15 Aug 2023 17:47:11 +0200 Subject: [PATCH] Debug v18 --- htdocs/accountancy/index.php | 5 +- htdocs/compta/accounting-files.php | 69 +++++++++++++++---- htdocs/compta/facture/class/facture.class.php | 3 + .../modules/facture/doc/pdf_crabe.modules.php | 2 +- .../facture/doc/pdf_sponge.modules.php | 4 +- .../fourn/class/fournisseur.facture.class.php | 10 +++ htdocs/fourn/facture/list.php | 28 ++++---- 7 files changed, 89 insertions(+), 32 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 3a1944b3cf4..28982da4e86 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -262,11 +262,14 @@ if (isModEnabled('accounting')) { print $boxlist; print ''; -} else { +} elseif (isModEnabled('compta')) { print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); print ''.$langs->trans("Module10Desc")."\n"; print "
"; +} 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 diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index ee4dad8a514..d45f290ad3f 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -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 ''.$langs->trans("Document").''; print ''.$langs->trans("Paid").''; - print ''.$langs->trans("TotalHT").(isModEnabled('multicurrency') ? ' ('.$conf->currency.')' : '').''; - print ''.$langs->trans("TotalTTC").(isModEnabled('multicurrency') ? ' ('.$conf->currency.')' : '').''; - print ''.$langs->trans("TotalVAT").(isModEnabled('multicurrency') ? ' ('.$conf->currency.')' : '').''; + print ''.$langs->trans("TotalHT").(isModEnabled('multicurrency') ? ' ('.$langs->getCurrencySymbol($conf->currency).')' : '').''; + print ''.$langs->trans("TotalTTC").(isModEnabled('multicurrency') ? ' ('.$langs->getCurrencySymbol($conf->currency).')' : '').''; + print ''.$langs->trans("TotalVAT").(isModEnabled('multicurrency') ? ' ('.$langs->getCurrencySymbol($conf->currency).')' : '').''; + print ''.$langs->trans("ThirdParty").''; print ''.$langs->trans("Code").''; print ''.$langs->trans("Country").''; @@ -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 ''.($data['paid'] ? yn($data['paid']) : '').''; - // Total ET + // Total WOT print ''.price(price2num($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'], 'MT'))."\n"; - // Total IT - print ''.price(price2num($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'], 'MT'))."\n"; + // Total INCT + print ''; + $tooltip = $langs->trans("TotalVAT").' : '.price(price2num($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'], 'MT')); + if (!empty($data['amount_revenuestamp'])) { + $tooltip .= '
'.$langs->trans("RevenueStamp").' : '.price(price2num($data['sens'] ? $data['amount_revenuestamp'] : -$data['amount_revenuestamp'], 'MT')); + } + print ''.price(price2num($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'], 'MT')).''; + print "
\n"; // Total VAT print ''.price(price2num($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'], 'MT'))."\n"; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 3db6e8f56fa..3422377f403 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1982,6 +1982,9 @@ class Facture extends CommonInvoice if (!empty($this->total_tva)) { $datas['amountvat'] = '
'.$langs->trans('AmountVAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); } + if (!empty($this->revenuestamp)) { + $datas['amountrevenustamp'] = '
'.$langs->trans('RevenueStamp').': '.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'] = '
'.$langs->transcountry('AmountLT1', $mysoc->country_code).': '.price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 7941815ee24..262571c2270 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -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(); } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 56cf21e16e8..8d283756653 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -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(); } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 6ac986093b7..7bb83da7fb3 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2766,6 +2766,16 @@ class FactureFournisseur extends CommonInvoice if (!empty($this->total_tva)) { $datas['totaltva'] = '
'.$langs->trans('AmountVAT').': '.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'] = '
'.$langs->transcountry('AmountLT1', $mysoc->country_code).': '.price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency); + } + if (!empty($this->total_localtax2) && $this->total_localtax2 != 0) { + $datas['amountlt2'] = '
'.$langs->transcountry('AmountLT2', $mysoc->country_code).': '.price($this->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency); + } + if (!empty($this->revenuestamp)) { + $datas['amountrevenustamp'] = '
'.$langs->trans('RevenueStamp').': '.price($this->revenuestamp, 0, $langs, 0, -1, -1, $conf->currency); + } if (!empty($this->total_ttc)) { $datas['totalttc'] = '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); } diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 9e9a8a46a62..303ad09369a 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -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),