- $supp_currency = get_supplier_currency($_POST['supplier_id']);
- $bank_currency = get_bank_account_currency($_POST['bank_account']);
- $comp_currency = get_company_currency();
- if ($comp_currency != $bank_currency && $bank_currency != $supp_currency)
- $rate = 0;
- else
- $rate = input_num('_ex_rate');
-
- $payment_id = add_supp_payment($_POST['supplier_id'], $_POST['DatePaid'],
- $_POST['bank_account'], input_num('amount'), input_num('discount'),
- $_POST['ref'], $_POST['memo_'], $rate, input_num('charge'));
+ $payment_id = write_supp_payment(0, $_POST['supplier_id'], $_POST['bank_account'],
+ $_POST['DatePaid'], $_POST['ref'], input_num('amount'), input_num('discount'), $_POST['memo_'],
+ input_num('charge'), input_num('bank_amount', input_num('amount')));