"; // outer table
echo "";
if (!isset($_POST['customer_id']))
$_POST['customer_id'] = get_global_customer(false);
if (!isset($_POST['DateBanked'])) {
$_POST['DateBanked'] = Today();
if (!is_date_in_fiscalyear($_POST['DateBanked'])) {
$_POST['DateBanked'] = end_fiscalyear();
}
}
customer_list_row(_("From Customer:"), 'customer_id', null, false, true);
if (db_customer_has_branches($_POST['customer_id'])) {
customer_branches_list_row(_("Branch:"), $_POST['customer_id'], 'BranchID', null, false, true, true);
} else {
hidden('BranchID', reserved_words::get_any_numeric());
}
read_customer_data();
set_global_customer($_POST['customer_id']);
if (isset($_POST['HoldAccount']) && $_POST['HoldAccount'] != 0) {
echo " ";
display_note(_("This customer account is on hold."), 0, 0, "class='redfb'");
} else {
$display_discount_percent = percent_format($_POST['pymt_discount']*100) . "%";
amount_row(_("Amount:"), 'amount');
amount_row(_("Amount of Discount:"), 'discount');
label_row(_("Customer prompt payment discount :"), $display_discount_percent);
date_row(_("Date of Deposit:"), 'DateBanked');
echo "";
echo " | "; // outer table
echo "";
bank_accounts_list_row(_("Into Bank Account:"), 'bank_account', null, true);
$cust_currency = get_customer_currency($_POST['customer_id']);
$bank_currency = get_bank_account_currency($_POST['bank_account']);
if ($cust_currency != $bank_currency) {
exchange_rate_display($cust_currency, $bank_currency, $_POST['DateBanked']);
}
bank_trans_types_list_row(_("Type:"), 'ReceiptType', null);
text_row(_("Reference:"), 'ref', null, 20, 40);
textarea_row(_("Memo:"), 'memo_', null, 22, 4);
echo " ";
echo " | ";
end_table(); // outer table
if ($cust_currency != $bank_currency)
display_note(_("Amount and discount are in customer's currency."));
echo"
";
submit_center('AddPaymentItem', _("Add Payment"));
}
echo "
";
}
//----------------------------------------------------------------------------------------------
start_form();
display_item_form();
end_form();
end_page();
?>