refactor: re-add remarks field to payment ledger and AR/AP report

(cherry picked from commit 5782c4469a)
This commit is contained in:
ruthra kumar
2022-08-22 15:46:04 +05:30
committed by Mergify
parent b067eae38c
commit f7898b4954
4 changed files with 19 additions and 2 deletions

View File

@@ -22,7 +22,8 @@
"amount", "amount",
"account_currency", "account_currency",
"amount_in_account_currency", "amount_in_account_currency",
"delinked" "delinked",
"remarks"
], ],
"fields": [ "fields": [
{ {
@@ -136,12 +137,17 @@
"fieldtype": "Link", "fieldtype": "Link",
"label": "Finance Book", "label": "Finance Book",
"options": "Finance Book" "options": "Finance Book"
},
{
"fieldname": "remarks",
"fieldtype": "Text",
"label": "Remarks"
} }
], ],
"in_create": 1, "in_create": 1,
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2022-07-11 09:13:54.379168", "modified": "2022-08-22 15:32:56.629430",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Payment Ledger Entry", "name": "Payment Ledger Entry",

View File

@@ -178,6 +178,11 @@ frappe.query_reports["Accounts Receivable"] = {
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 1 "hidden": 1
}, },
{
"fieldname": "show_remarks",
"label": __("Show Remarks"),
"fieldtype": "Check",
},
{ {
"fieldname": "customer_name", "fieldname": "customer_name",
"label": __("Customer Name"), "label": __("Customer Name"),

View File

@@ -119,6 +119,7 @@ class ReceivablePayableReport(object):
party_account=ple.account, party_account=ple.account,
posting_date=ple.posting_date, posting_date=ple.posting_date,
account_currency=ple.account_currency, account_currency=ple.account_currency,
remarks=ple.remarks,
invoiced=0.0, invoiced=0.0,
paid=0.0, paid=0.0,
credit_note=0.0, credit_note=0.0,
@@ -692,6 +693,7 @@ class ReceivablePayableReport(object):
ple.account_currency, ple.account_currency,
ple.amount, ple.amount,
ple.amount_in_account_currency, ple.amount_in_account_currency,
ple.remarks,
) )
.where(ple.delinked == 0) .where(ple.delinked == 0)
.where(Criterion.all(self.qb_selection_filter)) .where(Criterion.all(self.qb_selection_filter))
@@ -970,6 +972,9 @@ class ReceivablePayableReport(object):
options="Supplier Group", options="Supplier Group",
) )
if self.filters.show_remarks:
self.add_column(label=_("Remarks"), fieldname="remarks", fieldtype="Text", width=200),
def add_column(self, label, fieldname=None, fieldtype="Currency", options=None, width=120): def add_column(self, label, fieldname=None, fieldtype="Currency", options=None, width=120):
if not fieldname: if not fieldname:
fieldname = scrub(label) fieldname = scrub(label)

View File

@@ -1424,6 +1424,7 @@ def create_payment_ledger_entry(
"amount": dr_or_cr, "amount": dr_or_cr,
"amount_in_account_currency": dr_or_cr_account_currency, "amount_in_account_currency": dr_or_cr_account_currency,
"delinked": True if cancel else False, "delinked": True if cancel else False,
"remarks": gle.remarks,
} }
) )