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

[16.0] account_statement_import_sheet_file: keep order of rows in imported file #669

Open
cuongnmtm opened this issue Feb 7, 2024 · 2 comments

Comments

@cuongnmtm
Copy link

cuongnmtm commented Feb 7, 2024

When importing bank statements using a sheet file that contains a column with timestamps in date format, the sequence of generated journal items may not match the sequence of lines in the imported file. This happens because the rows are currently being sorted by the timestamp column.

The code that sorts rows by timestamp:

lines = list(sorted(lines, key=lambda line: line["timestamp"]))

Example:

STT No. TNX Date/ CT/ Doc No Effective date Debit Credit
1 02/01/2024 / 5254 - 96829 02/01/2024 6.000  
2 02/01/2024 / 5136 - 09957 02/01/2024 2.000  
3 02/01/2024 / 5136 - 10124 02/01/2024 2.000  
4 02/01/2024 / 5136 - 10694 02/01/2024 7.000  
5 02/01/2024 / 5136 - 11486 02/01/2024 15.000  
6 03/01/2024 / 5009 - 07716 03/01/2024   15.000

generated these journal items

image

Describe the solution you'd like

A way to avoid sorting rows upon import to preserve their original order. Alternatively, allow for sorting by multiple columns.

@cuongnmtm
Copy link
Author

cuongnmtm commented Feb 7, 2024

I can submit a pull request to improve this, but I'm not sure which direction to take.

Maybe an option on the mapping to skip the sort.

Copy link

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Aug 11, 2024
@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant