update reception class and card

This commit is contained in:
lmarcouiller 2021-09-24 14:46:52 +02:00
parent 7361941420
commit 14bcb124fe
2 changed files with 2 additions and 4 deletions

View File

@ -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'));
}

View File

@ -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);