return false;
}
if (isset($_POST['charge']) && input_num('charge') > 0) {
- $charge_acct = get_company_pref('bank_charge_act');
+ $charge_acct = get_bank_charge_account($_POST['bank_account']);
if (get_gl_account($charge_acct) == false) {
display_error(_("The Bank Charge Account has not been set in System and General GL Setup."));
set_focus('charge');
set_focus('discount');
return false;
}
+ if (!db_has_currency_rates(get_customer_currency($_POST['customer_id']), $_POST['DateBanked'], true))
+ return false;
$_SESSION['alloc']->amount = input_num('amount');
}
$new = $_SESSION['alloc']->trans_no == 0;
-if (list_updated('customer_id') || ($new && list_updated('bank_account'))) {
- $_SESSION['alloc']->read();
- $_POST['memo_'] = $_POST['amount'] = $_POST['discount'] = '';
- $Ajax->activate('alloc_tbl');
-}
//----------------------------------------------------------------------------------------------
if (isset($_POST['AddPaymentItem'])) {
hidden('customer_id', $_POST['customer_id']);
}
+ if (list_updated('customer_id') || ($new && list_updated('bank_account'))) {
+ $_SESSION['alloc']->read();
+ $_POST['memo_'] = $_POST['amount'] = $_POST['discount'] = '';
+ $Ajax->activate('alloc_tbl');
+ }
+
if (!isset($_POST['charge'])) // first page call
{
//Prepare allocation cart