X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcustomer_delivery.php;fp=sales%2Fcustomer_delivery.php;h=fb7efe0a0394ab124b1c10d1c9f9314ecfc8bca0;hb=8a5902d96158923e2bddd7661a859d8128d0b64b;hp=f54bbd1cc9c19db1cd49931139ec0e5b85fd3612;hpb=5b8f4c4b4aa8cf996bc071f116bfce1273200fa2;p=fa-stable.git diff --git a/sales/customer_delivery.php b/sales/customer_delivery.php index f54bbd1c..fb7efe0a 100644 --- a/sales/customer_delivery.php +++ b/sales/customer_delivery.php @@ -274,47 +274,12 @@ function check_quantities() } } } -// ... -// else -// $_SESSION['Items']->freight_cost = input_num('ChargeFreightCost'); return $ok; } -//------------------------------------------------------------------------------ - -if (isset($_POST['process_delivery']) && check_data()) -{ - global $SysPrefs; - $dn = &$_SESSION['Items']; - $newdelivery = ($dn->trans_no==0); - if (!$SysPrefs->allow_negative_stock()) { - foreach ($_SESSION['Items']->line_items as $itm) { - - if ($itm->qty_dispatched && has_stock_holding($itm->mb_flag)) { - $qoh_by_date = get_qoh_on_date($itm->stock_id, $_POST['Location'], $_POST['DispatchDate']); - $qoh_abs = get_qoh_on_date($itm->stock_id, $_POST['Location'], null); - //If editing current delivery delivered qty should be added - if (!$newdelivery) - { - $delivered = get_already_delivered($itm->stock_id, $_POST['Location'], key($dn->trans_no)); - - $qoh_abs = $qoh_abs - $delivered; - $qoh_by_date = $qoh_by_date - $delivered; - } - $qoh = ($qoh_by_date < $qoh_abs ? $qoh_by_date : $qoh_abs); - if ($itm->qty_dispatched > $qoh) { - display_error(_("The delivery cannot be processed because there is an insufficient quantity for item:") . - " " . $itm->stock_id . " - " . $itm->item_description); - return false; - } - } - } - } - return true; -} //------------------------------------------------------------------------------ -if (isset($_POST['process_delivery']) && check_data() && check_qoh()) { +if (isset($_POST['process_delivery']) && check_data()) { $dn = &$_SESSION['Items']; if ($_POST['bo_policy']) {