-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
feat: include payments in purchase / sales register report #36069
feat: include payments in purchase / sales register report #36069
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #36069 +/- ##
===========================================
+ Coverage 64.20% 64.26% +0.05%
===========================================
Files 785 785
Lines 60703 60952 +249
===========================================
+ Hits 38975 39169 +194
- Misses 21728 21783 +55
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be enhanced further to show a holistic ledger view for Supplier and Customer
- Maybe rename the check to "Show Ledger View" instead of "Include Payments"
- Show opening balances on the first row
- Few columns might have to be hidden and rearranged and added as well
- A balance column should be added
- Show invoice and payment amount in separate columns (Invoice and Payments)
- Hide columns like Supplier/Customer Group, Purchase Order, Receipt, Currency, Rounded total, and Outstanding Amount which are common for a specific party - Skip the total row for this view (there is a parameter that can be passed for this)
return query | ||
|
||
|
||
def get_opening_row(party_type, party, from_date, company): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, check for the party in this (query), multiple parties use the same account so this will fetch balance for all parties. Also add a check for cancelled entries, should not pull any cancelled entries
{"fieldname": "currency", "label": _("Currency"), "fieldtype": "Data", "width": 80}, | ||
] | ||
else: | ||
columns += [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convert these columns to the new format as well?
{"fieldname": "currency", "label": _("Currency"), "fieldtype": "Data", "width": 80}, | ||
] | ||
if not include_payments: | ||
columns += [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convert to new column format?
erpnext/accounts/report/utils.py
Outdated
return payment_entries | ||
|
||
|
||
def get_conditions(filters, query, docs, payments=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of docs, we can make this more explicit, which would be easier to read and understand. Instead of docs
parameter, we can pass the doctype which would be either Sales, Purchase Invoice, or Payment or Journal entry.
child_doc can be an optional parameter and docs[2] (Sales Invoice Payment) can be hard coded since its already inside the Sales Invoice if block
erpnext/accounts/report/utils.py
Outdated
(gle.account.isin(party_account)) | ||
& (gle.party == party) | ||
& (gle.posting_date < from_date) | ||
& (gle.docstatus == 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check for field is_cancelled
= 0, docstatus won't help here
Added the feature to enable fetching Payment Entries & Journal Entries along with Purchase/Sales Invoice details in Purchase/Sales Register Reports.
The
Include Payments
checkbox alters the flow in the following manner -Issue #34764
no-docs