Topic: Import Journal Entries Module

Thank you for the new import journal and budget entries module. I'm sure many will find them very useful.

I just wish to seek clarification with regards to deposit/payment type of journal entries and it seems the module does not include adding the entries to the bank transaction db. This off course does not have any effect on the GL but the imported deposit/payment journal entries will not be shown when doing a bank reconciliation.

It seems $trans_type, $memo and $ref are also not updated to the db. Appreciate therefore if anyone can also clarify whether this is necessary or not.

Thank you.

Re: Import Journal Entries Module

Hello freddygl,

  Thanks for your feedback on the import modules.

  It is possible that I missed something when putting together the deposit/payment import, and I'd love to get it working if so. 

  Could you give a step-by-step description of what you do that normally works with Deposits/Payments, and then a step-by-step description of how the importing of deposits/payments doesn't work?

  I'd be happy to tackle that problem asap!

  Thanks again!


Re: Import Journal Entries Module

Hi Tom,

Thank you for your reply. Once again, good work on the module. It is something which I was waiting for, having known that it is being developed.

The issues that I have raised is following a view on the codes. It seems only the gl_trans db is updated. For sake of completeness, I was wondering whether it is necessary to update the other related db.

Looking at gl/includes/db/ from line 354 to 383, shown here for quick reference below :

function add_journal_entries($items, $date_, $ref, $reverse, $memo_=null)

    $trans_type = systypes::journal_entry();
    $trans_id = get_next_trans_no($trans_type);

    foreach ($items as $journal_item)
        // post to first found bank account using given gl acount code.
        $is_bank_to = is_bank_account($journal_item->code_id);

        add_gl_trans($trans_type, $trans_id, $date_, $journal_item->code_id,
            $journal_item->dimension_id, $journal_item->dimension2_id,
            $journal_item->reference, $journal_item->amount);
        if ($is_bank_to)
            add_bank_trans($trans_type, $trans_id, $is_bank_to, $ref,
                $date_, $journal_item->amount,
                0, "", get_company_currency(),
                "Cannot insert a destination bank transaction");
        // store tax details if the gl account is a tax account
            ($journal_item->amount < 0.0 ? 2 : 1), $trans_id, -$journal_item->amount, 1, $date_, $memo_);
    add_comments($trans_type, $trans_id, $date_, $memo_);

    references::save($trans_type, $trans_id, $ref);

Looking through the above, it seems any journal transaction should also require entries to the bank_trans db (if account code is a bank account), as well as the comments and refs db. Perhaps anyone of the developers can clarify if this is required or not.

Thank you and regards,

Re: Import Journal Entries Module

I had only short look into Tom's code, but all seems right to me. The import module does not write anything to database, but only read transactions from file and pass control to respective journal/deposit/payment page, so all checks and writes are done by related core code.
For small amount of transactions to be processed in one shot this is really the best implementation, I think . Good work Tom smile.


Re: Import Journal Entries Module

Thanks for the clarification Janusz.

Once again, thanks for the module Tom.