Prevent using same sequence on earlier customer invoice: which date to use?

Knowing is better than believing (ddg helps in that case).
Even if it is in the same month, an invoice with an earlier date than current (or last posted invoice) is not possible in Tryton (this is what the thread is about).
So you cant fulfil german (and spanish) accounting requirements as it is now.

Thanks @yangoon for your time.

Indeed the constraint is not the problem but the consistency criteria (which date to use).
As there is no agreement probably by enabling a way to customize it would be enough …

I still do not believe it.

This is perfectly supported by Tryton. As anyone actually using Tryton knows about.

But we still do not have clear statement for Spanish accounting about your claimed requirement, nor counter argument about the consistency issue with your proposed workflow.

OK, quick test in the demo DB, post an invoice with invoice and accounting date for today, then try to post an invoice for the first of Jan:


That fails is a not really helpful error message.
If you post a predated invoice with invoice date and accounting date for 31 january you won’t be able to post any other invoice before this date. As well if you post an invoice for today with those dates, you won’t be able to post any earlier invoice with this sequence.

Consequence: Your statement is plain wrong. With this setup, Tryton cant cope with real world requirements, as ‘anyone actually using Tryton knows about’

In Spanish case the accounting date would be 1 January and invoice date 31 January (or later until 16 February).

I’m wondering what would be an helpful error message for you?

Wrong Tryton works correctly.
Nobody has shown any proof that people can number invoices without following a sequence.

And this works correctly with Tryton.

You can also post an invoice with the invoice date on 31 December as it will be a different sequence.

No it doesn’t as we have posted invoices with accounting date greater than 1 January.

Retrieving the origin of this thread … the accounting date of invoice taxes must be the moment the goods are delivered (this is called “momento del devengo” o “devengo del impuesto”). But invoice can be issued until 15th of next month.
This is described in section " Cómo se devenga el IVA según el artículo 75 de LIVA" of this article.

So if we limit the invoice sequence by accounting date, users cannot post an invoice with invoice_date 10Feb (assume this is today) and accounting_date 20Jan because they have post another invoices with accounting date greater than 20Jan.

I understand the usual thing in B2C is invoice_date=accounting_date but in certain B2B sectors this is not the case.

OK so I think we could relax the constraint by searching for prior invoice sequence usage based only on the invoice date and using the invoice date of the numbered invoice. But we must still use the accounting date to get and generate the number.

Such change could not be back-ported but for me business having such constraint should use a sequence per period and use the last day of the period as accounting date. The exact date is not really important for tax report as long as it is on the right period.

Why? Sales invoice is first of all related to the sales process. Then this is posted into accounting is a different story

I filled Issue 11139: Check invoice sequence against invoice date - Tryton issue tracker

1 Like

As already explained earlier in this thread the proposed solution is not enough for Germany. While there are very detailed requirements for the dates on invoices (invoice date, date of supply and service) there is no combined constraint on date and numbers for the invoice number.

Just some more additional links

https://rechnungen-muster.de/rechnungsnummern

Instead of guessing and believing I would prefer a solution in Tryton based on evidence.

All your links state the opposite of your statement. They all say that the invoice numbering must be consecutive. And for me it is clear that consecutive means consecutive in time otherwise it means nothing. And time is recorded by the accounting date.

Even if this were true (which I do not understand from your links), it does not prevent to use Tryton at all.

The links state that basing on German law an invoice sequence must provide unique numbers. And being consecutive is the primary property of a sequence otherwise is is a random series. That doesn’t mean at all that a sequence must be coupled to a date or something else.

I think there is enough evidence that it is true. Of course the current constraint does not prevent to use Tryton at all. We are talking about “Prevent using same sequence on earlier customer invoice” which is allowed in Germany.

Indeed in Spanish documentation “time” for customer invoices is issued time; and it is recorded by invoice date.

It means that otherwise if you can not order invoices, you can not have consecutive property.

And which is allowed in Tryton but enforcing consecutive property.

Well it is a little bit more complex because it is a combination of invoice and accounting date and the period of the sequence.

While I agree with @yangoon that there is no combined constraint on date and numbers of the invoice number I consider the issuing of invoices with a date in the past as bad practice. Especially since the date of delivery/service needs to be part of the invoice. Even if the business transaction to which an invoice relates is in the past the invoice date should be not older than today. I think the proposed changes will allow Tryton to be used in Germany for issuing invoices without any problems.

For the record, this is the only place where the requirements for an invoice number in germany are written down in german law (Section 14.5 Paragraph 10):

There are no requirements other than those described there.

In The Netherlands the same applies as for Germany. Just a sequence of consecutive numbers. It is possible to have multiple sequences but there should be a good reason for that.

I totally agree that invoice date in customer invoices should be preferably today and date in past should be avoided. This is not applicable to accounting date which should be the date when the goods are delivered or services are provided.
So for this reason I don’t see why invoice number must use accounting date to create consecutive numbering in time. Because imho it is not achieved in the moment I post invoices with accounting date in the past.

Finally we have official answer about what date to use in customer invoice numbering (note that first two pages were removed because they contained sensitive information).

As I said along thread, in Spain the date to use for getting a consecutive numbering in customer invoices is “invoice date”.

1 Like

una recomendacion borra el csv del documento porque se puede acceder a los datos privados.
un saludo