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

🐛 [Bug] - Trial Balance and Balance Sheet showing Incorrect Data #815

Open
njmulsqb opened this issue Jan 19, 2024 · 14 comments
Open

🐛 [Bug] - Trial Balance and Balance Sheet showing Incorrect Data #815

njmulsqb opened this issue Jan 19, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@njmulsqb
Copy link

njmulsqb commented Jan 19, 2024

Expected Behavior

When I add a journal entry, I want to check my assets and current bank balance and it should show correct amount as mentioned in Setup --> Chart of Accounts --> Current Assets --> Bank

Current Behavior

Instead it shows completely different and incorrect values
image
image
whereas the correct one is :

image

Steps to Reproduce

No response

FrappeBooks Version

0.20.0

Path or Feature name

Trial Balance

Country

PK

Language

English

OS

Macos (Apple Silicon)

Additional OS Info

No response

Reference: #730 (comment)

@njmulsqb njmulsqb added the bug Something isn't working label Jan 19, 2024
@mildred
Copy link
Contributor

mildred commented Jan 19, 2024

I don't know how those reports are working either but possibly some transactions are not counted depending on the report settings.

What I suspect is that old transactions outside of the time range are not counted and I'm not sure this is a bug or if it is the way the report is supposed to be shown.

edit: but I agree with you that I'm missing a report showing the same amounts as in shown in the account tree.

It would be good if you could link a demo company file that has the problem to this issue.

@njmulsqb
Copy link
Author

@njmulsqb
Copy link
Author

Any update with this?

@Jace996
Copy link

Jace996 commented Jan 27, 2024

@njmulsqb Not sure your problem is same with mine #819
My all reports messed up because of the date issue.

@njmulsqb
Copy link
Author

@njmulsqb Not sure your problem is same with mine #819 My all reports messed up because of the date issue.

Maybe Jace, I have started using Gnucash in parallel hoping that this bug resolves soon. Gnucash though design-wise is not so good but its features are solid and reports are properly calculated. I think in finance numbers matter more than looks.

@Isaac-GC
Copy link
Collaborator

Hi @njmulsqb,

I've narrowed down where the issue is and am working on it. There should be a fix out within the next day or two.

@Isaac-GC
Copy link
Collaborator

Just a general update: From what I'm seeing, the issue you are having is related to DateTimeStamp issue that is in the other bug linked above as well.

There currently is a PR open #831 for this issue and I'm working on testing database patches to fix the affected items.

@njmulsqb
Copy link
Author

Thank you for updates Isaac. Looking forward to a stable version.

@Isaac-GC
Copy link
Collaborator

Isaac-GC commented Feb 2, 2024

v0.21.1 patch update was just released. Can you validate the information shows as expected now please?

@njmulsqb
Copy link
Author

njmulsqb commented Feb 2, 2024

v0.21.1 patch update was just released. Can you validate the information shows as expected now please?

Unfortunately, numbers are still inconsistent in reports. Infact, I didnt see any change in the figures of reports.

@Isaac-GC
Copy link
Collaborator

Isaac-GC commented Feb 12, 2024

@mildred / @18alantom The numbers look to be populating/aggregated properly (even after the datetime issues) in the various report views mentioned in comment#1.

Would you be willing to see if there are differences or issues that I'm missing please?

@njmulsqb
Copy link
Author

njmulsqb commented Mar 8, 2024

Any update on this?

@Isaac-GC
Copy link
Collaborator

Hi @njmulsqb, I was hoping to have some correlation with findings from others above and also ended up getting sidetracked with other issues/feature-requests.

I did some manual accounting to validate what the outputs should be and came up with the below outputs. (please note the last item should be negative and is a typo)
Screenshot 2024-03-10 at 8 48 01 PM

I don't know if this is another bout of datetime issues, but pretty sure it is part of it. When using the General Ledger and changing the date to 18 January, an entry that shows as 17 January in the General Ledger (I.e. JV-1040) disappears.


Investigating deeper

There are three tables (at least) in the database that are part of the backend logic that build the numbers for the view for General Ledger. These tables are:

  • JournalEntry (stores most of the data)
  • JournalEntryAccount (Which stores the debit/credit amounts per item in JournalEntry)
  • AccountingLedgerEntry which actually stores the data used in the General Ledger (and other items under Reports or that extends the Reports class)

The items in JournalEntry/JournalEntryAccount table gets sync'd/copied over to the AccountingLedgerEntry table. Looking through the original database you provided above, I found that the date format is 2024-01-19 in the JournalEntry table whereas in the AccountingLedgerEntry table, the format is actually a datetime type 2024-01-18T19:00:00.000Z.

When this happens, the date format gets modified to a datetime format and due to the fun nature of datetime in Javascript, the date gets modified according to your timezone. So in the case above, when converting 2024-01-19 to datetime to Zulu (or GMT) time, the actual Zulu/GMT time is 5 hours behind your local timezone which then changes the date to 2024-01-18T19:00:00.000Z (18 Jan 2024 7pm GMT).

Patching it should be relatively simple... and probably will be done in the next version (If the above is indeed the issue, a fix will be pushed midweek). But for a larger scale, this brings up a valid issue with patching (see #867) and the overall way the schemas are managed (future work TBD)

@asadmalik
Copy link

Hi There,
Any update on this ( #815 ) and #819?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

5 participants