Fix shipment validation 2 times qty in SQL select
This commit is contained in:
parent
d7ad38be13
commit
38584f2cfa
@ -628,7 +628,7 @@ class Expedition extends CommonObject
|
|||||||
// TODO possibilite d'expedier a partir d'une propale ou autre origine
|
// TODO possibilite d'expedier a partir d'une propale ou autre origine
|
||||||
$sql = "SELECT cd.fk_product, cd.subprice,";
|
$sql = "SELECT cd.fk_product, cd.subprice,";
|
||||||
$sql.= " ed.rowid, ed.qty, ed.fk_entrepot,";
|
$sql.= " ed.rowid, ed.qty, ed.fk_entrepot,";
|
||||||
$sql.= " edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty, edb.fk_origin_stock";
|
$sql.= " edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty as edbqty, edb.fk_origin_stock";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd,";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."expeditiondet as ed";
|
$sql.= " ".MAIN_DB_PREFIX."expeditiondet as ed";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid";
|
||||||
@ -665,7 +665,7 @@ class Expedition extends CommonObject
|
|||||||
// line with batch detail
|
// line with batch detail
|
||||||
|
|
||||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
|
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
|
||||||
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $obj->eatby, $obj->sellby, $obj->batch);
|
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->edbqty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr",$numref), '', $obj->eatby, $obj->sellby, $obj->batch);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++; break;
|
$error++; break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user