Tryton - Issues

 

Issue9097

Title Wrong ES VAT list when invoices are cancelled
Priority bug Status resolved
Superseder Nosy List ced, josesalvador, pokoli, reviewbot, roundup-bot
Type behavior Components account_es
Assigned To pokoli Keywords review
Reviews 289441002
View: 289441002

Created on 2020-02-29.11:20:53 by pokoli, last changed by roundup-bot.

Messages
New changeset f21ac68b8048 by Sergi Almacellas Abellana in branch '5.4':
Exclude refunds from cancelled invoices on ES VAT List
https://hg.tryton.org/modules/account_es/rev/f21ac68b8048

New changeset 31e99858b795 by Sergi Almacellas Abellana in branch '5.2':
Exclude refunds from cancelled invoices on ES VAT List
https://hg.tryton.org/modules/account_es/rev/31e99858b795
New changeset ca657ec3bc79 by Sergi Almacellas Abellana in branch 'default':
Exclude refunds from cancelled invoices on ES VAT List
https://hg.tryton.org/tryton-env/rev/ca657ec3bc79
New changeset fef002013c63 by Sergi Almacellas Abellana in branch 'default':
Exclude refunds from cancelled invoices on ES VAT List
https://hg.tryton.org/modules/account_es/rev/fef002013c63

New changeset 3df94e4eb13e by Sergi Almacellas Abellana in branch 'default':
Add test for reporting with cancelled invoices
https://hg.tryton.org/modules/account_es/rev/3df94e4eb13e
review289441002 updated at https://codereview.tryton.org/289441002/#ps256801002
msg56107 (view) Author: [hidden] (josesalvador) Date: 2020-03-06.13:33:58
Well, first I'm not an accountant but I'm gonna to try to help here without to put too noise to the issue.

AFAIK there is only two ways to cancel an invoice in Spain:

- Through a rectificative invoice
- Through a refund invoice

The first one must be used when the invoice is cancelled by a data error like:

- VAT
- Date
- Taxes
- and so on...

The term refund is used when the invoice has to fix things like:

- partial or total refund
- partial or total cancel of some service invoiced
- and so on...

Both are implemented in the same way. No invoice is deleted and all of them must  be taken into account to calculate taxes.

In the case of this issue the mistake was not to take into account the cancelled invoice so the resultant amount was lesser than expected.

I think that probably we are only against a naming problem/misunderstanding.

Here a reference (in Spanish) with more detail about your question from a well known accounting and invoicing system used in Spain:

https://anfix.com/blog/rectificar-una-factura-o-anularla-no-es-lo-mismo/
msg56093 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2020-03-05.23:14:44
I'm a little bit astonished that in Spain it is allowed to use the cancellation of customer invoice.
review289441002 updated at https://codereview.tryton.org/289441002/#ps293161003
msg55641 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2020-02-29.11:20:52
Since changeset 22eabf722a91 when an invoice is refunded it is mark as cancel, which excludes it from the ES VAT LIST. As the refund is in paid state this is included on the VAT list making the real amount of the party less than the real one. 

Thanks to @josesalvador for explaining me the case.
History
Date User Action Args
2020-04-17 14:51:47roundup-botsetmessages: + msg57220
keyword: - backport
2020-04-06 13:07:03roundup-botsetmessages: + msg56919
2020-04-06 13:06:49roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg56918
2020-04-06 13:01:53pokolisetkeyword: + backport
2020-03-21 19:27:20reviewbotsetmessages: + msg56576
2020-03-06 13:33:59josesalvadorsetmessages: + msg56107
2020-03-05 23:14:44cedsetnosy: + ced
messages: + msg56093
2020-02-29 12:14:44reviewbotsetnosy: + reviewbot
messages: + msg55645
2020-02-29 11:26:56pokolisetstatus: in-progress -> testing
reviews: 289441002
keyword: + review
2020-02-29 11:20:53pokolicreate

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