From d4eb0906d71eb40ea979cc861245d79bb41d09c2 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Fri, 15 Mar 2024 18:44:31 +0530 Subject: [PATCH 1/3] fix(build): use --check-files to validate cached files (cherry picked from commit 137efccada46a3828f23e1f4c24e60ec090c2782) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d6412915d0..afd45354e7 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "frontend" ], "scripts": { - "postinstall": "cd frontend && yarn install", + "postinstall": "cd frontend && yarn install --check-files", "dev": "cd frontend && yarn dev", "build": "cd frontend && yarn build" }, From 02161e418c466c8b0ac833a66bec071c333031e3 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 18 Mar 2024 15:30:45 +0530 Subject: [PATCH 2/3] fix: don't update exchange rate for all references only for Journals exchange rate can be updated (cherry picked from commit 8b1a1385c66e3d6ec08b388e27c3912378783e3a) --- hrms/overrides/employee_payment_entry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hrms/overrides/employee_payment_entry.py b/hrms/overrides/employee_payment_entry.py index 1722bb5df5..ec8ce5df86 100644 --- a/hrms/overrides/employee_payment_entry.py +++ b/hrms/overrides/employee_payment_entry.py @@ -44,7 +44,8 @@ def set_missing_ref_details( d.reference_doctype, d.reference_name, self.party_account_currency ) - if ref_exchange_rate: + # Only update exchange rate when the reference is Journal Entry + if ref_exchange_rate and d.reference_doctype == "Journal Entry": ref_details.update({"exchange_rate": ref_exchange_rate}) for field, value in ref_details.items(): From c9cf77f2cd4e717c40c2a4b5729fcdaf96ad62cb Mon Sep 17 00:00:00 2001 From: krantheman Date: Mon, 18 Mar 2024 18:12:00 +0530 Subject: [PATCH 3/3] fix: zero exchange rate (cherry picked from commit a51523cb2d998ce7ecf724b30419538b0970fdcf) --- hrms/hr/doctype/employee_advance/employee_advance.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hrms/hr/doctype/employee_advance/employee_advance.py b/hrms/hr/doctype/employee_advance/employee_advance.py index a69ab719f3..4401f70072 100644 --- a/hrms/hr/doctype/employee_advance/employee_advance.py +++ b/hrms/hr/doctype/employee_advance/employee_advance.py @@ -27,6 +27,7 @@ def onload(self): def validate(self): validate_active_employee(self.employee) + self.validate_exchange_rate() self.set_status() def on_cancel(self): @@ -43,6 +44,10 @@ def publish_update(self): employee_user = frappe.db.get_value("Employee", self.employee, "user_id", cache=True) hrms.refetch_resource("hrms:employee_advance_balance", employee_user) + def validate_exchange_rate(self): + if not self.exchange_rate: + frappe.throw(_("Exchange Rate cannot be zero.")) + def set_status(self, update=False): precision = self.precision("paid_amount") total_amount = flt(flt(self.claimed_amount) + flt(self.return_amount), precision)