+ $_POST['trans_no'] = $_GET['trans_no'];
+
+ $new = 0;
+ $myrow = get_customer_trans($_POST['trans_no'], ST_CUSTPAYMENT);
+ $_POST['customer_id'] = $myrow["debtor_no"];
+ $_POST['customer_name'] = $myrow["DebtorName"];
+ $_POST['BranchID'] = $myrow["branch_code"];
+ $_POST['bank_account'] = $myrow["bank_act"];
+ $_POST['ref'] = $myrow["reference"];
+ $old_ref = $myrow["reference"];
+ $charge = get_cust_bank_charge(ST_CUSTPAYMENT, $_POST['trans_no']);
+ $_POST['charge'] = price_format($charge);
+ $_POST['DateBanked'] = sql2date($myrow['tran_date']);
+ $_POST["amount"] = price_format($myrow['Total'] - $myrow['ov_discount']);
+ $_POST["bank_amount"] = price_format($myrow['bank_amount']+$charge);
+ $_POST["discount"] = price_format($myrow['ov_discount']);
+ $_POST["memo_"] = get_comments_string(ST_CUSTPAYMENT,$_POST['trans_no']);
+
+ //Prepare allocation cart
+ if (isset($_POST['trans_no']) && $_POST['trans_no'] > 0 )
+ $_SESSION['alloc'] = new allocation(ST_CUSTPAYMENT,$_POST['trans_no']);
+ else
+ {
+ $_SESSION['alloc'] = new allocation(ST_CUSTPAYMENT, $_POST['trans_no']);
+ $Ajax->activate('alloc_tbl');
+ }
+}
+
+//----------------------------------------------------------------------------------------------
+$new = !$_SESSION['alloc']->trans_no;
+start_form();
+
+ hidden('trans_no');
+ hidden('old_ref', $old_ref);
+
+ start_outer_table(TABLESTYLE2, "width=60%", 5);
+
+ table_section(1);
+
+ bank_accounts_list_row(_("Into Bank Account:"), 'bank_account', null, true);