Openbravo Issue Tracking System - Localization Pack: Spain
View Issue Details
0032388Localization Pack: SpainMulti Dimensional Tax Report Cash VATpublic2016-03-02 13:242016-05-06 15:32
maite 
aferraz 
urgentmajoralways
closedfixed 
5
 
 
vmromanos
40887
OBPS
0032388: Wrong Settlement Date when invoice date is in 2014 (so manual settlement is in 2015) and payment date in 2016
Wrong Settlement Date when invoice date is in 2014 (so manual settlement is in 2015) and payment date in 2016
1. Register Sales Invoice set as "Cash vat" and with date in 2014. Add any line. Process and post invoice
2. According with the law, vat settlement for this invoice should be done at the end of 2015 (http://wiki.openbravo.com/wiki/Cash_VAT_Management/User_Documentation_Spanish#Liquidaci.C3.B3n_manual_del_IVA_de_Caja [^])
3. Register Payment In for this invoice with payment date in 2016. Process payment
4. Run Multidimensional Tax Report Cash VAT for 2016 year and realize that invoice appears with Settlement Date in 2016 when should be in 2015
No tags attached.
png Issue_32388.png (119,784) 2016-03-02 15:40
https://issues.openbravo.com/file_download.php?file_id=9125&type=bug
png
Issue History
2016-03-02 13:24maiteNew Issue
2016-03-02 13:24maiteSupport ticket => 40887
2016-03-02 13:24maiteOBNetwork customer => Yes
2016-03-02 13:25maiteResolution time => 1459634400
2016-03-02 13:25maiteIssue Monitored: networkb
2016-03-02 15:21psanjuanNote Added: 0084659
2016-03-02 15:24psanjuanNote Edited: 0084659bug_revision_view_page.php?bugnote_id=0084659#r11311
2016-03-02 15:35psanjuanNote Edited: 0084659bug_revision_view_page.php?bugnote_id=0084659#r11312
2016-03-02 15:39psanjuanNote Edited: 0084659bug_revision_view_page.php?bugnote_id=0084659#r11313
2016-03-02 15:40psanjuanNote Edited: 0084659bug_revision_view_page.php?bugnote_id=0084659#r11314
2016-03-02 15:40psanjuanFile Added: Issue_32388.png
2016-03-02 15:42psanjuanNote Edited: 0084659bug_revision_view_page.php?bugnote_id=0084659#r11315
2016-03-03 11:26psanjuanNote Edited: 0084659bug_revision_view_page.php?bugnote_id=0084659#r11337
2016-03-03 11:26psanjuanNote Edited: 0084659bug_revision_view_page.php?bugnote_id=0084659#r11338
2016-03-03 11:46psanjuanNote Edited: 0084659bug_revision_view_page.php?bugnote_id=0084659#r11339
2016-04-21 18:35dmitry_mezentsevAssigned To => Triage Finance
2016-04-21 18:57aferrazAssigned ToTriage Finance => AtulOpenbravo
2016-04-25 07:58AtulOpenbravoStatusnew => scheduled
2016-04-25 14:48aferrazAssigned ToAtulOpenbravo => aferraz
2016-05-06 13:43psanjuanNote Added: 0086270
2016-05-06 13:53psanjuanNote Edited: 0086270bug_revision_view_page.php?bugnote_id=0086270#r12001
2016-05-06 14:15psanjuanNote Edited: 0086270bug_revision_view_page.php?bugnote_id=0086270#r12002
2016-05-06 14:22psanjuanNote Edited: 0086270bug_revision_view_page.php?bugnote_id=0086270#r12003
2016-05-06 14:34psanjuanNote Edited: 0086270bug_revision_view_page.php?bugnote_id=0086270#r12004
2016-05-06 14:40psanjuanNote Edited: 0086270bug_revision_view_page.php?bugnote_id=0086270#r12005
2016-05-06 14:49psanjuanNote Edited: 0086270bug_revision_view_page.php?bugnote_id=0086270#r12006
2016-05-06 14:50psanjuanNote Edited: 0086270bug_revision_view_page.php?bugnote_id=0086270#r12007
2016-05-06 14:54psanjuanNote Edited: 0086270bug_revision_view_page.php?bugnote_id=0086270#r12008
2016-05-06 14:59psanjuanNote Edited: 0086270bug_revision_view_page.php?bugnote_id=0086270#r12013
2016-05-06 15:15psanjuanNote Added: 0086271
2016-05-06 15:26hgbotCheckin
2016-05-06 15:26hgbotNote Added: 0086272
2016-05-06 15:26hgbotStatusscheduled => resolved
2016-05-06 15:26hgbotResolutionopen => fixed
2016-05-06 15:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.module.invoiceTaxReportEnhanced30.cashvat/rev/c332bbd2aa880459577ec58814d763a8e1e413ee [^]
2016-05-06 15:26hgbotCheckin
2016-05-06 15:26hgbotNote Added: 0086273
2016-05-06 15:32aferrazReview Assigned To => vmromanos
2016-05-06 15:32aferrazNote Added: 0086274
2016-05-06 15:32aferrazStatusresolved => closed

Notes
(0084659)
psanjuan   
2016-03-02 15:21   
(edited on: 2016-03-03 11:46)
Scenario 1

Issue a sales invoice set as "Cash VAT" for any BP located in Spain, with below setup:
- Invoice Date = Accounting Date = 20-11-2014
Add any line by making sure that the tax used is for instance: "Entregas IVA 21% IVA de Caja".
Complete and post the invoice.
Add a payment in of half of the invoice amount dated on 20-12-2015 for instace.
Navigate to Tax tab, Cash VAT tab and make sure below data is shown:
Payment Date = 20-12-2015
Percentage = 41.32
Taxable Amount = 12.396
Tax Amount = 2.603.16
Payment = 1000068 - 20-12-2015 - 15000.00€

Go to "Manual Cash Vat Settlement" window and create a new record for the org by entering below data:
Starting Date = 01-01-2014
Ending Date = 31-12-2014
Accounting Date = 31-12-2015

Click on "Pick Lines&Complete".

Check that the sales invoice created is shown in there, showing a 58.68% (remaining %). Select the invoice and click on Complete.
Post it.

Go back to the sales invoice and check there is a new line in Cash VAT setup with below data:
Payment Date = (empty)
Percentage = 58.68
Taxable Amount =17604.00
Tax Amount = 3696.84
Payment = (empty)
Manual Settlement = Yes
Manual Cash VAT Settlement line = 1000333..etc
Manual Cash VAT Settlement Date = 31-12-2015

Add a new payment to the invoice for the rest of the amount dated on 02-03-2016.

Take note of the invoice, in our case it is sales invoice 1000083.

Run Multidimensional Tax Report Cash VAT with below data:

Show details info selected
From Date = 01-01-2014
To Date = 30-03-2016
Organization = select the Organization
Business Partner = select the BP used.
Tax selected
Sales/Receipt transactions selected

Press HTML format.

Search the section related to the tax "Entregas IVA 21% IVA de Caja".

Check that only one line is shown there for invoice 1000083, the one related to the payment in dated on 20-12-2015. See image attached (Issue_32388)

Proposed Solution:

There should be another line with the VAT settled dated on 30-12-2015, with below information:
Name = Entregas IVA 21% IVA de Caja
Rate = 21%
Doc No = 1000083
Doc type = AR Invoice
Doc Date = 20-11-2014
Acc date = 20-11-2014
Settl date = 31-12-2015
Business Partner = Customer Nacional
Tax Base = 30000.00
Tax Amount = 6300.00
Tax Base Sett = 17604.00
Tax Settlem. = 3696.84

Scenario 2

Issue a sales invoice set as "Cash VAT" for any BP located in Spain, with below setup:
- Invoice Date = Accounting Date = 03-03-2014
Add any line by making sure that the tax used is for instance: "Entregas IVA 21% IVA de Caja".
Complete and post the invoice. (i.e Invoice number 1000085)

Go to "Manual Cash Vat Settlement" window and create a new record for the org by entering below data:
Starting Date = 01-01-2014
Ending Date = 31-12-2014
Accounting Date = 31-12-2015

Click on "Pick Lines&Complete".

Check that the sales invoice created is shown in there, showing a 100% pending to be settled. Select the invoice and click on Complete.
Post it.

Go back to the sales invoice and check there is a new line in Cash VAT setup with below data:
Payment Date = (empty)
Percentage = 100
Taxable Amount =11000.00
Tax Amount = 2310.00
Payment = (empty)
Manual Settlement = Yes
Manual Cash VAT Settlement line = 100034..etc
Manual Cash VAT Settlement Date = 31-12-2015

Add a payment to the invoice dated on 03-03-2016.

Run Multidimensional Tax Report Cash VAT with below data:

Show details info selected
From Date = 01-01-2014
To Date = 30-03-2016
Organization = select the Organization
Business Partner = select the BP used.
Tax selected
Sales/Receipt transactions selected

Press HTML format.

Search the section related to the tax "Entregas IVA 21% IVA de Caja".

Check that there is one line shown in there for invoice 1000085 with no info about the VAT Settled dated on 31-12-2015

Proposed Solution:

There should be a line with the VAT settled dated on 30-12-2015, with below information:
Name = Entregas IVA 21% IVA de Caja
Rate = 21%
Doc No = 1000085
Doc type = AR Invoice
Doc Date = 03-03-2014
Acc date = 03-03-2014
Settl date = 31-12-2015
Business Partner = Customer Nacional
Tax Base = 11000.00
Tax Amount = 2310.00
Tax Base Sett = 11000.00
Tax Settlem. = 2310.00

(0086270)
psanjuan   
2016-05-06 13:43   
(edited on: 2016-05-06 14:59)
Test Plan above verified

Additional Test Plan:

Invoice dated on 2014 - do not paid in 2014 - report launched for 2014 = Invoice is shown in the report do not settled.

Invoice dated on 2014 - totally paid in 2014 - report launched for 2014 = Invoice is shown in the report 100% settled dated on 2014 payment date.

Invoice dated on 2014 - totally paid in 2015 - report launched for 2015 = Invoice is shown in the report 100% settled dated on 2015 payment date

Invoice dated on 2014 - do not paid in 2014 + manual settlement in 2015 - report launched for 2015 = Invoice is shown in the report 100% settled dated on Manual Settlement date 30-12-2015

Invoice dated on 2014 - do not paid in 2014 + manual settlement in 2015 (30-12-2015) + payment in 2015 (31-12-2015) - report launched for 2015 = Invoice is shown in the report only once 100% settled dated on Manual Settlement date 30-12-2015

Invoice dated on 2014 - do not paid in 2014 + manual settlement in 2015 + payment in 2016 - report launched for 2015 = Invoice is shown in the report only once 100% settled dated on Manual Settlement date 31-12-2015

Invoice dated on 2014 - do not paid in 2014 + manual settlement in 2015 + payment in 2016 - report launched for 2016 = Invoice is not shown.

Invoice dated on 2014 - partially paid in 2015 + manual settlement in 2015 - report launched for 2015 = Invoice is shown twice, one line showing as settlement date 2015 payment date (30-05-2015) and the tax base and tax settled and the other one showing manual settlement date (31-12-2015) and the tax base and tax settled.

Sales order dated on 2014 prepaid on 2014 (invoice created from the order dated on 2014) + invoice partially paid in 2015 + Manual Cash VAT Settlement in 2015 - launch report for 2015 - Invoice is shown twice one for the 2015 payment and second one for the manual settlement.

Repeat same test as above for corrective invoices.

Repeat same test as above for purchase orders/invoices.

(0086271)
psanjuan   
2016-05-06 15:15   
Test plan above verified.

Issue can be code reviewed and closed.
(0086272)
hgbot   
2016-05-06 15:26   
Repository: erp/pmods/org.openbravo.module.invoiceTaxReportEnhanced30.cashvat
Changeset: c332bbd2aa880459577ec58814d763a8e1e413ee
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu May 05 19:39:20 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.module.invoiceTaxReportEnhanced30.cashvat/rev/c332bbd2aa880459577ec58814d763a8e1e413ee [^]

Fixes issue 32388:Wrong settlement date in Multidimensional Tax Report Cash VAT

Include settlement date in invoices settled by Manual Cash VAT Settlement in getInvoicePayments method and exclude invoices settled by Manual Cash VAT Settlement in getInvoicesWithoutPayments method.

---
M src/org/openbravo/module/invoiceTaxReportEnhanced30/cashvat/ad_reports/OBMTRCVInvoiceTaxReportDao.java
A src-db/database/model/functions/OBMTRCV_GETMANUALSETTLDATE.xml
A src/org/openbravo/module/invoiceTaxReportEnhanced30/cashvat/databaseProcess/OBMTRCVGetSettlementDate.java
---
(0086273)
hgbot   
2016-05-06 15:26   
Repository: erp/pmods/org.openbravo.module.invoiceTaxReportEnhanced30.cashvat
Changeset: 98f08769ca6bed8606c14bb7d4d6944c8b8c73b6
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu May 05 19:39:38 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.module.invoiceTaxReportEnhanced30.cashvat/rev/98f08769ca6bed8606c14bb7d4d6944c8b8c73b6 [^]

Related to issue 32388: Update module version

---
M src-db/database/sourcedata/AD_MODULE.xml
M src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
---
(0086274)
aferraz   
2016-05-06 15:32   
Code review OK done by vmromanos