X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gl%2Fincludes%2Fdb%2Fgl_db_trans.inc;h=b529bd09a60771ee31569133b149332ac101be07;hb=217429ba80c03da8d7d2fa9f90deba25b9fd400d;hp=31c07899976ce54f038b8d22c949c5e20686bef1;hpb=4cfcee729a44879749095274b27f635d1c1062b1;p=fa-stable.git diff --git a/gl/includes/db/gl_db_trans.inc b/gl/includes/db/gl_db_trans.inc index 31c07899..b529bd09 100644 --- a/gl/includes/db/gl_db_trans.inc +++ b/gl/includes/db/gl_db_trans.inc @@ -393,7 +393,7 @@ function write_journal_entries(&$cart, $reverse, $use_transaction=true) begin_transaction(); if(!$new) - void_journal_trans($trans_type, $trans_id, true); + void_journal_trans($trans_type, $trans_id, false); foreach ($cart->gl_items as $journal_item) { @@ -492,15 +492,17 @@ function void_gl_trans($type, $trans_id, $nested=false) //---------------------------------------------------------------------------------------- -function void_journal_trans($type, $type_no) +function void_journal_trans($type, $type_no, $use_transaction=true) { - begin_transaction(); + if ($use_transaction) + begin_transaction(); void_bank_trans($type, $type_no, true); // void_gl_trans($type, $type_no, true); // this is done above // void_trans_tax_details($type, $type_no); // ditto - commit_transaction(); + if ($use_transaction) + commit_transaction(); } ?> \ No newline at end of file