def get_total_cost(self):
total_cost = Decimal()
for entry in self.entries.iterator():
try:
if entry.task.hourly_rate:
total_cost += (
duration_decimal(entry.duration)
* entry.task.hourly_rate
)
except: # noqa: E722
continue
return total_cost.quantize(Decimal('.01'), rounding=ROUND_DOWN)
评论列表
文章目录