From 68e4e710051de7903d5eff14660f51b3779be682 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Jan 2023 12:08:40 +0100 Subject: [PATCH] FIX: Amount of localtax1 and 2 not correctly save on purchase order (the rate was saved instead) --- ChangeLog | 32 +++++++++ htdocs/core/tpl/objectline_view.tpl.php | 67 +++++++++++-------- htdocs/filefunc.inc.php | 2 +- .../class/fournisseur.commande.class.php | 4 +- htdocs/fourn/commande/card.php | 1 - htdocs/langs/en_US/main.lang | 1 + 6 files changed, 76 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1abc487eff1..bd98b41d9b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,38 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 16.0.4 compared to 16.0.2 ***** + +FIX: Amount of localtax1 and 2 not correctly save on purchase order (the rate was saved instead) +FIX: #20415 +FIX: #21280 FIX: #23008 +FIX: #22271 +FIX: #22837 +FIX: #23019 Impossible to add task times to an existing draft invoice +FIX: #23072 +FIX: #23087 +FIX: #23115 FIX: #23116 +FIX: #23281 +FIX: bad selection of barcode numbering module +FIX: Can't see all time spent by all user +FIX: CI +FIX: CommonObject - showOptionals - Display blank td when MAIN_VIEW_LINE_NUMBER is enabled and action is confirm_valid +FIX: Documents API inconsistency +FIX|Fix [#23075] +FIX|Fix[#23117] +FIX: get multicurrency infos of propal when create order from propal with "WORKFLOW_PROPAL_AUTOCREATE_ORDER" conf +FIX: Give predictable order to inventory lines +FIX: include class multicurrency +FIX: methods declaration (backport fix 67b9a7dc07d708231d12b5e58800334d4a01ef98) +FIX: multicurrency_tx and not currency_tx +FIX: PGSQL Integer type does not have a free lenght +FIX: PGSQL Int type does not have a free lenght +FIX: Product list in setup.php in new Module +FIX: propal and order stats broken on Tag+User(retricted customer list) +FIX: saving of numbering module for jobs +FIX: Stickler +FIX: travis + ***** ChangeLog for 16.0.3 compared to 16.0.2 ***** diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index c2d81b81eb5..37b1d9af25e 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -255,11 +255,40 @@ if (!empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) { } print ''; +// Vendor price ref if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier' || $object->element == 'invoice_supplier_rec') { // We must have same test in printObjectLines print ''; print ($line->ref_fourn ? $line->ref_fourn : $line->ref_supplier); print ''; } + +$tooltiponprice = ''; +$tooltiponpriceend = ''; +if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { + $tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht); + $tooltiponprice .= '
'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva); + $seller = ($senderissupplier ? (is_object($object->thirdparty) ? $object->thirdparty : null) : $mysoc); + if ($seller) { + if ($seller->useLocalTax(1)) { + if (($mysoc->country_code == $object->thirdparty->country_code) || $seller->useLocalTax(1)) { + $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1); + } else { + $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThis".($senderissupplier ? "Vendor" : "Customer")).''; + } + } + if ($seller->useLocalTax(2)) { + if (($mysoc->country_code == $object->thirdparty->country_code) || $seller->useLocalTax(2)) { + $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2); + } else { + $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThis".($senderissupplier ? "Vendor" : "Customer")).''; + } + } + } + $tooltiponprice .= '
'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc); + $tooltiponprice = ''; + $tooltiponpriceend = ''; +} + // VAT Rate print ''; $coldisplay++; @@ -276,8 +305,9 @@ if (price2num($line->total_localtax2)) { if (empty($positiverates)) { $positiverates = '0'; } +print $tooltiponprice; print vatrate($positiverates.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''), '%', $line->info_bits); -//print vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); +print $tooltiponpriceend; ?> subprice); ?> @@ -344,45 +374,24 @@ if ($usemargins && !empty($conf->margin->enabled) && empty($user->socid)) { marque_tx, 'MT')).'%'; ?> special_code == 3) { ?> trans('Option'); ?> '; $coldisplay++; - if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht); - $tooltiponprice .= '
'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva); - if (!$senderissupplier && is_object($object->thirdparty)) { - if ($mysoc->useLocalTax(1)) { - if (($mysoc->country_code == $object->thirdparty->country_code) || $object->thirdparty->useLocalTax(1)) { - $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1); - } else { - $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; - } - } - if ($mysoc->useLocalTax(2)) { - if (($mysoc->country_code == $object->thirdparty->country_code) || $object->thirdparty->useLocalTax(2)) { - $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2); - } else { - $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; - } - } - } - $tooltiponprice .= '
'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc); - - print ''; - } + print $tooltiponprice; print price($sign * $line->total_ht); - if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - print ''; - } + print $tooltiponpriceend; print ''; if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { print ''.price($sign * $line->multicurrency_total_ht).''; $coldisplay++; } } + +// Price inc tax if ($outputalsopricetotalwithtax) { print ''.price($sign * $line->total_ttc).''; $coldisplay++; @@ -397,6 +406,7 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin } } + // Asset info if (!empty($conf->asset->enabled) && $object->element == 'invoice_supplier') { print ''; $coldisplay++; @@ -426,6 +436,7 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin print ''; } + // Edit picto print ''; $coldisplay++; if (($line->info_bits & 2) == 2 || !empty($disableedit)) { @@ -435,6 +446,7 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin } print ''; + // Delete picto print ''; $coldisplay++; if (!$situationinvoicelinewithparent && empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company. @@ -444,6 +456,7 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin } print ''; + // Move up-down picto if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { print ''; $coldisplay++; diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 7538846c6a1..f57a3730a6f 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '16.0.3'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '16.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index d39620bdb3b..92cfed778e4 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3895,8 +3895,8 @@ class CommandeFournisseurLigne extends CommonOrderLine $sql .= ", vat_src_code = '".(empty($this->vat_src_code) ? '' : $this->vat_src_code)."'"; $sql .= ", tva_tx='".price2num($this->tva_tx)."'"; - $sql .= ", localtax1_tx='".price2num($this->total_localtax1)."'"; - $sql .= ", localtax2_tx='".price2num($this->total_localtax2)."'"; + $sql .= ", localtax1_tx='".price2num($this->localtax1_tx)."'"; + $sql .= ", localtax2_tx='".price2num($this->localtax2_tx)."'"; $sql .= ", localtax1_type='".$this->db->escape($this->localtax1_type)."'"; $sql .= ", localtax2_type='".$this->db->escape($this->localtax2_type)."'"; $sql .= ", qty='".price2num($this->qty)."'"; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 3b0f4fdb6e5..cfe4a43d05e 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -69,7 +69,6 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'purchaseordercard'; // To manage different context of search - $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index cf748a60626..1acda85ed2a 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1122,6 +1122,7 @@ DeleteFileText=Do you really want delete this file? ShowOtherLanguages=Show other languages SwitchInEditModeToAddTranslation=Switch in edit mode to add translations for this language NotUsedForThisCustomer=Not used for this customer +NotUsedForThisVendor=Not used for this vendor AmountMustBePositive=Amount must be positive ByStatus=By status InformationMessage=Information