X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fincludes%2Fui%2Fsales_order_ui.inc;h=ce0b8604c9f6d4e3fbc1472a766c23896cd6ac04;hb=e39803c300ad0071a20d0c1977b5db6d79aa91c4;hp=ed3227379291e8227ba946bb3934624787c31dc9;hpb=1571869d54be48452fdbe08f25130972ff0a7b5a;p=fa-stable.git diff --git a/sales/includes/ui/sales_order_ui.inc b/sales/includes/ui/sales_order_ui.inc index ed322737..ce0b8604 100644 --- a/sales/includes/ui/sales_order_ui.inc +++ b/sales/includes/ui/sales_order_ui.inc @@ -123,12 +123,14 @@ function get_customer_details_to_order(&$order, $customer_id, $branch_id) } elseif ($order->trans_type == ST_SALESORDER) $order->due_date = add_days($order->document_date, $SysPrefs->default_delivery_required_by()); + elseif ($order->trans_type == ST_SALESQUOTE) + $order->due_date = add_days($order->document_date, $SysPrefs->default_quote_valid_days()); if($order->payment_terms['cash_sale']) { $order->set_location($order->pos["pos_location"], $order->pos["location_name"]); } else $order->set_location($myrow["default_location"], $myrow["location_name"]); - + return $ret_error; } @@ -136,12 +138,12 @@ function get_customer_details_to_order(&$order, $customer_id, $branch_id) function display_order_summary($title, &$order, $editable_items=false) { - global $SysPrefs; display_heading($title); div_start('items_table'); - start_table(TABLESTYLE, "colspan=7 width=90%"); + start_table(TABLESTYLE, "width='90%'"); + $th = array(_("Item Code"), _("Item Description"), _("Quantity"), _("Delivered"), _("Unit"), $order->tax_included ? _("Price after Tax") : _("Price before Tax"), _("Discount %"), _("Total"), ""); @@ -159,8 +161,8 @@ function display_order_summary($title, &$order, $editable_items=false) $k = 0; //row colour counter $id = find_submit('Edit'); - $has_marked = false; + $low_stock = $order->check_qoh($_POST['OrderDate'], $_POST['Location']); foreach ($order->get_items() as $line_no=>$stock_item) { @@ -170,23 +172,10 @@ function display_order_summary($title, &$order, $editable_items=false) $qoh_msg = ''; if (!$editable_items || $id != $line_no) { - if (!$SysPrefs->allow_negative_stock() && is_inventory_item($stock_item->stock_id) && - $order->trans_type != ST_SALESORDER && $order->trans_type!=ST_SALESQUOTE) { - $qoh = get_qoh_on_date($stock_item->stock_id, - $_POST['Location'], $_POST['delivery_date']); - if (($stock_item->qty_dispatched -$stock_item->qty_done) > $qoh) - { - // oops, we don't have enough of one of the component items - start_row("class='stockmankobg'"); - $qoh_msg .= $stock_item->stock_id . " - " . $stock_item->item_description . ": " . - _("Quantity On Hand") . " = " - . number_format2($qoh, get_qty_dec($stock_item->stock_id)) . '
'; - $has_marked = true; - } else - alt_table_row_color($k); - } else { + if (in_array($stock_item->stock_id, $low_stock)) + start_row("class='stockmankobg'"); // notice low stock status + else alt_table_row_color($k); - } view_stock_status_cell($stock_item->stock_id); @@ -245,12 +234,9 @@ function display_order_summary($title, &$order, $editable_items=false) end_row(); end_table(); - if ($has_marked) { + if ($low_stock) display_note(_("Marked items have insufficient quantities in stock as on day of delivery."), 0, 1, "class='stockmankofg'"); - if ($order->trans_type!=30 && !$SysPrefs->allow_negative_stock()) - display_error(_("The delivery cannot be processed because there is an insufficient quantity for item:") - . '
'. $qoh_msg); - } + div_end(); } @@ -260,7 +246,7 @@ function display_order_header(&$order, $editable, $date_text) { global $Ajax, $SysPrefs; - start_outer_table(TABLESTYLE2, "width=80%"); + start_outer_table(TABLESTYLE2, "width='80%'"); table_section(1); @@ -392,6 +378,7 @@ function display_order_header(&$order, $editable, $date_text) label_row(_("Customer Discount:"), ($order->default_discount * 100) . "%"); table_section(3); + start_row(); if (($order->pos['cash_sale'] || $order->pos['credit_sale']) && !$order->is_started()) { // editable payment type @@ -414,6 +401,7 @@ function display_order_header(&$order, $editable, $date_text) } else { label_cells(_('Payment:'), $order->payment_terms['terms'], "class='label'"); } + end_row(); if($editable) { $str = sales_types_list_row(_("Price List:"), 'sales_type', null, true); @@ -586,7 +574,7 @@ function display_delivery_details(&$order) if ($order->payment_terms['cash_sale']) { // Direct payment sale $Ajax->activate('items_table'); display_heading(_('Cash payment')); - start_table(TABLESTYLE2, "width=60%"); + start_table(TABLESTYLE2, "width='60%'"); locations_list_row(_("Deliver from Location:"), 'Location', null, false, true); if (list_updated('Location')) @@ -617,7 +605,7 @@ function display_delivery_details(&$order) $delname = _("Required Delivery Date").':'; } display_heading($title); - start_outer_table(TABLESTYLE2, "width=90%"); + start_outer_table(TABLESTYLE2, "width='90%'"); table_section(1); locations_list_row(_("Deliver from Location:"), 'Location', null, false, true); @@ -636,7 +624,7 @@ function display_delivery_details(&$order) date_row($delname, 'delivery_date', $order->trans_type==ST_SALESORDER ? _('Enter requested day of delivery') : $order->trans_type==ST_SALESQUOTE ? _('Enter Valid until Date') : ''); - text_row(_("Deliver To:"), 'deliver_to', $order->deliver_to, 40, 40, + text_row(_("Deliver To:"), 'deliver_to', $order->deliver_to, 50, 60, _('Additional identifier for delivery e.g. name of receiving person')); textarea_row(_("Address:"), 'delivery_address', $order->delivery_address, 35, 5, @@ -657,4 +645,3 @@ function display_delivery_details(&$order) div_end(); } -?> \ No newline at end of file