# Manual payment term on invoice

**URL:** https://discuss.tryton.org/t/manual-payment-term-on-invoice/2391
**Category:** Feature
**Tags:** accounting
**Created:** [February 29, 2020, 2:09pm UTC](https://discuss.tryton.org/t/manual-payment-term-on-invoice/2391 "2020-02-29T14:09:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [February 29, 2020, 2:09pm UTC](https://discuss.tryton.org/t/manual-payment-term-on-invoice/2391/1 "2020-02-29T14:09:13Z")

</div>

## Rational

The payment terms are great and quite flexible to automate the computation of the due amount and date. But sometimes we could want to use a particular set of dates and amount but it is so custom that you do not want to create a payment term for it. For example, the customer has negotiated a particular term for one invoice; or the supplier has terms that are not as straight as the Tryton’s payment term; or one time supplier has very special terms for which we do not want to create payment term.  
So I think it will be good to let the user fill the term result manually. It is the logical continuation of the [optional payment term change](https://bugs.tryton.org/issue4286).

## Proposal

We add a `payment_date` field which hide the `payment_term` if filled (and vice versa). The date must be greater or equal to the invoice date. When filled, it is used as `maturity_date` for the term line.  
We add on a tab a `One2Many` of `payment_term_lines` which is visible only if both `payment_term` and `payment_date` are empty (and hide the other if filled). The line stores a date and an amount (with the default value equals to the invoice amount minus amount of other lines). The sum of the lines’ amount must be equal to the invoice amount. If filled, those dates and amount are used as term lines.  
All the fields are read-only once the invoice is validated.  
When the invoice is credited, those fields are emptied.

## Implementation
