Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0038143
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Modules] Remittancemajoralways2018-03-14 15:222018-03-19 13:02
ReporterngarciaView Statuspublic 
Assigned ToAtulOpenbravo 
PriorityimmediateResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisionc13cad43cde5
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Merge Request Status
Regression date2017-05-31
Regression introduced by commithttps://code.openbravo.com/erp/mods/org.openbravo.module.remittance/rev/d675cb9dedd4 [^]
Regression levelProduction - Confirmed Stable
Review Assigned Toaferraz
Support ticket734
OBNetwork customerOBPS
Regression introduced in release
Summary

0038143: NullPointerException when posting a remittance that includes an invoice with more than two orders

DescriptionNullPointerException when posting a remittance that includes an invoice with more than two orders

The problem is that in loadLinesFieldProvider function of DocREMRemittance class, it is trying to remove the last element of the list with

list.remove(i-1)

but i does not contain the list size as some elements have been previously removed
Steps To ReproduceAs group admin role:
   Apply module's dataset from Enterprise Module Management window
   Add Remittance payment method to Cuenta de Banco financial account
   Configure the Accounting for 'Printable Remittance' Remittance Type
   Create three purchase orders for the same business partner
   Set Remittance payment method and book them
   Create a Purchase Invoice, set Remittance payment method and add the three orders on it
   Complete it
   Create a Remittance header, increase its expected date to a date after invoice due date
   Select Order or Invoices
      Transaction Type: Payment Out
      Document: Order and Invoices
      Select the three lines associated with the invoice
   Process the remittance with the option 'Group by invoice'
   Try to post it and check you get the following error:
      java.lang.NullPointerException

   The log shows:
      ERROR org.openbravo.erpCommon.ad_forms.AcctServer - An error ocurred posting RecordId: <> - tableId: FF8080812E6C2859012E6D0271E1009D
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
    at java.util.ArrayList.rangeCheck(ArrayList.java:639)
    at java.util.ArrayList.remove(ArrayList.java:478)
    at org.openbravo.module.remittance.ad_forms.DocREMRemittance.loadLinesFieldProvider(DocREMRemittance.java:152)
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
caused by defect 0036124 closednonofrancisco Accounting information should be grouped by invoice when posting a remittance. 

-  Notes
(0103292)
AtulOpenbravo (viewer)
2018-03-16 03:53

- Login as F&B International Group Admin role.
- Apply module's dataset from Enterprise Module Management window.
- Add Remittance payment method to Cuenta de Banco financial account.
- Configure the Accounting for 'Printable Remittance' Remittance Type for both General Ledgers.
- Create three purchase orders for the same business partner with any product, set Remittance payment method and book them.
- Create a Purchase Invoice, set Remittance payment method and add the three orders lines in it using Create Lines From. Complete it
- Create a Remittance header, set its expected date to a date after invoice due date, select Order or Invoices
      Transaction Type: Payment Out
      Document: Order and Invoices
      Select the three lines associated with the invoice
- Process the remittance with the option 'Group by invoice'
- Post the remittance and realize that it is processed successfully.
(0103293)
AtulOpenbravo (viewer)
2018-03-16 04:05

Test Plan

- Install remittance module and apply its datase to F&B España organization.
- Go to Remittance type and select "Printable Remittance".
- Fill in Accounting information for both General Ledger (EUR and USD ones).
- Go to Financial Account window, and select "Cuenta de Banco". Go to Payment Method tab, and select "Remittance" payment method.
- Enter a purchase order for Bebidas Alegres business partner. Select any product and enter below data:
  - Ordered Qty = 5
  - price = 1.00
  - tax rate = Compras exentas.
  Book the order.
- Enter another purchase order for Bebidas Alegres business partner. Select any product and enter below data:
  - Ordered Qty = 30
  - price = 1.00
  - tax rate = Compras exentas.
  Book the order.

- Go to Purchase Invoice window, and create a new one for Bebidas Alegres business partner. Use Create Lines From to select just created order lines. Change paymento method to "Remittance". Complete and Post the invoice. Take note of the due date = 17-04-2018.

- Go to Remittance window and create a new one for F&B España. Enter an expected date of 18-04-2018.
Click on "Select Orders or Invoices". Once in that new window, select "Payment Out" in the field "Transaction Type" and select the purchase invoice just created for an expected amount = 35.00. Press Process.

- Verify that two lines are shown. Click on Process.
- Post the document
- Verify Posting details shows only two lines

35.00 (40000) DEBIT
35.00 (43120) CREDIT
(0103346)
hgbot (developer)
2018-03-19 12:53

Repository: erp/mods/org.openbravo.module.remittance
Changeset: c13cad43cde57402071eb345f84971d73ed58381
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Mon Mar 19 14:17:15 2018 +0530
URL: http://code.openbravo.com/erp/mods/org.openbravo.module.remittance/rev/c13cad43cde57402071eb345f84971d73ed58381 [^]

Fixes issue 38143: NullPointerException when posting a remittance

NullPointerException when posting a remittance
that includes an invoice with more than two orders

Removing last element from the ArrayList is not feasible using
[index-1] as in the for loop index is incremented and removing
elements size of ArrayList is reduced. To avoid
java.lang.IndexOutOfBoundsException, store last element in
a variable.

---
M src/org/openbravo/module/remittance/ad_forms/DocREMRemittance.java
---
(0103347)
hgbot (developer)
2018-03-19 12:53

Repository: erp/mods/org.openbravo.module.remittance
Changeset: 97da9031eedad620398aaff67b5de5c2f15f3392
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Mar 19 12:45:21 2018 +0100
URL: http://code.openbravo.com/erp/mods/org.openbravo.module.remittance/rev/97da9031eedad620398aaff67b5de5c2f15f3392 [^]

Related to issue 38143: Update module version

---
M src-db/database/sourcedata/AD_MODULE.xml
---
(0103348)
aferraz (viewer)
2018-03-19 13:02

Code review + Testing OK

- Issue History
Date Modified Username Field Change
2018-03-14 15:22 ngarcia New Issue
2018-03-14 15:22 ngarcia Assigned To => Triage Finance
2018-03-14 15:22 ngarcia Support ticket => 734
2018-03-14 15:22 ngarcia OBNetwork customer => Yes
2018-03-14 15:24 ngarcia Resolution time => 1522792800
2018-03-14 15:26 ngarcia Relationship added related to 0036124
2018-03-14 15:27 ngarcia Issue Monitored: networkb
2018-03-14 15:49 ngarcia Priority urgent => immediate
2018-03-14 15:49 ngarcia Relationship replaced caused by 0036124
2018-03-15 09:38 aferraz Assigned To Triage Finance => markmm82
2018-03-15 09:45 aferraz Assigned To markmm82 => AtulOpenbravo
2018-03-16 03:53 AtulOpenbravo Status new => scheduled
2018-03-16 03:53 AtulOpenbravo Note Added: 0103292
2018-03-16 04:05 AtulOpenbravo Note Added: 0103293
2018-03-16 09:26 AtulOpenbravo Regression date => 2017-05-31
2018-03-16 09:26 AtulOpenbravo Regression introduced by commit => https://code.openbravo.com/erp/mods/org.openbravo.module.remittance/rev/d675cb9dedd4 [^]
2018-03-16 09:26 AtulOpenbravo Regression level => Production - Confirmed Stable
2018-03-19 12:53 hgbot Checkin
2018-03-19 12:53 hgbot Note Added: 0103346
2018-03-19 12:53 hgbot Status scheduled => resolved
2018-03-19 12:53 hgbot Resolution open => fixed
2018-03-19 12:53 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/mods/org.openbravo.module.remittance/rev/c13cad43cde57402071eb345f84971d73ed58381 [^]
2018-03-19 12:53 hgbot Checkin
2018-03-19 12:53 hgbot Note Added: 0103347
2018-03-19 13:02 aferraz Review Assigned To => aferraz
2018-03-19 13:02 aferraz Note Added: 0103348
2018-03-19 13:02 aferraz Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker