Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031184Openbravo ERP09. Financial managementpublic2015-10-20 12:132015-11-23 21:17
ngarcia 
vmromanos 
urgentmajoralways
closedfixed 
5
 
 
dmiguelez
Core
No
0031184: Cannot process a POS Order if it has a summary level tax rate with rate = 0 set as Cash VAT
Cannot process a POS Order if it has a summary level tax rate with rate = 0 set as Cash VAT. The problem is that the cash vat checkbox of the document header (both order and invoice) is not updated when inserting a Cash VAT on its lines, as it's rate is 0 (because it's a summary level tax rate)
As group admin role:
   Create a new Tax Rate, set is as Cash VAT and Summary Level (the tax rate will be 0, although it is hidden)
   Create a new Tax Rate, set it as Cash VAT, Tax Rate different from 0 and Parent Tax Rate the previously created tax rate
   Create a Standard Sales Order
   Don't set it as Cash VAT
   Add a line and select the already created summary level tax rate
   Try to book it and check the following error message is shown:
      "Any of the tax rates in the document doesn't match the Cash VAT configured at the header"
   Select the Cash VAT checkbox in the header and check you could book it
   Repeat the process for a POS Order
   Check it is not possible to book it
No tags attached.
causes defect 0032549 closed AtulOpenbravo Cash VAT field of document header is updated to 'N' when you insert a tax rate of 0 
Issue History
2015-10-20 12:13ngarciaNew Issue
2015-10-20 12:13ngarciaAssigned To => Triage Finance
2015-10-20 12:13ngarciaModules => Core
2015-10-20 12:13ngarciaResolution time => 1445292000
2015-10-20 12:13ngarciaTriggers an Emergency Pack => No
2015-10-20 12:15ngarciaIssue Monitored: networkb
2015-10-20 12:18ngarciaResolution time1445292000 => 1448060400
2015-11-19 17:41vmromanosStatusnew => scheduled
2015-11-19 17:41vmromanosAssigned ToTriage Finance => vmromanos
2015-11-20 09:15vmromanosNote Added: 0082006
2015-11-20 13:46psanjuanNote Edited: 0082006bug_revision_view_page.php?bugnote_id=0082006#r10321
2015-11-20 13:48psanjuanNote Added: 0082026
2015-11-23 13:07hgbotCheckin
2015-11-23 13:07hgbotNote Added: 0082083
2015-11-23 13:07hgbotStatusscheduled => resolved
2015-11-23 13:07hgbotResolutionopen => fixed
2015-11-23 13:07hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/77f1cb4dd278c84913938db669a62c4c52796486 [^]
2015-11-23 13:07dmiguelezReview Assigned To => dmiguelez
2015-11-23 13:07dmiguelezNote Added: 0082084
2015-11-23 13:07dmiguelezStatusresolved => closed
2015-11-23 21:17hudsonbotCheckin
2015-11-23 21:17hudsonbotNote Added: 0082267
2016-03-29 15:16ngarciaRelationship addedcauses 0032549

Notes
(0082006)
vmromanos   
2015-11-20 09:15   
(edited on: 2015-11-20 13:46)
Previous configuration:
 Install Cash VAT module
 (Optional) Install Spanish Cash VAT Tax Rates module
 Create a new Tax Rate, called cvat0, set is as Cash VAT and Summary Level (the tax rate will be 0, although it is hidden)
 Create a new Tax Rate, set it as Cash VAT, Tax Rate different from 0 and Parent Tax Rate the previously created tax rate cvat0
Set those Tax Rates as Type = Both.

Test plan I:
 Create a Standard Sales Order
 Don't set it as Cash VAT
 Add a line and select the cvat0 tax rate. Save it
 Verify the Cash VAT at header is automatically set to Yes
 Book it. Verify process is completed successfully

Test plan II:
 Create a Purchase Order
 Don't set it as Cash VAT
 Add a line and select the cvat0 tax rate. Save it
 Verify the Cash VAT at header is automatically set to Yes
 Book it. Verify process is completed successfully

Test plan III:
 Go to Sales Order window
 Create a POS Order
 Don't set it as Cash VAT
 Add a line for Cerveza Lager 0,5L and select the cvat0 tax rate. Save it
 Verify the Cash VAT at header is automatically set to Yes
 Book it. Verify process is completed successfully

Test plan IV:
 Create a Sales Invoice
 Don't set it as Cash VAT
 Add a line and select the cvat0 tax rate. Save it
 Verify the Cash VAT at header is automatically set to Yes
 Book it. Verify process is completed successfully

Test plan V:
 Create a Purchase Invoice
 Don't set it as Cash VAT
 Add a line and select the cvat0 tax rate. Save it
 Verify the Cash VAT at header is automatically set to Yes
 Book it. Verify process is completed successfully

Test plan VI:
 Create a Purchase Order
 Set it as Cash VAT
 Add a line and select any NON-Cash Vat tax rate. Save it
 Verify the Cash VAT at header is automatically set to No
 Book it. Verify process is completed successfully

Test plan VII:
 Create a Sales Order
 Set it as Cash VAT
 Add a line and select any NON-Cash Vat tax rate. Save it
 Verify the Cash VAT at header is automatically set to No
 Book it. Verify process is completed successfully

Test plan VIII:
 Create a Purchase Invoice
 Set it as Cash VAT
 Add a line and select any NON-Cash Vat tax rate. Save it
 Verify the Cash VAT at header is automatically set to No
 Book it. Verify process is completed successfully

Test plan IX:
 Create a Sales Invoice
 Set it as Cash VAT
 Add a line and select any NON-Cash Vat tax rate. Save it
 Verify the Cash VAT at header is automatically set to No
 Book it. Verify process is completed successfully

Test plan X:
 Create a Purchase Order
 Don't set it as Cash VAT
 Add a line and select any NON-Cash Vat tax rate. Save it
 Verify the Cash VAT at header continues to be No
 Book it. Verify process is completed successfully

Test plan XI:
 Create a Sales Order
 Don't set it as Cash VAT
 Add a line and select any NON-Cash Vat tax rate. Save it
 Verify the Cash VAT at header continues to be No
 Book it. Verify process is completed successfully

Test plan XII:
 Create a Purchase Invoice
 Don't set it as Cash VAT
 Add a line and select any NON-Cash Vat tax rate. Save it
 Verify the Cash VAT at header continues to be No
 Book it. Verify process is completed successfully

Test plan XIII:
 Create a Sales Invoice
 Don't set it as Cash VAT
 Add a line and select any NON-Cash Vat tax rate. Save it
 Verify the Cash VAT at header continues to be No
 Book it. Verify process is completed successfully

Test plan XIV:
 Create a new Tax Rate, called cvat21, set is as Cash VAT and summary level = N
 Create a Purchase Invoice
 Don't set it as Cash VAT
 Add a line and select the cvat21 tax rate. Save it
 Verify the Cash VAT at header is automatically set to Yes
 Book it. Verify process is completed successfully

(0082026)
psanjuan   
2015-11-20 13:48   
Issue Verified.

Test Plan above verified.

Repeat same steps for two tax rates (summary-child) set as purchase and sales tax type.
(0082083)
hgbot   
2015-11-23 13:07   
Repository: erp/devel/pi
Changeset: 77f1cb4dd278c84913938db669a62c4c52796486
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Fri Nov 20 10:33:03 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/77f1cb4dd278c84913938db669a62c4c52796486 [^]

Fixed bug 31184: Changed in order/invoice triggers to calculate Cash VAT flag

The way to calculate cash vat flag in document header was not accurate, and it failed when there was a summary level cash vat tax rate for 0%.

Now to know whether the introduced tax rate is really a cash vat tax rate (and thus to update the cash vat flag at header document accordingly), we check if exists any tax rate in the tax rate tree (or the tax rate itself if not a summary level) which is cash vat = Y and with a rate <> 0. In this case the cash vat flag at header will be automatically updated to Y, otherwise to N.
This change is done for Order and Invoice lines.

---
M src-db/database/model/triggers/C_INVOICELINE_TRG.xml
M src-db/database/model/triggers/C_ORDERLINE_TRG.xml
---
(0082084)
dmiguelez   
2015-11-23 13:07   
Code Review + Testing Ok
(0082267)
hudsonbot   
2015-11-23 21:17   
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/7b56bebaaa88 [^]
Maturity status: Test