# Customizable defaults on payment terms

**URL:** https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656
**Category:** Feature
**Tags:** accounting
**Created:** [August 16, 2018, 11:51am UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656 "2018-08-16T11:51:41Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [August 16, 2018, 11:51am UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/1 "2018-08-16T11:51:41Z")

</div>

## Rational

Currently tryton allows users to define the default payment term for invoices (or purchases or sales) at the party form.

That default value used to be a couple of fields of type Property but in latest versions that was converted to MultiValue fields.

The information of the party’s customer\_payment\_term and supplier\_payment\_term fields is stored in account.invoice.payment\_term and the model has the fields:

- party
- company
- customer\_payment\_term
- supplier\_payment term

The thing is that we’d like to be able to customize the way the payment term is choosen based on some other criteria (a “type” field on invoices, for example -could also be the journal), but which would only apply to customer invoices.

## Proposal

The idea would be to change account.invoice.payment\_term so that it only has the following fields:

- party
- company
- kind
- payment\_term

Kind could be a selection with the following options:

- Empty (affects both customer and supplier invoices)
- Customer Invoice
- Customer Credit Note
- Supplier Invoice
- Supplier Credit Note

To clarify, in our experience usually the company wants Customer Credit Notes to have a different payment term than the invoice.

This design would allow us to add a new field (invoice\_type, or journal) to be applied to lines of kind “Customer Invoice” and thus provide defaults in other circumstances.

Opinions?

---

<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: [August 16, 2018, 2:34pm UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/2 "2018-08-16T14:34:25Z")

</div>

I think it is a complex design for very few benefit.  
I think the major problem is to set a payment term for the credit note. It seems logical to consider that they are due directly by default. And as credit note are created manually, it is still possible to select a payment term for it.  
Also recently we allowed to [edit the maturity date](https://bugs.tryton.org/issue7276) because often for supplier document we can not compute the same result.

---

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [August 16, 2018, 3:25pm UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/3 "2018-08-16T15:25:12Z")

</div>

To be honest, our idea is to extend the model with information regarding payment type and bank account to be used too.

This way we have a good mechanism to define each type of invoice which values to use for those three fields.

But we can also manage with another field if using it in core provide no benefit.

The discussion regarding payment type should probably be part of another thread…

---

<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: [August 16, 2018, 3:29pm UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/4 "2018-08-16T15:29:53Z")

</div>

> [@albert](#):
>
> To be honest, our idea is to extend the model with information regarding payment type and bank account to be used too.

I do not see the link between those fields. But to be honest, I never understood the need of payment type nor bank on an invoice. Customer are free to pay by the mean they want.

---

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [August 16, 2018, 4:12pm UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/5 "2018-08-16T16:12:51Z")

</div>

> [@ced](#):
>
> Also recently we allowed to [edit the maturity date](https://bugs.tryton.org/issue7276) because often for supplier document we can not compute the same result.

By the way, we also created the [account\_Invoice\_maturity\_dates](https://bitbucket.org/trytonspain/trytond-account_invoice_maturity_dates/src/default/) module which allows the user to change the maturity dates of an invoices using a wizard from within the invoice, which proved very handy for many users. Specially the possibility (configurable) of showing the wizard when the “Post” button is clicked.

---

<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: [August 16, 2018, 4:18pm UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/6 "2018-08-16T16:18:32Z")

</div>

It does not need a wizard for that. A `One2Many` on the lines to pay with the amount and the maturity date should be enough.

---

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [August 16, 2018, 4:20pm UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/7 "2018-08-16T16:20:19Z")

</div>

Reviewing the places where payment term can be introduced I find it a bit inconsistent that the user can change the payment term on a per Sale (or Sale Subscription or Purchase) basis but cannot change it at the Project, as the module project\_invoice relies on the default payment term of the customer.

Would be adding payment\_term to project\_invoice be an acceptable patch?

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [August 17, 2018, 5:22pm UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/8 "2018-08-17T17:22:55Z")

</div>

> [@ced](#):
>
> > To be honest, our idea is to extend the model with information regarding payment type and bank account to be used too.
> 
> I do not see the link between those fields. But to be honest, I never understood the need of payment type nor bank on an invoice. Customer are free to pay by the mean they want.

I agree that customer is free to pay by the mean they want but it’s also common to reach an agreement with the customer on how they will pay your invoices. The main benefit about payment types is to have more specific information about if you have to process the payment or the customer will process it. Let me explain:

- When the agreement is to pay by Wire Transfer, the customer is the one which will initiate the payment.
- When the payment is by SEPA or Stripe, you have to process the lines to pay and generate upload the XML file to the bank.

This is similar to the [supplier has direct debit feature](https://bugs.tryton.org/issue6173) but also for customer payments.

Although it is possible to distinguish which customers you have mandate (an thus you have to process it’s payments) we may want to support the following case:

- Recurring payments are due with a SEPA XML
- Other invoices of same customer are paid by wire transfer

So in order to manage this case you have to agree on invoice level which payment type you should use and it will be good to indicate that it requires a mandate.

Probably the payment method will have a very close relation with the [new payment method](https://codereview.tryton.org/45561002/diff/140001/invoice.py#newcode2405). Or maybe both objects represent the same concept.

Having said that I think that we should not include the bank account on the invoice also as most of the times the bank account will be a property of the Payment Type.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [August 17, 2018, 5:25pm UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/9 "2018-08-17T17:25:17Z")

</div>

> [@albert](#):
>
> Would be adding payment\_term to project\_invoice be an acceptable patch?

Then we should consider adding also the invoice address as currently the default one is also used.

---

<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: [August 17, 2018, 6:04pm UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/10 "2018-08-17T18:04:06Z")

</div>

> [@pokoli](#):
>
> Although it is possible to distinguish which customers you have mandate (an thus you have to process it’s payments) we may want to support the following case:
> 
> - Recurring payments are due with a SEPA XML
> - Other invoices of same customer are paid by wire transfer

I still do not see why the invoice should have any information about the way it will be paid.  
I do not see neither why a company will not do SEPA direct debit if it has the mandate.

> [@pokoli](#):
>
> This is similar to the [supplier has direct debit feature](https://bugs.tryton.org/issue6173) but also for customer payments.

I do not agree. This feature is similar to the SEPA mandate.

> [@pokoli](#):
>
> Probably the payment method will have a very close relation with the [new payment method](https://codereview.tryton.org/45561002/diff/140001/invoice.py#newcode2405). Or maybe both objects represent the same concept.

Not at all. The payment method is to record the existing not to request.

---

<div class="post-metadata">

### Author: ![josesalvador](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/josesalvador/32/602_2.png) [@josesalvador](https://discuss.tryton.org/u/josesalvador)
#### Post date: [March 26, 2019, 5:26pm UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/11 "2019-03-26T17:26:30Z")

</div>

> [@pokoli](#):
>
> I agree that customer is free to pay by the mean they want but it’s also common to reach an agreement with the customer on how they will pay your invoices.

Totally agree.

> [@ced](#):
>
> > Probably the payment method will have a very close relation with the [new payment method](https://codereview.tryton.org/45561002/diff/140001/invoice.py#newcode2405). Or maybe both objects represent the same concept.
> 
> Not at all. The payment method is to record the existing not to request.

I see the relationship too.

It’s a pity we can not reuse payment method as additional info at purchase, sale and invoices to represent the intention/agreement to accomplish payments.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [May 17, 2019, 8:28pm UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/12 "2019-05-17T20:28:08Z")

</div>

> [@ced](#):
>
> I still do not see why the invoice should have any information about the way it will be paid.

For example if you expect the customer to pay the invoice by wire-transfer it’s easier to include it on the invoice so it easier to find and the payment will be faster.

We are currently using the payment\_term description to indicate this information but it forces us to duplicate the same description in diferent payment terms which is complex to maintain.

---

<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: [May 18, 2019, 7:47am UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/13 "2019-05-18T07:47:52Z")

</div>

> [@pokoli](#):
>
> For example if you expect the customer to pay the invoice by wire-transfer it’s easier to include it on the invoice so it easier to find and the payment will be faster.

Why? You still check all your payment means frequently and fill statement for them.  
For me, this is a practice that has no rational today. It could have some back in the days where banking was not electronic and moving funds was very slow and complex. Today, it is no more the case.

---

<div class="post-metadata">

### Author: ![josesalvador](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/josesalvador/32/602_2.png) [@josesalvador](https://discuss.tryton.org/u/josesalvador)
#### Post date: [May 19, 2019, 12:41pm UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/14 "2019-05-19T12:41:44Z")

</div>

> [@ced](#):
>
> Why? You still check all your payment means frequently and fill statement for them.  
> For me, this is a practice that has no rational today. It could have some back in the days where banking was not electronic and moving funds was very slow and complex. Today, it is no more the case.

For me it’s all about info.

I would like to know if an invoice will be paid through SEPA, wire-transfer, “cheque/talón” (I’m not sure if those spanish words/concepts have an english translation… may be bank check??).

Surely, I don’t know any accountant in spain that does not want to have the payment type, moreover, there are payment types as “bank checks” that have additional information as a unique identifier number that accountants used to want to note it, too, same for wire-transfer, the customer expects to see the bank account number on do the payment to.

---

<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: [May 20, 2019, 7:53am UTC](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/15 "2019-05-20T07:53:35Z")

</div>

> [@josesalvador](#):
>
> I would like to know if an invoice will be paid through

This is not what it does. It is not because you request to be paid with one method that the customer will be using it. He is free to pay the company by any mean he wants.

> [@josesalvador](#):
>
> I don’t know any accountant in spain that does not want to have the payment type

Accountant does not care about that. It is the business management that care about cash flow and where the money is.  
Because as I said, the accountant needs any way to check all the payment means.

> [@josesalvador](#):
>
> that have additional information

You can put them on the invoice report without the need of any additional information.
