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 = {}
|
quantities = {}
|
||||||
for work in works:
|
for work in works:
|
||||||
if (work.progress == 1
|
if (work.progress == 1
|
||||||
and work.list_price
|
and work.invoice_unit_price
|
||||||
and not work.invoice_line):
|
and not work.invoice_line):
|
||||||
if work.price_list_hour:
|
if work.price_list_hour:
|
||||||
quantity = work.effort_hours
|
quantity = work.effort_hours
|
||||||
@@ -115,7 +115,7 @@ class Progress:
|
|||||||
for sub_works in grouped_slice(works):
|
for sub_works in grouped_slice(works):
|
||||||
sub_works = list(sub_works)
|
sub_works = list(sub_works)
|
||||||
where = reduce_ids(
|
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,
|
cursor.execute(*table.join(progress,
|
||||||
condition=progress.work == table.id
|
condition=progress.work == table.id
|
||||||
).select(table.id, Sum(progress.progress),
|
).select(table.id, Sum(progress.progress),
|
||||||
@@ -127,7 +127,7 @@ class Progress:
|
|||||||
delta = (
|
delta = (
|
||||||
(work.progress or 0)
|
(work.progress or 0)
|
||||||
- invoiced_progress.get(work.id, 0.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
|
quantity = delta
|
||||||
if work.price_list_hour:
|
if work.price_list_hour:
|
||||||
quantity *= work.effort_hours
|
quantity *= work.effort_hours
|
||||||
@@ -288,7 +288,7 @@ class Timesheet:
|
|||||||
quantities = {}
|
quantities = {}
|
||||||
for work in works:
|
for work in works:
|
||||||
duration = durations[work.id]
|
duration = durations[work.id]
|
||||||
if work.list_price:
|
if work.invoice_unit_price:
|
||||||
hours = duration.total_seconds() / 60 / 60
|
hours = duration.total_seconds() / 60 / 60
|
||||||
if work.unit_to_invoice:
|
if work.unit_to_invoice:
|
||||||
hours = work.unit_to_invoice.round(hours)
|
hours = work.unit_to_invoice.round(hours)
|
||||||
|
|||||||
Reference in New Issue
Block a user