Пример #1
0
function gl_payment_controls()
{
    global $table_style2;
    $home_currency = get_company_currency();
    start_form(false, true);
    start_table($table_style2, 5, 7);
    echo "<tr><td valign=top>";
    // outer table
    echo "<table>";
    bank_accounts_list_row(tr("From Account:"), 'FromBankAccount', null, true);
    bank_accounts_list_row(tr("To Account:"), 'ToBankAccount', null, true);
    date_row(tr("Transfer Date:"), 'DatePaid');
    $from_currency = get_bank_account_currency($_POST['FromBankAccount']);
    $to_currency = get_bank_account_currency($_POST['ToBankAccount']);
    if ($from_currency != "" && $to_currency != "" && $from_currency != $to_currency) {
        amount_row(tr("Amount:"), 'amount', null, null, $from_currency);
        exchange_rate_display($from_currency, $to_currency, $_POST['DatePaid']);
    } else {
        amount_row(tr("Amount:"), 'amount');
    }
    echo "</table>";
    echo "</td><td valign=top class='tableseparator'>";
    // outer table
    echo "<table>";
    bank_trans_types_list_row(tr("Transfer Type:"), 'TransferType', null);
    ref_row(tr("Reference:"), 'ref', references::get_next(systypes::bank_transfer()));
    textarea_row(tr("Memo:"), 'memo_', null, 40, 4);
    end_table(1);
    echo "</td></tr>";
    end_table(1);
    // outer table
    submit_center('AddPayment', tr("Enter Transfer"));
    end_form();
}
Пример #2
0
function display_controls()
{
    global $table_style2;
    start_form(false, true);
    if (!isset($_POST['supplier_id'])) {
        $_POST['supplier_id'] = get_global_supplier(false);
    }
    if (!isset($_POST['DatePaid'])) {
        $_POST['DatePaid'] = Today();
        if (!is_date_in_fiscalyear($_POST['DatePaid'])) {
            $_POST['DatePaid'] = end_fiscalyear();
        }
    }
    start_table($table_style2, 5, 7);
    echo "<tr><td valign=top>";
    // outer table
    echo "<table>";
    bank_accounts_list_row(tr("From Bank Account:"), 'bank_account', null, true);
    amount_row(tr("Amount of Payment:"), 'amount');
    amount_row(tr("Amount of Discount:"), 'discount');
    date_row(tr("Date Paid") . ":", 'DatePaid');
    echo "</table>";
    echo "</td><td valign=top class='tableseparator'>";
    // outer table
    echo "<table>";
    supplier_list_row(tr("Payment To:"), 'supplier_id', null, false, true);
    set_global_supplier($_POST['supplier_id']);
    $supplier_currency = get_supplier_currency($_POST['supplier_id']);
    $bank_currency = get_bank_account_currency($_POST['bank_account']);
    if ($bank_currency != $supplier_currency) {
        exchange_rate_display($bank_currency, $supplier_currency, $_POST['DatePaid']);
    }
    bank_trans_types_list_row(tr("Payment Type:"), 'PaymentType', null);
    ref_row(tr("Reference:"), 'ref', references::get_next(22));
    text_row(tr("Memo:"), 'memo_', null, 52, 50);
    echo "</table>";
    echo "</td></tr>";
    end_table(1);
    // outer table
    submit_center('ProcessSuppPayment', tr("Enter Payment"));
    if ($bank_currency != $supplier_currency) {
        display_note(tr("The amount and discount are in the bank account's currency."), 2, 0);
    }
    end_form();
}
Пример #3
0
function gl_payment_controls()
{
    global $Refs;
    $home_currency = get_company_currency();
    start_form();
    start_outer_table(TABLESTYLE2);
    table_section(1);
    bank_accounts_list_row(_("From Account:"), 'FromBankAccount', null, true);
    bank_balance_row($_POST['FromBankAccount']);
    bank_accounts_list_row(_("To Account:"), 'ToBankAccount', null, true);
    if (!isset($_POST['DatePaid'])) {
        // init page
        $_POST['DatePaid'] = new_doc_date();
        if (!is_date_in_fiscalyear($_POST['DatePaid'])) {
            $_POST['DatePaid'] = end_fiscalyear();
        }
    }
    date_row(_("Transfer Date:"), 'DatePaid', '', true, 0, 0, 0, null, true);
    ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_BANKTRANSFER));
    table_section(2);
    $from_currency = get_bank_account_currency($_POST['FromBankAccount']);
    $to_currency = get_bank_account_currency($_POST['ToBankAccount']);
    if ($from_currency != "" && $to_currency != "" && $from_currency != $to_currency) {
        amount_row(_("Amount:"), 'amount', null, null, $from_currency);
        amount_row(_("Bank Charge:"), 'charge', null, null, $from_currency);
        exchange_rate_display($from_currency, $to_currency, $_POST['DatePaid']);
    } else {
        amount_row(_("Amount:"), 'amount');
        amount_row(_("Bank Charge:"), 'charge');
    }
    textarea_row(_("Memo:"), 'memo_', null, 40, 4);
    end_outer_table(1);
    // outer table
    submit_center('AddPayment', _("Enter Transfer"), true, '', 'default');
    end_form();
}
Пример #4
0
$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);
$comp_currency = get_company_currency();
$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($bank_currency, $cust_currency, $_POST['DateBanked'], $bank_currency == $comp_currency);
}
amount_row(_("Bank Charge:"), 'charge');
end_outer_table(1);
if ($cust_currency == $bank_currency) {
    div_start('alloc_tbl');
    show_allocatable(false);
    div_end();
}
start_table(TABLESTYLE, "width=60%");
label_row(_("Customer prompt payment discount :"), $display_discount_percent);
amount_row(_("Amount of Discount:"), 'discount');
amount_row(_("Amount:"), 'amount');
textarea_row(_("Memo:"), 'memo_', null, 22, 4);
end_table(1);
if ($cust_currency != $bank_currency) {
Пример #5
0
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>";
}
Пример #6
0
    $Ajax->activate('alloc_tbl');
}
set_global_supplier($_POST['supplier_id']);
if (!list_updated('bank_account')) {
    $_POST['bank_account'] = get_default_supplier_bank_account($_POST['supplier_id']);
}
bank_accounts_list_row(_("From Bank Account:"), 'bank_account', null, true);
bank_balance_row($_POST['bank_account']);
table_section(2);
ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_SUPPAYMENT));
date_row(_("Date Paid") . ":", 'DatePaid', '', true, 0, 0, 0, null, true);
table_section(3);
$supplier_currency = get_supplier_currency($_POST['supplier_id']);
$bank_currency = get_bank_account_currency($_POST['bank_account']);
if ($bank_currency != $supplier_currency) {
    exchange_rate_display($bank_currency, $supplier_currency, $_POST['DatePaid'], true);
}
amount_row(_("Bank Charge:"), 'charge');
end_outer_table(1);
// outer table
if ($bank_currency == $supplier_currency) {
    div_start('alloc_tbl');
    show_allocatable(false);
    div_end();
}
start_table(TABLESTYLE, "width=60%");
amount_row(_("Amount of Discount:"), 'discount');
amount_row(_("Amount of Payment:"), 'amount');
textarea_row(_("Memo:"), 'memo_', null, 22, 4);
end_table(1);
if ($bank_currency != $supplier_currency) {