From d62eb0f5c183563cfa26ee4d22e628211bf5a9c1 Mon Sep 17 00:00:00 2001 From: Poorvi-R-Bhat Date: Fri, 19 Jul 2024 14:46:24 +0530 Subject: [PATCH] fix: Billing hours is not updated in Time sheet#19026 (#42404) --- erpnext/projects/doctype/timesheet/timesheet.js | 1 + erpnext/projects/doctype/timesheet/timesheet.py | 1 + 2 files changed, 2 insertions(+) diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js index 9aba75b3ce9..ef4595c1733 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.js +++ b/erpnext/projects/doctype/timesheet/timesheet.js @@ -296,6 +296,7 @@ frappe.ui.form.on("Timesheet Detail", { hours: function (frm, cdt, cdn) { calculate_end_time(frm, cdt, cdn); + update_billing_hours(frm, cdt, cdn); calculate_billing_costing_amount(frm, cdt, cdn); calculate_time_and_amount(frm); }, diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index d2048593eb6..81870889d05 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -36,6 +36,7 @@ class Timesheet(Document): for row in self.time_logs: if row.to_time and row.from_time: row.hours = time_diff_in_hours(row.to_time, row.from_time) + self.update_billing_hours(row) def calculate_total_amounts(self): self.total_hours = 0.0