Openbravo Issue Tracking System - Modules
View Issue Details
0034984ModulesCash VAT Managementpublic2017-01-17 16:572017-01-19 10:04
aferraz 
vmromanos 
urgentcriticalalways
closedfixed 
30Professional Appliance
 
 
aferraz
0034984: AddMissingCashVATPayments modulescript does not release the connection
AddMissingCashVATPayments modulescript does not release the connection.
AddMissingCashVATPayments.selectMissedPaymentDetails query retrieves a scrollable which is not closed in the modulescript.
Thus, the connection is not released and install.source task is not completed.
Install Cash VAT Management module (version >= 1.0.200).
Run ant install.source task.
Realize task does not end and it is locked in following step: Enabling constraints.
Add the following code at the end of the modulescript:
finally {
  if (data != null){
    data.close();
  }
}
No tags attached.
Issue History
2017-01-17 16:57aferrazNew Issue
2017-01-17 16:57aferrazAssigned To => Triage Finance
2017-01-17 17:00aferrazProposed Solution updated
2017-01-17 19:13vmromanosStatusnew => scheduled
2017-01-17 19:13vmromanosAssigned ToTriage Finance => vmromanos
2017-01-17 19:47vmromanosNote Added: 0093669
2017-01-17 19:49hgbotCheckin
2017-01-17 19:49hgbotNote Added: 0093670
2017-01-17 19:49hgbotStatusscheduled => resolved
2017-01-17 19:49hgbotResolutionopen => fixed
2017-01-17 19:49hgbotFixed in SCM revision => http://code.openbravo.com/erp/mods/org.openbravo.module.cashvat/rev/a96bfb231d0697aed4d517ba23594e9b4d0a6147 [^]
2017-01-17 19:50vmromanosReview Assigned To => aferraz
2017-01-19 10:04aferrazNote Added: 0093723
2017-01-19 10:04aferrazStatusresolved => closed

Notes
(0093669)
vmromanos   
2017-01-17 19:47   
Test plan I:
1. Clone the https://code.openbravo.com/erp/mods/org.openbravo.module.cashvat/ [^] (which includes the fix for this issue) into the modules folder
2. Runs ant install.source. Verify the process completes successfully


Test plan II:
1. Create a new Tax Rate, rate = 21%, Cash VAT = Y
2. Create a Sales Invoice with 1 line. Manually select the previously created tax rate
3. Complete the invoice
4. Add a full payment
5. Verify Sales Invoice | Tax | Cash VAT is populated with 100%
6. As System Admin, delete the preference "CashVATCreditMemoPartialModuleScriptExecuted" (if available)
7. Run delete from c_invoicetax_cashvat directly into the database [Cash VAT table]
8. Run ant smartbuild -Dlocal=no.
Verify the log for the module script says:
Fixed Invoice Tax Cash VAT lines: 1
9. Back to Openbravo, search for the previous Sales Invoice, and go to Tax | Cash VAT. Verify a record with 100% is there
(0093670)
hgbot   
2017-01-17 19:49   
Repository: erp/mods/org.openbravo.module.cashvat
Changeset: a96bfb231d0697aed4d517ba23594e9b4d0a6147
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Tue Jan 17 19:50:49 2017 +0100
URL: http://code.openbravo.com/erp/mods/org.openbravo.module.cashvat/rev/a96bfb231d0697aed4d517ba23594e9b4d0a6147 [^]

Fixed issue 34984: AddMissingCashVATPayments does not release the connection

Surround logic in try-finally, adding the closing stuff in the finally.
Compile module with Java 6 for backwards compatibility

---
M build/classes/org/openbravo/module/cashvat/modulescript/AddMissingCashVATPayments.class
M src-db/database/sourcedata/AD_MODULE.xml
M src-util/modulescript/src/org/openbravo/module/cashvat/modulescript/AddMissingCashVATPayments.java
---
(0093723)
aferraz   
2017-01-19 10:04   
Code review + Testing OK