X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcustomer_payments.php;h=7612a2b4b68cf66bb30bc3432644cdc6b431ec9b;hb=15637f687c7fc48fde54904fe54c0386b7e90859;hp=25f3b3f8090ce1aa6ec73c5ad71ba8ca8b5b6311;hpb=9e61d0860639941a0aceace8f4c14ced1c635e7f;p=fa-stable.git diff --git a/sales/customer_payments.php b/sales/customer_payments.php index 25f3b3f8..7612a2b4 100644 --- a/sales/customer_payments.php +++ b/sales/customer_payments.php @@ -48,7 +48,8 @@ if (!isset($_POST['bank_account'])) { // first page call if (isset($_GET['SInvoice'])) { // get date and supplier - $inv = get_customer_trans($_GET['SInvoice'], ST_SALESINVOICE); + $type = !isset($_GET['Type']) ? ST_SALESINVOICE : $_GET['Type']; + $inv = get_customer_trans($_GET['SInvoice'], $type); $dflt_act = get_default_bank_account($inv['curr_code']); $_POST['bank_account'] = $dflt_act['id']; if ($inv) { @@ -58,7 +59,7 @@ if (!isset($_POST['bank_account'])) { // first page call $_POST['BranchID'] = $inv['branch_code']; $_POST['DateBanked'] = sql2date($inv['tran_date']); foreach($_SESSION['alloc']->allocs as $line => $trans) { - if ($trans->type == ST_SALESINVOICE && $trans->type_no == $_GET['SInvoice']) { + if ($trans->type == $type && $trans->type_no == $_GET['SInvoice']) { $un_allocated = $trans->amount - $trans->amount_allocated; if ($un_allocated){ $_SESSION['alloc']->allocs[$line]->current_allocated = $un_allocated;