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 (backport #38239) (#38241)

fix(Timesheet): warn user if billing hours > actual hours instead of 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)

Co-authored-by: Rucha Mahabal <[email protected]>
  • Loading branch information
mergify[bot] and ruchamahabal authored Nov 21, 2023
1 parent bb77546 commit 1f2f5d8
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 @@ -69,8 +69,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 1f2f5d8

Please sign in to comment.