Topic: 0005724: Bug In Date Editing in Latest FA

Dear Team,

I would like to bring to your attention that I have identified a bug in the latest version of FA.

When attempting to edit a transaction and modify the date, we encounter an issue where we are unable to save the transaction. An error message is displayed, which reads as follows:

"DATABASE ERROR: Cannot update audit gl_seq
Error code: 1048"

I have also confirmed that this issue persists in the latest FA release.

I would like to emphasize the urgency of addressing this matter promptly. Please prioritize and resolve this bug as soon as possible.

Thank you for your attention to this issue.


Step to Reproduce :
    Enable Debug Mode
Enter the Transaction and submit
reopen the same transaction for editing
change the Date
and Save .

it can be easily Reprodue in Journal and other transaction

Re: 0005724: Bug In Date Editing in Latest FA

@joe
$kvvaradha

please check it

Re: 0005724: Bug In Date Editing in Latest FA

@yubrajkafle99

You need to describe in details what you did to reach this stage. The error clearly mentions a problem in fiscal years for the date entered. So please list your fiscal years opened/closed and your current fiscal year. and to what date you are changing the transaction date.

Re: 0005724: Bug In Date Editing in Latest FA

@rafat

I am getting this error
DATABASE ERROR : Cannot update audit gl_seq
error code : 1048
error message : Column 'fiscal_year' cannot be null
sql that failed was : UPDATE 0_audit_trail audit LEFT JOIN 0_fiscal_year year ON year.begin<='2023-11-08' AND year.end>='2023-11-08' SET audit.gl_seq = IF(audit.id=6, 0, NULL),audit.fiscal_year=year.id WHERE type='0' AND trans_no='2'

my fiscal years Starts 2022.01.01
and Ends : 2022.12.31


i had posted the journal Entry on Date 2022.12.10 and i have got this error when i try to update my Journal Entry Date to 2022.12.11

Re: 0005724: Bug In Date Editing in Latest FA

Create a 2023 fiscal year and try again. No need for it to be the current. Try with active and not active 2023.
Good luck.

Re: 0005724: Bug In Date Editing in Latest FA

@rafat  Thank you so much . Worked .
problem solved .

Re: 0005724: Bug In Date Editing in Latest FA

This bug was reported on Mantis as
0005724: Bug In Date Editing in Latest FA

I cannot reproduce this error. And this has been specified on the Mantis bug report.

Joe

Re: 0005724: Bug In Date Editing in Latest FA

This occurs due to lines 28-32 in includes/db/audit_trail_db.inc:

    $sql = "UPDATE ".TB_PREF."audit_trail audit LEFT JOIN ".TB_PREF."fiscal_year year ON year.begin<='$date' AND year.end>='$date'
        SET audit.gl_seq = IF(audit.id=".db_insert_id().", 0, NULL),"
        ."audit.fiscal_year=year.id"
        . " WHERE type=".db_escape($trans_type)." AND trans_no="
        . db_escape($trans_no);

If there is no valid matching value of the field fiscal_year as happens when no records for fiscal year in question, this will error out.