mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
parent
380cae761a
commit
eeaa4f8205
|
|
@ -2155,7 +2155,7 @@ elseif ($id || $ref)
|
|||
//if ($filter) $sql.= $filter;
|
||||
$sql .= " ORDER BY obj.fk_product";
|
||||
|
||||
dol_syslog("expedition/card.php get list of shipment lines", LOG_DEBUG);
|
||||
dol_syslog("get list of shipment lines", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -801,12 +801,6 @@ class Expedition extends CommonObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If stock is now 0, we can remove entry into llx_product_stock, but only if there is no child lines into llx_product_batch (detail of batch, because we can imagine
|
||||
// having a lot1/qty=X and lot2/qty=-X, so 0 but we must not loose repartition of different lot.
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM ".MAIN_DB_PREFIX."product_batch as pb)";
|
||||
$resql = $this->db->query($sql);
|
||||
// We do not test error, it can fails if there is child in batch details
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -571,13 +571,11 @@ class MouvementStock extends CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
if (empty($donotcleanemptyline)) {
|
||||
// If stock is now 0, we can remove entry into llx_product_stock, but only if there is no child lines into llx_product_batch (detail of batch, because we can imagine
|
||||
// having a lot1/qty=X and lot2/qty=-X, so 0 but we must not loose repartition of different lot.
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM ".MAIN_DB_PREFIX."product_batch as pb)";
|
||||
$resql = $this->db->query($sql);
|
||||
// We do not test error, it can fails if there is child in batch details
|
||||
}
|
||||
// If stock is now 0, we can remove entry into llx_product_stock, but only if there is no child lines into llx_product_batch (detail of batch, because we can imagine
|
||||
// having a lot1/qty=X and lot2/qty=-X, so 0 but we must not loose repartition of different lot.
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM ".MAIN_DB_PREFIX."product_batch as pb)";
|
||||
$resql = $this->db->query($sql);
|
||||
// We do not test error, it can fails if there is child in batch details
|
||||
}
|
||||
|
||||
// Add movement for sub products (recursive call)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user