fix: added Show Remarks checkbox in AR & AP reports (#27374)

This commit is contained in:
Anuja Pawar 2021-09-09 11:57:29 +05:30 committed by GitHub
parent 295020451f
commit 3576668638
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 39 deletions

View File

@ -110,6 +110,11 @@ frappe.query_reports["Accounts Payable"] = {
"label": __("Based On Payment Terms"),
"fieldtype": "Check",
},
{
"fieldname": "show_remarks",
"label": __("Show Remarks"),
"fieldtype": "Check",
},
{
"fieldname": "tax_id",
"label": __("Tax Id"),

View File

@ -156,6 +156,11 @@ frappe.query_reports["Accounts Receivable"] = {
"label": __("Show Sales Person"),
"fieldtype": "Check",
},
{
"fieldname": "show_remarks",
"label": __("Show Remarks"),
"fieldtype": "Check",
},
{
"fieldname": "tax_id",
"label": __("Tax Id"),

View File

@ -106,6 +106,7 @@ class ReceivablePayableReport(object):
party = gle.party,
posting_date = gle.posting_date,
account_currency = gle.account_currency,
remarks = gle.remarks if self.filters.get("show_remarks") else None,
invoiced = 0.0,
paid = 0.0,
credit_note = 0.0,
@ -583,10 +584,12 @@ class ReceivablePayableReport(object):
else:
select_fields = "debit, credit"
remarks = ", remarks" if self.filters.get("show_remarks") else ""
self.gl_entries = frappe.db.sql("""
select
name, posting_date, account, party_type, party, voucher_type, voucher_no, cost_center,
against_voucher_type, against_voucher, account_currency, {0}
against_voucher_type, against_voucher, account_currency, {0} {remarks}
from
`tabGL Entry`
where
@ -595,7 +598,7 @@ class ReceivablePayableReport(object):
and party_type=%s
and (party is not null and party != '')
{1} {2} {3}"""
.format(select_fields, date_condition, conditions, order_by), values, as_dict=True)
.format(select_fields, date_condition, conditions, order_by, remarks=remarks), values, as_dict=True)
def get_sales_invoices_or_customers_based_on_sales_person(self):
if self.filters.get("sales_person"):
@ -754,6 +757,10 @@ class ReceivablePayableReport(object):
self.add_column(label=_('Voucher Type'), fieldname='voucher_type', fieldtype='Data')
self.add_column(label=_('Voucher No'), fieldname='voucher_no', fieldtype='Dynamic Link',
options='voucher_type', width=180)
if self.filters.show_remarks:
self.add_column(label=_('Remarks'), fieldname='remarks', fieldtype='Text', width=200),
self.add_column(label='Due Date', fieldtype='Date')
if self.party_type == "Supplier":