fix: timesheet report not showing total amount correctly
This commit is contained in:
@@ -74,24 +74,17 @@ def get_data(filters):
|
||||
if time_start <= from_date and time_end >= from_date:
|
||||
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
|
||||
time_end, from_date, total_hours, total_billable_hours, total_amount)
|
||||
|
||||
billable_hours_worked += total_billable_hours
|
||||
hours_worked += total_hours
|
||||
working_cost += total_amount
|
||||
elif time_start >= from_date and time_end >= to_date:
|
||||
elif time_start <= to_date and time_end >= to_date:
|
||||
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
|
||||
to_date, time_start, total_hours, total_billable_hours, total_amount)
|
||||
|
||||
billable_hours_worked += total_billable_hours
|
||||
hours_worked += total_hours
|
||||
working_cost += total_amount
|
||||
elif time_start >= from_date and time_end <= to_date:
|
||||
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
|
||||
time_end, time_start, total_hours, total_billable_hours, total_amount)
|
||||
|
||||
billable_hours_worked += total_billable_hours
|
||||
hours_worked += total_hours
|
||||
working_cost += total_amount
|
||||
|
||||
hours_worked += total_hours
|
||||
billable_hours_worked += total_billable_hours
|
||||
working_cost += total_amount
|
||||
|
||||
row = {
|
||||
"employee": entries.employee,
|
||||
@@ -101,7 +94,6 @@ def get_data(filters):
|
||||
"total_hours": total_hours,
|
||||
"amount": total_amount
|
||||
}
|
||||
|
||||
if entries_exists:
|
||||
data.append(row)
|
||||
entries_exists = False
|
||||
|
||||
Reference in New Issue
Block a user