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/gl_db_trans.inc from line 354 to 383, shown here for quick reference below :
function add_journal_entries($items, $date_, $ref, $reverse, $memo_=null)
{
begin_transaction();
$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
add_gl_tax_details($journal_item->code_id,
($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,
Freddy