fix(Timesheet): reset billing hours equal to hours if they exceed actual hours (backport #38134) (#38153)

fix(Timesheet): reset billing hours equal to hours if they exceed actual hours (#38134)

(cherry picked from commit 20c6e9fca29d80016cefb83deee4e44ac9bc1d47)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
This commit is contained in:
mergify[bot] 2023-11-17 18:25:37 +05:30 committed by GitHub
parent 20e15ebd22
commit 5b7b431dc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,7 @@ class Timesheet(Document):
def update_billing_hours(self, args):
if args.is_billable:
if flt(args.billing_hours) == 0.0:
if flt(args.billing_hours) == 0.0 or flt(args.billing_hours) > flt(args.hours):
args.billing_hours = args.hours
else:
args.billing_hours = 0