From 6fd1c1bca263b05cf035c97fcf56d209c137b61b Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 5 Sep 2023 08:53:10 +0530 Subject: [PATCH] refactor: display allocated amount in account currency with symbol --- .../unreconcile_payment_entries.json | 15 ++++++++++++--- .../unreconcile_payments/unreconcile_payments.py | 2 ++ erpnext/public/js/utils/unreconcile.js | 5 +++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/doctype/unreconcile_payment_entries/unreconcile_payment_entries.json b/erpnext/accounts/doctype/unreconcile_payment_entries/unreconcile_payment_entries.json index 955c3bbe03..42da669e65 100644 --- a/erpnext/accounts/doctype/unreconcile_payment_entries/unreconcile_payment_entries.json +++ b/erpnext/accounts/doctype/unreconcile_payment_entries/unreconcile_payment_entries.json @@ -12,6 +12,7 @@ "reference_doctype", "reference_name", "allocated_amount", + "account_currency", "unlinked" ], "fields": [ @@ -24,9 +25,10 @@ }, { "fieldname": "allocated_amount", - "fieldtype": "Int", + "fieldtype": "Currency", "in_list_view": 1, - "label": "Allocated Amount" + "label": "Allocated Amount", + "options": "account_currency" }, { "default": "0", @@ -57,12 +59,19 @@ "fieldname": "party", "fieldtype": "Data", "label": "Party" + }, + { + "fieldname": "account_currency", + "fieldtype": "Link", + "label": "Account Currency", + "options": "Currency", + "read_only": 1 } ], "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-08-30 10:58:45.322668", + "modified": "2023-09-05 09:33:28.620149", "modified_by": "Administrator", "module": "Accounts", "name": "Unreconcile Payment Entries", diff --git a/erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.py b/erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.py index 5161a92823..25f85db71f 100644 --- a/erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.py +++ b/erpnext/accounts/doctype/unreconcile_payments/unreconcile_payments.py @@ -30,6 +30,7 @@ class UnreconcilePayments(Document): ple.against_voucher_type.as_("reference_doctype"), ple.against_voucher_no.as_("reference_name"), Abs(Sum(ple.amount_in_account_currency)).as_("allocated_amount"), + ple.account_currency, ) .where( (ple.docstatus == 1) @@ -99,6 +100,7 @@ def get_linked_payments_for_doc( ple.voucher_type, ple.voucher_no, Abs(Sum(ple.amount_in_account_currency)).as_("allocated_amount"), + ple.account_currency, ) .where(Criterion.all(criteria)) .groupby(ple.voucher_no, ple.against_voucher_no) diff --git a/erpnext/public/js/utils/unreconcile.js b/erpnext/public/js/utils/unreconcile.js index df07643bb7..cd44f3578b 100644 --- a/erpnext/public/js/utils/unreconcile.js +++ b/erpnext/public/js/utils/unreconcile.js @@ -53,7 +53,8 @@ erpnext.accounts.unreconcile_payments = { let child_table_fields = [ { label: __("Voucher Type"), fieldname: "voucher_type", fieldtype: "Dynamic Link", options: "DocType", in_list_view: 1, read_only: 1}, { label: __("Voucher No"), fieldname: "voucher_no", fieldtype: "Link", options: "voucher_type", in_list_view: 1, read_only: 1 }, - { label: __("Allocated Amount"), fieldname: "allocated_amount", fieldtype: "Float", in_list_view: 1, read_only: 1 }, + { label: __("Allocated Amount"), fieldname: "allocated_amount", fieldtype: "Currency", in_list_view: 1, read_only: 1 , options: "account_currency"}, + { label: __("Currency"), fieldname: "account_currency", fieldtype: "Currency", read_only: 1}, ] let unreconcile_dialog_fields = [ { @@ -83,7 +84,7 @@ erpnext.accounts.unreconcile_payments = { title: 'Un-Reconcile Allocations', fields: unreconcile_dialog_fields, size: 'large', - cannot_add_rows: 1, + cannot_add_rows: true, primary_action_label: 'Un-Reconcile', primary_action(values) {