mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
refactor: call procedures based on config
(cherry picked from commit e90c6a33bd)
# Conflicts:
# erpnext/accounts/report/accounts_receivable/accounts_receivable.py
This commit is contained in:
@@ -114,10 +114,15 @@ class ReceivablePayableReport:
|
|||||||
self.fetch_ple_in_buffered_cursor()
|
self.fetch_ple_in_buffered_cursor()
|
||||||
elif self.ple_fetch_method == "UnBuffered Cursor":
|
elif self.ple_fetch_method == "UnBuffered Cursor":
|
||||||
self.fetch_ple_in_unbuffered_cursor()
|
self.fetch_ple_in_unbuffered_cursor()
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
=======
|
=======
|
||||||
self.init_and_run_sql_procedures()
|
self.init_and_run_sql_procedures()
|
||||||
|
=======
|
||||||
|
elif self.ple_fetch_method == "Raw SQL":
|
||||||
|
self.init_and_run_sql_procedures()
|
||||||
|
>>>>>>> e90c6a33bd (refactor: call procedures based on config)
|
||||||
|
|
||||||
# Build delivery note map against all sales invoices
|
# Build delivery note map against all sales invoices
|
||||||
self.build_delivery_note_map()
|
self.build_delivery_note_map()
|
||||||
@@ -343,24 +348,40 @@ class ReceivablePayableReport:
|
|||||||
voucher_type,
|
voucher_type,
|
||||||
voucher_no,
|
voucher_no,
|
||||||
party,
|
party,
|
||||||
party_account,
|
party_account `account`,
|
||||||
posting_date,
|
posting_date,
|
||||||
account_currency,
|
account_currency,
|
||||||
sum(invoiced),
|
sum(invoiced) `invoiced`,
|
||||||
sum(paid),
|
sum(paid) `paid`,
|
||||||
sum(credit_note),
|
sum(credit_note) `credit_note`,
|
||||||
sum(invoiced) - sum(paid) - sum(credit_note),
|
sum(invoiced) - sum(paid) - sum(credit_note) `outstanding`,
|
||||||
sum(invoiced_in_account_currency),
|
sum(invoiced_in_account_currency) `invoiced_in_account_currency`,
|
||||||
sum(paid_in_account_currency),
|
sum(paid_in_account_currency) `paid_in_account_currency`,
|
||||||
sum(credit_note_in_account_currency),
|
sum(credit_note_in_account_currency) `credit_note_in_account_currency`,
|
||||||
sum(invoiced_in_account_currency) - sum(paid_in_account_currency) - sum(credit_note_in_account_currency)
|
sum(invoiced_in_account_currency) - sum(paid_in_account_currency) - sum(credit_note_in_account_currency) `outstanding_in_account_currency`
|
||||||
from `{self.proc._voucher_balance_name}` group by name;"""
|
from `{self.proc._voucher_balance_name}` group by name;""",
|
||||||
|
as_dict=True,
|
||||||
)
|
)
|
||||||
self.printv(res)
|
|
||||||
|
|
||||||
def printv(self, res):
|
|
||||||
for x in res:
|
for x in res:
|
||||||
print(x)
|
if self.filters.get("ignore_accounts"):
|
||||||
|
key = (x.voucher_type, x.voucher_no, x.party)
|
||||||
|
else:
|
||||||
|
key = (x.account, x.voucher_type, x.voucher_no, x.party)
|
||||||
|
|
||||||
|
_d = self.build_voucher_dict(x)
|
||||||
|
for field in [
|
||||||
|
"invoiced",
|
||||||
|
"paid",
|
||||||
|
"credit_note",
|
||||||
|
"outstanding",
|
||||||
|
"invoiced_in_account_currency",
|
||||||
|
"paid_in_account_currency",
|
||||||
|
"credit_note_in_account_currency",
|
||||||
|
"outstanding_in_account_currency",
|
||||||
|
]:
|
||||||
|
_d[field] = x.get(field)
|
||||||
|
|
||||||
|
self.voucher_balance[key] = _d
|
||||||
|
|
||||||
def update_sub_total_row(self, row, party):
|
def update_sub_total_row(self, row, party):
|
||||||
total_row = self.total_row_map.get(party)
|
total_row = self.total_row_map.get(party)
|
||||||
|
|||||||
Reference in New Issue
Block a user