From 14bcb124fe09d81d953b52950549afccae6d3777 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 24 Sep 2021 14:46:52 +0200 Subject: [PATCH] update reception class and card --- htdocs/reception/card.php | 2 +- htdocs/reception/class/reception.class.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 520214f0d5c..aa7a85c2464 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -366,7 +366,7 @@ if (empty($reshook)) { $eatbydate = str_replace('/', '-', $eatby); $sellbydate = str_replace('/', '-', $sellby); if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { - $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha'), GETPOST($cost_price, 'double')); + $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha'), price2num(GETPOST($cost_price, 'double'), 'MU')); } else { $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha')); } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 0b53c6fd17d..d8ca28bd456 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -562,9 +562,7 @@ class Reception extends CommonObject $sql = "SELECT cd.fk_product, cd.subprice,"; $sql .= " ed.rowid, ed.qty, ed.fk_entrepot,"; $sql .= " ed.eatby, ed.sellby, ed.batch"; - if (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION || $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { - $sql .= ", ed.cost_price"; - } + $sql .= ", ed.cost_price"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd,"; $sql .= " ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed"; $sql .= " WHERE ed.fk_reception = ".((int) $this->id);