X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=sales%2Fincludes%2Fui%2Fsales_order_ui.inc;h=bb20dce6abf46658ea78a9c7f6d61a88e8385a22;hb=b0e112621af4ffcf4fed2264bffd0ebbda258a48;hp=5ec8dfcb1d22a06769c527efd1f46ba6196f0fe0;hpb=96fabfb7db562daf05bb9caa3f08fe3ef9390e3b;p=fa-stable.git diff --git a/sales/includes/ui/sales_order_ui.inc b/sales/includes/ui/sales_order_ui.inc index 5ec8dfcb..bb20dce6 100644 --- a/sales/includes/ui/sales_order_ui.inc +++ b/sales/includes/ui/sales_order_ui.inc @@ -13,7 +13,7 @@ include_once($path_to_root . "/sales/includes/cart_class.inc"); include_once($path_to_root . "/includes/manufacturing.inc"); //-------------------------------------------------------------------------------- -function add_to_order(&$order, $new_item, $new_item_qty, $price, $discount) +function add_to_order(&$order, $new_item, $new_item_qty, $price, $discount, $description='') { // calculate item price to sum of kit element prices factor for // value distribution over all exploded kit items @@ -47,7 +47,7 @@ function add_to_order(&$order, $new_item, $new_item_qty, $price, $discount) if (!$item['is_foreign'] && $item['item_code'] != $item['stock_id']) { // this is sales kit - recurse add_to_order($order, $item['stock_id'], $new_item_qty*$item['quantity'], - $item_price, $discount, $std_price); + $item_price, $discount); } else { // stock item record eventually with foreign code @@ -63,9 +63,10 @@ function add_to_order(&$order, $new_item, $new_item_qty, $price, $discount) } } $order->add_to_cart (count($order->line_items), $item['stock_id'], - $new_item_qty*$item['quantity'], $item_price, $discount); + $new_item_qty*$item['quantity'], $item_price, $discount, 0,0, $description); } } + } //--------------------------------------------------------------------------------- @@ -217,9 +218,27 @@ function display_order_summary($title, &$order, $editable_items=false) if ($id==-1 && $editable_items) sales_order_item_controls($order, $k); - $display_total = price_format($total); - label_row(_("Total Excluding Shipping"), $display_total, "colspan=6 align=right", - "nowrap align=right", 2); + $colspan = 6; + if ($order->trans_no!=0) + ++$colspan; + start_row(); + label_cell(_("Shipping Charge"), "colspan=$colspan align=right"); + small_amount_cells(null, 'freight_cost', price_format(get_post('freight_cost',0))); + label_cell('', 'colspan=2'); + end_row(); + $display_sub_total = price_format($total + input_num('freight_cost')); + + label_row(_("Sub-total"), $display_sub_total, "colspan=$colspan align=right","align=right", 2); + + $taxes = $order->get_taxes(input_num('freight_cost')); + $tax_total = display_edit_tax_items($taxes, $colspan, $order->tax_included, 2); + + $display_total = price_format(($total + input_num('freight_cost') + $tax_total)); + + start_row(); + label_cells(_("Amount Total"), $display_total, "colspan=$colspan align=right","align=right"); + submit_cells('update', _("Update"), "colspan=2", _("Refresh"), true); + end_row(); end_table(); if ($has_marked) { @@ -468,11 +487,19 @@ function sales_order_item_controls(&$order, &$rowcounter, $line_no=-1) $_POST['qty'] = number_format2($order->line_items[$id]->qty_dispatched, $dec); $_POST['price'] = price_format($order->line_items[$id]->price); $_POST['Disc'] = percent_format($order->line_items[$id]->discount_percent*100); - $_POST['item_description'] = $order->line_items[$id]->item_description; $units = $order->line_items[$id]->units; + $_POST['item_description'] = $order->line_items[$id]->item_description; hidden('stock_id', $_POST['stock_id']); label_cell($_POST['stock_id']); - text_cells(null,'item_description', null, 45, 150); + if ($order->line_items[$id]->descr_editable) + text_cells(null,'item_description', null, 45, 150); + else { + hidden('item_description', $_POST['item_description']); + label_cell($_POST['item_description']); + } +// } else { +// sales_items_list_cells(null,'item_description', null, false, true); +// } //label_cell($order->line_items[$line_no]->item_description, "nowrap"); $Ajax->activate('items_table'); } @@ -589,18 +616,15 @@ function display_delivery_details(&$order) textarea_row(_("Address:"), 'delivery_address', $order->delivery_address, 35, 5, _('Delivery address. Default is address of customer branch')); - text_row(_("Contact Phone Number:"), 'phone', $order->phone, 25, 25, - _('Phone number of ordering person. Defaults to branch phone number')); table_section(2); + text_row(_("Contact Phone Number:"), 'phone', $order->phone, 25, 25, + _('Phone number of ordering person. Defaults to branch phone number')); text_row(_("Customer Reference:"), 'cust_ref', $order->cust_ref, 25, 25, _('Customer reference number for this order (if any)')); textarea_row(_("Comments:"), "Comments", $order->Comments, 31, 5); - small_amount_row(_("Shipping Charge:"), 'freight_cost', - price_format(get_post('freight_cost',0))); - shippers_list_row(_("Shipping Company:"), 'ship_via', $order->ship_via); end_outer_table(1);