X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcustomer_payments.php;h=b67df99c774a1b3c06c22e2dd64faab2879c7ed9;hb=ac5842d266a1c8b935231b03f987bd52dc8b9500;hp=939799f7dd2f46d8b148f73410fdcf25a773ce30;hpb=a9451b18467d4d82fe0500737b17e0ab5a1971d7;p=fa-stable.git diff --git a/sales/customer_payments.php b/sales/customer_payments.php index 939799f7..b67df99c 100644 --- a/sales/customer_payments.php +++ b/sales/customer_payments.php @@ -152,7 +152,8 @@ function can_process() return false; } - if ((input_num('amount') - input_num('discount') <= 0)) { + //if ((input_num('amount') - input_num('discount') <= 0)) { + if (input_num('amount') <= 0) { display_error(_("The balance of the amount and discout is zero or negative. Please enter valid amounts.")); set_focus('discount'); return false; @@ -216,26 +217,18 @@ function read_customer_data() { global $Refs; - $sql = "SELECT ".TB_PREF."debtors_master.pymt_discount, - ".TB_PREF."credit_status.dissallow_invoices - FROM ".TB_PREF."debtors_master, ".TB_PREF."credit_status - WHERE ".TB_PREF."debtors_master.credit_status = ".TB_PREF."credit_status.id - AND ".TB_PREF."debtors_master.debtor_no = ".db_escape($_POST['customer_id']); - - $result = db_query($sql, "could not query customers"); - - $myrow = db_fetch($result); + $myrow = get_customer_habit($_POST['customer_id']); $_POST['HoldAccount'] = $myrow["dissallow_invoices"]; $_POST['pymt_discount'] = $myrow["pymt_discount"]; - $_POST['ref'] = $Refs->get_next(12); + $_POST['ref'] = $Refs->get_next(ST_CUSTPAYMENT); } //---------------------------------------------------------------------------------------------- start_form(); - start_outer_table("$table_style2 width=60%", 5); + start_outer_table(TABLESTYLE2, "width=60%", 5); table_section(1); customer_list_row(_("From Customer:"), 'customer_id', null, false, true); @@ -288,7 +281,7 @@ start_form(); div_end(); } - start_table("$table_style width=60%"); + start_table(TABLESTYLE, "width=60%"); label_row(_("Customer prompt payment discount :"), $display_discount_percent); amount_row(_("Amount of Discount:"), 'discount');