X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fincludes%2Fui%2Fsales_order_ui.inc;h=faa2a3c8e2c2283b7be83a6ad7a0e7efba442fdf;hb=fbf51ab0febfd0885620abcab8738339d156ff45;hp=456f54f77c7d8447f29cf72448435d6328d4251f;hpb=7198643c8d4301fe41c70f202c6316a2880c9f52;p=fa-stable.git diff --git a/sales/includes/ui/sales_order_ui.inc b/sales/includes/ui/sales_order_ui.inc index 456f54f7..faa2a3c8 100644 --- a/sales/includes/ui/sales_order_ui.inc +++ b/sales/includes/ui/sales_order_ui.inc @@ -125,6 +125,7 @@ function get_customer_details_to_order(&$order, $customer_id, $branch_id) $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 @@ -376,7 +377,8 @@ function display_order_header(&$order, $editable, $date_text) label_row(_("Customer Discount:"), ($order->default_discount * 100) . "%"); table_section(3); - if ($order->pos['cash_sale'] || $order->pos['credit_sale']) { + if (($order->pos['cash_sale'] || $order->pos['credit_sale']) + && !$order->is_started()) { // editable payment type if (get_post('payment') !== $order->payment) { $order->payment = get_post('payment'); @@ -392,11 +394,10 @@ function display_order_header(&$order, $editable, $date_text) $paymcat = !$order->pos['cash_sale'] ? PM_CREDIT : (!$order->pos['credit_sale'] ? PM_CASH : PM_ANY); // all terms are available for SO - sale_payment_list_cells(_('Payment:'), 'payment', - (in_array($order->trans_type, array(ST_SALESQUOTE, ST_SALESORDER)) - ? PM_ANY : $paymcat), null); + $is_order = in_array($order->trans_type, array(ST_SALESQUOTE, ST_SALESORDER)); + sale_payment_list_cells(_('Payment:'), 'payment', $is_order ? PM_ANY : $paymcat, null, true, $is_order); } else { - label_cells(_('Payment:'), $order->payment_terms['terms']); + label_cells(_('Payment:'), $order->payment_terms['terms'], "class='label'"); } if($editable) { @@ -605,6 +606,14 @@ function display_delivery_details(&$order) table_section(1); locations_list_row(_("Deliver from Location:"), 'Location', null, false, true); + if ($order->payment_terms['days_before_due'] < 0) + { + $Ajax->addUpdate('items_table', 'prep_amount', price_format($order->get_trans_total())); // bind to items_table update + if (!$order->is_started()) + amount_row(_("Pre-Payment Required:"), 'prep_amount'); + else + label_row(_("Pre-Payment Required:"), price_format($order->prep_amount), "class='label'"); + } if (list_updated('Location')) $Ajax->activate('items_table');