+$new = 1;
+$old_ref = 0;
+
+//Chaitanya : 13-OCT-2011 - To support Edit feature
+if (isset($_GET['trans_no']) && $_GET['trans_no'] > 0 )
+{
+ $_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"];
+ //$_POST['charge'] = $myrow[""];
+ $_POST['DateBanked'] = sql2date($myrow['tran_date']);
+ $_POST["amount"] = price_format($myrow['Total'] - $myrow['ov_discount']);
+ $_POST["discount"] = price_format($myrow['ov_discount']);
+ $_POST["memo_"] = get_comments_string(ST_CUSTPAYMENT,$_POST['trans_no']);
+
+ if (!isset($_POST['charge'])) // first page call
+ {
+ //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,0);
+ $Ajax->activate('alloc_tbl');
+ }
+ }
+
+}