mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-11 19:43:01 +01:00
Compare commits
1 Commits
phpstan-ba
...
revert-368
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f33194b17 |
@@ -656,7 +656,7 @@ class MouvementStock extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($donotcleanemptylines) && !getDolGlobalInt('STOCK_MOVEMENT_FORCE_DO_NOT_CLEAN_EMPTY_LINES')) {
|
||||
if (empty($donotcleanemptylines)) {
|
||||
// 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 ".$this->db->prefix()."product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM ".$this->db->prefix()."product_batch as pb)";
|
||||
|
||||
@@ -1052,10 +1052,8 @@ if (!$variants || getDolGlobalString('VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PA
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."product_stock as ps";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product";
|
||||
$sql .= " WHERE ps.fk_entrepot = e.rowid";
|
||||
if (!getDolGlobalInt('STOCK_MOVEMENT_FORCE_DO_NOT_CLEAN_EMPTY_LINES')) {
|
||||
$sql .= " AND ps.reel != 0";
|
||||
}
|
||||
$sql .= " WHERE ps.reel != 0";
|
||||
$sql .= " AND ps.fk_entrepot = e.rowid";
|
||||
$sql .= " AND e.entity IN (".getEntity('stock').")";
|
||||
$sql .= " AND ps.fk_product = ".((int) $object->id);
|
||||
$sql .= " ORDER BY e.ref";
|
||||
|
||||
Reference in New Issue
Block a user