Openbravo Issue Tracking System - Localization Pack: Spain
View Issue Details
0030156Localization Pack: SpainAEAT 390 Cash VAT compatiblepublic2015-06-11 12:292015-06-12 12:23
vmromanos 
vmromanos 
normalmajoralways
closedfixed 
5
 
 
0030156: Wrong amounts calculated in scenarios where invoice's amount is higher that order's amount
In case an invoice is generated from an order, and the invoice's amount is higher that order's amount, the 390 wrongly calculates the tax %.

The reason is that the negative tax amount in Invoice | Tax | Cash VAT tab is added to the total 390 tax amount.
Create a Sales Order dated on 2014 with a 21% Cash VAT tax rate. Total amount 10.000€
Create an invoice from the previous order. Edit the net unit price and set a lower amount (for instance 5.000,00 tax base amount = Line Net Price, therefore tax amount = 1050.00)

Complete the invoice and post it.

Pay the invoice dated on 2014.

Realize that two lines have been created under Cash VAT tab:
Percentage // Taxable Amount // Tax Amount
-100 // -5000.00 // -1050.00
200 // 10000.00 // 21000.00
Sum up of above two lines is:

100 // 5000.00 // 1050.00


Launch the 390. Verify that the tax amount is not properly calculated.
No tags attached.
related to defect 00274843.0PR14Q4 closed AtulOpenbravo Openbravo ERP Wrong cash vat lines when payment is automatically created and invoice's amount is higher that order's amount 
xml 3902014Antes.xml (3,055) 2015-06-12 12:17
https://issues.openbravo.com/file_download.php?file_id=8190&type=bug
xml 3902014Error.xml (3,056) 2015-06-12 12:17
https://issues.openbravo.com/file_download.php?file_id=8191&type=bug
xml 3902014Despues.xml (3,056) 2015-06-12 12:17
https://issues.openbravo.com/file_download.php?file_id=8192&type=bug
Issue History
2015-06-11 12:29vmromanosNew Issue
2015-06-11 12:29vmromanosAssigned To => vmromanos
2015-06-11 12:29vmromanosIssue generated from0030155
2015-06-11 12:29vmromanosRelationship addedrelated to 0027484
2015-06-11 12:45vmromanosPriorityimmediate => normal
2015-06-11 15:23vmromanosStatusnew => scheduled
2015-06-11 15:23hgbotCheckin
2015-06-11 15:23hgbotNote Added: 0078210
2015-06-11 15:23hgbotStatusscheduled => resolved
2015-06-11 15:23hgbotResolutionopen => fixed
2015-06-11 15:23hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.module.aeat390.es/rev/f34cff28ee305274ab0ec904b31289b81f399adc [^]
2015-06-12 11:31psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8828#r8828
2015-06-12 12:15psanjuanNote Added: 0078232
2015-06-12 12:15psanjuanStatusresolved => closed
2015-06-12 12:15psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8829#r8829
2015-06-12 12:17psanjuanFile Added: 3902014Antes.xml
2015-06-12 12:17psanjuanFile Added: 3902014Error.xml
2015-06-12 12:17psanjuanFile Added: 3902014Despues.xml
2015-06-12 12:20psanjuanNote Edited: 0078232bug_revision_view_page.php?bugnote_id=0078232#r8831
2015-06-12 12:23psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8832#r8832
2015-06-12 12:24psanjuanNote Edited: 0078232bug_revision_view_page.php?bugnote_id=0078232#r8833
2015-06-12 12:25psanjuanNote Edited: 0078232bug_revision_view_page.php?bugnote_id=0078232#r8834

Notes
(0078210)
hgbot   
2015-06-11 15:23   
Repository: erp/pmods/org.openbravo.module.aeat390.es
Changeset: f34cff28ee305274ab0ec904b31289b81f399adc
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Thu Jun 11 15:20:33 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.module.aeat390.es/rev/f34cff28ee305274ab0ec904b31289b81f399adc [^]

Fixed bug 30156: Wrong amounts calculated in scenarios where invoice's amount is higher that order's amount
In this scenario, the ITCV tax amount was added as a positive value to the total tax amount. Now we add it to the total tax amount taking into account its sign.
This should be safe because Cash VAT taxes don't have complex scenarios with several child tax rates with negative rates

---
M src-db/database/sourcedata/AD_MODULE.xml
M src/org/openbravo/module/aeat390/es/api/cashvat/AEAT390CashVATReadyCalculationsHelper.java
---
(0078232)
psanjuan   
2015-06-12 12:15   
(edited on: 2015-06-12 12:25)
Verified. See xml files attached.

Antes:
<RegGeneral>
<BaseImponibleyCuota>
            <RegCriterioCaja>
                <Tipo4>
                    <BI>11538.56</BI>
                    <Cuota>461.54</Cuota>
                </Tipo4>
                <Tipo10>
                    <BI>1041.03</BI>
                    <Cuota>104.11</Cuota>
                </Tipo10>
                <Tipo21>
                    <BI>99385.08</BI>
                    <Cuota>20870.88</Cuota>
                </Tipo21>

Error:

<RegGeneral>
        <BaseImponibleyCuota>
            <RegCriterioCaja>
                <Tipo4>
                    <BI>11538.56</BI>
                    <Cuota>461.54</Cuota>
                </Tipo4>
                <Tipo10>
                    <BI>1041.03</BI>
                    <Cuota>104.11</Cuota>
                </Tipo10>
                <Tipo21>
                    <BI>104385.08</BI> (99385.08 + 5000.00)
                    <Cuota>24020.88</Cuota> (20870.88 + 1050.00 +2100.00)
                </Tipo21>

Despues:
<RegGeneral>
        <BaseImponibleyCuota>
            <RegCriterioCaja>
                <Tipo4>
                    <BI>11538.56</BI>
                    <Cuota>461.54</Cuota>
                </Tipo4>
                <Tipo10>
                    <BI>1041.03</BI>
                    <Cuota>104.11</Cuota>
                </Tipo10>
                <Tipo21>
                    <BI>104385.08</BI> (99385.08 + 5000.00)
                    <Cuota>21920.88</Cuota> (20870.88 + 1050.00)
                </Tipo21>