# Payment terms based on shipment (or another) date

**URL:** https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566
**Category:** Ideas
**Created:** [December 16, 2020, 7:19pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566 "2020-12-16T19:19:23Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [December 16, 2020, 7:19pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/1 "2020-12-16T19:19:23Z")

</div>

Actually maturity dates on invoices are computed using payment term and based on invoice date. But we have customers who want to compute it based on shipment date. This is normally the case when the invoice is delayed a lot with respect shipment.  
I’ve been reviewing code and it will not be difficult to add a custom module to implement it, but imho it could be interesting to add on core.

Opinions?

---

<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: [December 17, 2020, 6:35am UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/2 "2020-12-17T06:35:36Z")

</div>

> [@sergyo](#):
>
> want to compute it based on shipment date

In case multiple shipments grouped in a invoice what is considered shipment date?

> [@sergyo](#):
>
> imho it could be interesting to add on core

So IIUC you are proposing to adding a select box to allow the user to choose the date used for computing the deltas. By default this checkbox will only have the invoice date but when the account\_inovice\_stock module is activated it will have an extra option to use the shipment date.

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [December 17, 2020, 8:37am UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/3 "2020-12-17T08:37:14Z")

</div>

> [@pokoli](#):
>
> In case multiple shipments grouped in a invoice what is considered shipment date?

Normally the maximum [1]. This matches with FechaOperacion of Spain SII.  
But could exists two options (max and min).

> [@pokoli](#):
>
> By default this checkbox will only have the invoice date but when the account\_inovice\_stock module is activated it will have an extra option to use the shipment date.

That is.

---

<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: [December 17, 2020, 9:43am UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/4 "2020-12-17T09:43:23Z")

</div>

I do not see the point. If you base the invoicing on the shipment than it means that you create the invoice at the time the shipment is done so the invoice date will be the same as the shipment date.

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [December 17, 2020, 12:38pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/5 "2020-12-17T12:38:57Z")

</div>

The process with supplier is the following:

- payment terms are negotiated 30d after receive items.
- the supplier sends items and customer receive it.
- the customer confirms to supplier the products received, the quantities and in some cases the prices to be invoiced.
- after that supplier post and send the invoice. Note that this action and the previous one can be delayed many days/weeks [1].
- the customer receive the invoice and post it defining in “invoice\_date” the date defined on supplier invoice.

[1] In Spain there is a legal limit of 1month.

---

<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: [December 17, 2020, 12:41pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/6 "2020-12-17T12:41:57Z")

</div>

So it is not related at all with the shipment but just the invoice date. Everything is there in Tryton to support this.

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [December 17, 2020, 1:13pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/7 "2020-12-17T13:13:48Z")

</div>

sorry but I don’t see how.

---

<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: [December 17, 2020, 1:40pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/8 "2020-12-17T13:40:10Z")

</div>

As you can confirm the reception of the invoice only when the customer confirm it. You just have to post the invoice at this confirmation. This way the invoice date correspond to the reception date.

---

<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: [December 17, 2020, 1:59pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/9 "2020-12-17T13:59:56Z")

</div>

But in some cases it could happen that the invoice date can not be set in the past if other invoices have been posted with a date after. So it may be useful to have an optional field `payment_term_date` which is used to compute the terms if filled instead of the invoice date. But we should probably have a warning in case this date creates a term in the past.

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [December 17, 2020, 2:23pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/10 "2020-12-17T14:23:44Z")

</div>

> [@ced](#):
>
> As you can confirm the reception of the invoice only when the customer confirm it. You just have to post the invoice at this confirmation. This way the invoice date correspond to the reception date.

The examples is about a supplier invoice. In this case we cannot define a invoice date different of the given by supplier.

> [@ced](#):
>
> So it may be useful to have an optional field `payment_term_date` which is used to compute the terms if filled instead of the invoice date.

Some kind of configuration in payment term will be interesting as described @pokoli to set “payment\_term\_date” when creating an invoice. In this way users can define terms “30d after invoice date” or “30d after shipment date” on parties.

---

<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: [December 17, 2020, 3:22pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/11 "2020-12-17T15:22:35Z")

</div>

> [@sergyo](#):
>
> The examples is about a supplier invoice.

It does not matter both cases work the same.

> [@sergyo](#):
>
> Some kind of configuration in payment term will be interesting as described @pokoli to set “payment\_term\_date” when creating an invoice. In this way users can define terms “30d after invoice date” or “30d after shipment date” on parties.

I do not agree because it makes no sense. The invoice can only rely on itself to compute the terms. “After shipment date” means nothing for an invoice.

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [December 17, 2020, 3:33pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/12 "2020-12-17T15:33:48Z")

</div>

> [@ced](#):
>
> I do not agree because it makes no sense. The invoice can only rely on itself to compute the terms. “After shipment date” means nothing for an invoice.

There should be a mechanism to propose users the “payment\_term\_date”. IMHO The feature is incomplete if the have to input date manually on each invoice of a Party with this kind of negotiated payment term.

---

<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: [December 17, 2020, 3:52pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/13 "2020-12-17T15:52:59Z")

</div>

> [@sergyo](#):
>
> There should be a mechanism to propose users the “payment\_term\_date”.

You can set the payment\_term\_date with the last effective\_date of the related shipments once posting the invoice if not set.

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [December 17, 2020, 4:09pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/14 "2020-12-17T16:09:07Z")

</div>

That’s clear … but how to determine when set date or not with last shipment effective\_date?

---

<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: [December 17, 2020, 5:13pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/15 "2020-12-17T17:13:30Z")

</div>

> [@sergyo](#):
>
> how to determine when set date or not with last shipment effective\_date

This is something you should tell us. How is this negotiated in your case? For each customer (independently of the payment term used) or depening on the payment term?

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [December 17, 2020, 5:41pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/16 "2020-12-17T17:41:55Z")

</div>

> [@pokoli](#):
>
> This is something you should tell us.

Indeed I did it a couple of times … 🤔

> [@pokoli](#):
>
> How is this negotiated in your case? For each customer (independently of the payment term used) or depening on the payment term?

It is depending on payment term. For this reason I mentioned examples such as “30d after invoice date” or “30d after shipment date” (theses are descriptive names for payment terms).

---

<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: [December 17, 2020, 6:50pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/17 "2020-12-17T18:50:36Z")

</div>

> [@sergyo](#):
>
> > [@pokoli](#):
> >
> > How is this negotiated in your case? For each customer (independently of the payment term used) or depening on the payment term?
> 
> It is depending on payment term. For this reason I mentioned examples such as “30d after invoice date” or “30d after shipment date” (theses are descriptive names for payment terms).

But what happens if a customer uses a shorter payment term for a specific sale? Which date should be used? The invoice or the shipment?

I mean if you agree to always use the shipment date no mather the payment term it should be something defined on the party but if you agree to use a diferent date depending on the term it should be defined on the payment term.

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [December 17, 2020, 7:14pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/18 "2020-12-17T19:14:43Z")

</div>

I think the most flexible option is define it on the payment term.

---

<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: [December 17, 2020, 8:28pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/19 "2020-12-17T20:28:13Z")

</div>

For me there is an issue in the division of responsibility. The payment term can not be responsible of the starting date of its computation because it does not have any link to other document. And more over invoices are not always related to any shipment.  
So for me it will be good to have in standard a `payment_term_date` on invoice which override the default starting date. This will also solve a common issue for supplier invoice which is that companies do not always now how the term is computed and so this will allow to just fill the term date (without any payment term).  
By default in standard the `payment_term_date` is empty but it is easily to customize the purchase or sale to fill it with whatever people want.  
But nothing more should be added in standard.

---

<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: [December 22, 2020, 4:53pm UTC](https://discuss.tryton.org/t/payment-terms-based-on-shipment-or-another-date/3566/20 "2020-12-22T16:53:40Z")

</div>

I’ve filled [Allow to define the date used to compute payment term date (#9956) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue9956) with an implementation of this feature.
