From 11d79c96651ef4cc89c9c289b35d8acc92de8b4a Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Thu, 13 Sep 2012 00:15:39 +0200 Subject: [PATCH] Fixed incorect selection of invoices in Customer Payments/Payments To Supplier when search customer/supplier option is used. --- purchasing/supplier_payment.php | 11 ++++++----- sales/customer_payments.php | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/purchasing/supplier_payment.php b/purchasing/supplier_payment.php index 28f890a..aff8282 100644 --- a/purchasing/supplier_payment.php +++ b/purchasing/supplier_payment.php @@ -57,11 +57,6 @@ if (isset($_POST['_DatePaid_changed'])) { $Ajax->activate('_ex_rate'); } -if (list_updated('supplier_id') || list_updated('bank_account')) { - $_SESSION['alloc']->read(); - $_POST['memo_'] = $_POST['amount'] = ''; - $Ajax->activate('alloc_tbl'); -} //---------------------------------------------------------------------------------------- if (!isset($_POST['bank_account'])) { // first page call @@ -274,6 +269,12 @@ start_form(); supplier_list_row(_("Payment To:"), 'supplier_id', null, false, true); + if (list_updated('supplier_id') || list_updated('bank_account')) { + $_SESSION['alloc']->read(); + $_POST['memo_'] = $_POST['amount'] = ''; + $Ajax->activate('alloc_tbl'); + } + set_global_supplier($_POST['supplier_id']); if (!list_updated('bank_account')) diff --git a/sales/customer_payments.php b/sales/customer_payments.php index 34a862b..b81b609 100644 --- a/sales/customer_payments.php +++ b/sales/customer_payments.php @@ -251,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'])) { @@ -346,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 -- 2.30.2