fix: total error arissing due to blank link field

This commit is contained in:
Anurag Mishra
2019-04-16 17:32:45 +05:30
parent 332b4171c0
commit d6757b7af6
3 changed files with 4 additions and 20 deletions

View File

@@ -54,9 +54,6 @@ def get_data(filters):
data = []
record = get_records(filters)
billable_hours_worked = 0
hours_worked = 0
working_cost = 0
for entries in record:
total_hours = 0
total_billable_hours = 0
@@ -81,11 +78,6 @@ def get_data(filters):
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
time_end, time_start, total_hours, total_billable_hours, total_amount)
hours_worked += total_hours
billable_hours_worked += total_billable_hours
working_cost += total_amount
row = {
"employee": entries.employee,
"employee_name": entries.employee_name,
@@ -97,14 +89,6 @@ def get_data(filters):
if entries_exists:
data.append(row)
entries_exists = False
total = {
"total_billable_hours": billable_hours_worked,
"total_hours": hours_worked,
"amount": working_cost
}
if billable_hours_worked !=0 or hours_worked !=0 or working_cost !=0:
data.append(total)
return data
def get_records(filters):

View File

@@ -1,5 +1,5 @@
{
"add_total_row": 0,
"add_total_row": 1,
"creation": "2019-03-08 15:08:19.929728",
"disable_prepared_report": 0,
"disabled": 0,
@@ -7,7 +7,7 @@
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
"modified": "2019-03-08 15:08:19.929728",
"modified": "2019-04-16 17:29:18.376932",
"modified_by": "Administrator",
"module": "Projects",
"name": "Employee Billing Summary",

View File

@@ -1,5 +1,5 @@
{
"add_total_row": 0,
"add_total_row": 1,
"creation": "2019-03-11 16:22:39.460524",
"disable_prepared_report": 0,
"disabled": 0,
@@ -7,7 +7,7 @@
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
"modified": "2019-03-11 16:22:39.460524",
"modified": "2019-04-16 17:28:32.749633",
"modified_by": "Administrator",
"module": "Projects",
"name": "Project Billing Summary",