From 94afc84a0c80431b35e666ef61049c12aabf6200 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Nov 2013 19:31:13 +0100 Subject: [PATCH] Fix: price should not be lower than min price. --- htdocs/product/class/product.class.php | 5 +++++ htdocs/product/price.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 61f1c199d8c..0176effbb18 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1011,6 +1011,11 @@ class Product extends CommonObject // Check parameters if ($newvat == '') $newvat=$this->tva_tx; + if (! empty($newminprice) && ($newminprice > $newprice)) + { + $this->error='ErrorPricCanBeLowerThanMinPrice'; + return -1; + } if ($newprice!='' || $newprice==0) { diff --git a/htdocs/product/price.php b/htdocs/product/price.php index cba87ea6e45..0a245093057 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani