X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcustomer_delivery.php;h=97f0459003acd6d3fbcf214d4f40e1d7e32a1063;hb=1626f8d1594dc467722783e3818f222dae88ad0b;hp=4b6726efa1e21690c87a22a4ecfec0f60827db7f;hpb=c09be0dad6b05131e240349a375af7a4b7bf3444;p=fa-stable.git diff --git a/sales/customer_delivery.php b/sales/customer_delivery.php index 4b6726ef..97f04590 100644 --- a/sales/customer_delivery.php +++ b/sales/customer_delivery.php @@ -1,4 +1,14 @@ . +***********************************************************************/ //----------------------------------------------------------------------------- // // Entry/Modify Delivery Note against Sales Order @@ -36,13 +46,12 @@ page($_SESSION['page_title'], false, false, "", $js); if (isset($_GET['AddedID'])) { $dispatch_no = $_GET['AddedID']; - print_hidden_script(13); - display_notification(_("Dispatch processed:") . ' '.$_GET['AddedID'], true); + display_notification_centered(sprintf(_("Delivery # %d has been entered."),$dispatch_no)); - display_note(get_customer_trans_view_str(13, $dispatch_no, _("View this dispatch")), 0, 1); + display_note(get_customer_trans_view_str(13, $dispatch_no, _("&View This Delivery")), 0, 1); - display_note(print_document_link($dispatch_no, _("Print this delivery"), true, 13)); + display_note(print_document_link($dispatch_no, _("&Print Delivery Note"), true, 13)); display_note(get_gl_view_str(13, $dispatch_no, _("View the GL Journal Entries for this Dispatch")),1); @@ -55,7 +64,6 @@ if (isset($_GET['AddedID'])) { } elseif (isset($_GET['UpdatedID'])) { $delivery_no = $_GET['UpdatedID']; - print_hidden_script(13); display_notification_centered(sprintf(_('Delivery Note # %d has been updated.'),$delivery_no)); @@ -116,14 +124,16 @@ if (isset($_GET['OrderNumber']) && $_GET['OrderNumber'] > 0) { end_page(); exit; -} elseif (!check_quantities()) { - display_error(_("Selected quantity cannot be less than quantity invoiced nor more than quantity - not dispatched on sales order.")); +} else { + check_edit_conflicts(); -} elseif(!check_num('ChargeFreightCost', 0)) - display_error(_("Freight cost cannot be less than zero")); - set_focus('ChargeFreightCost'); + if (!check_quantities()) { + display_error(_("Selected quantity cannot be less than quantity invoiced nor more than quantity not dispatched on sales order.")); + } elseif(!check_num('ChargeFreightCost', 0)) + display_error(_("Freight cost cannot be less than zero")); + set_focus('ChargeFreightCost'); +} //----------------------------------------------------------------------------- @@ -208,6 +218,7 @@ function copy_from_cart() $_POST['due_date'] = $cart->due_date; $_POST['Location'] = $cart->Location; $_POST['Comments'] = $cart->Comments; + $_POST['cart_id'] = $cart->cart_id; } //------------------------------------------------------------------------------ @@ -296,6 +307,7 @@ if (isset($_POST['Update']) || isset($_POST['_Location_update'])) { } //------------------------------------------------------------------------------ start_form(false, true); +hidden('cart_id'); start_table("$table_style2 width=80%", 5); echo ""; // outer table @@ -360,6 +372,14 @@ end_table(); echo ""; end_table(1); // outer table +$row = get_customer_to_order($_SESSION['Items']->customer_id); +if ($row['dissallow_invoices'] == 1) +{ + display_error(_("The selected customer account is currently on hold. Please contact the credit control personnel to discuss.")); + end_form(); + end_page(); + exit(); +} display_heading(_("Delivery Items")); div_start('Items'); start_table("$table_style width=80%"); @@ -368,13 +388,13 @@ $th = array(_("Item Code"), _("Item Description"), _("Ordered"), _("Units"), _(" table_header($th); $k = 0; $has_marked = false; -$show_qoh = true; foreach ($_SESSION['Items']->line_items as $line=>$ln_itm) { if ($ln_itm->quantity==$ln_itm->qty_done) { continue; //this line is fully delivered } // if it's a non-stock item (eg. service) don't show qoh + $show_qoh = true; if (sys_prefs::allow_negative_stock() || !has_stock_holding($ln_itm->mb_flag) || $ln_itm->qty_dispatched == 0) { $show_qoh = false;