Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0024615Openbravo ERP09. Financial managementpublic2013-08-28 13:462014-01-17 15:49
psanjuan 
vmromanos 
urgentmajoralways
closedfixed 
20Ubuntu 8.04.1
 
3.0MP303.0MP30 
pramakrishnan
Core
No
0024615: Openbravo 3 needs to allow Cash VAT management
Openbravo 3 needs to allow Cash VAT management
n/a
(1) There should be a new check-box created at "Tax Rate" level named "Cash VAT rate" (Tipo de IVA de Caja). This implies that:
* there will be VAT tax rates set as "Cash VAT rate" and the very same ones do not set as "Cash VAT rate". In other words, this implies to duplicate the VAT rates included in the Spanish Taxes dataset. Therefore the corresponding one can be used whether Cash VAT applies or not.
See issue related.

(2) There should be a new check-box at "Invoice" level named "Cash VAT Invoice" ("Factura con IVA de Caja"), in both "Purchase Invoice" and "Sales Invoice" window, that applies to purchase/sales invoices of any type (AP Invoice, AP Credit Note, Reversed Purchase Invoice, AR Invoice, AR Credit Memo...etc). This check-box needs to be selected or not prior to "Post" the Invoice to the Ledger.

* if selected:

** only VAT rates set as "Cash VAT Rate" will be available for "automatic" or "manual" selection, either in the case of purchase invoices or in the case of sales invoices of any type (AP Invoice, AP Credit Note, AR Invoice...etc)

** the Purchase VAT of each received invoice can be collected from the AEAT (and therefore included in the VAT forms) only if it has been paid.
In other words only if the Purchase Invoice is paid (totally or partially paid), and for the VAT amount actually paid.

** the Sales VAT of each issued invoice can be paid to the AEAT (and therefore included in the VAT reports) only if it has been collected.
In other words only if the Sales Invoice is paid (totally or partially paid), and for the VAT amount actually collected.
Besides, Issued sales invoices must specify the text "Régimen especial del criterio de caja" if printed or sent by email.


* if not selected (current behavior applies):

** only VAT rates DO NOT set as "Cash VAT Rate" will be available for "automatic" or "manual" selection.

** the Purchase VAT of each received invoice can be collected from the AEAT (and therefore included in the corresponding VAT form), at the time of posting the purchase invoice to the ledger, and for the total purchase VAT included in the purchase invoice.
It is also required to take into account the purchase VAT deductible and not deductible as only the deductible one (IVA deducible) can be collected from the AEAT and therefore included in the corresponding VAT form.

** the Sales VAT of each issued invoice can be paid to the AEAT (and therefore included in the corresponding VAT form), at the time of posting the sales invoice to the ledger, and for the total sales VAT included in the sales invoice.

(3) It is important to manage for those Invoices set as "Cash VAT Invoice":

* if the invoice is paid, not paid or partially paid.
* the invoice amount actually paid
* the purchase/sales VAT actually paid
* and the effective date of the invoice payment and therefore of the VAT payment. For instance: in the case of Remittances for Discount that date has to be the Due Date of each invoice and not the Discount Date, in the case of "Domiciliaciones" that date is "Fecha Valor", etc...). To be research.

(4) Tax payment feature needs to manage Cash VAT:

* if an Invoice is under this regimen only the Sales VAT collected can be included same as the Purchase VAT paid, within the corresponding period for which the tax payment feature is launched.

Additional research on:
- Impagos (el 31 de Diciembre del año posterior deben liquidarse todo los importes de IVA independientemente del cobro/pago de las facturas)
No tags attached.
related to feature request 0024614 closed vmromanos Localization Pack: Spain Several SPLP features need to be adjusted to manage Cash VAT 
related to defect 00256383.0PR14Q3 closed vmromanos Openbravo ERP Cash VAT: Withholding and tax exempt (rate=0%) support 
Issue History
2013-08-28 13:46psanjuanNew Issue
2013-08-28 13:46psanjuanAssigned To => dmiguelez
2013-08-28 13:46psanjuanModules => Core
2013-08-28 13:46psanjuanTriggers an Emergency Pack => No
2013-08-28 13:48psanjuanProposed Solution updated
2013-08-28 14:10psanjuanProposed Solution updated
2013-08-28 14:11psanjuanProposed Solution updated
2013-09-03 12:39psanjuanProposed Solution updated
2013-09-03 12:39psanjuanRelationship addedrelated to 0024614
2013-09-03 12:43psanjuanProposed Solution updated
2013-09-03 12:50psanjuanProposed Solution updated
2013-09-03 13:08psanjuanProposed Solution updated
2013-09-03 13:13psanjuanProposed Solution updated
2013-09-03 13:46psanjuanProposed Solution updated
2013-11-28 08:01mmarquezIssue Monitored: mmarquez
2013-11-28 16:03vmromanosStatusnew => scheduled
2013-11-28 16:03vmromanosAssigned Todmiguelez => vmromanos
2013-11-28 16:03vmromanosfix_in_branch => pi
2013-12-04 11:07hgbotCheckin
2013-12-04 11:07hgbotNote Added: 0062503
2013-12-04 11:07hgbotStatusscheduled => resolved
2013-12-04 11:07hgbotResolutionopen => fixed
2013-12-04 11:07hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d35376bf34451805ab160e90f846fdc785398658 [^]
2013-12-04 11:07hgbotCheckin
2013-12-04 11:07hgbotNote Added: 0062504
2013-12-09 11:15hgbotCheckin
2013-12-09 11:15hgbotNote Added: 0062662
2013-12-09 11:48hgbotCheckin
2013-12-09 11:48hgbotNote Added: 0062663
2013-12-09 12:04hgbotCheckin
2013-12-09 12:04hgbotNote Added: 0062664
2013-12-09 15:19vmromanosNote Added: 0062669
2013-12-09 15:19vmromanosStatusresolved => new
2013-12-09 15:19vmromanosResolutionfixed => open
2013-12-09 15:19vmromanosTarget Version => 3.0MP30
2013-12-09 15:19vmromanosfix_in_branchpi =>
2013-12-09 15:19vmromanosStatusnew => scheduled
2013-12-09 15:19vmromanosfix_in_branch => pi
2013-12-09 15:20vmromanosNote Added: 0062670
2013-12-09 15:20vmromanosStatusscheduled => resolved
2013-12-09 15:20vmromanosFixed in Version => 3.0MP30
2013-12-09 15:20vmromanosResolutionopen => fixed
2013-12-09 15:21vmromanosReview Assigned To => pramakrishnan
2013-12-09 15:21vmromanosStatusresolved => closed
2013-12-10 12:54hgbotCheckin
2013-12-10 12:54hgbotNote Added: 0062687
2013-12-19 12:30hudsonbotCheckin
2013-12-19 12:30hudsonbotNote Added: 0062819
2013-12-19 12:30hudsonbotCheckin
2013-12-19 12:30hudsonbotNote Added: 0062820
2013-12-19 12:30hudsonbotCheckin
2013-12-19 12:30hudsonbotNote Added: 0062834
2013-12-19 12:30hudsonbotCheckin
2013-12-19 12:30hudsonbotNote Added: 0062835
2013-12-19 12:30hudsonbotCheckin
2013-12-19 12:30hudsonbotNote Added: 0062842
2013-12-31 15:33hgbotCheckin
2013-12-31 15:33hgbotNote Added: 0063151
2014-01-02 17:14hudsonbotCheckin
2014-01-02 17:14hudsonbotNote Added: 0063208
2014-01-07 11:38hgbotCheckin
2014-01-07 11:38hgbotNote Added: 0063233
2014-01-17 15:49hudsonbotCheckin
2014-01-17 15:49hudsonbotNote Added: 0063474
2014-02-03 12:13vmromanosRelationship addedrelated to 0025638

Notes
(0062503)
hgbot   
2013-12-04 11:07   
Repository: erp/devel/pi
Changeset: d35376bf34451805ab160e90f846fdc785398658
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Thu Nov 28 11:24:57 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d35376bf34451805ab160e90f846fdc785398658 [^]

[cashvat] Fixed issue 24615: Cash VAT Management

Any legal entity can define whether it is subscribed to the Cash VAT management. By default organizations
are not subscribed to Cash VAT. To subscribe it, go to Organization | Information and set the Cash VAT flag to Yes.
Since that moment, the Sales flows (orders and invoices) will work with Cash VAT

Vendors can be subscribed to Cash VAT. This can be configured in the ERP at Business Partner | Vendor tab. Note that
each vendor registered into the system may be subscribed to Cash VAT or not.
For Purchase flows (orders and invoices), the system will detect whether the vendor is subscribed to Cash VAT and, in
this case, it will activate the Cash VAT support.

Both Sales and Purchase flows (orders and invoices) can override the Cash VAT configuration defined at the Organization and
Business Partner respectively by setting/unsetting the Cash VAT flag at the document header.

The C_GetTax function now accepts a new optional parameter to override the Cash VAT configuration defined at the Organization
or the Business Partner. This allows to properly purpose the right tax when entering order/invoice lines.


Created new tab Cash VAT under Sales/Purchase Invoice | Tax. It manages the tax amount that has been
paid for the invoice. It takes the percentage of the invoice that has been paid in a payment and it
calculates the correspondent tax amount and taxable amount for each tax included into the invoice.



Two new transitory tax accounts have been created to manage the Cash VAT. When an invoice is not yet paid/collected, the tax
amount is accounted to these transitory accounts. Once we pay/receive a payment, the correspondent amount is moved from the
transitory tax account to the final one. The Invoice, Payment, Transaction and Reconciliation accounting engines have been
modified to support the Cash VAT flows.

When an invoice has been paid from an order (prepayment), the accounting will use the final tax accounts instead of the transitory ones.

The COA importer now supports the new two transitory tax account defaults: T_CREDIT_TRANS_ACCT and T_DUE_TRANS_ACCT


The invoice's JRXML now prints a "Cash VAT Invoice" (at the footer) to fulfill the law

---
M modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
M src-db/database/model/functions/C_GETTAX.xml
M src-db/database/model/functions/C_INVOICE_POST.xml
M src-db/database/model/functions/C_ORDER_POST1.xml
M src-db/database/model/tables/AD_ORGINFO.xml
M src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml
M src-db/database/model/tables/C_BPARTNER.xml
M src-db/database/model/tables/C_INVOICE.xml
M src-db/database/model/tables/C_ORDER.xml
M src-db/database/model/tables/C_TAX.xml
M src-db/database/model/tables/C_TAX_ACCT.xml
M src-db/database/model/triggers/C_INVOICELINE_TRG.xml
M src-db/database/model/triggers/C_TAX_TRG.xml
M src-db/database/sourcedata/AD_AUXILIARINPUT.xml
M src-db/database/sourcedata/AD_CALLOUT.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_MODEL_OBJECT.xml
M src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
M src-db/database/sourcedata/AD_TAB.xml
M src-db/database/sourcedata/AD_TABLE.xml
M src-db/database/sourcedata/AD_TEXTINTERFACES.xml
M src/org/openbravo/erpCommon/ad_callouts/SE_Invoice_BPartner.java
M src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Tax_data.xsql
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Product.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Tax_data.xsql
M src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java
M src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java
M src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java
M src/org/openbravo/erpCommon/ad_forms/DocInvoice.java
M src/org/openbravo/erpCommon/ad_forms/DocInvoice_data.xsql
M src/org/openbravo/erpCommon/ad_forms/DocLine_FINFinAccTransaction.java
M src/org/openbravo/erpCommon/ad_forms/DocLine_FINPayment.java
M src/org/openbravo/erpCommon/ad_forms/DocLine_FINReconciliation.java
M src/org/openbravo/erpCommon/ad_forms/DocTax.java
M src/org/openbravo/erpCommon/ad_forms/DocTax_data.xsql
M src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java
M src/org/openbravo/erpCommon/businessUtility/Tax.java
M src/org/openbravo/erpCommon/businessUtility/Tax_data.xsql
M src/org/openbravo/erpReports/RptC_Invoice_new.jrxml
A src-db/database/model/tables/C_INVOICETAX_CASHVAT.xml
A src-db/database/model/views/C_INVOICETAX_CASHVAT_V.xml
A src/org/openbravo/erpCommon/ad_callouts/SE_Invoice_Organization.java
A src/org/openbravo/erpCommon/ad_callouts/SE_Order_Organization.java
A src/org/openbravo/erpCommon/ad_callouts/SE_Organization_NotTaxDeductable.java
A src/org/openbravo/erpCommon/ad_callouts/SE_TaxRate_Withholding.java
A src/org/openbravo/erpCommon/ad_forms/DocLineCashVATReady_PaymentTransactionReconciliation.java
A src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0062504)
hgbot   
2013-12-04 11:07   
Repository: erp/devel/pi
Changeset: f858eb0d6a4e220e875e03817b67012ec9d01d82
Author: Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> openbravo.com>
Date: Wed Dec 04 11:23:46 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/f858eb0d6a4e220e875e03817b67012ec9d01d82 [^]

Related to Issue 24615: Openbravo 3 needs to allow Cash VAT management

---
M src-db/database/model/triggers/C_INVOICELINE_TRG.xml
M src-db/database/sourcedata/AD_TAB.xml
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0062662)
hgbot   
2013-12-09 11:15   
Repository: erp/devel/pi
Changeset: 2760a9dce9d4c8e68b1370ee073778106043d8ec
Author: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
Date: Mon Dec 09 15:45:03 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/2760a9dce9d4c8e68b1370ee073778106043d8ec [^]

Related to Issue 24615

---
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0062663)
hgbot   
2013-12-09 11:48   
Repository: erp/devel/pi
Changeset: 86fc73b1414cfc187acec6a431b9abc0279c56c8
Author: Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> openbravo.com>
Date: Mon Dec 09 16:17:44 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/86fc73b1414cfc187acec6a431b9abc0279c56c8 [^]

Related to Issue 24615

---
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0062664)
hgbot   
2013-12-09 12:04   
Repository: erp/devel/api-checks
Changeset: 5f21f98bdbde59e476d430f0491540f17669c208
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Mon Dec 09 12:04:12 2013 +0100
URL: http://code.openbravo.com/erp/devel/api-checks/rev/5f21f98bdbde59e476d430f0491540f17669c208 [^]

Issue 24615: false API change

---
M model/src-db/database/model/functions/C_GETTAX.xml
M model/src-db/database/model/tables/AD_ORGINFO.xml
M model/src-db/database/model/tables/C_ACCTSCHEMA_DEFAULT.xml
M model/src-db/database/model/tables/C_TAX.xml
---
(0062669)
vmromanos   
2013-12-09 15:19   
Reopened to update target version to 3.0MP30
(0062670)
vmromanos   
2013-12-09 15:20   
Code review and testing done by Pandeeswari and Eduardo
(0062687)
hgbot   
2013-12-10 12:54   
Repository: erp/devel/pi
Changeset: 32ca39665f062ec6ac43f44af59154dbd3bd7b45
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Tue Dec 10 12:52:34 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/32ca39665f062ec6ac43f44af59154dbd3bd7b45 [^]

Related to issue 24615: code review
Added index to C_INVOICETAX_CASHVAT table
Use OBContext.setAdminMode(true);
Added flush() to avoid problems with adminMode
Removed unused javadoc params

---
M src-db/database/model/tables/C_INVOICETAX_CASHVAT.xml
M src/org/openbravo/erpCommon/ad_forms/DocLineCashVATReady_PaymentTransactionReconciliation.java
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0062819)
hudsonbot   
2013-12-19 12:30   
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/b878bb51dc09 [^]

Maturity status: Test
(0062820)
hudsonbot   
2013-12-19 12:30   
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/b878bb51dc09 [^]

Maturity status: Test
(0062834)
hudsonbot   
2013-12-19 12:30   
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/b878bb51dc09 [^]

Maturity status: Test
(0062835)
hudsonbot   
2013-12-19 12:30   
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/b878bb51dc09 [^]

Maturity status: Test
(0062842)
hudsonbot   
2013-12-19 12:30   
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/b878bb51dc09 [^]

Maturity status: Test
(0063151)
hgbot   
2013-12-31 15:33   
Repository: erp/devel/pi
Changeset: 9fe57239e6a9b53d6112bd8cb822b92203e9063d
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Fri Dec 27 14:31:41 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/9fe57239e6a9b53d6112bd8cb822b92203e9063d [^]

Related to issue 24615: cash vat UI moved to external module

---
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_TAB.xml
---
(0063208)
hudsonbot   
2014-01-02 17:14   
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/d2a6126e04e6 [^]

Maturity status: Test
(0063233)
hgbot   
2014-01-07 11:38   
Repository: erp/devel/pi
Changeset: f1ef6704c5a0236a56198a42a28586710190c9cd
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Tue Jan 07 11:07:33 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/f1ef6704c5a0236a56198a42a28586710190c9cd [^]

Related to issue 24615: implemented double cash criteria

For purchase flows the cash vat can be defined by the business partner (vendor) OR the organization.
If both the Cash VAT and the Double Cash Criteria flags are set to Yes, the Cash VAT regime will be automatically applied for the purchase flow too.

The sales flows only depend on the Organization's Cash VAT flag.

---
M src-db/database/model/functions/C_GETTAX.xml
M src-db/database/model/tables/AD_ORGINFO.xml
M src-db/database/model/triggers/C_INVOICELINE_TRG.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src/org/openbravo/erpCommon/ad_callouts/SE_Invoice_BPartner.java
M src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0063474)
hudsonbot   
2014-01-17 15:49   
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/9669102eb541 [^]
Maturity status: Test