Bug 5310: DB error when on bank payment/transfer edit if current fiscal year is missi...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 11 Feb 2021 00:05:06 +0000 (01:05 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 11 Feb 2021 00:05:06 +0000 (01:05 +0100)
gl/includes/db/gl_db_banking.inc

index c1a5e16d23a193e3d3ce3c67a4177fa7d94a08a1..1a6aed3e857b6c78ea52d4a75ad3cd298b7f5947 100644 (file)
@@ -351,7 +351,7 @@ function update_bank_transfer(
 {
        begin_transaction();
        delete_comments(ST_BANKTRANSFER, $trans_no);
-       void_transaction(ST_BANKTRANSFER, $trans_no, Today(), _("Document reentered."));
+       void_transaction(ST_BANKTRANSFER, $trans_no, $date_, _("Document reentered."));
        void_gl_trans(ST_BANKTRANSFER, $trans_no, true);
        $new_trans_no = add_bank_transfer(
                $from_account, $to_account, $date_, $amount,
@@ -518,7 +518,7 @@ function write_bank_transaction($trans_type, $trans_no, $from_account, $items, $
        //  otherwise the operation could fail for cash accounts due to temporary negative balance
        if ($old_trans) 
        {
-               $msg = void_transaction($trans_type, $old_trans, Today(), _("Document reentered."));
+               $msg = void_transaction($trans_type, $old_trans, $date_, _("Document reentered."));
                if ($msg)
                {
                        display_error($msg);