check_db_has_bank_accounts(_("There are no bank accounts defined in the system."));
//----------------------------------------------------------------------------------------
-if ($ret = context_restore()) {
- if(isset($ret['customer_id']))
- $_POST['customer_id'] = $ret['customer_id'];
- if(isset($ret['branch_id']))
- $_POST['BranchID'] = $ret['branch_id'];
-}
-if (isset($_POST['_customer_id_editor'])) {
- context_call($path_to_root.'/sales/manage/customers.php?debtor_no='.$_POST['customer_id'],
- array( 'customer_id', 'BranchID', 'bank_account', 'DateBanked',
- 'ref', 'amount', 'discount', 'memo_') );
+
+if (list_updated('BranchID')) {
+ // when branch is selected via external editor also customer can change
+ $br = get_branch(get_post('BranchID'));
+ $_POST['customer_id'] = $br['debtor_no'];
+ $Ajax->activate('customer_id');
}
if (!isset($_POST['customer_id']))
$Ajax->activate('_ex_rate');
}
if (list_updated('customer_id') || list_updated('bank_account')) {
- get_allocations_for_transaction(12, 0);
+ $_SESSION['alloc']->read();
$Ajax->activate('alloc_tbl');
}
//----------------------------------------------------------------------------------------------
input_num('amount'), input_num('discount'), $_POST['memo_'], $rate, input_num('charge'));
$_SESSION['alloc']->trans_no = $payment_no;
- handle_allocate();
+ $_SESSION['alloc']->write();
meta_forward($_SERVER['PHP_SELF'], "AddedID=$payment_no");
}
start_form();
- start_outer_table($table_style2, 5);
+ start_outer_table("$table_style2 width=60%", 5);
table_section(1);
customer_list_row(_("From Customer:"), 'customer_id', null, false, true);
if (!isset($_POST['bank_account'])) // first page call
- get_allocations_for_transaction(12, 0);
+ $_SESSION['alloc'] = new allocation(12,0);
+
if (db_customer_has_branches($_POST['customer_id'])) {
customer_branches_list_row(_("Branch:"), $_POST['customer_id'], 'BranchID', null, false, true, true);
} else {