X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcustomer_invoice.php;fp=sales%2Fcustomer_invoice.php;h=287c61709328cb1adc7aa2f570326a5174229358;hb=d963dd95bd75b4b6c7c32bbc2cb36943e5a46a33;hp=071b3946f40dad3f095ecec28f20b5db3dde80de;hpb=b3b458b39c2b24680c486e80d52a4880c011dce6;p=fa-stable.git diff --git a/sales/customer_invoice.php b/sales/customer_invoice.php index 071b3946..287c6170 100644 --- a/sales/customer_invoice.php +++ b/sales/customer_invoice.php @@ -323,6 +323,16 @@ if (isset($_POST['process_invoice']) && check_data()) { } } +if(list_updated('payment')) { + $order = &$_SESSION['Items']; + $order->payment = get_post('payment'); + $order->payment_terms = get_payment_terms($order->payment); + $order->due_date = get_invoice_duedate($order->payment, $order->document_date); + if ($order->payment_terms['cash_sale']) { + $_POST['Location'] = $order->Location = $order->pos['pos_location']; + $order->location_name = $order->pos['location_name']; + } +} // find delivery spans for batch invoice display $dspans = array(); $lastdn = ''; $spanlen=1; @@ -362,7 +372,6 @@ if ($dim > 0) label_cells(_("Customer"), $_SESSION['Items']->customer_name, "class='tableheader2'"); label_cells(_("Branch"), get_branch_name($_SESSION['Items']->Branch), "class='tableheader2'"); if ($_SESSION['Items']->pos['credit_sale'] || $_SESSION['Items']->pos['cash_sale']) { - // editable payment type $paymcat = !$_SESSION['Items']->pos['cash_sale'] ? PM_CREDIT : (!$_SESSION['Items']->pos['credit_sale'] ? PM_CASH : PM_ANY); label_cells(_("Payment terms:"), sale_payment_list('payment', $paymcat),