hook_db_prewrite is not properly used inside journal entry. Fixed by @kvvaradha.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 11 Oct 2021 20:43:56 +0000 (22:43 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 11 Oct 2021 20:43:56 +0000 (22:43 +0200)
gl/includes/db/gl_journal.inc

index 56ec39c31ab5063209cae4d34d257117af7ff485..7de137a1f5c6bbe88cb15022067cc0c0195a4fab 100644 (file)
@@ -105,7 +105,7 @@ function write_journal_entries(&$cart)
        $new = $cart->order_id == 0;
 
        begin_transaction();
        $new = $cart->order_id == 0;
 
        begin_transaction();
-
+       hook_db_prewrite($cart, ST_JOURNAL);
        if (!$new)
        {
                $msg = void_transaction($trans_type, $cart->order_id, Today(), _("Document reentered."));
        if (!$new)
        {
                $msg = void_transaction($trans_type, $cart->order_id, Today(), _("Document reentered."));
@@ -132,7 +132,7 @@ function write_journal_entries(&$cart)
        }
 
        add_audit_trail($trans_type, $trans_id, $date_);
        }
 
        add_audit_trail($trans_type, $trans_id, $date_);
-
+       hook_db_postwrite($cart, ST_JOURNAL);
        commit_transaction();
 
        return $trans_id;
        commit_transaction();
 
        return $trans_id;