Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0026991
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Localization Pack: Spain] AEAT 349majoralways2014-07-01 18:592014-09-16 14:22
ReportermaiteView Statuspublic 
Assigned Torafaroda 
PriorityurgentResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisiond78267acb4cb
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Regression date
Regression introduced by commit
Regression level
Review Assigned To
Regression introduced in release
Summary

0026991: It should not be possible to select invoices from different periods as "corrective 349" invoices in the tab "Reversed Invoices"

DescriptionIt should not be possible to select invoices from different periods as "corrective 349" invoices in the tab "Reversed Invoices"
Steps To Reproduce1. Register a sales invoice for an amount of 100 € for a customer located in France. Tax rate to be used: Entregas intracomunitarias (%N=>0%). Invoice dated on August 2014. Complete and Post the invoice.
Launch the 349 tax form from the Tax Report Launcher for August period and realize that the Tax Base Amount for that customer is = 100

2. Register a new sales invoice for an amount of 200 € for the same customer as in 1. Once more the tax rate to be used: Entregas intracomunitarias (%N=>0%). Invoice dated on September 2014. Complete and Post the invoice.
Launch the 349 tax form from the Tax Report Launcher for September period and realize that the Tax Base Amount for that customer is = 200

3. Register a Reverse Sales Invoice for the same customer and for an amount of -200 €. Invoice dated on October 2014
Access "Reverse Invoice" tab, select August invoice (see point 1 above) and set it as "corrective 349". Enter below data:
Year = 2014
Period = August
Base Imponible del 349 Productos = 100

In this tab add a new record referencing the invoice dated in February (see point 2 above) and set it as "corrective 349". Enter below data:
Year = 2014
Period = September
Base Imponible del 349 Productos = 200

Realize that no error is obtained.

Launch the 349 tax form from the Tax Report Launcher for October and realize that it is not possible to validate the txt file obtained because it is not possible to import it in AEAT software "Informativas". Below error is shown (In Spanish):
Código: 31401A
Descripción: Base Imponible rectificada NO NUMÉRICA

The reason is:
Openbravo is making this calculation:
(1) to get new August tax base is doing 100-200 = -100
(2) to get new September tax base is doing 200-200= 0
but above calculations are not correct because it is not possible to indicate which amount (among reverse invoice amount of 200 €) should correct August invoice and which amount (among reverse invoice amount of 200 €) should correct September invoice.

Therefore it should not be possible to reference invoices from different periods (months or quarters) in the same reverse invoice as "Corrective 349", as there is no way to know the new tax base amount of each period (month or quarter).
At the end of the day end-user needs to register two Reversed Sales Invoice, first one reversing August invoice and second one reversing September invoice.

Same applies to purchase invoice.

Same applies for Quarterly submission of 349 tax form.

Proposed SolutionIt should not be possible to reference invoices from different periods (months or quarters) in the same reverse invoice as "Corrective 349", as there is no way to know the new tax base amount of each period (month or quarter).
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0027613 newvmromanos Base Imponible Rectificada is not properly calculated for Reverse Invoices with currency different from EURO 

-  Notes
(0069508)
psanjuan (manager)
2014-08-19 14:15
edited on: 2014-08-19 14:39

Below scenario should be possible:

January 2014 - Invoice 1 - Amount 100€
349 tax base for customer A (January) = 100€

February 2014 - Invoice 2 - Amount 200€
February 2014 - Invoice 3 - Amount 300€
February 2014 - Invoice 4 - Amount 400€
349 tax base for customer A (February) = 900€

March 2014 - Reverse Invoice 1 - Amount -500€
Reversed Invoice tab:
record 1 - Invoice 2 (February) set as 349 corrective with below data:
Year =2014
Period = February
Base Imponible 349 Productos = 900
record 2 - Invoice 3 (February) set as 349 corrective with below data:
Year =2014
Period = February
Base Imponible 349 Productos = 900

349 tax base for customer A (March) = 900-500= 400€ (Base Imponible Rectificada)
and 900€ as (Base Imponible declarada anteriormente)

Now if we launch 349 tax form for the period of March, Openbravo shows the same error
Código: 31401A
Descripción: Base Imponible rectificada NO NUMÉRICA

seems the calculation now is 900-500= 400
and once more 400 -500 = -100 (this gives the error)

Same applies to purchase invoice.

Same applies to quarterly submission.

(0069918)
rafaroda (developer)
2014-09-02 18:43

Hi Patricia,

Actually, for the Scenario 2 (in your comment) the code is getting: [{Period=02, Year=2014, BPTaxBaseAmount=1000.00, BPFormerAmount=900, BPId=44CB679908C64EF5B852E8DB8A1AA061, TaxKey=E}]

BPTaxBaseAmount (Base Imponible) = 1000: which seems wrong (kind of 2 * 500: actualy if we add the third Invoice 3 February as Reversed, BPTaxBaseAmount = 3 * 500 = 1500)

BPFormerAmount (Base Imponible declarada anteriormente) = 900: which seems correct

So Base Imponible Rectificada is calculated as BPFormerAmount - BPTaxBaseAmount (900 - 1000) which leads to the wrong -100 result.

Some error in the query selecting invoices https://code.openbravo.com/erp/pmods/org.openbravo.module.aeat349.es/file/e40ddcd62a4a/src/org/openbravo/module/aeat349/es/AEAT3492010ReportDao.java#l366 [^]
(0070139)
hgbot (developer)
2014-09-16 12:52

Repository: erp/pmods/org.openbravo.module.aeat349.es
Changeset: d78267acb4cbc34acda720da1c9d52ee7902b894
Author: Rafa Roda Palacios <rafa.roda <at> ubiquads.com>
Date: Tue Sep 16 12:50:13 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.module.aeat349.es/rev/d78267acb4cbc34acda720da1c9d52ee7902b894 [^]

Fixes issue 26991 Proper calculation of Base Imponible Rectificada in 349

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/module/aeat349/es/AEAT3492010ReportDao.java
A src-db/database/model/functions/AEAT349_REVINVOICES_CHECK.xml
A src-db/database/sourcedata/AD_EP_PROCEDURES.xml
---
(0070142)
psanjuan (manager)
2014-09-16 12:57
edited on: 2014-09-16 13:12

To avoid not allowing to set invoices dated on different periods as "Correctivas del 349" for the same reverse invoice, two new fields should be included in the tab "Reversed Invoices".

The purpose of those two new fields should be to enter the reversed amount that matches each invoice set as corrective, for both "Product Tax Base" and "Service Tax Base".

(0070144)
psanjuan (manager)
2014-09-16 13:12

fixed and working
(0070147)
hgbot (developer)
2014-09-16 14:22

Repository: erp/pmods/org.openbravo.module.aeat349.es
Changeset: 71d751192efcf0296c00927db2f2d760de7741f0
Author: Rafa Roda Palacios <rafa.roda <at> ubiquads.com>
Date: Tue Sep 16 14:01:24 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.module.aeat349.es/rev/71d751192efcf0296c00927db2f2d760de7741f0 [^]

Related to issue 26991 Added small correction for purchase invoices

---
M src/org/openbravo/module/aeat349/es/AEAT3492010ReportDao.java
---

- Issue History
Date Modified Username Field Change
2014-07-01 18:59 maite New Issue
2014-07-01 18:59 maite Assigned To => jonalegriaesarte
2014-07-01 19:00 maite Issue Monitored: networkb
2014-07-01 19:23 heccam Issue Monitored: heccam
2014-07-21 16:36 jonalegriaesarte Regression date => 2014-08-08
2014-07-21 16:40 jonalegriaesarte Regression date 2014-08-08 =>
2014-07-21 16:40 jonalegriaesarte Resolution time => 1407448800
2014-07-24 13:44 jonalegriaesarte Assigned To jonalegriaesarte => AtulOpenbravo
2014-08-19 13:53 psanjuan Summary Should not be possible to reference invoices from different periods in "Reversed Invoices" tab, in a "corrective 349" invoice => It should not be possible to select invoices from different periods as "corrective 349" invoices in the tab "Reversed Invoices"
2014-08-19 13:53 psanjuan Description Updated View Revisions
2014-08-19 13:53 psanjuan Steps to Reproduce Updated View Revisions
2014-08-19 14:15 psanjuan Note Added: 0069508
2014-08-19 14:15 psanjuan Steps to Reproduce Updated View Revisions
2014-08-19 14:15 psanjuan Proposed Solution updated
2014-08-19 14:25 psanjuan Note Edited: 0069508 View Revisions
2014-08-19 14:29 psanjuan Note Edited: 0069508 View Revisions
2014-08-19 14:29 psanjuan Note Edited: 0069508 View Revisions
2014-08-19 14:30 psanjuan Note Edited: 0069508 View Revisions
2014-08-19 14:35 psanjuan Note Edited: 0069508 View Revisions
2014-08-19 14:39 psanjuan Note Edited: 0069508 View Revisions
2014-08-26 16:10 rafaroda Status new => scheduled
2014-08-26 16:10 rafaroda Assigned To AtulOpenbravo => rafaroda
2014-08-26 16:10 rafaroda fix_in_branch => pi
2014-09-02 18:43 rafaroda Note Added: 0069918
2014-09-16 12:44 rafaroda Relationship added related to 0027613
2014-09-16 12:52 hgbot Checkin
2014-09-16 12:52 hgbot Note Added: 0070139
2014-09-16 12:52 hgbot Status scheduled => resolved
2014-09-16 12:52 hgbot Resolution open => fixed
2014-09-16 12:52 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.module.aeat349.es/rev/d78267acb4cbc34acda720da1c9d52ee7902b894 [^]
2014-09-16 12:57 psanjuan Note Added: 0070142
2014-09-16 13:00 psanjuan Note Edited: 0070142 View Revisions
2014-09-16 13:12 psanjuan Note Edited: 0070142 View Revisions
2014-09-16 13:12 psanjuan Note Added: 0070144
2014-09-16 13:12 psanjuan Status resolved => closed
2014-09-16 13:12 psanjuan fix_in_branch pi =>
2014-09-16 14:22 hgbot Checkin
2014-09-16 14:22 hgbot Note Added: 0070147


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker