Browse Source

FIX: Amount of localtax1 and 2 not correctly save on purchase order (the
rate was saved instead)

Laurent Destailleur 2 years ago
parent
commit
68e4e71005

+ 32 - 0
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 *****
 

+ 40 - 27
htdocs/core/tpl/objectline_view.tpl.php

@@ -255,11 +255,40 @@ if (!empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) {
 }
 
 print '</td>';
+// 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 '<td class="linecolrefsupplier">';
 	print ($line->ref_fourn ? $line->ref_fourn : $line->ref_supplier);
 	print '</td>';
 }
+
+$tooltiponprice = '';
+$tooltiponpriceend = '';
+if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
+	$tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht);
+	$tooltiponprice .= '<br>'.$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 .= '<br>'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1);
+			} else {
+				$tooltiponprice .= '<br>'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'=<span class="opacitymedium">'.$langs->trans("NotUsedForThis".($senderissupplier ? "Vendor" : "Customer")).'</span>';
+			}
+		}
+		if ($seller->useLocalTax(2)) {
+			if (($mysoc->country_code == $object->thirdparty->country_code) || $seller->useLocalTax(2)) {
+				$tooltiponprice .= '<br>'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2);
+			} else {
+				$tooltiponprice .= '<br>'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'=<span class="opacitymedium">'.$langs->trans("NotUsedForThis".($senderissupplier ? "Vendor" : "Customer")).'</span>';
+			}
+		}
+	}
+	$tooltiponprice .= '<br>'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc);
+	$tooltiponprice = '<span class="classfortooltip" title="'.dol_escape_htmltag($tooltiponprice).'">';
+	$tooltiponpriceend = '</span>';
+}
+
 // VAT Rate
 print '<td class="linecolvat nowrap right">';
 $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;
 ?></td>
 
 	<td class="linecoluht nowrap right"><?php $coldisplay++; ?><?php print price($sign * $line->subprice); ?></td>
@@ -344,45 +374,24 @@ if ($usemargins && !empty($conf->margin->enabled) && empty($user->socid)) {
 		<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php print price(price2num($line->marque_tx, 'MT')).'%'; ?></td>
 	<?php }
 }
+
 // Price total without tax
 if ($line->special_code == 3) { ?>
 	<td class="linecoloption nowrap right"><?php $coldisplay++; ?><?php print $langs->trans('Option'); ?></td>
 <?php } else {
 	print '<td class="linecolht nowrap right">';
 	$coldisplay++;
-	if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
-		$tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht);
-		$tooltiponprice .= '<br>'.$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 .= '<br>'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1);
-				} else {
-					$tooltiponprice .= '<br>'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'=<span class="opacitymedium">'.$langs->trans("NotUsedForThisCustomer").'</span>';
-				}
-			}
-			if ($mysoc->useLocalTax(2)) {
-				if (($mysoc->country_code == $object->thirdparty->country_code) || $object->thirdparty->useLocalTax(2)) {
-					$tooltiponprice .= '<br>'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2);
-				} else {
-					$tooltiponprice .= '<br>'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'=<span class="opacitymedium">'.$langs->trans("NotUsedForThisCustomer").'</span>';
-				}
-			}
-		}
-		$tooltiponprice .= '<br>'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc);
-
-		print '<span class="classfortooltip" title="'.dol_escape_htmltag($tooltiponprice).'">';
-	}
+	print $tooltiponprice;
 	print price($sign * $line->total_ht);
-	if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
-		print '</span>';
-	}
+	print $tooltiponpriceend;
 	print '</td>';
 	if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
 		print '<td class="linecolutotalht_currency nowrap right">'.price($sign * $line->multicurrency_total_ht).'</td>';
 		$coldisplay++;
 	}
 }
+
+// Price inc tax
 if ($outputalsopricetotalwithtax) {
 	print '<td class="linecolht nowrap right">'.price($sign * $line->total_ttc).'</td>';
 	$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 '<td class="linecolasset center">';
 		$coldisplay++;
@@ -426,6 +436,7 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin
 		print '</td>';
 	}
 
+	// Edit picto
 	print '<td class="linecoledit center">';
 	$coldisplay++;
 	if (($line->info_bits & 2) == 2 || !empty($disableedit)) {
@@ -435,6 +446,7 @@ if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlin
 	}
 	print '</td>';
 
+	// Delete picto
 	print '<td class="linecoldelete center">';
 	$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 '</td>';
 
+	// Move up-down picto
 	if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) {
 		print '<td class="linecolmove tdlineupdown center">';
 		$coldisplay++;

+ 1 - 1
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')) {

+ 2 - 2
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)."'";

+ 0 - 1
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');
 

+ 1 - 0
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