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
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
}
}
$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);
}
}
+
}
//---------------------------------------------------------------------------------
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) {
$_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');
}
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);