Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying a journal uses today's date for voiding the existing journal resulting in DB error if there is no current financial year #10

Open
rkilchmn opened this issue Dec 10, 2022 · 0 comments

Comments

@rkilchmn
Copy link

rkilchmn commented Dec 10, 2022

Version FA 2.4.14
When modifying a journal the existing journal gets voided using todays date
/usr/share/webapps/frontaccounting/gl/includes/db/gl_journal.inc
$msg = void_transaction($trans_type, $cart->order_id, Today(), _("Document reentered."));

That causes a DB error in /usr/share/webapps/frontaccounting/includes/db/audit_trail_db.inc
function add_audit_trail($trans_type, $trans_no, $trans_date, $descr='')
Line 34

Example: the exiting journals transaction date is '2012-05-12' but the query tries to find a financial year for today and fails with error "Column 'fiscal_year' cannot be null". I am using the "demo" company with active financial year in 2012
"UPDATE 0_audit_trail audit LEFT JOIN 0_fiscal_year year ON year.begin<='2022-12-11' AND year.end>='2022-12-11'
SET audit.gl_seq = IF(audit.id=601, 0, NULL),audit.fiscal_year=year.id WHERE type='0' AND trans_no='53'"

For most other transaction types , the original transaction's date is used for voiding:
Example: /usr/share/webapps/frontaccounting/gl/includes/db/gl_db_banking.inc:
$msg = void_transaction($trans_type, $old_trans, $date_, _("Document reentered."));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant