Openbravo Issue Tracking System - Modules
View Issue Details
0033340ModulesCash VAT Managementpublic2016-06-23 13:582016-06-24 22:11
psanjuan 
vmromanos 
urgentmajoralways
closedfixed 
30Professional Appliance
 
 
psanjuan
0033340: Cash VAT management should handle at least 10 decimals while getting Tax/Tax Base Amounts calculations.
Cash VAT management should handle at least 10 decimals while getting Tax/Tax Base Amounts calculations.
Create a purchase invoice set as Cash VAT.
Invoice Amount = 1028500,00€ for instance.
Complete and Post.

Create a payment for that invoice for a small amount such as 20.00€

Go to Cash VAT tab and realize that the % calculated is = 0.00, because:


20/1028500.00 x 100 = 0.001944579 = 0.00
Internally more than 2 decimals need to be handle so amounts are calculated by using at leas 15 in our case 0.001944579, that will end in a tax base/tax base amount different to 0.00
No tags attached.
Issue History
2016-06-23 13:58psanjuanNew Issue
2016-06-23 13:58psanjuanAssigned To => Triage Finance
2016-06-23 14:23psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12463#r12463
2016-06-23 14:25psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12464#r12464
2016-06-23 14:25psanjuanProposed Solution updated
2016-06-24 12:58psanjuanNote Added: 0087891
2016-06-24 12:59psanjuanNote Edited: 0087891bug_revision_view_page.php?bugnote_id=0087891#r12493
2016-06-24 13:01psanjuanNote Edited: 0087891bug_revision_view_page.php?bugnote_id=0087891#r12494
2016-06-24 13:02psanjuanNote Edited: 0087891bug_revision_view_page.php?bugnote_id=0087891#r12495
2016-06-24 13:03psanjuanNote Edited: 0087891bug_revision_view_page.php?bugnote_id=0087891#r12496
2016-06-24 13:07psanjuanNote Added: 0087892
2016-06-24 13:07psanjuanNote Edited: 0087892bug_revision_view_page.php?bugnote_id=0087892#r12498
2016-06-24 13:08psanjuanNote Added: 0087893
2016-06-24 13:24vmromanosStatusnew => scheduled
2016-06-24 13:24vmromanosAssigned ToTriage Finance => vmromanos
2016-06-24 13:25hgbotCheckin
2016-06-24 13:25hgbotNote Added: 0087897
2016-06-24 13:25hgbotStatusscheduled => resolved
2016-06-24 13:25hgbotResolutionopen => fixed
2016-06-24 13:25hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/7341d1f97b977f53160aeb31d2b1c5860bdb3ba4 [^]
2016-06-24 13:25vmromanosReview Assigned To => psanjuan
2016-06-24 13:25vmromanosStatusresolved => closed
2016-06-24 22:11hudsonbotCheckin
2016-06-24 22:11hudsonbotNote Added: 0087914

Notes
(0087891)
psanjuan   
2016-06-24 12:58   
(edited on: 2016-06-24 13:03)
Test Plan for the verification of the issue:

Create a purchase invoice for F&B España, Bebidas Alegres BP. Set it us Cash VAT.
Go to lines and enter a line with Cerveza Ale 0.5L product, invoiced qty = 850.000. Make sure a Cash VAT tax is used.
Make sure no discount is applied.

Complete and Post the invoice. Make sure that invoice posting reflects a temporary tax ledger account.

Add a payment for 20.00. Check Cash VAT tab shows below info:
Percentage = 0
Tax Amount = 0.00
Taxable Amount = 0.00

Add a payment for 35000. Check Cash VAT tab shows below info:
Percentage = 2.5
Tax Amount = 6069.00
Taxable Amount = 28900.00

Add a payment for 363740.00. Check Cash VAT tab shows below info:
Percentage = 26
Tax Amount = 63117.60
Taxable Amount = 300560.00

Add a payment for 450000. Check Cash VAT tab shows below info:
Percentage = 32.17
Tax Amount = 78095.89
Taxable Amount = 371885.20

Add a payment for 550000.00. Check Cash VAT tab shows below info:
Percentage = 39.33
Tax Amount = 95477.51
Taxable Amount = 454654.80

Verify that the sum is:
Percentage = 100
Tax Amount = 242760.00
Taxable Amount = 1156000.00

(0087892)
psanjuan   
2016-06-24 13:07   
Test Plan for the verification of the fix:

Create a purchase invoice for F&B España, Bebidas Alegres BP. Set it us Cash VAT.
Go to lines and enter a line with Cerveza Ale 0.5L product, invoiced qty = 850.000. Make sure a Cash VAT tax is used.

Complete and Post the invoice. Make sure that invoice posting reflects a temporary tax ledger account.

Add a payment for 20.00. Check Cash VAT tab shows below info:
Percentage = 0.00143
Tax Amount = 3.47
Taxable Amount = 16.53

Add a payment for 35000. Check Cash VAT tab shows below info:
Percentage = 2.502216
Tax Amount = 6074.38
Taxable Amount = 28952.62

Add a payment for 363740.00. Check Cash VAT tab shows below info:
Percentage = 26.004461
Tax Amount = 63128.43
Taxable Amount = 300611.57

Add a payment for 450000. Check Cash VAT tab shows below info:
Percentage = 32.171352
Tax Amount = 78099.17
Taxable Amount = 371900.83

Add a payment for 550000.00. Check Cash VAT tab shows below info:
Percentage = 39.320541
Tax Amount = 95454.55
Taxable Amount = 454654.45

Verify that the sum is:
Percentage = 100
Tax Amount = 242760.00
Taxable Amount = 1156000.00

(0087893)
psanjuan   
2016-06-24 13:08   
Test Plan above verified.

Issue can be closed.
(0087897)
hgbot   
2016-06-24 13:25   
Repository: erp/devel/pi
Changeset: 7341d1f97b977f53160aeb31d2b1c5860bdb3ba4
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Thu Jun 23 13:07:42 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/7341d1f97b977f53160aeb31d2b1c5860bdb3ba4 [^]

Fixed bug 33340: Cash VAT percentage rounding issues,
Hardcoded a rounding precision of 15 for cash vat percentage

---
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0087914)
hudsonbot   
2016-06-24 22:11   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/cc0900cf80c9 [^]
Maturity status: Test