# Account\_es and cia

**URL:** https://discuss.tryton.org/t/account-es-and-cia/1560
**Category:** Ideas
**Tags:** accounting, purchasing, sales
**Created:** [July 13, 2019, 7:43am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560 "2019-07-13T07:43:49Z")
**Posts on this page:** 20
**Page:** 1

<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: [July 13, 2019, 7:43am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/1 "2019-07-13T07:43:49Z")

</div>

# Introduction

At Tryton Spain we would like to improve Tryton ERP system in order to get it working out of the box under the Spain laws.

To reach that there are some law requirements required that should be included into the foundation modules, by now they are into the foundation account\_es and many other third modules.

It will be very good that other friends of Tryton take a quick look, may be some many countries have the same constraints, and we can work together in order to evict “localization modules”.

So here I’m gonna to divide them into two sections, those which are legally required and those which will be desirable to have included.

# Legally required features

## Renumber account moves

Renumber account moves ordered by date and number: [Código de comercio](https://www.boe.es/buscar/act.php?id=BOE-A-1885-6627&p=20181229&tn=2)

An existing implementation: [https://bitbucket.org/trytonspain/trytond-account\_move\_renumber/src/default/](https://bitbucket.org/trytonspain/trytond-account_move_renumber/src/default/)

## ~~Ensure invoice date consecutive~~

~~Ensure that a new invoice has not previous date that the last one: [Ley del Iva](https://www.boe.es/buscar/act.php?id=BOE-A-1992-28740&p=20181229&tn=2)~~

~~An existing implementation: [https://bitbucket.org/trytonspain/trytond-account\_invoice\_consecutive/src/default/~~](https://bitbucket.org/trytonspain/trytond-account_invoice_consecutive/src/default/~~)

## Accountability reports

Balance Sheet and Revenue and Loss: [Modelos oficiales para las cuentas anuales](https://www.boe.es/boe/dias/2017/05/25/pdfs/BOE-A-2017-5775.pdf)

An existing implementation: [https://bitbucket.org/trytonspain/trytond-account\_financial\_statement\_es/src/default/](https://bitbucket.org/trytonspain/trytond-account_financial_statement_es/src/default/)

## SII

A must procedure for the companies to communicate the invoices to government: [SII (Suministro de Información Inmediata)](https://www.agenciatributaria.es/AEAT.internet/Inicio/La_Agencia_Tributaria/Campanas/Suministro_Inmediato_de_Informacion_en_el_IVA__SII_/INFORMACION/Normativa/Normativa.shtml)

An existing implementation: [https://bitbucket.org/trytonspain/trytond-aeat\_sii/src/default/](https://bitbucket.org/trytonspain/trytond-aeat_sii/src/default/)

# Desirable features

## Right pad accounts with zero digits

To pad account code with a defined number of digits.

An existing implementation: [https://bitbucket.org/trytonspain/trytond-account\_code\_digits/src/default/](https://bitbucket.org/trytonspain/trytond-account_code_digits/src/default/)

## Prevent invoice duplication

To prevent user to post twice the same invoice.

An existing implementation: [https://bitbucket.org/trytonspain/trytond-account\_invoice\_prevent\_duplicates/src/default/](https://bitbucket.org/trytonspain/trytond-account_invoice_prevent_duplicates/src/default/)

## Include line invoice discount option

To add the option to do discount line by line in an invoice.

An existing implementation: [https://bitbucket.org/trytonspain/trytond-account\_invoice\_discount/src/default/](https://bitbucket.org/trytonspain/trytond-account_invoice_discount/src/default/)

## Payment types

To reflect a prior agreement between parties on how invoices will be paid.

Related to this [topic](https://discuss.tryton.org/t/customizable-defaults-on-payment-terms/656/1).

Existing implementations:

- [https://bitbucket.org/trytonspain/trytond-account\_payment\_type/src/default/](https://bitbucket.org/trytonspain/trytond-account_payment_type/src/default/)
- [https://bitbucket.org/trytonspain/trytond-sale\_payment\_type/src/default/](https://bitbucket.org/trytonspain/trytond-sale_payment_type/src/default/)
- [https://bitbucket.org/trytonspain/trytond-purchase\_payment\_type/src/default/](https://bitbucket.org/trytonspain/trytond-purchase_payment_type/src/default/)

---

<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: [July 13, 2019, 8:43am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/2 "2019-07-13T08:43:20Z")

</div>

> [@josesalvador](#):
>
> Renumber account moves ordered by date and number: [Código de comercio](https://www.boe.es/buscar/act.php?id=BOE-A-1885-6627&p=20181229&tn=2)

Could you point to the exact description of this requirement. For me, it is a very strange requirement because the principle of immutability of posted accounting is very common and general.  
More over there is the post\_date and post\_number that have the constraint/design to follow each other order.

> [@josesalvador](#):
>
> Ensure that a new invoice has not previous date that the last one

There is already [Remove check\_invoice\_sequences (#5205) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue5205)

> [@josesalvador](#):
>
> Balance Sheet and Revenue and Loss

Why are the standard reports not good?

> [@josesalvador](#):
>
> A must procedure for the companies to communicate the invoices to government

Which one is missing? We have AEAT111, AEAT115, AEAT303, AEAT347 and AEAT349.

> [@josesalvador](#):
>
> To pad account code with a defined number of digits.

For me, it is really a feature to please people who can not adapt. It will not provide any functionality except introduce complex code and bugs.

> [@josesalvador](#):
>
> To prevent user to post twice the same invoice.

This is a feature that for me is not possible to implement right. It was discussed on [Add warning when an supplier with same reference already exists (#8244) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue8244)

> [@josesalvador](#):
>
> To add the option to do discount line by line in an invoice.

Discount display is a marketing thing so I think it is better to implement it on sale.  
We had an [old prototype](https://codereview.tryton.org/66001/) but it will be better to start from [Discount on Sale](https://discuss.tryton.org/t/discount-on-sale/472)

---

<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: [July 14, 2019, 7:17pm UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/3 "2019-07-14T19:17:10Z")

</div>

> [@ced](#):
>
> > Balance Sheet and Revenue and Loss
> 
> Why are the standard reports not good?

They’re quite good but do not have a “printable” (libreoffice) version as general ledger do and Registro Mercantil (state authority in charge of receive that documents) expects official documents as described in [Modelos oficiales para las cuentas anuales](https://www.boe.es/boe/dias/2017/05/25/pdfs/BOE-A-2017-5775.pdf).

> [@ced](#):
>
> > A must procedure for the companies to communicate the invoices to government
> 
> Which one is missing? We have AEAT111, AEAT115, AEAT303, AEAT347 and AEAT349.

The AEAT11X are to inform about amount retention (normally to party as an employee), the AEAT3XX are about to inform taxes (VAT). [SII (Suministro de Información Inmediata)](https://www.agenciatributaria.es/AEAT.internet/Inicio/La_Agencia_Tributaria/Campanas/Suministro_Inmediato_de_Informacion_en_el_IVA__SII_/INFORMACION/Normativa/Normativa.shtml) is about to inform invoices to government.

> [@ced](#):
>
> > To pad account code with a defined number of digits.
> 
> For me, it is really a feature to please people who can not adapt. It will not provide any functionality except introduce complex code and bugs.

Totally agree with you but here we’re close to impossible to fit Tryton without that “feature” ☹

> [@ced](#):
>
> > To add the option to do discount line by line in an invoice.
> 
> Discount display is a marketing thing so I think it is better to implement it on sale.  
> We had an [old prototype](https://codereview.tryton.org/66001/) but it will be better to start from [Discount on Sale](https://discuss.tryton.org/t/discount-on-sale/472)

😃

---

<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: [July 14, 2019, 9:52pm UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/4 "2019-07-14T21:52:13Z")

</div>

> [@josesalvador](#):
>
> They’re quite good but do not have a “printable” (libreoffice) version as general ledger do and Registro Mercantil (state authority in charge of receive that documents) expects official documents as described in [Modelos oficiales para las cuentas anuales](https://www.boe.es/boe/dias/2017/05/25/pdfs/BOE-A-2017-5775.pdf).

So it is just a matter to define a report in account\_es based on GL and Income statement.

> [@josesalvador](#):
>
> [SII (Suministro de Información Inmediata)](https://www.agenciatributaria.es/AEAT.internet/Inicio/La_Agencia_Tributaria/Campanas/Suministro_Inmediato_de_Informacion_en_el_IVA__SII_/INFORMACION/Normativa/Normativa.shtml) is about to inform invoices to government.

Not sure to understand what it is. Is it like `account_fr_chorus` which is to send invoice which has a government agency as customer?  
If yes, then you should create a blueprint and probably copy the design of `account_fr_chorus`.

---

<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: [July 15, 2019, 7:24am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/5 "2019-07-15T07:24:39Z")

</div>

> [@ced](#):
>
> Not sure to understand what it is. Is it like `account_fr_chorus` which is to send invoice which has a government agency as customer?

It is not the same. It is a requirement for companies with more than 6M€ of revenue that have to send all of them invoices (from all customers and suppliers) to the tax authorithy using a web service.

> [@ced](#):
>
> If yes, then you should create a blueprint and probably copy the design of `account_fr_chorus` .

Yes I think we can follow the same design.

---

<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: [July 15, 2019, 7:42am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/6 "2019-07-15T07:42:23Z")

</div>

> [@pokoli](#):
>
> > [@ced](#):
> >
> > Not sure to understand what it is. Is it like `account_fr_chorus` which is to send invoice which has a government agency as customer?
> 
> It is not the same. It is a requirement for companies with more than 6M€ of revenue that have to send all of them invoices (from all customers and suppliers) to the tax authorithy using a web service.

Indeed is for companies subscribed to [REDEME](https://www.agenciatributaria.es/AEAT.internet/Inicio/La_Agencia_Tributaria/Campanas/IVA/_INFORMACION/Informacion_General/Devolucion_mensual_del_Impuesto_sobre_el_Valor_Anadido/Devolucion_mensual_del_Impuesto_sobre_el_Valor_Anadido.shtml) (monthly VAT declaration).

---

<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: [July 15, 2019, 8:36am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/7 "2019-07-15T08:36:02Z")

</div>

> [@ced](#):
>
> > They’re quite good but do not have a “printable” (libreoffice) version as general ledger do and Registro Mercantil (state authority in charge of receive that documents) expects official documents as described in [Modelos oficiales para las cuentas anuales](https://www.boe.es/boe/dias/2017/05/25/pdfs/BOE-A-2017-5775.pdf).
> 
> So it is just a matter to define a report in account\_es based on GL and Income statement.

Yep. For Balance Sheet and Income Statement.

---

<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: [September 13, 2019, 2:48pm UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/8 "2019-09-13T14:48:25Z")

</div>

> [@josesalvador](#):
>
> ## Ensure invoice date consecutive
> 
> Ensure that a new invoice has not previous date that the last one: [Ley del Iva](https://www.boe.es/buscar/act.php?id=BOE-A-1992-28740&p=20181229&tn=2)
> 
> An existing implementation: [https://bitbucket.org/trytonspain/trytond-account\_invoice\_consecutive/src/default/](https://bitbucket.org/trytonspain/trytond-account_invoice_consecutive/src/default/)

There is a [work in progress](https://bugs.tryton.org/issue5205) for this by @ced. [Here the review.](https://codereview.tryton.org/267921002)

---

<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: [September 30, 2019, 7:51am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/9 "2019-09-30T07:51:52Z")

</div>

> [@josesalvador](#):
>
> ## Ensure invoice date consecutive
> 
> Ensure that a new invoice has not previous date that the last one: [Ley del Iva](https://www.boe.es/buscar/act.php?id=BOE-A-1992-28740&p=20181229&tn=2)
> 
> An existing implementation: [https://bitbucket.org/trytonspain/trytond-account\_invoice\_consecutive/src/default/](https://bitbucket.org/trytonspain/trytond-account_invoice_consecutive/src/default/)

Committed [here](https://hg.tryton.org/tryton-env/rev/e751c6a2cb3f).

---

<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: [October 10, 2019, 9:58am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/10 "2019-10-10T09:58:46Z")

</div>

> [@ced](#):
>
> > [@josesalvador](#):
> >
> > Renumber account moves ordered by date and number: [Código de comercio](https://www.boe.es/buscar/act.php?id=BOE-A-1885-6627&p=20181229&tn=2)
> 
> Could you point to the exact description of this requirement. For me, it is a very strange requirement because the principle of immutability of posted accounting is very common and general.  
> More over there is the post\_date and post\_number that have the constraint/design to follow each other order.

The exact description is on [Article 25](https://www.boe.es/buscar/act.php?id=BOE-A-1885-6627&p=20181229&tn=1#art25) but it is a bit ambiguos (as usual in Spanish regulatory writing) .  
In practice, the presentation of annual general ledger in the “Registro mercantil” is rejected if the account moves are not ordered chronologically and numbered consecutively.

---

<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: [October 10, 2019, 10:08am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/11 "2019-10-10T10:08:06Z")

</div>

But what is the definition of the date and the number?  
Having such constraint does not mean that you have to change the number. For me, it means you must follow the rule for every moves and not cheating by renumbering.

By the way for me, this sounds like the posting number and the posting date which respect this constraint. So nothing new.

---

<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: [October 16, 2019, 9:58pm UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/12 "2019-10-16T21:58:56Z")

</div>

Indeed:

- chronologically =\> posting date
- numbered consecutively =\> posting number

---

<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: [October 17, 2019, 7:32am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/13 "2019-10-17T07:32:14Z")

</div>

So there is no need to renumber the move as the posting date and posting number provides the chronological order and they are guarantee by the code to stay like that (requirements in many countries).

---

<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: [October 18, 2019, 9:04am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/14 "2019-10-18T09:04:51Z")

</div>

> [@sergyo](#):
>
> Indeed:
> 
> - chronologically =\> posting date
> - numbered consecutively =\> posting number

After talk with a finantial mate I was wrong. The requisite is:

- chronologically =\> **date**
- numbered consecutively =\> posting number ( **ascending, starting in 1** )

So if a post a move on 15th of January (posting date) with date 1st of January (date) the posting number should be “1” (considering there aren’t more moves on 1st of January).

---

<div class="post-metadata">

### Author: ![risto3](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@risto3](https://discuss.tryton.org/u/risto3)
#### Post date: [October 18, 2019, 9:10am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/15 "2019-10-18T09:10:54Z")

</div>

Is this number GL wide or per journal?

---

<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: [October 18, 2019, 9:31am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/16 "2019-10-18T09:31:22Z")

</div>

> [@risto3](#):
>
> Is this number GL wide or per journal?

It is per fiscal year.

---

<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: [October 18, 2019, 9:55am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/17 "2019-10-18T09:55:19Z")

</div>

Could you tell me how such constraints are managed manually? I can not see how an accountant can deal with such thing manually (neither with a computer).  
I really doubt that your “financial mate” understand correctly what are the different dates. Could you ask what is the definition of “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: [October 18, 2019, 11:34am UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/18 "2019-10-18T11:34:37Z")

</div>

> [@ced](#):
>
> Could you tell me how such constraints are managed manually? I can not see how an accountant can deal with such thing manually (neither with a computer).

It is not managed at the moment. It is managed while preparing the presentation of annual general ledger (when closing fiscal year).  
So for this reason we are taking always of “renumber” concept.  
Actually in Tryton it is manged with [https://bitbucket.org/trytonspain/trytond-account\_move\_renumber](https://bitbucket.org/trytonspain/trytond-account_move_renumber/src/default/)

> [@ced](#):
>
> I really doubt that your “financial mate” understand correctly what are the different dates. Could you ask what is the definition of “date”?

date: the date on which the accounting fact happens.  
posting\_date: the date on which the move is posted.

---

<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: [October 18, 2019, 12:37pm UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/19 "2019-10-18T12:37:10Z")

</div>

> [@sergyo](#):
>
> the presentation of annual general ledger

What is this? Please provide the definition. Could you point the precise paragraph talking about that in [BOE-A-1885-6627 Real Decreto de 22 de agosto de 1885 por el que se publica el Código de Comercio.](https://www.boe.es/buscar/act.php?id=BOE-A-1885-6627&p=20181229&tn=2)

> [@sergyo](#):
>
> date: the date on which the accounting fact happens.

For me, it is the tryton definition. What I want is the definition of the date implied in this numbering.

Also I can not find any (none Odoo) references about such practice.

---

<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: [October 18, 2019, 2:00pm UTC](https://discuss.tryton.org/t/account-es-and-cia/1560/20 "2019-10-18T14:00:41Z")

</div>

> [@ced](#):
>
> What is this? Please provide the definition. Could you point the precise paragraph talking about that in [BOE-A-1885-6627 Real Decreto de 22 de agosto de 1885 por el que se publica el Código de Comercio.](https://www.boe.es/buscar/act.php?id=BOE-A-1885-6627&p=20181229&tn=2)

[Title 3 section First](https://www.boe.es/buscar/act.php?id=BOE-A-1885-6627&p=20181229&tn=1#art25), articles from 25 to 33

> [@ced](#):
>
> For me, it is the tryton definition. What I want is the definition of the date implied in this numbering.

Date implied in this numbering: the date on which the accounting fact happens.

> [@ced](#):
>
> Also I can not find any (none Odoo) references about such practice.

You can try googling “\<erpname\> renumerar asientos”:

[Odoo reference](http://odoo.rgbconsulting.com/es/cierre-contable-en-odoo-reenumeracion-de-asientos/)

[SAGE 200cloud reference](http://soporte.sage.es/sage-200c-2/2017/11/como-renumerar-asientos-en-sage-200c/) (also exists on 50cloud and other products).

NAV references (complementary):

- [ref. 1](https://blog.aitana.es/2018/10/23/numero-de-asiento-periodo-nav)
- [ref. 2 (go to step 3)](https://blog.aitana.es/2016/12/21/cierre-del-ejercicio-microsoft-dynamics-nav/)

[Next page](https://discuss.tryton.org/t/account-es-and-cia/1560.md?page=2)
