mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 18:51:21 +00:00
feat: added column cost_center to receivable reports (#23837)
* feat: added column cost_center to receivable reports * Update accounts_receivable.py Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
@@ -160,6 +160,8 @@ class ReceivablePayableReport(object):
|
|||||||
else:
|
else:
|
||||||
# advance / unlinked payment or other adjustment
|
# advance / unlinked payment or other adjustment
|
||||||
row.paid -= gle_balance
|
row.paid -= gle_balance
|
||||||
|
if gle.cost_center:
|
||||||
|
row.cost_center = gle.cost_center
|
||||||
|
|
||||||
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)
|
||||||
@@ -210,7 +212,6 @@ class ReceivablePayableReport(object):
|
|||||||
for key, row in self.voucher_balance.items():
|
for key, row in self.voucher_balance.items():
|
||||||
row.outstanding = flt(row.invoiced - row.paid - row.credit_note, self.currency_precision)
|
row.outstanding = flt(row.invoiced - row.paid - row.credit_note, self.currency_precision)
|
||||||
row.invoice_grand_total = row.invoiced
|
row.invoice_grand_total = row.invoiced
|
||||||
|
|
||||||
if abs(row.outstanding) > 1.0/10 ** self.currency_precision:
|
if abs(row.outstanding) > 1.0/10 ** self.currency_precision:
|
||||||
# non-zero oustanding, we must consider this row
|
# non-zero oustanding, we must consider this row
|
||||||
|
|
||||||
@@ -577,7 +578,7 @@ class ReceivablePayableReport(object):
|
|||||||
|
|
||||||
self.gl_entries = frappe.db.sql("""
|
self.gl_entries = frappe.db.sql("""
|
||||||
select
|
select
|
||||||
name, posting_date, account, party_type, party, voucher_type, voucher_no,
|
name, posting_date, account, party_type, party, voucher_type, voucher_no, cost_center,
|
||||||
against_voucher_type, against_voucher, account_currency, remarks, {0}
|
against_voucher_type, against_voucher, account_currency, remarks, {0}
|
||||||
from
|
from
|
||||||
`tabGL Entry`
|
`tabGL Entry`
|
||||||
@@ -741,6 +742,7 @@ class ReceivablePayableReport(object):
|
|||||||
self.add_column(_("Customer Contact"), fieldname='customer_primary_contact',
|
self.add_column(_("Customer Contact"), fieldname='customer_primary_contact',
|
||||||
fieldtype='Link', options='Contact')
|
fieldtype='Link', options='Contact')
|
||||||
|
|
||||||
|
self.add_column(label=_('Cost Center'), fieldname='cost_center', fieldtype='Data')
|
||||||
self.add_column(label=_('Voucher Type'), fieldname='voucher_type', fieldtype='Data')
|
self.add_column(label=_('Voucher Type'), fieldname='voucher_type', fieldtype='Data')
|
||||||
self.add_column(label=_('Voucher No'), fieldname='voucher_no', fieldtype='Dynamic Link',
|
self.add_column(label=_('Voucher No'), fieldname='voucher_no', fieldtype='Dynamic Link',
|
||||||
options='voucher_type', width=180)
|
options='voucher_type', width=180)
|
||||||
|
|||||||
Reference in New Issue
Block a user