From c0201877dd0906d43cd6ab2df9fe61be72776f0f Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Tue, 27 Mar 2018 18:45:42 +0530 Subject: [PATCH] fixed column fieldnames for translations (#13406) --- .../accounts_receivable.html | 10 +++---- .../accounts_receivable.py | 28 +++++++++++++++++-- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html index 10f326242b7..78015b40c8d 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html @@ -91,8 +91,8 @@ {% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %} - {%= __("Date") %} - {%= __("Ref") %} + {%= __("Date") %} + {%= __("Reference") %} {% if(!filters.show_pdc_in_print) { %} {%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %} {% } %} @@ -125,9 +125,9 @@ {% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %} {% if(data[i][__("Customer")] || data[i][__("Supplier")]) { %} - {%= dateutil.str_to_user(data[i][__("Posting Date")]) %} - {%= data[i][__("Voucher Type")] %} -
{%= data[i][__("Voucher No")] %} + {%= dateutil.str_to_user(data[i]["posting_date"]) %} + {%= data[i]["voucher_type"] %} +
{%= data[i]["voucher_no"] %} {% if(!filters.show_pdc_in_print) { %} {% if(!(filters.customer || filters.supplier)) { %} diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 02f247b8b0c..b971327abb2 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -22,13 +22,35 @@ class ReceivablePayableReport(object): return columns, data, None, chart def get_columns(self, party_naming_by, args): - columns = [_("Posting Date") + ":Date:80", _(args.get("party_type")) + ":Link/" + args.get("party_type") + ":200"] + columns = [] + columns.append({ + "label": _("Posting Date"), + "fieldtype": "Date", + "fieldname": "posting_date", + "width": 90 + }) + + columns += [_(args.get("party_type")) + ":Link/" + args.get("party_type") + ":200"] if party_naming_by == "Naming Series": columns += [args.get("party_type") + " Name::110"] - columns += [_("Voucher Type") + "::110", _("Voucher No") + ":Dynamic Link/"+_("Voucher Type")+":120", - _("Due Date") + ":Date:80"] + columns.append({ + "label": _("Voucher Type"), + "fieldtype": "Data", + "fieldname": "voucher_type", + "width": 110 + }) + + columns.append({ + "label": _("Voucher No"), + "fieldtype": "Dynamic Link", + "fieldname": "voucher_no", + "width": 110, + "options": "voucher_type", + }) + + columns += [_("Due Date") + ":Date:80"] if args.get("party_type") == "Supplier": columns += [_("Bill No") + "::80", _("Bill Date") + ":Date:80"]