This commit is contained in:
2026-02-16 15:46:43 +01:00
parent 3f54cbef6a
commit bb313d29bf
2 changed files with 8 additions and 5 deletions

View File

@@ -48,7 +48,7 @@ class PaymentTerm(DeactivableMixin, ModelSQL, ModelView):
'.msg_payment_term_missing_last_remainder',
payment_term=term.rec_name))
def compute(self, amount, currency, date, purchase_line = None):
def compute(self, amount, currency, date, line = None):
"""Calculate payment terms and return a list of tuples
with (date, amount) for each payment term line.
@@ -61,7 +61,7 @@ class PaymentTerm(DeactivableMixin, ModelSQL, ModelView):
remainder = amount
for line in self.lines:
value = line.get_value(remainder, amount, currency)
value_date = line.get_date(date, purchase_line)
value_date = line.get_date(date, line)
if value is None or not value_date:
continue
if ((remainder - value) * sign) < Decimal(0):