X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcustomer_delivery.php;h=9cbd252710e176255427609d416ac0eb8118edc7;hb=40c3b111b007ad16a2eedff175e1612150191d04;hp=605df69188fd200ccc48b3635975c51a4477d648;hpb=1b9351ae81a67726e757eba55895a4f059c7f128;p=fa-stable.git diff --git a/sales/customer_delivery.php b/sales/customer_delivery.php index 605df691..9cbd2527 100644 --- a/sales/customer_delivery.php +++ b/sales/customer_delivery.php @@ -26,7 +26,7 @@ include_once($path_to_root . "/reporting/includes/reporting.inc"); include_once($path_to_root . "/taxes/tax_calc.inc"); $js = ""; -if ($use_popup_windows) { +if ($SysPrefs->use_popup_windows) { $js .= get_js_open_window(900, 500); } if (user_use_date_picker()) { @@ -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']) { @@ -576,4 +541,3 @@ end_form(); end_page(); -?>