Use invoice_unit_price to compute quantity to invoice
issue11833 review413861003
This commit is contained in:
+4
-4
@@ -39,7 +39,7 @@ class Effort:
|
||||
quantities = {}
|
||||
for work in works:
|
||||
if (work.progress == 1
|
||||
and work.list_price
|
||||
and work.invoice_unit_price
|
||||
and not work.invoice_line):
|
||||
if work.price_list_hour:
|
||||
quantity = work.effort_hours
|
||||
@@ -115,7 +115,7 @@ class Progress:
|
||||
for sub_works in grouped_slice(works):
|
||||
sub_works = list(sub_works)
|
||||
where = reduce_ids(
|
||||
table.id, [x.id for x in sub_works if x.list_price])
|
||||
table.id, [x.id for x in sub_works if x.invoice_unit_price])
|
||||
cursor.execute(*table.join(progress,
|
||||
condition=progress.work == table.id
|
||||
).select(table.id, Sum(progress.progress),
|
||||
@@ -127,7 +127,7 @@ class Progress:
|
||||
delta = (
|
||||
(work.progress or 0)
|
||||
- invoiced_progress.get(work.id, 0.0))
|
||||
if work.list_price and delta > 0:
|
||||
if work.invoice_unit_price and delta > 0:
|
||||
quantity = delta
|
||||
if work.price_list_hour:
|
||||
quantity *= work.effort_hours
|
||||
@@ -288,7 +288,7 @@ class Timesheet:
|
||||
quantities = {}
|
||||
for work in works:
|
||||
duration = durations[work.id]
|
||||
if work.list_price:
|
||||
if work.invoice_unit_price:
|
||||
hours = duration.total_seconds() / 60 / 60
|
||||
if work.unit_to_invoice:
|
||||
hours = work.unit_to_invoice.round(hours)
|
||||
|
||||
Reference in New Issue
Block a user