fix: added Show Remarks checkbox in AR & AP reports (#27374)
This commit is contained in:
parent
295020451f
commit
3576668638
@ -110,6 +110,11 @@ frappe.query_reports["Accounts Payable"] = {
|
|||||||
"label": __("Based On Payment Terms"),
|
"label": __("Based On Payment Terms"),
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "show_remarks",
|
||||||
|
"label": __("Show Remarks"),
|
||||||
|
"fieldtype": "Check",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "tax_id",
|
"fieldname": "tax_id",
|
||||||
"label": __("Tax Id"),
|
"label": __("Tax Id"),
|
||||||
|
@ -156,6 +156,11 @@ frappe.query_reports["Accounts Receivable"] = {
|
|||||||
"label": __("Show Sales Person"),
|
"label": __("Show Sales Person"),
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "show_remarks",
|
||||||
|
"label": __("Show Remarks"),
|
||||||
|
"fieldtype": "Check",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "tax_id",
|
"fieldname": "tax_id",
|
||||||
"label": __("Tax Id"),
|
"label": __("Tax Id"),
|
||||||
|
@ -106,6 +106,7 @@ class ReceivablePayableReport(object):
|
|||||||
party = gle.party,
|
party = gle.party,
|
||||||
posting_date = gle.posting_date,
|
posting_date = gle.posting_date,
|
||||||
account_currency = gle.account_currency,
|
account_currency = gle.account_currency,
|
||||||
|
remarks = gle.remarks if self.filters.get("show_remarks") else None,
|
||||||
invoiced = 0.0,
|
invoiced = 0.0,
|
||||||
paid = 0.0,
|
paid = 0.0,
|
||||||
credit_note = 0.0,
|
credit_note = 0.0,
|
||||||
@ -583,10 +584,12 @@ class ReceivablePayableReport(object):
|
|||||||
else:
|
else:
|
||||||
select_fields = "debit, credit"
|
select_fields = "debit, credit"
|
||||||
|
|
||||||
|
remarks = ", remarks" if self.filters.get("show_remarks") else ""
|
||||||
|
|
||||||
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, cost_center,
|
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
|
from
|
||||||
`tabGL Entry`
|
`tabGL Entry`
|
||||||
where
|
where
|
||||||
@ -595,7 +598,7 @@ class ReceivablePayableReport(object):
|
|||||||
and party_type=%s
|
and party_type=%s
|
||||||
and (party is not null and party != '')
|
and (party is not null and party != '')
|
||||||
{1} {2} {3}"""
|
{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):
|
def get_sales_invoices_or_customers_based_on_sales_person(self):
|
||||||
if self.filters.get("sales_person"):
|
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 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)
|
||||||
|
|
||||||
|
if self.filters.show_remarks:
|
||||||
|
self.add_column(label=_('Remarks'), fieldname='remarks', fieldtype='Text', width=200),
|
||||||
|
|
||||||
self.add_column(label='Due Date', fieldtype='Date')
|
self.add_column(label='Due Date', fieldtype='Date')
|
||||||
|
|
||||||
if self.party_type == "Supplier":
|
if self.party_type == "Supplier":
|
||||||
|
Loading…
Reference in New Issue
Block a user