Merge pull request #14048 from simicar29/11.0-replenish
replenish : select expedition quantities only from opened orders when…
This commit is contained in:
commit
e17818c3dd
@ -376,8 +376,11 @@ if ($usevirtualstock)
|
||||
$sqlExpeditionsCli = "(SELECT ".$db->ifsql("SUM(ed2.qty) IS NULL", "0", "SUM(ed2.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL
|
||||
$sqlExpeditionsCli .= " FROM ".MAIN_DB_PREFIX."expedition as e2,";
|
||||
$sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."expeditiondet as ed2,";
|
||||
$sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."commande as c2,";
|
||||
$sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."commandedet as cd2";
|
||||
$sqlExpeditionsCli .= " WHERE ed2.fk_expedition = e2.rowid AND cd2.rowid = ed2.fk_origin_line AND e2.entity IN (".getEntity('expedition').")";
|
||||
$sqlExpeditionsCli .= " AND cd2.fk_commande = c2.rowid";
|
||||
$sqlExpeditionsCli .= " AND c2.fk_statut IN (1,2)";
|
||||
$sqlExpeditionsCli .= " AND cd2.fk_product = p.rowid";
|
||||
$sqlExpeditionsCli .= " AND e2.fk_statut IN (1,2))";
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user