Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032549Openbravo ERP09. Financial managementpublic2016-03-29 15:162016-06-17 19:36
ngarcia 
AtulOpenbravo 
immediatemajoralways
closedfixed 
5
 
3.0PR16Q3 
aferraz
Core
Production - QA Approved
2015-11-20
3.0PR16Q1
https://code.openbravo.com/erp/devel/pi/rev/77f1cb4dd278c84913938db669a62c4c52796486 [^]
No
0032549: Cash VAT field of document header is updated to 'N' when you insert a tax rate of 0
Cash VAT field of document header is updated to 'N' when you insert a tax rate of 0
As group admin role:
   Create a Tax Rate and set it as Cash VAT
   Create an exempt tax rate (Rate = 0)
   Create a Sales Order header and check the Cash VAT field is 'N'
   Add a line and select the Cash Vat Tax Rate
   Check the Cash VAT field of the header is modified to 'Y'. This is correct
   Add a new line and select the Exempt tax rate
   Check the Cash VAT field of the header is modified to 'N'. This is not correct
   Try to book the sales order and check the following error message is raised:
     "Any of the tax rates in the document doesn't match the Cash VAT configured at the header"
The update should not be done for withholding tax rates or tax rates with 0 rate with summary level = 'N'
No tags attached.
depends on backport 00325943.0PR16Q2 closed AtulOpenbravo Cash VAT field of document header is updated to 'N' when you insert a tax rate of 0 
depends on backport 00325953.0PR16Q1.1 closed AtulOpenbravo Cash VAT field of document header is updated to 'N' when you insert a tax rate of 0 
caused by defect 0031184 closed vmromanos Cannot process a POS Order if it has a summary level tax rate with rate = 0 set as Cash VAT 
Issue History
2016-03-29 15:16ngarciaNew Issue
2016-03-29 15:16ngarciaAssigned To => Triage Finance
2016-03-29 15:16ngarciaModules => Core
2016-03-29 15:16ngarciaResolution time => 1461880800
2016-03-29 15:16ngarciaTriggers an Emergency Pack => No
2016-03-29 15:16ngarciaIssue Monitored: networkb
2016-03-29 15:16ngarciaRelationship addedcaused by 0031184
2016-03-29 15:28ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=11544#r11544
2016-03-30 12:50psanjuanNote Added: 0085332
2016-03-31 13:44AtulOpenbravoAssigned ToTriage Finance => AtulOpenbravo
2016-03-31 13:45AtulOpenbravoStatusnew => scheduled
2016-04-01 09:19AtulOpenbravoRegression date => 2015-11-20
2016-04-01 09:19AtulOpenbravoRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/77f1cb4dd278c84913938db669a62c4c52796486 [^]
2016-04-01 12:28AtulOpenbravoNote Added: 0085383
2016-04-01 13:09AtulOpenbravoNote Added: 0085384
2016-04-01 14:09AtulOpenbravoNote Added: 0085385
2016-04-04 09:55psanjuanNote Added: 0085401
2016-04-04 09:57vmromanosNote Added: 0085402
2016-04-04 09:57vmromanosSeveritymajor => minor
2016-04-04 10:05psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11629
2016-04-04 10:25psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11630
2016-04-04 10:31psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11631
2016-04-04 11:06psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11632
2016-04-04 11:23psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11633
2016-04-04 12:26psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11636
2016-04-05 11:41aferrazStatusscheduled => feedback
2016-04-05 11:41aferrazStatusfeedback => scheduled
2016-04-06 10:01aferrazRegression level => Production - QA Approved
2016-04-06 10:01aferrazRegression introduced in release => 3.0PR16Q1
2016-04-07 10:05psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11687
2016-04-07 10:15psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11688
2016-04-07 10:24psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11689
2016-04-07 10:36psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11690
2016-04-07 10:43psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11691
2016-04-07 11:54psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11692
2016-04-07 11:55psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11693
2016-04-07 12:59psanjuanNote Added: 0085487
2016-04-07 12:59psanjuanSeverityminor => major
2016-04-07 13:00psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11694
2016-04-07 13:34psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11695
2016-04-07 15:45psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11704
2016-04-11 13:00psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11741
2016-04-11 13:18psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11742
2016-04-11 13:55psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11747
2016-04-11 13:55psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11748
2016-04-11 14:12psanjuanNote Edited: 0085401bug_revision_view_page.php?bugnote_id=0085401#r11749
2016-04-11 15:37psanjuanNote Added: 0085572
2016-04-15 12:36psanjuanNote Added: 0085664
2016-04-15 12:42psanjuanNote Edited: 0085664bug_revision_view_page.php?bugnote_id=0085664#r11783
2016-04-15 14:50hgbotCheckin
2016-04-15 14:50hgbotNote Added: 0085672
2016-04-15 14:50hgbotStatusscheduled => resolved
2016-04-15 14:50hgbotResolutionopen => fixed
2016-04-15 14:50hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/714ea45ce839a94bc28270fb15b0bfff1b1b0f00 [^]
2016-04-15 15:01aferrazReview Assigned To => aferraz
2016-04-15 15:01aferrazNote Added: 0085676
2016-04-15 15:01aferrazStatusresolved => closed
2016-04-15 15:01aferrazFixed in Version => 3.0PR16Q3
2016-06-17 19:36hudsonbotCheckin
2016-06-17 19:36hudsonbotNote Added: 0087452

Notes
(0085332)
psanjuan   
2016-03-30 12:50   
Issue verified.
(0085383)
AtulOpenbravo   
2016-04-01 12:28   
Test Plan A

- Login as group admin role:
- Create a Tax Rate and set it as Cash VAT.
- Create an exempt tax rate (Rate = 0).
- Create a Sales Order header and check the Cash VAT field is 'N'
- Add a line and select the Cash Vat Tax Rate
- Check the Cash VAT field of the header is modified to 'Y'.
- Add a new line and select the Exempt tax rate.
- Check the Cash VAT field of the header is not modified.
- Try to book the sales order and check that order is processed successfully.

Test Plan B

- Login as group admin role.
- Create a Tax Rate and set it as Cash VAT.
- Create an exempt tax rate (Rate = 0). Non cash vat.
- Create a Sales Order header and check the Cash VAT field is 'N'
- Add a line and select the Cash Vat Tax Rate
- Check the Cash VAT field of the header is modified to 'Y'.
- Add a new line and select the Exempt tax rate.
- Check the Cash VAT field of the header is not modified.
- Add a new line and select the non zero, non cash vat tax rate
- Check the Cash VAT field of the header is modified to 'N'.
- Try to book the sales order and check the following error message is raised:
     "Any of the tax rates in the document doesn't match the Cash VAT configured at the header"
(0085384)
AtulOpenbravo   
2016-04-01 13:09   
Test Plan C

- Login as group admin role:
- Create a Tax Rate (Rate = 10) and set it as Cash VAT.
- Create a Withholding tax (Rate = 10).
- Create a Sales Order header and check the Cash VAT field is 'N'
- Add a line and select the Cash Vat Tax Rate
- Check the Cash VAT field of the header is modified to 'Y'.
- Add a new line and select the Withholding tax rate.
- Check the Cash VAT field of the header is not modified.
- Try to book the sales order and check that order is processed successfully.
(0085385)
AtulOpenbravo   
2016-04-01 14:09   
Above Test Plan A, B and C verified for Sales Invoice document.
(0085401)
psanjuan   
2016-04-04 09:55   
(edited on: 2016-04-11 14:12)
Above test plan (A, B and C) verify.

Besides below

Test Plan

Setup:

Install Cash VAT management module.
Install Cash VAT Spanish taxes module and apply it to F&B España org.

Go to organization window, select F&B España and check it is not configured as Cash VAT.

Scenario 1 - Fist tax rate a Cash VAT rate in a non Cash VAT invoice; together with 0 VAT rates and withholding and after that a non Cash VAT rate.

Go to Sales Invoice window and create a new one for F&B España, Alimentos y Supermercados business partner.
Save it.
Verify Cash VAT check in the header is set as "No".
Go to lines. Select any product, ie: Cerveza Ale 0.5L
Check that "Entregas IVA 21%" tax rate is seleted which is OK.
Change tax rate to "Entregas IVA 21% IVA de Caja".
Check that Cash VAT check in the header has changed to "Yes".

Create another line and select a new product, for instance "Vino Tinto 0.75L" check that "Entregas IVA 21% IVA de Caja" is selected, this is OK.
Change this tax to "Entregas no sujetas con dcho a deducción", that is a 0 tax rate.
Check that Cash VAT check in the header remains as "Yes" which is correct.

Create another line and select a new product, for instace "cola 0.5L". check that "Entregas IVA 21% IVA de Caja" is selected, this is OK.
Change this tax to "Servicios prestados nacional 21& -15%R IVA de cja", that is summary tax rate including a withholding tax rate.
Check that Cash VAT check in the header remains as "Yes" which is correct.

Complete the invoice.
Check it can be completed without any problem.

Post the invoice.
Check it is posted correctly as just withholding tax amount is post in final tax ledger account.

Reactivate the invoice.

Add a new line by selecting another product, ie. "Limonada 0,5L". Check that "Entregas IVA 21% IVA de Caja" is selected, this is correct.
Change that tax rate to "Entregas IVA 21%" which is not a Cash VAT tax rate.
Save.
Check that Cash VAT check is now set to "No". This is correct.
Try to complete the invoice.
Check that below error is shown:

"Any of the tax rates in the document does not match the Cash VAT configured at the header."

This is correct as an invoice can not mix cash vat rates and non cash vat rates, except 0 tax rates and withholding.

Change last tax rate "Entregas IVA 21%" to "Entregas Bienes Inversión 21% IVA de Caja".
Check that Cash VAT check in the header is set to "Yes" which is correct.
Verify that the invoice can be completed successfully.


Scenario 2 - Fist tax rate a 0 VAT rate in a non Cash VAT invoice, together with Cash VAT rates and withholding and after that a non Cash VAT rate.

Go to Sales Invoice window and create a new one for F&B España, Alimentos y Supermercados business partner.
Save it.
Verify Cash VAT check in the header is set as "No".
Go to lines. Select any product, ie: Cerveza Ale 0.5L
Check that "Entregas IVA 21%" tax rate is seleted which is OK.
Change tax rate to "Entregas no sujetas con decho deducción".
Check that Cash VAT check in the header remains as "NO", this is correct.

Create another line and select a new product, for instance "Vino Tinto 0.75L" check that "Entregas IVA 21%" is selected, this is OK.
Change this tax to "Entregas IVA 10% IVA de Caja", that is a cash tax rate.
Check that Cash VAT check in the header changes to "Yes" which is correct.

Check that the invoice can be completed successfully.

Scenario 3 - Fist tax rate a 0 VAT rate in a Cash VAT invoice, together with Cash VAT rates and withholding and after that a non Cash VAT rate.

Go to Sales Invoice window and create a new one for F&B España, Alimentos y Supermercados business partner.
Save it.
Check Cash VAT check in the header to "Yes".
Go to lines. Select any product, ie: Cerveza Ale 0.5L
Check that "Entregas IVA 21% IVA de caja" tax rate is seleted which is OK.
Change tax rate to "Entregas no sujetas con decho deducción".
Check that Cash VAT check in the header remains as "Yes", this is correct.

Create another line and select a new product, for instance "Vino Tinto 0.75L" check that "Entregas IVA 21% IVA de Caja" is selected, this is OK.
Change this tax to "Servicios prestados nacional 21% -19%R IVA de Caja", that is a cash tax rate, including a withholding tax rate.
Check that Cash VAT check in the header remains as "Yes" which is correct.

Check that the invoice can be completed successfully.

Scenario 4 - Different BP country than Organization country.

Configure F&B España as Cash VAT org.
Create a vendor and a customer located abroad, for instance France.

Go to Sales Invoice window and create a new one, check that "Cash VAT" check in the header is set as "yes", that is OK.

Select the customer located in France. Save.

Check that Cash VAT check in the header changes to NO. That is OK.

Repeat same test as above for:

- Sales order (POS Order)
- Purchase order
- Purchase Invoice

Repeat same test for tax rates set as summary (rate = 0) that at least one children tax rate is set as "Cash VAT" = Yes. Check that Cash VAT check in the header changes and remains as Yes, after selecting this tax rate in the line.

Repeat same test for BOM taxes as described below:

Scenario 5:

Create a tax category named "BOM Tax Category", set up as "As per BOM".
Create a tax rate related to that tax category, named "BOM Tax Rate" with below setup:
- Summary = yes
- rate = 0
- Cash VAT = Yes
Do not include any children tax rate as there is no need for it.

Create a BOM product related to BOM Tax Category. This BOM product has two products one of them relate to a "IVA Normal" tax category (Product A, BOM Quantity = 1, BOM Price = 100.00) and the other one related to an "Exempt" tax category (Product B, BOM Quantity = 1, BOM Price = 100.00).
Relate BOM Product to a sales price with a unit/list Price = 200.00

Set F&B España as Cash VAT org.

Create a Sales Invoice and verify that "Cash VAT" check is Yes.
Go to lines and select BOM product, 1 unit, line net amount = 200.00.
Save.
Check that "Cash VAT" check remains as Yes. This is correct.
Check there are two lines in tax tab, one of them related to a cash VAT tax rate (Product A, taxable amount = 100.00, Tax amount = 21.00), and the other one related to an exempt VAT rate (Product B, taxable amount = 100.00, Tax Amount = 0.00).
 
Complete the invoice and verify it can be completed without any problem.

Scenario 6

Go to F&B España and set it as Cash VAT org.
Verify that summary "BOM Tax Rate" related to "BOM Tax Category" has a rate = 0
Save and check it as summary.

Go to sales invoice and create a new one. Verify that "Cash VAT" check is = Yes.
Go to lines and select the "BOM product", 1 unit. Check that BOM tax rate is selected, which is OK.
Save.

Go to "Tax" tab and verify that there are two lines, one of them related to a cash VAT tax rate (Product A, taxable amount = 100.00, Tax amount = 21.00), and the other one related to an exempt VAT rate (Product B, taxable amount = 100.00, Tax Amount = 0.00).
 
Complete and save.

Scenario 7

Repeat scenario 6 above but changing summary BOM Tax rate to 1.
Enter additional lines in the sales invoice, by selecting an exempt tax rate and a withholding tax rate, together with BOM Tax rate. Complete and post the invoice.
Same results are obtained.The invoice can be completed without any problem.

Repeat scenarios above for sales order, purchase order and purchase invoice.

In the case of scenario 6 and 7 above, make sure that:
1) vendor selected is mark as Cash VAT, if organization is not set as Cash VAT org
2) vendor selected is not marked as Cash VAT, if organization is set as Cash VAT org (Double cash criteria) check.

Verify all scenarios in end-customer environment.

(0085402)
vmromanos   
2016-04-04 09:57   
Set as minor, since the flag can be manually changed before booking the document as an easy workaround
(0085487)
psanjuan   
2016-04-07 12:59   
Change to major as this is not a minor bug, that caused confusion.
(0085572)
psanjuan   
2016-04-11 15:37   
Test plan above verified.

Running test plan above (together with specific customer scenarios) in customer environment.
(0085664)
psanjuan   
2016-04-15 12:36   
(edited on: 2016-04-15 12:42)
Test in customer environment OK (also tested automatic process such as: Create Lines From (Invoice - create lines from - Order) & Generar Factura; by using products having summary tax rate and "As per BOM" tax category, together with exempt rates (set as Traslado IVA = No).

Also tested quotation and POS Order, invoices automatically created OK (set as Traslado de IVA = Yes).

(0085672)
hgbot   
2016-04-15 14:50   
Repository: erp/devel/pi
Changeset: 714ea45ce839a94bc28270fb15b0bfff1b1b0f00
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Fri Apr 08 14:51:17 2016 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/714ea45ce839a94bc28270fb15b0bfff1b1b0f00 [^]

Fixes Issue 32549:Cash VAT field of document header is updated to 'N'
when you insert a tax rate of 0

Added condition prior to update the order cash flag vat, to check
whether tax is non withholding tax and non zero tax.

Code is now shifted to C_OrderTax and C_InvoiceTax Triggers instead
of C_OrderLine and C_InvoiceLine Triggers.

---
M src-db/database/model/triggers/C_INVOICELINE_TRG.xml
M src-db/database/model/triggers/C_INVOICETAX_TRG.xml
M src-db/database/model/triggers/C_ORDERLINE_TRG.xml
M src-db/database/model/triggers/C_ORDERTAX_TRG.xml
---
(0085676)
aferraz   
2016-04-15 15:01   
Code review OK
(0087452)
hudsonbot   
2016-06-17 19:36   
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/0dc7be081b1c [^]
Maturity status: Test