Beispiel #1
0
    label_cells(tr("Currency"), $from_trans['bank_curr_code'], "class='tableheader2'");
}
label_cells(tr("Amount"), number_format2(-$from_trans['amount'], user_price_dec()), "class='tableheader2'", "align=right");
label_cells(tr("Date"), sql2date($from_trans['trans_date']), "class='tableheader2'");
end_row();
start_row();
label_cells(tr("Pay To"), payment_person_types::person_name($from_trans['person_type_id'], $from_trans['person_id']), "class='tableheader2'", "colspan={$colspan1}");
label_cells(tr("Payment Type"), $from_trans['BankTransType'], "class='tableheader2'");
end_row();
start_row();
label_cells(tr("Reference"), $from_trans['ref'], "class='tableheader2'", "colspan={$colspan2}");
end_row();
comments_display_row(systypes::bank_payment(), $trans_no);
end_table(1);
$voided = is_voided_display(systypes::bank_payment(), $trans_no, tr("This payment has been voided."));
$items = get_gl_trans(systypes::bank_payment(), $trans_no);
if (db_num_rows($items) == 0) {
    echo "<br>" . tr("There are no items for this payment.");
} else {
    display_heading2(tr("Items for this Payment"));
    if ($show_currencies) {
        display_heading2(tr("Item Amounts are Shown in :") . " " . $company_currency);
    }
    echo "<br>";
    start_table("{$table_style} width=80%");
    $th = array(tr("Account Code"), tr("Account Description"), tr("Amount"), tr("Memo"));
    table_header($th);
    $k = 0;
    //row colour counter
    $totalAmount = 0;
    while ($item = db_fetch($items)) {
Beispiel #2
0
    session_register("pay_items");
    $_SESSION['pay_items'] = new items_cart();
    $_POST['date_'] = Today();
    if (!is_date_in_fiscalyear($_POST['date_'])) {
        $_POST['date_'] = end_fiscalyear();
    }
    $_SESSION['pay_items']->tran_date = $_POST['date_'];
}
//-----------------------------------------------------------------------------------------------
if (isset($_POST['Process'])) {
    $input_error = 0;
    if (!references::is_valid($_POST['ref'])) {
        display_error(tr("You must enter a reference."));
        set_focus('ref');
        $input_error = 1;
    } elseif (!is_new_reference($_POST['ref'], systypes::bank_payment())) {
        display_error(tr("The entered reference is already in use."));
        set_focus('ref');
        $input_error = 1;
    } elseif (!is_date($_POST['date_'])) {
        display_error(tr("The entered date for the payment is invalid."));
        set_focus('date_');
        $input_error = 1;
    } elseif (!is_date_in_fiscalyear($_POST['date_'])) {
        display_error(tr("The entered date is not in fiscal year."));
        set_focus('date_');
        $input_error = 1;
    }
    if ($input_error == 1) {
        unset($_POST['Process']);
    }