Tryton - Issues

 

Issue7150

Title Simplify account_es definition
Priority feature Status resolved
Superseder Nosy List albertca, ced, pokoli, reviewbot, roundup-bot
Type feature request Components account_es
Assigned To pokoli Keywords review
Reviews 44841002, 45081002
View: 44841002, 45081002

Created on 2018-02-20.13:32:13 by pokoli, last changed by roundup-bot.

Messages
New changeset 79b5dc5ac416 by Sergi Almacellas Abellana in branch 'default':
Add translation release news
https://hg.tryton.org/www.tryton.org/rev/79b5dc5ac416
review45081002 updated at https://codereview.tryton.org/45081002/#ps60001
review45081002 updated at https://codereview.tryton.org/45081002/#ps40001
New review45081002 at https://codereview.tryton.org/45081002/#ps20001
New changeset 96b64381fedf by Sergi Almacellas Abellana in branch 'default':
Simplify account and tax definition
http://hg.tryton.org/modules/account_es/rev/96b64381fedf
msg40581 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-05-08.17:16:52
>> May we include it on the translation release?
> We can include it.

Ok, then I will include a note on the translation release news to explain that the spanish chart of accounts 4.8 is also available.
msg40577 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-05-08.17:10:06
On 2018-05-08 16:59, Sergi Almacellas Abellana wrote:
> @ced do we have a schedule for the release of the 4.8 series?

There is no schedule as we were waiting the rework.

> May we include it on the translation release?

We can include it.
msg40575 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-05-08.16:59:14
@ced do we have a schedule for the release of the 4.8 series? May we include it on the translation release?
review44841002 updated at https://codereview.tryton.org/44841002/#ps120001
msg40545 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-05-07.17:51:41
I uploaded the fix on latest review version
msg40540 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-05-07.16:35:52
Fix it here as types have already been reworked.
msg40539 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-05-07.16:15:43
> Where are we now? Is the cleaning finished?

All models have been reviewed, so I think all the cleaning is finished. 

I just found that there is a display_balance of one account_type which is wrong. Should I open a new issue? or should I fix it here?
msg40538 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-05-07.15:44:08
Where are we now? Is the cleaning finished?
review44841002 updated at https://codereview.tryton.org/44841002/#ps100001
review44841002 updated at https://codereview.tryton.org/44841002/#ps90001
review44841002 updated at https://codereview.tryton.org/44841002/#ps80001
review44841002 updated at https://codereview.tryton.org/44841002/#ps70001
review44841002 updated at https://codereview.tryton.org/44841002/#ps60001
msg40189 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-04-17.16:02:25
> I guess you checked to have only account defined in the document and idem for the account type?

I checked only accounts but I will check for the correct definition of account type to ensure everything is correct.
msg40183 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-04-17.12:20:41
Otherwise, I find it already much more cleaner and simpler. Good job.
msg40182 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-04-17.12:20:00
I think it will be good to put the link of https://www.boe.es/boe/dias/2007/11/20/pdfs/C00001-00152.pdf in the documentation of the module.
I guess you checked to have only account defined in the document and idem for the account type?
I pointed some mistakes in the patch, so it may be good to make a full review.
review44841002 updated at https://codereview.tryton.org/44841002/#ps50001
msg39952 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-04-13.12:27:45
By the way, I maintain a repo synced with the review on https://bitbucket.org/pokoli/account_es if somebody want's to download the patch and test.
msg39951 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-04-13.12:15:54
I've checked the defintion with https://www.boe.es/boe/dias/2007/11/20/pdfs/C00001-00152.pdf and  the view account is not defined on the oficial documentation. 

So I removed them and I checked that all accounts are correctly defined resulting in some account's name change.  

All this work is uploaded on the latests version of the review.
msg39947 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-04-12.12:31:59
I do not see the simplification of account level where most of accounts are under a view account with only one children.
review44841002 updated at https://codereview.tryton.org/44841002/#ps40001
review44841002 updated at https://codereview.tryton.org/44841002/#ps30001
review44841002 updated at https://codereview.tryton.org/44841002/#ps20001
msg39547 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-03-29.17:55:13
Here is review44841002 which is ready to be tested. I followed your advice and started the tax.xml from scratch. Tax codes follow the oficial models definition (303 for IVA and 111 and 115 for IRPF). The account.xml is very similar, except that I removed some accounts related to no more existing taxes. 

I'm waiting some replies on the spanish mailing list to see if we can remove more accounts [1]. We have one account per tax (I suspect this is for legacy reasons) which seems useless to me. Only an account for all similar taxes (one per IVA, one per IRPF, etc.) is required. 

I will send a post to the spanish mailing list requesting for feedback. 

[1] https://groups.google.com/forum/#!topic/tryton-es/vbaZVEh39h8
New review44841002 at https://codereview.tryton.org/44841002/#ps1
msg39524 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-03-29.09:56:49
Here is a link about the result of the discussion: 

https://groups.google.com/d/msg/tryton/qZIRTarG14w/pvNhW5Z1BAAJ 

I'm start to work on it.
msg39121 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-20.15:28:26
Sorry but the documentation added still does not give any clear picture of the design.
I do not need to have a listing of the record, I can read the XML file.
I need to know how it was designed, which choices were made, what was skipped (and what is the plan to support it in the future), what is working or not working, etc.
How the tax are linked to tax code? Why there are such much tax codes? How to use them?
review41101002 updated at https://codereview.tryton.org/41101002/#ps120001
msg39116 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-03-20.13:57:51
I can understand your feeling. 

I've updated the review including the requested explanation on doc folder
msg39105 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-20.11:15:43
My problem is that I do not understand how the module works. For example, I had no idea there was fake taxes to "simulate" cash basis report.
Now that I read there was such things, I have lost trust and I doubt about the all design.
So what will help is to have a clear picture (like a presentation) on how it is designed (it may be included in the doc/):

- type of taxes
- tax codes charts: how they work and what are their purpose. (any other countries have so much of them)
- tax rules: how they work with the taxes (any other countries has neither so much of them)

So there are no clear requirements to be included. It is a matter of quality and stability. I can judge it for most of the modules because I understand the business requirement. But for a country accounting, I do not have the knowledge so it is purely based on the feeling and experience.
review41101002 updated at https://codereview.tryton.org/41101002/#ps100001
msg39103 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-03-20.10:34:29
> I find the module is not in a good shape. I start to think that I should not have accepted to include as-is as standard module.
> I'm wondering if we should not move it in the sandbox and stop publish it until it become stable and correct.

You have the decision here but I will prefer to be positive and work on the module to make stable and correct. I think we are on the right way so let's keep pushing on this direction. If you list the requirements to include as standard module I will be happy to work on it.
msg39101 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-20.00:16:55
I find the module is not in a good shape. I start to think that I should not have accepted to include as-is as standard module.
I'm wondering if we should not move it in the sandbox and stop publish it until it become stable and correct.
review41101002 updated at https://codereview.tryton.org/41101002/#ps80001
msg39081 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-03-19.13:14:08
> I checked the chart of account and I found other things that are stranges:
> 
> - There are very specific rules like "Operaciones exentas sin derecho de deducción (arrendamiento terrenos rústicos)". I do not think they should be in the standard module.
> - The rules for intracom. defines a rule line for each taxes. This should be based on tax group.
> - The rules for intracom. is defined as "Both". It can not be right. The purchase in intracom. is too complex and depend on the supplier. He may or not apply the tax of his country or of Spain.
> - Idem for extracom. It should be split and probably for purchase it can not be written correctly because it is too much complex.

Ok. I will update the review taking in account your comments. 

> - Is "Compras bienes de inversión" so common?

Yes, the tax autority requests to separate investment goods (bienes de inversion) purchases when reporting the tax. 

> - Those do not seem to be generic "Régimen especial agricultura ganadería y pesca", "Operaciones exentas sin derecho de deducción (servicios asistentciales)".

I will remove them also. 

> 
> So for me, account_es must still be simplified.
msg38758 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-02.14:09:40
I checked the chart of account and I found other things that are stranges:

- There are very specific rules like "Operaciones exentas sin derecho de deducción (arrendamiento terrenos rústicos)". I do not think they should be in the standard module.
- The rules for intracom. defines a rule line for each taxes. This should be based on tax group.
- The rules for intracom. is defined as "Both". It can not be right. The purchase in intracom. is too complex and depend on the supplier. He may or not apply the tax of his country or of Spain.
- Idem for extracom. It should be split and probably for purchase it can not be written correctly because it is too much complex.
- Is "Compras bienes de inversión" so common?
- Those do not seem to be generic "Régimen especial agricultura ganadería y pesca", "Operaciones exentas sin derecho de deducción (servicios asistentciales)".

So for me, account_es must still be simplified.
review41101002 updated at https://codereview.tryton.org/41101002/#ps40001
msg38633 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-27.16:42:50
With the current implementation we use the tax code to report to the tax authorities, so I removed some more taxes that use the same tax code as other similar taxes because they do not provide any valuable information. 

For me this is all the cleaning that we can do. 

I will like to make the account_es generate all the required information and be able to generate the files required by the spanish tax authorities but for me this is out of the scope of the current issue.
review41101002 updated at https://codereview.tryton.org/41101002/#ps20001
msg38626 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-27.01:30:02
About the feasibility of all tax reports using tax code, it should take in consideration issue6013 for complex cases.
msg38624 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-27.00:30:09
On 2018-02-26 23:30, Albert Cervera i Areny wrote:
> The thing is that there are lots of reports, not only 303. There's
> 340, 347, 349... And each of them requires different or slightly
> different information.

So we need ALL the documentation.
But the main point is: could it be solved with the current design of tax
code.

> For me it is better to try to create something that is as complete as
> possible because it is hard for the user to create that for
> themselves.

I do not think we have the resource for that. So I prefer to have a
minimal but correct implementation than something that pretend to be
complete but buggy.
msg38623 (view) Author: [hidden] (albertca) (Tryton committer) (Tryton translator) Date: 2018-02-26.23:30:34
The thing is that there are lots of reports, not only 303. There's 340, 347, 349... And each of them requires different or slightly different information.

For me it is better to try to create something that is as complete as possible because it is hard for the user to create that for themselves.
msg38536 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-21.13:11:03
> But those specific cases are also managed by tax code?

Yes as is the only way to have a report of which amount has been accrued on each period.
msg38515 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-20.17:55:05
On 2018-02-20 17:41, Sergi Almacellas Abellana wrote:
> > So I guess each model xxx is defined by a set of tax code?
> 
> For the issue we are managing here yes. There are some models that are used to send the EC list, tax resume per party and other things. 

I do not know about which "models" you are speaking.
I guess EC list is already managed by account_eu.

> Most of the taxes are sent by the model 303 and model 111 for retention which is what most of the companies use. Then specific cases have their own report which only must be supplied if you have this special taxes.

But those specific cases are also managed by tax code?
msg38512 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-20.17:41:39
> So I guess each model xxx is defined by a set of tax code?

For the issue we are managing here yes. There are some models that are used to send the EC list, tax resume per party and other things. 

Most of the taxes are sent by the model 303 and model 111 for retention which is what most of the companies use. Then specific cases have their own report which only must be supplied if you have this special taxes.
msg38511 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-20.17:25:06
On 2018-02-20 16:50, Sergi Almacellas Abellana wrote:
> > What are model xxx of aeat? What is the link with aeat 303 ?
> 
> Model xxx of aeat are the documents which the spanish tax autority (Agencia Tributaria http://www.agenciatributaria.es/) uses to required the tax information to the companies. 
> 
> Aeat 303 or model 303 from aeat is the report that all companies/self-employees in Spain should use to declare they tax. 
> 
> Retenciones is a Special tax that should be applied when a physical person that has declared itself as self-employed and so reports taxes to the tax authority. Model 111 of aeat is used by companies to declare this taxes to the tax authority. 
> 
> When a building rent invoice is issued from a self-employed to a company, it also includes the retention same retention tax percentage but the company should declare it to the tax authority using a different Model. This model is the number 115 of aeat. So we created both taxes to be able to know on which model should declare the amounts. 
> 
> I hope it clarifies the issue. Feel free to ask more if something is not clear enough.

So I guess each model xxx is defined by a set of tax code?

Also I guess it is pretty rare that a self-employed rent a building to a
company.
But the retention should be quite spread.
msg38508 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-20.16:50:13
> What are model xxx of aeat? What is the link with aeat 303 ?

Model xxx of aeat are the documents which the spanish tax autority (Agencia Tributaria http://www.agenciatributaria.es/) uses to required the tax information to the companies. 

Aeat 303 or model 303 from aeat is the report that all companies/self-employees in Spain should use to declare they tax. 

Retenciones is a Special tax that should be applied when a physical person that has declared itself as self-employed and so reports taxes to the tax authority. Model 111 of aeat is used by companies to declare this taxes to the tax authority. 

When a building rent invoice is issued from a self-employed to a company, it also includes the retention same retention tax percentage but the company should declare it to the tax authority using a different Model. This model is the number 115 of aeat. So we created both taxes to be able to know on which model should declare the amounts. 

I hope it clarifies the issue. Feel free to ask more if something is not clear enough.
msg38505 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-20.16:15:05
On 2018-02-20 15:56, Sergi Almacellas Abellana wrote:
> > This sounds strange to me. There should be only one way to report tax to
> > authorities.
> 
> The main way to report to tax authorities is aeat 303 and none of this special cases are included on this report. 
> 
> > So the policy is that the chart of accounts must follow the official way
> > from the authorities. And it should not implement too specialized cases.
> > And also it should contain only fully working configuration.
> > I can not judge on this case without knowing what it is.
> 
> The only usage is see is for "Retenciones a cuenta Arrendamientos". Which the legal authority requires to declare the tax related to building rent (model 115 of aeat) in a separate way of the other ones (model 111 of aeat). But probably this can be solved by a third party module which adds some mechanism to determine if the invoice/tax is related to the bulding renting.

What are model xxx of aeat? What is the link with aeat 303 ?
msg38502 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-20.15:56:41
> This sounds strange to me. There should be only one way to report tax to
> authorities.

The main way to report to tax authorities is aeat 303 and none of this special cases are included on this report. 

> So the policy is that the chart of accounts must follow the official way
> from the authorities. And it should not implement too specialized cases.
> And also it should contain only fully working configuration.
> I can not judge on this case without knowing what it is.

The only usage is see is for "Retenciones a cuenta Arrendamientos". Which the legal authority requires to declare the tax related to building rent (model 115 of aeat) in a separate way of the other ones (model 111 of aeat). But probably this can be solved by a third party module which adds some mechanism to determine if the invoice/tax is related to the bulding renting.

The name of other taxes makes me think that they are separated for similar cases, but I can not find any model where they are used. Athought I must admin that I haven't reviewed all the models, only the most used ones. 

P.S: I'm cc albert to see if he can bring some light to the issue.
msg38500 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-20.15:20:06
On 2018-02-20 14:49, Sergi Almacellas Abellana wrote:
> I've reviewed the taxes and here are some examples that I seem redundant to me:
> 
> - IVA 0% Inversión del sujeto pasivo (chatarra y reciclaje de cartón)
> - IVA 0% Inversión del sujeto pasivo (ejecuciones de obra)
> - IVA alquiler vivienda Exento
> - IVA 0% Operaciones exentas sin derecho a deducción (servicios asistenciales)
> - IVA 0% Operaciones exentas sin derecho a deducción (arrendamiento terrenos rústicos)
> - Retenciones a cuenta IRPF Arrendamientos 19,5%
> - Retenciones a cuenta IRPF Arrendamientos 20%
> 
> They are some specialized cases of other taxes on which only the report description changes or a specialized tax code has been created. 
> 
> Not sure what if the policy about account charts but for me it makes sense to include only the most common taxes and then let the user duplicate them if they want to have reporting about more detailed information.  

This sounds strange to me. There should be only one way to report tax to
authorities.
So the policy is that the chart of accounts must follow the official way
from the authorities. And it should not implement too specialized cases.
And also it should contain only fully working configuration.
I can not judge on this case without knowing what it is.
msg38499 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-20.14:49:03
I understand your point, indeed a good cleaning was done on the account_es module before inclusion.

I've reviewed the taxes and here are some examples that I seem redundant to me:

- IVA 0% Inversión del sujeto pasivo (chatarra y reciclaje de cartón)
- IVA 0% Inversión del sujeto pasivo (ejecuciones de obra)
- IVA alquiler vivienda Exento
- IVA 0% Operaciones exentas sin derecho a deducción (servicios asistenciales)
- IVA 0% Operaciones exentas sin derecho a deducción (arrendamiento terrenos rústicos)
- Retenciones a cuenta IRPF Arrendamientos 19,5%
- Retenciones a cuenta IRPF Arrendamientos 20%

They are some specialized cases of other taxes on which only the report description changes or a specialized tax code has been created. 

Not sure what if the policy about account charts but for me it makes sense to include only the most common taxes and then let the user duplicate them if they want to have reporting about more detailed information.  

If we agree on this, I will update the review to remove also this kind of taxes and tax rules.
review41101002 updated at https://codereview.tryton.org/41101002/#ps1
msg38496 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-20.13:44:46
I'm a little worry about this. If I knew there was such duplication, I would not allowed the module as is.
So is there any other crappy hack in this module?
msg38494 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-20.13:32:13
We include separated taxes for Criterio de Caja (Spanish cash basis tax) to be able to differentiate the supplier invoices which are based on tax basis when the company does not apply the cash basis. 

The correct way of solving this issue is explained on msg38492, so I propose to remove the criterio de caja taxes and tax rules from the Spanish chart templates.
History
Date User Action Args
2018-05-21 23:10:05roundup-botsetstatus: chatting -> resolved
messages: + msg40865
2018-05-17 16:42:44reviewbotsetmessages: + msg40728
2018-05-09 09:44:26reviewbotsetmessages: + msg40590
2018-05-08 17:40:49reviewbotsetstatus: resolved -> chatting
messages: + msg40584
2018-05-08 17:40:48reviewbotsetreviews: 44841002 -> 44841002, 45081002
2018-05-08 17:30:52roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg40582
2018-05-08 17:16:52pokolisetmessages: + msg40581
2018-05-08 17:10:07cedsetmessages: + msg40577
2018-05-08 16:59:15pokolisetmessages: + msg40575
2018-05-07 18:09:11reviewbotsetmessages: + msg40546

Showing 10 items. Show all history (warning: this could be VERY long)