Skip to content

Commit

Permalink
fix(Timesheet): warn user if billing hours > actual hours instead of …
Browse files Browse the repository at this point in the history
…resetting (#38239)

* revert: "fix(Timesheet): reset billing hours equal to hours if they exceed actual hours"

This reverts commit 0ec8034.

* fix: warn user if billing hours > actual hours

(cherry picked from commit ac91030)
  • Loading branch information
ruchamahabal authored and mergify[bot] committed Nov 21, 2023
1 parent ddf82cf commit 6d06d03
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion erpnext/projects/doctype/timesheet/timesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@ def calculate_percentage_billed(self):

def update_billing_hours(self, args):
if args.is_billable:
if flt(args.billing_hours) == 0.0 or flt(args.billing_hours) > flt(args.hours):
if flt(args.billing_hours) == 0.0:
args.billing_hours = args.hours
elif flt(args.billing_hours) > flt(args.hours):
frappe.msgprint(
_("Warning - Row {0}: Billing Hours are more than Actual Hours").format(args.idx),
indicator="orange",
alert=True,
)
else:
args.billing_hours = 0

Expand Down

0 comments on commit 6d06d03

Please sign in to comment.