Пример #1
0
function check_valid_entries()
{
    if (!is_date($_POST['DatePaid'])) {
        display_error(tr("The entered date is invalid."));
        set_focus('DatePaid');
        return false;
    }
    if (!is_date_in_fiscalyear($_POST['DatePaid'])) {
        display_error(tr("The entered date is not in fiscal year."));
        set_focus('DatePaid');
        return false;
    }
    if (!check_num('amount', 0)) {
        display_error(tr("The entered amount is invalid or less than zero."));
        set_focus('amount');
        return false;
    }
    if (!references::is_valid($_POST['ref'])) {
        display_error(tr("You must enter a reference."));
        set_focus('ref');
        return false;
    }
    if (!is_new_reference($_POST['ref'], systypes::bank_transfer())) {
        display_error(tr("The entered reference is already in use."));
        set_focus('ref');
        return false;
    }
    if ($_POST['FromBankAccount'] == $_POST['ToBankAccount']) {
        display_error(tr("The source and destination bank accouts cannot be the same."));
        set_focus('ToBankAccount');
        return false;
    }
    return true;
}
Пример #2
0
}
display_heading(systypes::name(systypes::bank_transfer()) . " #{$trans_no}");
echo "<br>";
start_table("{$table_style} width=80%");
start_row();
label_cells(tr("From Bank Account"), $from_trans['bank_account_name'], "class='tableheader2'");
if ($show_currencies) {
    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");
if ($show_currencies) {
    end_row();
    start_row();
}
label_cells(tr("To Bank Account"), $to_trans['bank_account_name'], "class='tableheader2'");
if ($show_currencies) {
    label_cells(tr("Currency"), $to_trans['bank_curr_code'], "class='tableheader2'");
}
if ($show_both_amounts) {
    label_cells(tr("Amount"), number_format2($to_trans['amount'], user_price_dec()), "class='tableheader2'", "align=right");
}
end_row();
start_row();
label_cells(tr("Date"), sql2date($from_trans['trans_date']), "class='tableheader2'");
label_cells(tr("Transfer Type"), $from_trans['BankTransType'], "class='tableheader2'");
label_cells(tr("Reference"), $from_trans['ref'], "class='tableheader2'");
end_row();
comments_display_row(systypes::bank_transfer(), $trans_no);
end_table(1);
is_voided_display(systypes::bank_transfer(), $trans_no, tr("This transfer has been voided."));
end_page(true);