Topic: The selected transaction was closed for edition and cannot be voided

When I tried to void a transaction (payments, invoice, etc) - by going to Setup > Maintenance > Void a transaction
I get an error message:

"The selected transaction was closed for edition and cannot be voided."

The transaction I am trying to void is from this year.

The current fiscal year is 1/1/2022-12/31/2022 and previous years have been closed.

It appears the problem is the current version is not compatible with PHP 8.0.    When I switched the PHP back to 7.0 from 8.0, the problem went away, and I was able to void transactions without the error message.  So there is a problem with compatibility with PHP 8.0

https://frontaccounting.com/punbb/viewtopic.php?id=9664

2 (edited by rogerk 07/04/2022 10:02:49 am)

Re: The selected transaction was closed for edition and cannot be voided

Hi,

In PHP 8.1 comparisons have changed if one of them is not a number.

Replace this function in frontaccounting/includes/db/audit_trail_db.inc:

function is_closed_trans($type, $trans_no) {

        $gl_seq = get_journal_number($type, $trans_no);
        if (is_numeric( $gl_seq )) {
                return  $gl_seq > 0;
        }
        else {
                return false;
        }
}

3 (edited by trunox 07/08/2022 07:52:57 am)

Re: The selected transaction was closed for edition and cannot be voided

I have change the function accordingly.
After this change, in the Customer Transaction Inquiry, I am able to click the edit button (Before this it show CLOSED), but it could not display the record for edit. It just go to new page and show the transaction no. only.

What is the possible causes?

As for the Sales Order Inquiry, it can be edit now.


rogerk wrote:

Hi,

In PHP 8.1 comparisons have changed if one of them is not a number.

Replace this function in frontaccounting/includes/db/audit_trail_db.inc:

function is_closed_trans($type, $trans_no) {

        $gl_seq = get_journal_number($type, $trans_no);
        if (is_numeric( $gl_seq )) {
                return  $gl_seq > 0;
        }
        else {
                return false;
        }
}

Re: The selected transaction was closed for edition and cannot be voided

possibly your GL close date might be changed.  check the Banking and General ledger -> GL Close transaction.

If the date is greater than the transaction date, it wont allow you to do this. We cant consider its just php version issue, it can be  code changed to make it fail or make it complex.

Subscription service based on FA
HRM CRM POS batch Themes

Re: The selected transaction was closed for edition and cannot be voided

Hi Kvvaradha

Thanks for the reply. Appreciated it.
I have check the GL close date. I have never use this function, but to try it, i have set the close date to 2020... and my current fiscal year is in 2022.
This transaction locked happen right after i accidental update the PHP version on my hosting server.

Now after i change the frontaccounting/includes/db/audit_trail_db.inc:
It can edit the sales order, but the invoice is still not able to show( The pencil button is now show as editable).
But still it cant convert DO into Invoice.

Kindly help this...
Thanks a lot...