From 6e69e99227e89d65c7df5963739b4f634c78fb30 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Sat, 30 Jan 2016 15:33:11 +0100
Subject: [PATCH] FIX VAT Rate was not visible in log of old price list

---
 htdocs/product/price.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index 4e0079b491d..f10d8f17922 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -1026,7 +1026,7 @@ $sql .= " WHERE fk_product = " . $object->id;
 $sql .= " AND p.entity IN (" . getEntity('productprice', 1) . ")";
 $sql .= " AND p.fk_user_author = u.rowid";
 if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES)) $sql .= " AND p.price_level = " . $soc->price_level;
-$sql .= " ORDER BY p.date_price, p.rowid DESC, p.price_level ASC";
+$sql .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC";
 // $sql .= $db->plimit();
 
 $result = $db->query($sql);
@@ -1063,7 +1063,7 @@ if ($result)
 		}
 
 		print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
-		if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '<td align="right">' . $langs->trans("VATRate") . '</td>';
+		if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) || ! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '<td align="right">' . $langs->trans("VATRate") . '</td>';
 		print '<td align="right">' . $langs->trans("HT") . '</td>';
 		print '<td align="right">' . $langs->trans("TTC") . '</td>';
 		if (! empty($conf->dynamicprices->enabled)) {
@@ -1098,7 +1098,7 @@ if ($result)
 			}
 
 			print '<td align="center">' . $langs->trans($objp->price_base_type) . "</td>";
-			if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '<td align="right">' . vatrate($objp->tva_tx, true, $objp->recuperableonly) . "</td>";
+			if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) || ! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '<td align="right">' . vatrate($objp->tva_tx, true, $objp->recuperableonly) . "</td>";
 
 			//Price
 			if (! empty($objp->fk_price_expression) && ! empty($conf->dynamicprices->enabled))
-- 
GitLab