Fix computation of invoice amount on effort

The amount must proportional to the effort hours of the work because the
invoice line could have been grouped.

issue4946
review19431002
This commit is contained in:
Cédric Krier committed 2015-09-04 12:05:18 +02:00
1 parent 66578ae3d8
commit db9620ab31
1 file changed
+2 -2
+2 -2
View File
@@ -153,9 +153,9 @@ class Work:
id2invoice_lines = dict((l.id, l) for l in invoice_lines)
amounts = {}
for work in works:
if work.invoice_line:
if work.invoice_line and work.effort_hours:
invoice_line = id2invoice_lines[work.invoice_line.id]
amounts[work.id] = invoice_line.amount
amounts[work.id] = work.effort_hours * invoice_line.list_price
else:
amounts[work.id] = Decimal(0)
return amounts