Skip to content

Commit

Permalink
Simplify calculate_payments code
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuoris committed Aug 21, 2017
1 parent 6c1698f commit 1eb261f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions openprocurement/tender/esco/npv_calculation.py
Expand Up @@ -80,16 +80,19 @@ def calculate_payments(
days_for_discount_rate):
'''Calculates client payments to a participant'''

lists = zip(
client_cost_reductions,
days_with_payments,
days_for_discount_rate,
)
payments = []

for i, _ in enumerate(client_cost_reductions):
payments.append(
calculate_payment(
yearly_payments_percentage,
client_cost_reductions[i],
days_with_payments[i],
days_for_discount_rate[i],
)
)

return [
calculate_payment(yearly_payments_percentage, *arg)
for arg in lists
]
return payments


def calculate_discounted_income(coef_discount, income_customer):
Expand Down

0 comments on commit 1eb261f

Please sign in to comment.