From 50db128ff17f684e17f106c3bb78f2064e0ee855 Mon Sep 17 00:00:00 2001 From: Anurag Mishra Date: Thu, 11 Apr 2019 16:07:38 +0530 Subject: [PATCH] fix: timesheet report not showing total amount correctly --- erpnext/projects/report/billing_summary.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/erpnext/projects/report/billing_summary.py b/erpnext/projects/report/billing_summary.py index 80bf926a54c..4906ba9d997 100644 --- a/erpnext/projects/report/billing_summary.py +++ b/erpnext/projects/report/billing_summary.py @@ -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