X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=sales%2Fcustomer_delivery.php;fp=sales%2Fcustomer_delivery.php;h=3c3c1800c5e02f1ae396863a37166ad053b6e8a7;hb=f14d54f1294a8120fafc54bfb99d32cdcecb32a0;hp=36dc0b49b9acd4100ff4b8c66bca626dae547ab1;hpb=77d649c6b45f760018b94a857b25af91b51bf99b;p=fa-stable.git diff --git a/sales/customer_delivery.php b/sales/customer_delivery.php index 36dc0b49..3c3c1800 100644 --- a/sales/customer_delivery.php +++ b/sales/customer_delivery.php @@ -434,7 +434,7 @@ foreach ($_SESSION['Items']->line_items as $line=>$ln_itm) { // (but anyway dispatch is checked again later before transaction is saved) $qty = $ln_itm->qty_dispatched; - if ($check = check_negative_stock($ln_itm->stock_id, -$ln_itm->qty_dispatched, $_POST['Location'], $_POST['DispatchDate'])) + if ($check = check_negative_stock($ln_itm->stock_id, $ln_itm->qty_done-$ln_itm->qty_dispatched, $_POST['Location'], $_POST['DispatchDate'])) $qty = $check['qty']; $q_class = hook_get_dispatchable_quantity($ln_itm, $_POST['Location'], $_POST['DispatchDate'], $qty);