X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcustomer_payments.php;h=b81b609cbd5e243f3ce829481f5f8f63accc37e8;hb=21935dd8a577b626267573437cc22eb99e196107;hp=f5d1f011a5e9a1ec4347023e295c3c45bf721738;hpb=cf8ea0adfea887c575f6833ef36403a9568585da;p=fa-stable.git diff --git a/sales/customer_payments.php b/sales/customer_payments.php index f5d1f011..b81b609c 100644 --- a/sales/customer_payments.php +++ b/sales/customer_payments.php @@ -211,6 +211,8 @@ function can_process() 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'); @@ -249,11 +251,6 @@ if (isset($_POST['ref']) && $_SESSION['alloc']->trans_no == 0) // added by Joe t } $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'])) { @@ -344,6 +341,12 @@ start_form(); 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