customer_list_row(_("From Customer:"), 'customer_id', null, false, true); } else { label_cells(_("From Customer:"), $_POST['customer_name'], "class='label'"); hidden('customer_id', $_POST['customer_id']); } if (list_updated('customer_id') || $new && list_updated('bank_account')) { $_SESSION['alloc']->read(); $_POST['memo_'] = $_POST['amount'] = $_POST['discount'] = ''; $Ajax->activate('alloc_tbl'); } if (db_customer_has_branches($_POST['customer_id'])) { customer_branches_list_row(_("Branch:"), $_POST['customer_id'], 'BranchID', null, false, true, true); } else { hidden('BranchID', ANY_NUMERIC); } read_customer_data(); set_global_customer($_POST['customer_id']); if (isset($_POST['HoldAccount']) && $_POST['HoldAccount'] != 0) { display_warning(_("This customer account is on hold.")); } $display_discount_percent = percent_format($_POST['pymt_discount'] * 100) . "%"; table_section(2); if (!list_updated('bank_account')) { $_POST['bank_account'] = get_default_customer_bank_account($_POST['customer_id']); } //Chaitanya : 13-OCT-2011 - Is AJAX call really needed ??? //bank_accounts_list_row(_("Into Bank Account:"), 'bank_account', null, true); bank_accounts_list_row(_("Into Bank Account:"), 'bank_account', null, false); text_row(_("Reference:"), 'ref', null, 20, 40); table_section(3); date_row(_("Date of Deposit:"), 'DateBanked', '', true, 0, 0, 0, null, true);
function display_item_form() { global $table_style2; start_table($table_style2, 5, 7); echo "<tr><td valign=top>"; // outer table echo "<table>"; 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(tr("From Customer:"), 'customer_id', null, false, true); if (db_customer_has_branches($_POST['customer_id'])) { customer_branches_list_row(tr("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 "</table></table>"; display_note(tr("This customer account is on hold."), 0, 0, "class='redfb'"); } else { $display_discount_percent = percent_format($_POST['pymt_discount'] * 100) . "%"; amount_row(tr("Amount:"), 'amount'); amount_row(tr("Amount of Discount:"), 'discount'); label_row(tr("Customer prompt payment discount :"), $display_discount_percent); date_row(tr("Date of Deposit:"), 'DateBanked'); echo "</table>"; echo "</td><td valign=top class='tableseparator'>"; // outer table echo "<table>"; bank_accounts_list_row(tr("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(tr("Type:"), 'ReceiptType', null); text_row(tr("Reference:"), 'ref', null, 20, 40); textarea_row(tr("Memo:"), 'memo_', null, 22, 4); echo "</table>"; echo "</td></tr>"; end_table(); // outer table if ($cust_currency != $bank_currency) { display_note(tr("Amount and discount are in customer's currency.")); } echo "<br>"; submit_center('AddPaymentItem', tr("Add Payment")); } echo "<br>"; }