From eec8d30625ebb3963576a36844e3411b0c40d817 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Wed, 27 Jan 2016 10:57:04 +0100 Subject: [PATCH 1/2] FIX: Not returning the correct multilevel price --- htdocs/product/class/product.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2188293a1ba..749899e345c 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -12,6 +12,7 @@ * Copyright (C) 2014 Henry Florian * Copyright (C) 2014 Philippe Grand * Copyright (C) 2014 Ion agorria + * Copyright (C) 2016 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1673,7 +1674,7 @@ class Product extends CommonObject $sql.= " WHERE entity IN (".getEntity('productprice', 1).")"; $sql.= " AND price_level=".$i; $sql.= " AND fk_product = '".$this->id."'"; - $sql.= " ORDER BY date_price, rowid DESC"; + $sql.= " ORDER BY date_price DESC, rowid DESC"; $sql.= " LIMIT 1"; $resql = $this->db->query($sql); if ($resql) From e3d8a9a8a4b9e274b9e554f86f43e2c89387b3fd Mon Sep 17 00:00:00 2001 From: fmarcet Date: Wed, 27 Jan 2016 12:13:31 +0100 Subject: [PATCH 2/2] FIX: Doesn't collect the value of the cost price correctly --- htdocs/product/fournisseurs.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 1f5e35a043a..0fe2769803d 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -7,6 +7,7 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2014 Ion Agorria * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2016 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,7 +47,7 @@ $rowid=GETPOST('rowid','int'); $action=GETPOST('action', 'alpha'); $cancel=GETPOST('cancel', 'alpha'); $socid=GETPOST('socid', 'int'); -$cost_price=GETPOST('cost_price', 'int'); +$cost_price=GETPOST('cost_price', 'alpha'); $backtopage=GETPOST('backtopage','alpha'); $error=0;