Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0039969 | Openbravo ERP | 09. Financial management | public | 2019-01-16 19:16 | 2019-03-28 14:56 |
|
Reporter | ngarcia | |
Assigned To | markmm82 | |
Priority | urgent | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR19Q2 | |
Merge Request Status | |
Review Assigned To | Sandrahuguet |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0039969: Process failed during execution when posting a payment/transaction/reconciliation of a Cash VAT invoice with different currency |
Description | Process failed during execution when posting a payment/transaction/reconciliation of a Cash VAT invoice with different currency than the general ledger currency.
In createFactCashVAT of CashVATUtil class, taxAmountConverted could be 0 and in that case factLine1 is null and a NullPointerException is raised when trying to create factLine2 |
Steps To Reproduce | As system admin role:
Install Cash VAT Management module
As group admin role:
Set an Organization as Cash VAT
Set a Tax Rate as Cash VAT
Create a sales price list in MXN
Add a price to a product in it
Define a conversion of 0.04 between MXN and EUR and between MXN and USD
Create a Sales Invoice
Select previously created price list (MXN)
Set it as Cash VAT
Add a line and select previously created tax rate and product
Complete it
Add a payment of 0.06 to it with today's date
Add a new payment with the pending amount and a different date
Check a record with a Tax Amount of 0.01 is shown in 'Sales Invoice - Tax - Cash VAT'
Try to post the payment or the transaction and check the following error is shown:
Process failed during execution
The log shows:
java.lang.NullPointerException
at org.openbravo.erpCommon.utility.CashVATUtil.createFactCashVAT(CashVATUtil.java:563)
at org.openbravo.erpCommon.ad_forms.DocFINReconciliation.createFactPaymentDetails(DocFINReconciliation.java:898)
at org.openbravo.erpCommon.ad_forms.DocFINReconciliation.createFactPayment(DocFINReconciliation.java:704)
at org.openbravo.erpCommon.ad_forms.DocFINReconciliation.createFact(DocFINReconciliation.java:596)
at org.openbravo.erpCommon.ad_forms.AcctServer.postLogic(AcctServer.java:1114) |
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | defect | 0040091 | | scheduled | markmm82 | If converted amount is zero the document should be disabled for accounting. |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2019-01-16 19:16 | ngarcia | New Issue | |
2019-01-16 19:16 | ngarcia | Assigned To | => Triage Finance |
2019-01-16 19:16 | ngarcia | Modules | => Core |
2019-01-16 19:16 | ngarcia | Resolution time | => 1549407600 |
2019-01-16 19:16 | ngarcia | Triggers an Emergency Pack | => No |
2019-01-17 09:39 | dmiguelez | Assigned To | Triage Finance => markmm82 |
2019-01-21 02:40 | markmm82 | Note Added: 0109027 | |
2019-01-21 20:13 | markmm82 | Status | new => scheduled |
2019-01-28 23:58 | markmm82 | Note Added: 0109289 | |
2019-01-29 00:09 | markmm82 | Note Edited: 0109289 | bug_revision_view_page.php?bugnote_id=0109289#r18209 |
2019-01-29 12:04 | Sandrahuguet | Review Assigned To | => Sandrahuguet |
2019-01-31 17:19 | Sandrahuguet | Relationship added | related to 0040091 |
2019-02-05 17:40 | hgbot | Checkin | |
2019-02-05 17:40 | hgbot | Note Added: 0109597 | |
2019-02-05 17:40 | hgbot | Status | scheduled => resolved |
2019-02-05 17:40 | hgbot | Resolution | open => fixed |
2019-02-05 17:40 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/e36d52a51aee7822955668823c7762d590201fe7 [^] |
2019-02-05 17:40 | hgbot | Checkin | |
2019-02-05 17:40 | hgbot | Note Added: 0109598 | |
2019-02-05 17:40 | hgbot | Checkin | |
2019-02-05 17:40 | hgbot | Note Added: 0109599 | |
2019-02-05 17:42 | dmiguelez | Note Added: 0109602 | |
2019-02-05 17:42 | dmiguelez | Status | resolved => closed |
2019-02-05 17:42 | dmiguelez | Fixed in Version | => 3.0PR19Q2 |
2019-02-20 00:10 | markmm82 | Note Edited: 0109027 | bug_revision_view_page.php?bugnote_id=0109027#r18347 |
2019-03-28 14:55 | hudsonbot | Checkin | |
2019-03-28 14:55 | hudsonbot | Note Added: 0110794 | |
2019-03-28 14:55 | hudsonbot | Checkin | |
2019-03-28 14:55 | hudsonbot | Note Added: 0110795 | |
2019-03-28 14:56 | hudsonbot | Checkin | |
2019-03-28 14:56 | hudsonbot | Note Added: 0110796 | |
Notes |
|
(0109027)
|
markmm82
|
2019-01-21 02:40
(edited on: 2019-02-20 00:10) |
|
Test Plan:
As system admin role:
Install Cash VAT Management module
As group admin role:
Set an Organization as Cash VAT
Set a Tax Rate as Cash VAT
Create a sales price list in MXN
Add a price to a product in it
Define a conversion of 0.04 between MXN and EUR and between MXN and USD
Create a Sales Invoice
Select previously created price list (MXN)
Set it as Cash VAT
Add a line and select previously created tax rate and product
Complete it
Add a payment of 0.06 to it with today's date
Add a new payment with the pending amount and a different date
Check a record with a Tax Amount of 0.01 is shown in 'Sales Invoice - Tax - Cash VAT'
Try to post the payment or the transaction and check the process ends with a warning explaining that the Document is disabled for accounting
|
|
|
(0109289)
|
markmm82
|
2019-01-28 23:58
(edited on: 2019-01-29 00:09) |
|
Issue could be reproduced by the following settings:
As Group Admin:
Apply CashVat dataset.
Go to Organization window and select F&B España, S.A
Go to Information tab and check the Cash VAT and Doube Cash Criteria checkboxes.
Go to Tax Rate window and select Entregas IVA 21% tax rate.
Enable the Cash VAT flag.
Go to Tax Rate -> Accounting tab and select related record to F&B España, S.A. US/A/Euro GL.
Define a Tax Due Transitory, for example = 10000 - Capital social
Define a Tax Credit Transitory, for example = 10100 - Fondo social
Go to Tax Rate -> Accounting tab and select related record to F&B International Group US/A/US Dollar GL.
Define a Tax Due Transitory, for example = 1110 - Checking Account
Define a Tax Credit Transitory, for example = 1120 - Funds In-Transfer
Go to General Ledger Configuration window and select F&B España, S.A. US/A/Euro in the Defaults tab.
Define a Tax Due Transitory, for example = 1110 - Checking Account
Define a Tax Credit Transitory, for example = 1120 - Funds In-Transfer
Go to General Ledger Configuration window and select F&B International Group US/A/US Dollar in the Defaults tab.
Define a Tax Due Transitory, for example = 1110 - Checking Account
Define a Tax Credit Transitory, for example = 1120 - Funds In-Transfer
Go to Price List window and create new one.
Organization = F&B España, S.A.
Name = MXN
Currency = MXN
Sales Price List = Y
Go to Price List Version and define a new one:
Name = MXN
Valid From = Yesterday
Add a Product Price for it:
Product = Agua sin Gas 1L
Unit Price = 10.00
List Price = 10.00
Define a conversion of 0.04 between MXN and EUR
Currency = MXN
To Currency = EUR
Valid from Date = Yesterday
Multiple Rate By = 0.04
Divide Rate By = 25
Define a conversion of 0.04 between MXN and USD
Currency = MXN
To Currency = USD
Valid from Date = Yesterday
Multiple Rate By = 0.04
Divide Rate By = 25
Go to Cuenta de Banco Financial Account
Go to Payment Method tab and select Transferencia Payment method
Allow the Payment IN to receive Payments in Multiple Currencies
Create a Sales Invoice
Select previously created MXN price list (with MXN currency)
Set it as Cash VAT
Add a line and select previously created tax rate and product
Complete it
Add a payment of 0.06 to it with today's date
Add a new payment with the pending amount and a different date
Check a record with a Tax Amount of 0.01 is shown in 'Sales Invoice - Tax - Cash VAT'
Try to post the payment or the transaction and check the following error is shown:
Process failed during execution
If you debug the process you will be able to see the following NPE (Notice that the log isn't show in the console because the exception is catched and treated):
java.lang.NullPointerException
at org.openbravo.erpCommon.utility.CashVATUtil.createFactCashVAT(CashVATUtil.java:563)
at org.openbravo.erpCommon.ad_forms.DocFINReconciliation.createFactPaymentDetails(DocFINReconciliation.java:898)
at org.openbravo.erpCommon.ad_forms.DocFINReconciliation.createFactPayment(DocFINReconciliation.java:704)
at org.openbravo.erpCommon.ad_forms.DocFINReconciliation.createFact(DocFINReconciliation.java:596)
at org.openbravo.erpCommon.ad_forms.AcctServer.postLogic(AcctServer.java:1114)
|
|
|
(0109597)
|
hgbot
|
2019-02-05 17:40
|
|
Repository: erp/devel/pi
Changeset: e36d52a51aee7822955668823c7762d590201fe7
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Thu Jan 31 16:18:04 2019 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e36d52a51aee7822955668823c7762d590201fe7 [^]
Fixed issue 39969 Avoid NPE when posting a payment/transaction/reconciliation
of a Cash VAT invoice with different currency.
After convert the tax amount with from the used currency to the financial account
currency it is possible that this conversion is ZERO.
If Amount converted is zero should have the same behaviour as when amount is zero.
---
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
|
|
|
(0109598)
|
hgbot
|
2019-02-05 17:40
|
|
Repository: erp/devel/pi
Changeset: e4b5142297857df4e655dafb00f527ec7300a2b1
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Mon Feb 04 11:53:15 2019 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e4b5142297857df4e655dafb00f527ec7300a2b1 [^]
Related to Issue 39969. Code Review changes.
Moved logic to retrieve some variables after if clause.
If the condition is not fulfilled, it is not necessary to
initialize this variables.
---
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
|
|
|
(0109599)
|
hgbot
|
2019-02-05 17:40
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|