fix: timesheet report not showing total amount correctly

This commit is contained in:
Anurag Mishra
2019-04-11 16:07:38 +05:30
parent 0f62b13dd8
commit 50db128ff1

View File

@@ -74,23 +74,16 @@ 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
billable_hours_worked += total_billable_hours
working_cost += total_amount
row = {
@@ -101,7 +94,6 @@ def get_data(filters):
"total_hours": total_hours,
"amount": total_amount
}
if entries_exists:
data.append(row)
entries_exists = False