Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033508Openbravo ERP09. Financial managementpublic2016-07-20 12:522016-08-11 18:40
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q4 
aferraz
Core
Production - Confirmed Stable
2016-01-25
3.0PR16Q2
https://code.openbravo.com/erp/devel/pi/rev/7dafd0844a3d [^]
No
0033508: Cannot post a Cash VAT payment that pays more than one invoice, Process failed during execution error is shown
Cannot post a Cash VAT payment that pays more than one invoice, Process failed during execution error is shown
As system admin role:
   Install the Cash VAT Management module

As group admin role:
   Create a tax rate. Configure its accounting for Cash VAT:
      Tax Due Transitory
      Tax Credit Transitory
   Set it as Cash VAT
   Create three purchase orders, set them as Cash VAT and select the previously created tax rate
   Create three purchase invoices from them
   Create a Payment Out and pay the three invoices
   Try to post the payment out and check the following error message is shown:
      Process failed during execution
   The log shows:
      org.hibernate.LazyInitializationException: could not initialize proxy - no Session
    at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:167)
    at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215)
    at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
    at org.openbravo.model.common.invoice.InvoiceTax_$$_javassist_194.getTax(InvoiceTax_$$_javassist_194.java)
    at org.openbravo.erpCommon.utility.CashVATUtil.createFactCashVAT(CashVATUtil.java:496)
    at org.openbravo.erpCommon.ad_forms.DocFINPayment.createFact(DocFINPayment.java:396)
    at org.openbravo.erpCommon.ad_forms.AcctServer.postLogic(AcctServer.java:1111)
    at org.openbravo.erpCommon.ad_forms.AcctServer.post(AcctServer.java:804)
    at org.openbravo.erpCommon.ad_forms.AcctServer.post(AcctServer.java:720)
    at org.openbravo.erpCommon.ad_actionButton.Posted.processButton(Posted.java:273)
    at org.openbravo.erpCommon.ad_actionButton.Posted.doPost(Posted.java:104)
...
No tags attached.
related to defect 0029475 closed AtulOpenbravo Cash VAT post it is not correct in case sales invoice is linked to sales order but with a lower price 
related to defect 00278203.0PR15Q1 closed AtulOpenbravo Error when posting Payment/Transaction/Reconciliation referencing a cash vat invoice linked to several orders 
related to defect 00265713.0PR14Q3 closed AtulOpenbravo Error when paying a "cash vat" invoice with total amount lower than related order's amount 
related to defect 0032203 closed vmromanos Not possible to post a remittance as well as the settlement of that remittance. 
depends on backport 00335313.0PR16Q3 closed markmm82 Cannot post a Cash VAT payment that pays more than one invoice, Process failed during execution error is shown 
depends on backport 00335323.0PR16Q2.2 closed markmm82 Cannot post a Cash VAT payment that pays more than one invoice, Process failed during execution error is shown 
caused by defect 0031580 closed vmromanos Java Heap Space error when posting payment with huge amount of details 
related to defect 0033688 closed rqueralta Cannot post a financial account transaction if the invoice is partially paid by using credit 
png Issue_33508.png (120,380) 2016-07-21 16:30
https://issues.openbravo.com/file_download.php?file_id=9646&type=bug
png

png Issue_33508_2.png (96,569) 2016-07-21 16:30
https://issues.openbravo.com/file_download.php?file_id=9647&type=bug
png
Issue History
2016-07-20 12:52ngarciaNew Issue
2016-07-20 12:52ngarciaAssigned To => Triage Finance
2016-07-20 12:52ngarciaModules => Core
2016-07-20 12:52ngarciaResolution time => 1470780000
2016-07-20 12:52ngarciaTriggers an Emergency Pack => No
2016-07-20 12:53ngarciaIssue Monitored: networkb
2016-07-20 13:17aferrazAssigned ToTriage Finance => markmm82
2016-07-21 10:56psanjuanNote Added: 0088610
2016-07-21 10:58psanjuanNote Edited: 0088610bug_revision_view_page.php?bugnote_id=0088610#r12721
2016-07-21 10:59psanjuanNote Edited: 0088610bug_revision_view_page.php?bugnote_id=0088610#r12722
2016-07-21 11:02psanjuanNote Edited: 0088610bug_revision_view_page.php?bugnote_id=0088610#r12723
2016-07-21 11:08psanjuanNote Edited: 0088610bug_revision_view_page.php?bugnote_id=0088610#r12724
2016-07-21 11:10psanjuanNote Edited: 0088610bug_revision_view_page.php?bugnote_id=0088610#r12725
2016-07-21 15:39psanjuanNote Edited: 0088610bug_revision_view_page.php?bugnote_id=0088610#r12726
2016-07-21 16:27psanjuanNote Edited: 0088610bug_revision_view_page.php?bugnote_id=0088610#r12727
2016-07-21 16:29psanjuanNote Edited: 0088610bug_revision_view_page.php?bugnote_id=0088610#r12728
2016-07-21 16:30psanjuanFile Added: Issue_33508.png
2016-07-21 16:30psanjuanFile Added: Issue_33508_2.png
2016-07-21 16:33psanjuanNote Edited: 0088610bug_revision_view_page.php?bugnote_id=0088610#r12729
2016-07-21 17:06markmm82Statusnew => scheduled
2016-07-22 12:34psanjuanNote Added: 0088632
2016-07-22 14:24aferrazStatusscheduled => feedback
2016-07-22 14:25aferrazStatusfeedback => scheduled
2016-07-22 14:25aferrazRegression level => Production - Confirmed Stable
2016-07-22 14:25aferrazRegression date => 2016-01-25
2016-07-22 14:25aferrazRegression introduced in release => 3.0PR16Q2
2016-07-22 14:25aferrazRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/7dafd0844a3d [^]
2016-07-22 14:26aferrazRelationship addedcaused by 0031580
2016-07-26 11:45aferrazRelationship addedrelated to 0029475
2016-07-26 11:48aferrazRelationship addedrelated to 0027820
2016-07-26 11:49aferrazRelationship addedrelated to 0026571
2016-07-26 12:15aferrazRelationship addedrelated to 0032203
2016-07-27 21:09markmm82Relationship addeddepends on 0033551
2016-08-02 08:53hgbotCheckin
2016-08-02 08:53hgbotNote Added: 0088716
2016-08-02 08:53hgbotStatusscheduled => resolved
2016-08-02 08:53hgbotResolutionopen => fixed
2016-08-02 08:53hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/429081c6bccb9c9992499c4c472615e8d1df7dcd [^]
2016-08-02 08:53hgbotCheckin
2016-08-02 08:53hgbotNote Added: 0088717
2016-08-02 15:11hgbotCheckin
2016-08-02 15:11hgbotNote Added: 0088749
2016-08-02 15:11hgbotCheckin
2016-08-02 15:11hgbotNote Added: 0088750
2016-08-02 15:12hgbotCheckin
2016-08-02 15:12hgbotNote Added: 0088751
2016-08-02 15:13aferrazReview Assigned To => aferraz
2016-08-02 15:13aferrazNote Added: 0088752
2016-08-02 15:13aferrazStatusresolved => closed
2016-08-02 15:13aferrazFixed in Version => 3.0PR16Q4
2016-08-11 18:40hudsonbotCheckin
2016-08-11 18:40hudsonbotNote Added: 0089028
2016-08-11 18:40hudsonbotCheckin
2016-08-11 18:40hudsonbotNote Added: 0089029
2016-08-12 10:48aferrazRelationship addedrelated to 0033688

Notes
(0088610)
psanjuan   
2016-07-21 10:56   
(edited on: 2016-07-21 16:33)
Issue verified by following Step by step process below:

- Install the Cash VAT module
- Go to Account tree window and select F&B España account tree. Go to element value an create a new one with below setup:
Search Key = 47700T
Name = HP IVA repercutido transitorio
Element level = Subaccount
Account Type =Liability
- Create another more with below setup:
Search Key = 47200T
Name = HP IVA soportado transitorio
Element level = Subaccount
Account Type =Asset

- Select now F&B Internation Group account tree. Go to element value an create a new one with below setup:
Search Key = 2260T
Name = Sales Tax Payable Transitory
Element level = Subaccount
Account Type =Liability

- Create another one with below setup
Search Key = 7410T
Name = Tax Expense Transitory
Element level = Subaccount
Account Type =Expense

- Go to General ledger configuration window, select F&B España one. Go to Defaults tab and enter below accounts in below listed fields.
Tax Due Transitory = 47700T
Tax Credit Transitory = 47200T

- Go to General ledger configuration window, select F&B International one. Go to Defaults tab and enter below accounts in below listed fields.
Tax Due Transitory = 2260T
Tax Credit Transitory = 7410T

- Go to tax rate window and create a new tax rate with below setup:
Name = Adquisiciones IVA 21% IVA de Caja
Valid from = 01-01-2016
Tax Category = IVA Normal
Rate = 21
Sales/Purchase Tax = Purchase Tax
Cash VAT Tax = Yes
Country/Destination Country = Spain

- Go to accounting tab and enter the ledgers accounts previously created for both general ledgers.

- Go to Purchase order window and create 3 new purchase orders set as Cash VAT = Yes (under More Information group of fields), for F&B España org and Bebidas Alegres BP.

Purchase order 1 - for instance (1000190). Product = Cerveza Ale 5L, 100 units.
Make sure cash vat tax rate just created is being used.
Book the order.

Purchase order 2 - for instance (1000191) - Product = Cerveza Larger 0.5L, 200 units. Make sure cash vat tax rate just created is being used.
Book the order.

Purchase order 3 - for instance (1000192) - Product = Vino Blanco, 50 units.
Make sure cash vat tax rate just created is being used.
Book the order.

- Go to Purchase Invoice and create 3 separate invoices set as CAsh VAT = Yes, from the purchase order created above (Create Lines From).

Purchase Invoice 1 (i.e. 10000897) with below data:
Total Gross Amount = 164.56
Total Net Amount = 136.00 (Taxable Amount)
Tax Amount = 28.53

Complete and Post the invoice and check below posting is shown:

F&B ESPAÑA EURO general ledger:
136.00 (60000) Compras DEBIT
28.56 (47200T) HP IVA soportado transitorio DEBIT
164.56 (40000) Proveedores CREDIT

F&B International Group Dollar general ledger:
142.80 (5360) Product Expense DEBIT
29.99 (7410T) Tax Expense Transitory DEBIT
172.79 (2110) Accounts Payable CREDIT

Purchase Invoice 2 (i.e. 10000898) with below data:
Total Gross Amount = 425.92
Total Net Amount = 352.00 (Taxable Amount)
Tax Amount = 73.92

Complete and Post the invoice and check below posting is shown:

F&B ESPAÑA EURO general ledger:
352.00 (60000) Compras DEBIT
73.92 (47200T) HP IVA soportado transitorio DEBIT
425.92 (40000) Proveedores CREDIT

F&B International Group Dollar general ledger:
369.60 (5360) Product Expense DEBIT
77.62 (7410T) Tax Expense Transitory DEBIT
447.22 (2110) Accounts Payable CREDIT

Purchase Invoice 3 (i.e. 10000899) with below data:
Total Gross Amount = 214.78
Total Net Amount = 177.50 (Taxable Amount)
Tax Amount = 37.28

Complete and Post the invoice and check below posting is shown:

F&B ESPAÑA EURO general ledger:
177.50 (60000) Compras DEBIT
37.28 (47200T) HP IVA soportado transitorio DEBIT
214.78 (40000) Proveedores CREDIT

F&B International Group Dollar general ledger:
186.38 (5360) Product Expense DEBIT
39.14 (7410T) Tax Expense Transitory DEBIT
225.52(2110) Accounts Payable CREDIT

- Go to Payment Out window and create a new payment for F&B España, Bebidas Alegres BP. Select the 3 invoices above through button Add Details.
Post the payment.

Below error is shown.


Correct posting should been:

805.26 (40000) Proveedores DEBIT
37.28 (47200) HP IVA soportado DEBIT
73.92 (47200) HP IVA soportado DEBIT
28.56 (47200) HP IVA soportado DEBIT

805.26 (57200) Bancos CREDIT
37.28 (47200T) HP IVA soportado transitorio CREDIT
73.92 (47200T) HP IVA soportado transitorio CREDIT
28.56 (47200T) HP IVA soportado transitorio CREDIT

(0088632)
psanjuan   
2016-07-22 12:34   
It also fails with 2 invoices.
(0088716)
hgbot   
2016-08-02 08:53   
Repository: erp/devel/pi
Changeset: 429081c6bccb9c9992499c4c472615e8d1df7dcd
Author: Mark <markmm82 <at> gmail.com>
Date: Tue Jul 26 14:43:28 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/429081c6bccb9c9992499c4c472615e8d1df7dcd [^]

Fixes issue 33508: Error posting Cash VAT payment if pays more than one invoice

When trying to post a Cash VAT payment that pays more than one invoice, process was failing and an error was shown. It was caused by a clearing of the session when iterating on the cash vat invoices list. To avoid it, list of cash vat ids are retrieved instead a list of InvoiceTaxCashVAT_V.

---
M src/org/openbravo/erpCommon/ad_forms/DocLineCashVATReady_PaymentTransactionReconciliation.java
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0088717)
hgbot   
2016-08-02 08:53   
Repository: erp/devel/pi
Changeset: 7ebe0a53a4253297fe27348f86a445297f567bdb
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Aug 01 13:21:44 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/7ebe0a53a4253297fe27348f86a445297f567bdb [^]

Related to issue 33508: Code review improvements

Set invoiceTaxCashVAT_V variable as private.
Keep getInvoiceTaxCashVAT_V and setInvoiceTaxCashVAT_V methods as deprecated to avoid API change.
Add distinct to setInvoiceTaxCashVAT_V query to avoid retrieve duplicated ids.

---
M src/org/openbravo/erpCommon/ad_forms/DocLineCashVATReady_PaymentTransactionReconciliation.java
M src/org/openbravo/erpCommon/utility/CashVATUtil.java
---
(0088749)
hgbot   
2016-08-02 15:11   
Repository: erp/mods/org.openbravo.module.cashvat
Changeset: febb490051c5ac0b318ebfa71dfbbe104b723201
Author: Mark <markmm82 <at> gmail.com>
Date: Tue Jul 26 14:46:44 2016 -0400
URL: http://code.openbravo.com/erp/mods/org.openbravo.module.cashvat/rev/febb490051c5ac0b318ebfa71dfbbe104b723201 [^]

Related to issue 33508: Adapt DocManualSettlementCashVAT to API change

When trying to post a Cash VAT payment that pays more than one invoice, process was failing and an error was shown. It was caused by a clearing of the session when iterating on the cash vat invoices list. To avoid it, list of cash vat ids are retrieved instead a list of InvoiceTaxCashVAT_V and DocManualSettlementCashVAT is adapted to this change of the API.

---
M src/org/openbravo/module/cashvat/accounting/DocManualSettlementCashVAT.java
---
(0088750)
hgbot   
2016-08-02 15:11   
Repository: erp/mods/org.openbravo.module.cashvat
Changeset: 3fc3d787c444133c70d3079b6424e070d7f811fe
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Aug 01 13:48:30 2016 +0200
URL: http://code.openbravo.com/erp/mods/org.openbravo.module.cashvat/rev/3fc3d787c444133c70d3079b6424e070d7f811fe [^]

Related to issue 33508: Code review improvements

Use setInvoiceTaxCashVAT_V_IDs instead of setInvoiceTaxCashVAT_V method.

---
M src/org/openbravo/module/cashvat/accounting/DocManualSettlementCashVAT.java
---
(0088751)
hgbot   
2016-08-02 15:12   
Repository: erp/mods/org.openbravo.module.cashvat
Changeset: 746ecd0655e493ea254a675b358757f0bee1404f
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Tue Aug 02 14:59:26 2016 +0200
URL: http://code.openbravo.com/erp/mods/org.openbravo.module.cashvat/rev/746ecd0655e493ea254a675b358757f0bee1404f [^]

Related to issue 33508: Update module version

---
M src-db/database/sourcedata/AD_MODULE.xml
M src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
---
(0088752)
aferraz   
2016-08-02 15:13   
Code review + Testing OK
(0089028)
hudsonbot   
2016-08-11 18:40   
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/edaa05b1fb18 [^]
Maturity status: Test
(0089029)
hudsonbot   
2016-08-11 18:40   
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/edaa05b1fb18 [^]
Maturity status: Test