mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
Accounts receivable aging based on supplier due date (#15080)
* Accounts receivable aging based on supplier due date (#13801) * Remove spaces
This commit is contained in:
@@ -32,7 +32,7 @@ frappe.query_reports["Accounts Payable"] = {
|
|||||||
"fieldname":"ageing_based_on",
|
"fieldname":"ageing_based_on",
|
||||||
"label": __("Ageing Based On"),
|
"label": __("Ageing Based On"),
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"options": 'Posting Date\nDue Date',
|
"options": 'Posting Date\nDue Date\nSupplier Invoice Date',
|
||||||
"default": "Posting Date"
|
"default": "Posting Date"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ class ReceivablePayableReport(object):
|
|||||||
|
|
||||||
# get due date
|
# get due date
|
||||||
due_date = voucher_details.get(gle.voucher_no, {}).get("due_date", "")
|
due_date = voucher_details.get(gle.voucher_no, {}).get("due_date", "")
|
||||||
|
bill_date = voucher_details.get(gle.voucher_no, {}).get("bill_date", "")
|
||||||
|
|
||||||
row += [gle.voucher_type, gle.voucher_no, due_date]
|
row += [gle.voucher_type, gle.voucher_no, due_date]
|
||||||
|
|
||||||
@@ -167,15 +168,25 @@ class ReceivablePayableReport(object):
|
|||||||
row += [invoiced_amount, paid_amt, credit_note_amount, outstanding_amount]
|
row += [invoiced_amount, paid_amt, credit_note_amount, outstanding_amount]
|
||||||
|
|
||||||
# ageing data
|
# ageing data
|
||||||
entry_date = due_date if self.filters.ageing_based_on == "Due Date" else gle.posting_date
|
if self.filters.ageing_based_on == "Due Date":
|
||||||
|
entry_date = due_date
|
||||||
|
elif self.filters.ageing_based_on == "Supplier Invoice Date":
|
||||||
|
entry_date = bill_date
|
||||||
|
else:
|
||||||
|
entry_date = gle.posting_date
|
||||||
row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2),
|
row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2),
|
||||||
cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount)
|
cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount)
|
||||||
|
|
||||||
|
|
||||||
# issue 6371-Ageing buckets should not have amounts if due date is not reached
|
# issue 6371-Ageing buckets should not have amounts if due date is not reached
|
||||||
if self.filters.ageing_based_on == "Due Date" \
|
if self.filters.ageing_based_on == "Due Date" \
|
||||||
and getdate(due_date) > getdate(self.filters.report_date):
|
and getdate(due_date) > getdate(self.filters.report_date):
|
||||||
row[-1]=row[-2]=row[-3]=row[-4]=0
|
row[-1]=row[-2]=row[-3]=row[-4]=0
|
||||||
|
|
||||||
|
if self.filters.ageing_based_on == "Supplier Invoice Date" \
|
||||||
|
and getdate(bill_date) > getdate(self.filters.report_date):
|
||||||
|
row[-1]=row[-2]=row[-3]=row[-4]=0
|
||||||
|
|
||||||
if self.filters.get(scrub(args.get("party_type"))):
|
if self.filters.get(scrub(args.get("party_type"))):
|
||||||
row.append(gle.account_currency)
|
row.append(gle.account_currency)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user