X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fsupplier_payment.php;h=899e2afd27b0619f4c90ce17a4a35b73ca54cf0b;hb=4deaa6ba6e084655989c30cfb7d9dd307408c7dc;hp=c7bedf4dcd16502bd153c201a98e839283b28335;hpb=a001646bef2b971535791d4e67b8565684d6de24;p=fa-stable.git diff --git a/purchasing/supplier_payment.php b/purchasing/supplier_payment.php index c7bedf4d..899e2afd 100644 --- a/purchasing/supplier_payment.php +++ b/purchasing/supplier_payment.php @@ -161,19 +161,6 @@ function check_inputs() } } - if (@$_POST['discount'] == "") - { - $_POST['discount'] = 0; - } - - if (!check_num('discount', 0)) - { - display_error(_("The entered discount is invalid or less than zero.")); - set_focus('amount'); - return false; - } - - //if (input_num('amount') - input_num('discount') <= 0) if (input_num('amount') <= 0) { display_error(_("The total of the amount and the discount is zero or negative. Please enter positive values.")); @@ -232,15 +219,11 @@ function check_inputs() function handle_add_payment() { - $payment_id = write_supp_payment(0, $_POST['supplier_id'], $_POST['bank_account'], - $_POST['DatePaid'], $_POST['ref'], input_num('amount'), input_num('discount'), $_POST['memo_'], + $payment_id = save_supp_payment($_SESSION['alloc'], $_POST['supplier_id'], $_POST['bank_account'], + $_POST['DatePaid'], $_POST['ref'], input_num('amount'), $_POST['memo_'], input_num('charge'), input_num('bank_amount', input_num('amount'))); new_doc_date($_POST['DatePaid']); - $_SESSION['alloc']->trans_no = $payment_id; - $_SESSION['alloc']->date_ = $_POST['DatePaid']; - $_SESSION['alloc']->write(); - unset($_POST['bank_account']); unset($_POST['DatePaid']); unset($_POST['currency']); @@ -326,11 +309,13 @@ start_form(); div_end(); start_table(TABLESTYLE, "width='60%'"); - amount_row(_("Amount of Discount:"), 'discount', null, '', $supplier_currency); + label_row(_("Total Discount:"), price_format(input_num('discount')), '', '', 0, 'discount'); amount_row(_("Amount of Payment:"), 'amount', null, '', $supplier_currency); textarea_row(_("Memo:"), 'memo_', null, 22, 4); end_table(1); + hidden('discount', null); + submit_center('ProcessSuppPayment',_("Enter Payment"), true, '', 'default'); end_form();