Tryton - Issues

 

Issue7139

Title Tax Report on Cash Basis
Priority feature Status resolved
Superseder Nosy List ced, pokoli, reviewbot, risto3, roundup-bot, yangoon
Type feature request Components account, account_invoice, account_statement
Assigned To ced Keywords review
Reviews 41081002, 44011002, 43131002, 41091002
View: 41081002, 44011002, 43131002, 41091002

Created on 2018-02-15.11:15:56 by ced, last changed by roundup-bot.

Messages
New changeset 28fbdf1a6625 by Cédric Krier in branch 'default':
Initial commit
http://hg.tryton.org/modules/account_tax_cash/rev/28fbdf1a6625
New changeset c14a54185452 by Cédric Krier in branch 'default':
Use Invoice.add_payments method
http://hg.tryton.org/modules/account_statement/rev/c14a54185452
New changeset 2e09b0b8d551 by Cédric Krier in branch 'default':
Improve payment management
http://hg.tryton.org/modules/account_invoice/rev/2e09b0b8d551
New changeset ba63091f8632 by Cédric Krier in branch 'default':
Improve tax management
http://hg.tryton.org/modules/account/rev/ba63091f8632
review44011002 updated at https://codereview.tryton.org/44011002/#ps120001
review41091002 updated at https://codereview.tryton.org/41091002/#ps200001
review43131002 updated at https://codereview.tryton.org/43131002/#ps40001
review44011002 updated at https://codereview.tryton.org/44011002/#ps100001
review41091002 updated at https://codereview.tryton.org/41091002/#ps180001
review41091002 updated at https://codereview.tryton.org/41091002/#ps160001
review41091002 updated at https://codereview.tryton.org/41091002/#ps140001
review43131002 updated at https://codereview.tryton.org/43131002/#ps20001
review44011002 updated at https://codereview.tryton.org/44011002/#ps80001
review41081002 updated at https://codereview.tryton.org/41081002/#ps40001
msg38828 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-06.16:59:00
msg38822: I see no problem to support this case. It just need to have the proper groups set on the fiscal year.
msg38827 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-06.16:57:16
So you would not put them back?
msg38826 (view) Author: [hidden] (risto3) Date: 2018-03-06.16:53:20
Sorry, that was probably by accident as the text widget for 'change note' doesn't disable <tab> for changing to next field.
msg38825 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-06.16:51:27
@risto3: Why did you remove the review links?
msg38822 (view) Author: [hidden] (risto3) Date: 2018-03-06.16:31:04
The party's supplier tax group on cash basis seems, with respect to the French legislation anyway, seems totally wrong.

As mentioned in Issue7194, by default, the "T.V.A. Achat de services" group is *already* on cash basis.  To need to set this on each and every supplier is grotesque.
There needs to be a possibility to set this globally (perhaps it is already if set on the fiscal year?).

On the other hand, if the supplier has opted for "TVA sur les débits", upon which obliges an express written indication on the invoices, then accrual basis is to be used. Unfortunately, there seems to be no easy way to stipulate a tax rule to correct things (which is the object of Issue7194).

I understand that some countries are all or nothing as to deducting suppliers VAT, such as The Netherlands, where the choice is actually up to the client:
https://www.belastingdienst.nl/wps/wcm/connect/bldcontentnl/belastingdienst/zakelijk/btw/btw_aangifte_doen_en_betalen/bereken_het_bedrag/hoe_berekent_u_het_btw_bedrag/kasstelsel/

So perhaps there should be an "opt in" and an "opt out" sort of capability, with a means to set a rule enforcing things accounting wise.
review41091002 updated at https://codereview.tryton.org/41091002/#ps120001
msg38495 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-20.13:36:56
The proposed solution seems to me the simpler way to manage the case when the suplier is based on cash and customer on accrual. 

I added issue7150 to clean the not needed taxes from the account_es module.
review41091002 updated at https://codereview.tryton.org/41091002/#ps100001
msg38492 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-20.12:58:26
Indeed for what I understand, the problem is when two companies used different tax basis.
The case when the supplier is based on accrual and the customer is base on cash, should not be a problem because the customer will deduct the taxes only when he'll pay and the supplier will already provision the state with the tax. So it benefit to the state.
The other case is more problematic because the supplier will not provision the state with the tax until the payment is made. So if the customer deduct on accrual basis the taxes, then the state will need to advance the tax amount. And this is bad for the state, so that's why they enforce that in such case the customer must deduct the taxes also on cash basis.
I think this case is often managed manually by entering the supplier invoice only when the company paid the invoice. But any way, we can provide a cleaner solution.
So I will update the review to add on the supplier invoice the tax groups that should be on cash basis (with a default value on party). So on posting the move, we will only update the "on_cash_basis" field with the period/fiscalyear configuration only if it is not already set.
review41091002 updated at https://codereview.tryton.org/41091002/#ps70020
msg38490 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-20.11:10:09
On 2018-02-20 10:39, Sergi Almacellas Abellana wrote:
> In spain there is the need to add some note on the invoice to indicate that this invoice is based on cash basis. From the third paragraf of [1] I see this is a requirement also in France. 
> 
> Maybe we should allow to define this note on the fiscalyear/period and then append to the legal advice on invoice introduced on issue2329. 

I do not think the text should be different for each taxes. So this can
be managed on the report.
I will just add a property on account.invoice.tax to compute if it is
reported on cash basis or not.
msg38489 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-20.11:00:05
On 2018-02-20 10:01, Sergi Almacellas Abellana wrote:
> Should we remove this taxes from the account_es as part of this issue? Or we should create a separate issue?

I think you must manage this in a separate issue. At least, I do not
understand any Spanish taxes so I will be unable to do anything.
Also it will be great to clean this Spanish account module from any
similar hack even if it removes features as far as there is no correct
implementation.
msg38488 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-20.10:48:35
about msg38486, I've found the legal requirement, which can be found on the clause "Destinatarios de las operaciones afectadas por el régimen" of the following link:

http://www.agenciatributaria.es/AEAT.internet/en_gb/Inicio/_Segmentos_/Empresas_y_profesionales/Empresas/IVA/Regimenes_de_tributacion/Regimen_especial_del_criterio_de_caja/Nota_informativa.shtml

If you supplier uses a cash basis regime, you should not include the tax amount until the invoice is paid (like if they were on the cash basis regime). I think we are missing support for this part.
msg38487 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-20.10:39:58
In spain there is the need to add some note on the invoice to indicate that this invoice is based on cash basis. From the third paragraf of [1] I see this is a requirement also in France. 

Maybe we should allow to define this note on the fiscalyear/period and then append to the legal advice on invoice introduced on issue2329. 

[1] https://discuss.tryton.org/t/tax-report-on-cash-basis/15/26
msg38486 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-02-20.10:01:46
I haven't got time to have a deeper review, but at first shoot I see you define on each fiscalyear which taxes are based on report taxes which raises the following question on my mind:

In account_es we duplicated the taxes in order to differentiate the cash basis taxes for our suppliers. IIRC this is not required anymore as the same taxes can be used for cash basis and not cash basis. I also reviewed the oficial declaration and there is no need to diferentiate the supplier taxes based on tax basis and on not tax basis if you are not part of the cash basis regime. 

Should we remove this taxes from the account_es as part of this issue? Or we should create a separate issue?
review41091002 updated at https://codereview.tryton.org/41091002/#ps80001
review41091002 updated at https://codereview.tryton.org/41091002/#ps60001
review44011002 updated at https://codereview.tryton.org/44011002/#ps60001
msg38469 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-19.18:43:09
Ready for testing.
review44011002 updated at https://codereview.tryton.org/44011002/#ps20001
review41081002 updated at https://codereview.tryton.org/41081002/#ps20001
msg38461 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-19.11:59:57
After a talk with nicoe, we found that adding a unique constraint is the best choice because:

- it enforces the usage of add_payment
- it prevents to add a new field on the lines which should be excluded from the check modify and which should be prevented to be used instead of add_payment

To be able to add payment lines to existing invoice and to search for unlinked payment lines, a Boolean function fields will be added which represent if the line is linked to an invoice or not.
review41091002 updated at https://codereview.tryton.org/41091002/#ps40001
msg38427 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-19.10:45:54
In order to correctly compute the partial paid amount for an invoice, I must ensure that there is only one InvoicePaymentLine per posted invoice.
So there are two options:

- add a unique constraint on invoice
- replace the Many2Many by a One2Many

in both cases, we need to clean when the invoice is paid to ensure only the reconciled lines stay.
New review41091002 at https://codereview.tryton.org/41091002/#ps20001
New review43131002 at https://codereview.tryton.org/43131002/#ps1
New review44011002 at https://codereview.tryton.org/44011002/#ps1
New review41081002 at https://codereview.tryton.org/41081002/#ps1
msg38382 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-02-15.11:15:56
From: https://discuss.tryton.org/t/tax-report-on-cash-basis/15
History
Date User Action Args
2018-04-05 12:20:41cedlinkissue3364 superseder
2018-03-24 16:00:17roundup-botsetmessages: + msg39329
2018-03-24 15:30:31roundup-botsetmessages: + msg39328
2018-03-24 15:29:49roundup-botsetmessages: + msg39327
2018-03-24 15:27:54roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg39326
2018-03-22 11:22:29reviewbotsetmessages: + msg39204
2018-03-22 11:22:21reviewbotsetmessages: + msg39202
2018-03-20 11:55:39reviewbotsetmessages: + msg39108
2018-03-20 11:55:35reviewbotsetmessages: + msg39107
2018-03-16 18:11:13cedlinkissue6013 superseder

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