From d3be0e4ebb71962c422897237f0215a1a64cb383 Mon Sep 17 00:00:00 2001 From: AravindR97 Date: Fri, 13 Feb 2026 14:07:35 +0530 Subject: [PATCH] fix: Amount fields based on transaction currency --- .../payment_advice/doctype/payment_advice/payment_advice.js | 2 +- .../doctype/payment_advice/payment_advice.json | 5 ++++- .../payment_advice/doctype/payment_advice/payment_advice.py | 2 ++ .../payment_advice_reference/payment_advice_reference.json | 5 ++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/payment_advice/payment_advice/doctype/payment_advice/payment_advice.js b/payment_advice/payment_advice/doctype/payment_advice/payment_advice.js index 437ed1b..4e77618 100644 --- a/payment_advice/payment_advice/doctype/payment_advice/payment_advice.js +++ b/payment_advice/payment_advice/doctype/payment_advice/payment_advice.js @@ -413,7 +413,7 @@ function toggle_exchange_rate_field(frm) { function convert_amount(frm) { - if (!frm.doc.amount) return; + // if (!frm.doc.amount) return; let total = 0; if ( diff --git a/payment_advice/payment_advice/doctype/payment_advice/payment_advice.json b/payment_advice/payment_advice/doctype/payment_advice/payment_advice.json index 2865567..536363f 100644 --- a/payment_advice/payment_advice/doctype/payment_advice/payment_advice.json +++ b/payment_advice/payment_advice/doctype/payment_advice/payment_advice.json @@ -335,12 +335,14 @@ "fieldname": "amount_in_trans_cur", "fieldtype": "Currency", "label": "Total Amount", + "options": "transaction_currency", "read_only": 1 }, { "fieldname": "amount_paid_in_trans_curr", "fieldtype": "Currency", "label": "Total Amount Paid", + "options": "transaction_currency", "read_only": 1 }, { @@ -353,6 +355,7 @@ "fieldname": "amount_to_be_settled_trans_curr", "fieldtype": "Currency", "label": "Total Amount To be Settled", + "options": "transaction_currency", "read_only": 1 } ], @@ -364,7 +367,7 @@ "link_fieldname": "custom_payment_advice" } ], - "modified": "2026-02-12 18:23:42.737425", + "modified": "2026-02-13 12:24:52.258169", "modified_by": "Administrator", "module": "Payment Advice", "name": "Payment Advice", diff --git a/payment_advice/payment_advice/doctype/payment_advice/payment_advice.py b/payment_advice/payment_advice/doctype/payment_advice/payment_advice.py index 93659f9..07019e6 100644 --- a/payment_advice/payment_advice/doctype/payment_advice/payment_advice.py +++ b/payment_advice/payment_advice/doctype/payment_advice/payment_advice.py @@ -12,6 +12,8 @@ class PaymentAdvice(Document): def validate(self): if self.amount_to_be_settled: self.amount_to_be_settled_in_words = money_in_words(self.amount_to_be_settled) + if self.amount_to_be_settled_trans_curr: + self.amount_words_trans_curr = money_in_words(self.amount_to_be_settled_trans_curr, self.transaction_currency) if self.payment_amount: pending = self.amount_to_be_settled - self.payment_amount self.pending_amount = pending if pending > 0 else 0 diff --git a/payment_advice/payment_advice/doctype/payment_advice_reference/payment_advice_reference.json b/payment_advice/payment_advice/doctype/payment_advice_reference/payment_advice_reference.json index 2cf2aeb..c2ef5aa 100644 --- a/payment_advice/payment_advice/doctype/payment_advice_reference/payment_advice_reference.json +++ b/payment_advice/payment_advice/doctype/payment_advice_reference/payment_advice_reference.json @@ -107,18 +107,21 @@ "fieldname": "amount_in_currency", "fieldtype": "Currency", "label": "Total Amount in Currency", + "options": "currency", "read_only": 1 }, { "fieldname": "settled_amount_in_currency", "fieldtype": "Currency", "label": "Settled Amount in Currency", + "options": "currency", "read_only": 1 }, { "fieldname": "net_payable_amount_in_currency", "fieldtype": "Currency", "label": "Net Payable Amount in Currency", + "options": "currency", "read_only": 1 }, { @@ -143,7 +146,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2026-02-12 19:20:45.177581", + "modified": "2026-02-13 12:28:17.239483", "modified_by": "Administrator", "module": "Payment Advice", "name": "Payment Advice Reference",