feat: calculate hours (#33464)
* feat: calculate hours * chore: Linting Issues Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
This commit is contained in:
parent
010718ffed
commit
d054f37602
@ -25,12 +25,18 @@ class Timesheet(Document):
|
||||
def validate(self):
|
||||
self.set_status()
|
||||
self.validate_dates()
|
||||
self.calculate_hours()
|
||||
self.validate_time_logs()
|
||||
self.update_cost()
|
||||
self.calculate_total_amounts()
|
||||
self.calculate_percentage_billed()
|
||||
self.set_dates()
|
||||
|
||||
def calculate_hours(self):
|
||||
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)
|
||||
|
||||
def calculate_total_amounts(self):
|
||||
self.total_hours = 0.0
|
||||
self.total_billable_hours = 0.0
|
||||
|
Loading…
Reference in New Issue
Block a user