Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033354Openbravo ERP09. Financial managementpublic2016-06-24 13:122016-06-28 16:06
psanjuan 
vmromanos 
urgentmajoralways
closedfixed 
30Professional Appliance
 
3.0PR16Q3 
aferraz
Core
Production - Confirmed Stable
2014-08-26
3.0PR14Q4
https://code.openbravo.com/erp/devel/pi/rev/35648d50070b5bde2cbd8ff287e098d98ed0044d#l1.42 [^]
No
0033354: No correct Cash VAT posting for the payment in case of more than one General Ledger assigned to the Organization.
No correct Cash VAT posting for the payment in case of more than one General Ledger assigned to the Organization.
In an environment with F&B International Group demo data, install "Cash VAT Management" module.

Once installed apply its dataset at * organization.

Go to Account Tree window and create below accounts:

For F&B España, create the accounts:
Search Key: 47200T
Name: HP IVA soportado Transitorio
Account Type: Asset

Search Key: 47700T
Name: HP IVA repercutido Transitorio
Account Type: Liability

For F&B International Group, create the accounts:
Search Key: 2260T
Name: Sales Tax Payable Transitory
Account Type: Liability

Search Key: 7410T
Name: Tax Expense Transitory
Account Type: Expense

Go to General ledger Configuration window and enter above created accounts for each General Ledger Configuration, Defaults tab:

F&B España:
Tax Due Transitory: 47700T
Tax Credit Transitory: 47200T

F&B International:
Tax Due Transitory: 2260T
Tax Credit Transitory: 7410T

Go to Tax rate window and create below two one tax rates:
(1) For F&B España:
Name = Adquisiciones IVA 21% IVA de Caja
Valid from date = 01-01-2016
Rate = 21
Purchase Tax
Cash VAT = YES
Country= Destination country = Spain.

(1) For F&B US:
Name = Purchase Tax Cash VAT
Valid from date = 01-01-2016
Rate = 21
Purchase Tax
Cash VAT = YES
Country= Destination country = United States

Go to purchase invoice and create a new one for F&B España. Bebidas Alegres BP. Set it as Cash VAT = Yes.
Enter any line. Make sure that the tax "Adquisiciones IVA 21% IVA de Caja" is shown in there.
Complete and post the invoice.

Verify postings refers a transitory VAT account:

F&B España Euro:

204.00 (6000) Compras Mercaderias - DEBIT
42.84 (47200T) HP IVA soportado Transitorio - DEBIT
264.84 (4000) Proveedores - CREDIT

F&B International Dollar:

22.36 (5360) Product Expense - DEBIT
42.84 (7410T) Tax Expense Transitory - DEBIT
269.06 (2110) Accounts Receivable - CREDIT

Add a payment for the invoice. Go to the payment and post it.

F&B España Euro:
246.84 (40000) Proveedores - DEBIT
246.84 (57200) Bancos - CREDIT

(*) this posting is not correct as it does not move Cash VAT transitory account balance to a Final Cash VAT account

F&B International Group:

269.06 (2110) Account payables - DEBIT
46.70 (7410) Tax expense - DEBIT
269.06 (1140) Bank - CREDIT
46.70 (7410T) Tax Expense Transitory - CREDIT

(*) this posting is correct.

Moreover, create a purchase invoice for F&B US, Be Soft Drinker Inc BP. Make sure it is set as Cash VAT = Yes.

Add any line. Make sure that the tax rate "Purchase Tax Cash VAT" is used.

Complete and post.

Add a payment and verify below posting for the only general ledger related to F&B US:

F&B International Group /Dollar

366.03 (2110) Account payables - DEBIT
65.53 (7410) Tax expense - DEBIT
366.03(1140) Bank - CREDIT
63.53 (7410T) Tax Expense Transitory - CREDIT

Transitory Cash VAT should take place, therefore correct payment posting looks like:
246.84 (40000) Proveedores - DEBIT
42.84 (47200) HP IVA soportado - DEBIT
246.84 (57200) Bancos - CREDIT
42.84 (47200t) HP IVA soportado transitorio - CREDIT
No tags attached.
related to defect 0033341 closed vmromanos Invoice prepayment accounting needs to support Cash VAT in the case of managing more than one General Ledger configuration 
depends on backport 00333613.0PR16Q2.1 closed vmromanos No correct Cash VAT posting for the payment in case of more than one General Ledger assigned to the Organization. 
depends on backport 00333623.0PR16Q1.4 closed vmromanos No correct Cash VAT posting for the payment in case of more than one General Ledger assigned to the Organization. 
caused by defect 00274603.0PR14Q4 closed AtulOpenbravo Error when posting Payment/Transaction/Reconciliation referencing several cash vat invoices 
diff 33354_proposed.diff (1,252) 2016-06-27 11:08
https://issues.openbravo.com/file_download.php?file_id=9581&type=bug
Issue History
2016-06-24 13:12psanjuanNew Issue
2016-06-24 13:12psanjuanAssigned To => Triage Finance
2016-06-24 13:24psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12501#r12501
2016-06-24 13:29psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12502#r12502
2016-06-24 13:39psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12503#r12503
2016-06-24 13:39psanjuanProposed Solution updated
2016-06-24 13:39psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12504#r12504
2016-06-24 13:40psanjuanNote Added: 0087899
2016-06-24 13:40psanjuanRelationship addedrelated to 0033341
2016-06-27 11:04vmromanosProjectModules => Openbravo ERP
2016-06-27 11:06vmromanosModules => Core
2016-06-27 11:06vmromanosRegression level => Production - Confirmed Stable
2016-06-27 11:06vmromanosRegression date => 2014-08-26
2016-06-27 11:06vmromanosRegression introduced in release => 3.0PR14Q4
2016-06-27 11:06vmromanosRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/35648d50070b5bde2cbd8ff287e098d98ed0044d#l1.42 [^]
2016-06-27 11:06vmromanosTriggers an Emergency Pack => No
2016-06-27 11:06vmromanosCategoryCash VAT Management => 09. Financial management
2016-06-27 11:08vmromanosFile Added: 33354_proposed.diff
2016-06-27 11:11vmromanosRelationship addedcaused by 0027460
2016-06-27 11:51aferrazStatusnew => scheduled
2016-06-27 11:51aferrazAssigned ToTriage Finance => vmromanos
2016-06-27 12:36psanjuanNote Added: 0087974
2016-06-27 12:38psanjuanNote Edited: 0087974bug_revision_view_page.php?bugnote_id=0087974#r12521
2016-06-27 12:44psanjuanNote Edited: 0087974bug_revision_view_page.php?bugnote_id=0087974#r12522
2016-06-27 12:46psanjuanNote Edited: 0087974bug_revision_view_page.php?bugnote_id=0087974#r12523
2016-06-27 12:50psanjuanNote Edited: 0087974bug_revision_view_page.php?bugnote_id=0087974#r12524
2016-06-27 13:00psanjuanNote Edited: 0087974bug_revision_view_page.php?bugnote_id=0087974#r12525
2016-06-27 13:04psanjuanNote Edited: 0087974bug_revision_view_page.php?bugnote_id=0087974#r12526
2016-06-27 13:15psanjuanNote Edited: 0087974bug_revision_view_page.php?bugnote_id=0087974#r12527
2016-06-27 13:39psanjuanNote Edited: 0087974bug_revision_view_page.php?bugnote_id=0087974#r12528
2016-06-27 13:59psanjuanNote Edited: 0087974bug_revision_view_page.php?bugnote_id=0087974#r12529
2016-06-27 15:03psanjuanNote Edited: 0087974bug_revision_view_page.php?bugnote_id=0087974#r12530
2016-06-27 15:38psanjuanNote Added: 0087992
2016-06-27 18:28psanjuanNote Edited: 0087974bug_revision_view_page.php?bugnote_id=0087974#r12533
2016-06-27 18:33psanjuanNote Edited: 0087974bug_revision_view_page.php?bugnote_id=0087974#r12535
2016-06-28 10:02hgbotCheckin
2016-06-28 10:02hgbotNote Added: 0088008
2016-06-28 10:02hgbotStatusscheduled => resolved
2016-06-28 10:02hgbotResolutionopen => fixed
2016-06-28 10:02hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cc5f703395d681b92315cdc21d19642e4f549101 [^]
2016-06-28 10:02aferrazReview Assigned To => aferraz
2016-06-28 10:02aferrazNote Added: 0088009
2016-06-28 10:02aferrazStatusresolved => closed
2016-06-28 10:02aferrazFixed in Version => 3.0PR16Q3
2016-06-28 16:06hudsonbotCheckin
2016-06-28 16:06hudsonbotNote Added: 0088059

Notes
(0087899)
psanjuan   
2016-06-24 13:40   
I think once this issue is solved, issue related 33341 will be solved.
(0087974)
psanjuan   
2016-06-27 12:36   
(edited on: 2016-06-27 18:33)
Test Plan 1

Take into account details explained above to properly setup Cash VAT.

Create a purchase invoice for F&B España, Bebidas Alegres BP, invoice date = 27/06/2016. Set is as Cash VAT = Yes.
Enter any line. Check that a Cash VAT tax rate is used.
Complete and Post the invoice.

Verify a "Transitory" tax account has been used for both general ledger (EUR and Dollar).

Add a payment of 100% of the invoice dated on 28/06/2018, for instance.
Post the payment.

Check below posting is shown.

General Ledger F&B España Euro:

822.80 (40000) Proveedores DEBIT
142.80 (47200) HP IVA soportado DEBIT
822.80 (57200) Bancos - CREIDT
142.80 (47200T) HP IVA soportado transitorio CREDIT


General Ledger F&B international Dollar:

896.85 (2110) Account Payables DEBIT
142.80 (7410) Tax Expense DEBIT
822.80 (1170) Check In-Transfer - CREIDT
142.80 (7410T) Tax Expense Transitory CREDIT


Additional test executed for F&B España, Bebidas Alegres BP, Cash VAT = Yes:

Test Plan 2.-

Partial payments of a purchase invoice (ie. 30% - 45% and 25%) dated after invoice date.

check that = every payment post include the corresponding Cash VAT amount transfer from "Transitory" to "Final Tax accounts for both General Ledgers (EUR & Dollar).

Test Plan 3.-

Invoice prepayment, payment date (27-06-2016) dated on before invoice date (30-06-2016), purchase invoice is booked and post to the ledger prior to the payment.

Check that = invoice posting uses a transitory Tax account for both GLs and check that payment posting looks like:

F&B España GL Euro

27-06-2016
1398.76 (40700) Anticipo proveedores DEBIT
242.76 (47200) HP IVA soportado DEBIT
1398.76 (57200) Bancos CREDIT
242.76 (47200T) HP IVA soportado transitorio CREDIT

30-06-2016
1398.76 (40000) Proveedores - DEBIT
1398.76 (40700) Anticipo proveedores - CREDIT

For F&B International Group Dollar

27-06-2016
1524.65 (1410) Vendor Prepayment DEBIT
264.61 (7410) Tax Expense DEBIT
1524.65 (1140) Check In-Transfer CREDIT
264.61 (7410T) Tax Expense transitory CREDIT

30-06-2016
1524.65 (2110) Account Payables - DEBIT
1524.65 (1410) Vendor Prepayment - CREDIT

Test Plan 4.-

Partial invoice prepayment, for instance 1000.00 €, payment date (27-06-2016) dated on before invoice date (30-06-2016), purchase invoice is booked and post to the ledger prior to the payment. Second payment after invoice date.

Check that = invoice posting uses a transitory Tax account for both GLs and check that first payment posting (Prepayment) looks like:

F&B España GL Euro

27-06-2016
1000.00 (40700) Anticipo proveedores DEBIT
173.55 (47200) HP IVA soportado DEBIT
1000.00 (57200) Bancos CREDIT
173.55 (47200T) HP IVA soportado transitorio CREDIT

30-06-2016
1000.00 (40000) Proveedores - DEBIT
1000.00 (40700) Anticipo proveedores - CREDIT

For F&B International Group Dollar

27-06-2016 - June exchange rate (EUR to $) = 1.09
1090.00 (1410) Vendor Prepayment DEBIT
189.17 (7410) Tax Expense DEBIT
1090.00 (1140) Check In-Transfer CREDIT
189.17 (7410T) Tax Expense transitory CREDIT

30-06-2016 - June exchange rate (EUR to $) = 1.09
1090.00 (2110) Account Payables - DEBIT
1090.00 (1410) Vendor Prepayment - CREDIT

Check that second payment posting dated after invoice date (for the rest i.e. 645.60) looks like:

F&B España GL Euro
01-08-2016
645.60 (40000) Proveedores DEBIT
112.05 (47200) HP IVA soportado DEBIT
645.60 (57200) Bancos CREDIT
112.05 (47200T) HP IVA soportado transitory CREDIT

For F&B International Group Dollar
01-08-2016 - August exchange rate (EUR to $) = 1.05

703.70 (645.60*1.09) (2110) Account Payables DEBIT
117.65 (112.05*1.05) (7410) Tax Expense DEBIT
4.48 [(112.05*1.09)- (112.05*1.05)] (8251) Bank Revaluation loss DEBIT
677.88 (645.60*1.05) (1140) Check In-Transfer CREDIT
122.13 (112.05*1.09) (7410T) Tax Expense Transitory CREDIT
25.82 [(645.60*1.09)- (645.60*1.05)] (8050) Bank Revaluation gain CREDIT

Test Plan 5.-

Total order prepayment, purchase order is paid totally, after that purchase invoice is booked and posted.

Create a purchase order set as Cash VAT = Yes. Add a payment for the total amount of the order.

Post the payment. Check that payment posting does not include any tax accounting.

Create the purchase invoice from the order. Check it is already paid.
Post the invoice. Check that invoice posting does not include any transitory tax account but final.

Test Plan 6.-

Partial order prepayment. Book a purchase order dated on June and pay it partially (ie 300.00€ from a total gross amount = 329.12; Total Net Amount = 272.00, Tax Amount =57.12 ) on June. After that create the purchase invoice from the order dated on June. Post it and pay rest of the amount dated on June.

Check that prepayment accounting looks like:

For F&B España Euro:
300.00 (40700) Anticipo proveedores - DEBIT
300.00 (57200) Bancos - CREDIT

For F&B International Group Dollar:
327.00 (1410) Vendor Prepayment - DEBIT
327.00 (1140) Check-In Transit - CREDIT
(300.00*1.09=327.00)

Check that Invoice accounting looks like:

For F&B España Euro:
272.00 (60000) Compra mercaderias - DEBIT
52.06 (47200) HP IVA soportado - DEBIT
5.06 47200T) HP IVA soportado transitorio - DEBIT
300.00 (40700) Anticipo a proveedores - DEBIT
29.12 (40000) Proveedores - CREDIT

For F&B International Group Dollar:
296.48 (5360) Product Expense- DEBIT
56.75 (7410) Tax expense - DEBIT
5.52 (7410T) Tax expense transitory- DEBIT
327.00 (40700) Anticipo a proveedores - DEBIT
31.74 (2110) Account Payables - CREDIT
0.01 (8255) Currency balancing.

Second payment posting for the rest of the amount (29.12) looks like:

For F&B España Euro:
29.12 (40000) Proveedores - DEBIT
5.06 (47200) HP IVA Soportado - DEBIT
29.12 (57200) Bancos - CREDIT
5.06 (47200T) HP IVA Soportado transitorio CREDIT

For F&B International Group Dollar:
31.74 (2110) Accounts Payables - DEBIT
5.52 (7410) Tax Expense - DEBIT
31.74 (1140) Check-In Transit - CREDIT
5.52 (7410T) Tax Expense Transitory - CREDIT

(29.12*1.09=31.74)
(5.06*1.09=5.52)

Repeat same test as above for Sales cycle and F&B US (only one general ledger related).

(0087992)
psanjuan   
2016-06-27 15:38   
Test Plan above verified.

Issue can be code reviewed and closed.
(0088008)
hgbot   
2016-06-28 10:02   
Repository: erp/devel/pi
Changeset: cc5f703395d681b92315cdc21d19642e4f549101
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Mon Jun 27 11:57:06 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/cc5f703395d681b92315cdc21d19642e4f549101 [^]

Fixed issue 33354: Cash VAT accounting with several ledgers

Comparing objects was wrongly done using equals instead of comparing by the ID.
The iteration for the first accounting schema worked fine, but the next ones were identified as other objects (although the record ID was the same).
Now the comparation is done using the ID.

---
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0088009)
aferraz   
2016-06-28 10:02   
Code review OK
(0088059)
hudsonbot   
2016-06-28 16:06   
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/865878a5d292 [^]
Maturity status: Test