function write_trans($type, $entry, $curEntryId, $bank_account)
{
    if ($type == ST_JOURNAL) {
        if (!check_journal_entry($entry, $curEntryId)) {
        }
        write_journal_entries($entry, false, false);
        // FA built-in function
    } elseif ($type == ST_BANKDEPOSIT || $type == ST_BANKPAYMENT) {
        add_bank_transaction($entry->trans_type, $bank_account, $entry, $entry->tran_date, false, false, false, $entry->reference, $entry->memo_, false);
    }
}
Пример #2
0
            display_error(_("The entered reference is already in use."));
            set_focus('ref');
            $input_error = 1;
        }
    }
    if ($input_error == 1) {
        unset($_POST['Process']);
    }
}
if (isset($_POST['Process'])) {
    $cart =& $_SESSION['journal_items'];
    $new = $cart->order_id == 0;
    $cart->reference = $_POST['ref'];
    $cart->memo_ = $_POST['memo_'];
    $cart->tran_date = $_POST['date_'];
    $trans_no = write_journal_entries($cart, check_value('Reverse'));
    $cart->clear_items();
    new_doc_date($_POST['date_']);
    unset($_SESSION['journal_items']);
    if ($new) {
        meta_forward($_SERVER['PHP_SELF'], "AddedID={$trans_no}");
    } else {
        meta_forward($_SERVER['PHP_SELF'], "UpdatedID={$trans_no}");
    }
}
//-----------------------------------------------------------------------------------------------
function check_item_data()
{
    if (isset($_POST['dimension_id']) && $_POST['dimension_id'] != 0 && dimension_is_closed($_POST['dimension_id'])) {
        display_error(_("Dimension is closed."));
        set_focus('dimension_id');