$id = find_submit('Edit');
$has_marked = false;
- foreach ($order->line_items as $line_no=>$stock_item)
+
+ foreach ($order->get_items() as $line_no=>$stock_item)
{
$line_total = round($stock_item->qty_dispatched * $stock_item->price * (1 - $stock_item->discount_percent),
$row = get_customer_to_order($_POST['customer_id']);
if ($row['dissallow_invoices'] == 1)
$customer_error = _("The selected customer account is currently on hold. Please contact the credit control personnel to discuss.");
-
}
}
table_section(2);
- if (!is_company_currency($order->customer_currency))
+ if (!is_company_currency($order->customer_currency) && in_array($order->trans_type, array(ST_SALESINVOICE, ST_CUSTDELIVERY)))
{
label_row(_("Customer Currency:"), $order->customer_currency);
- exchange_rate_display($order->customer_currency, get_company_currency(),
+ exchange_rate_display(get_company_currency(), $order->customer_currency,
($editable ? $_POST['OrderDate'] : $order->document_date));
}
}
else // prepare new line
{
- sales_items_list_cells(null,'stock_id', null, false, true);
+ sales_items_list_cells(null,'stock_id', null, false, true, true);
if (list_updated('stock_id')) {
$Ajax->activate('price');
$Ajax->activate('units');