This commit is contained in:
atm-lena 2022-02-22 11:59:00 +01:00
parent 5cf723e7a5
commit 49545228c8

View File

@ -61,7 +61,7 @@ if ($action == 'updateselectbatchbywarehouse' && $permissiontoproduce) {
$sql .= " JOIN " . MAIN_DB_PREFIX . "product_stock as ps on ps.rowid = pb.fk_product_stock";
$sql .= " JOIN " . MAIN_DB_PREFIX . "entrepot as e on e.rowid = ps.fk_entrepot AND e.entity IN (" . getEntity('stock') . ")";
$sql .= " WHERE ps.fk_product = " .((int) $fk_product);
if ($batch_id > 0) $sql.= " AND pb.batch = '" . $batch_id . "'";
if ($batch_id > 0) $sql.= " AND pb.batch = '" . ((int) $batch_id) . "'";
$sql .= " ORDER BY e.ref, pb.batch";
$resql = $db->query($sql);