Openbravo Issue Tracking System - Retail Modules
View Issue Details
0041203Retail ModulesWeb POSpublic2019-06-28 14:002019-07-12 15:01
xabiermerino 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
 
RR19Q4 
guilleaer
No
0041203: Errors while importing when synchronize a ticket with a discount of 100% and Generate Invoices active
When you have the check 'Generate Invoice' activate and try to synchronize a ticket with a discount of the 100% an error while importing happens:

java.lang.IndexOutOfBoundsException: Index 0 out-of-bounds for length 0
    at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
    at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
    at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
    at java.base/java.util.Objects.checkIndex(Objects.java:372)
    at java.base/java.util.ArrayList.get(ArrayList.java:440)
    at org.hibernate.collection.internal.PersistentBag.get(PersistentBag.java:452)
    at org.openbravo.retail.posterminal.utility.InvoiceUtils.createPaymentTerms(InvoiceUtils.java:751)
- Configure a POS Terminal type for generate invoices
- Create a ticket of avalanche and add a cash payment
- Apply a discount of 100%
- Complete the ticket with the payment added
- realize that there is a new errors while importing
No tags attached.
depends on backport 0041204RR19Q2.1 closed ranjith_qualiantech_com Errors while importing when synchronize a ticket with a discount of 100% and Generate Invoices active 
depends on backport 0041205RR19Q1.3 closed ranjith_qualiantech_com Errors while importing when synchronize a ticket with a discount of 100% and Generate Invoices active 
patch issue 41203 source posterminal.patch (1,145) 2019-07-01 14:42
https://issues.openbravo.com/file_download.php?file_id=13067&type=bug
Issue History
2019-06-28 14:00xabiermerinoNew Issue
2019-06-28 14:00xabiermerinoAssigned To => Retail
2019-06-28 14:00xabiermerinoResolution time => 1562277600
2019-06-28 14:00xabiermerinoTriggers an Emergency Pack => No
2019-06-28 14:14Asantos9Issue Monitored: Asantos9
2019-06-28 14:21marvintmStatusnew => scheduled
2019-06-28 14:21marvintmAssigned ToRetail => ranjith_qualiantech_com
2019-06-28 14:33ngarciaIssue Monitored: ngarcia
2019-07-01 12:45Asantos9Steps to Reproduce Updatedbug_revision_view_page.php?rev_id=19012#r19012
2019-07-01 12:47Asantos9Steps to Reproduce Updatedbug_revision_view_page.php?rev_id=19013#r19013
2019-07-01 14:42ranjith_qualiantech_comFile Added: issue 41203 source posterminal.patch
2019-07-03 15:39hgbotCheckin
2019-07-03 15:39hgbotNote Added: 0113156
2019-07-03 15:39hgbotStatusscheduled => resolved
2019-07-03 15:39hgbotResolutionopen => fixed
2019-07-03 15:39hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/22d52041fdbbc10dde3ec61c24da3d4399c876af [^]
2019-07-03 19:22marvintmNote Added: 0113163
2019-07-03 19:22marvintmStatusresolved => new
2019-07-03 19:22marvintmResolutionfixed => open
2019-07-04 08:23ranjith_qualiantech_comStatusnew => scheduled
2019-07-11 11:03hgbotCheckin
2019-07-11 11:03hgbotNote Added: 0113267
2019-07-11 11:03hgbotStatusscheduled => resolved
2019-07-11 11:03hgbotResolutionopen => fixed
2019-07-11 11:03hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/22d52041fdbbc10dde3ec61c24da3d4399c876af [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/8e5a9920aa7b2e1022cef58d1313a732da66b143 [^]
2019-07-11 15:31hgbotCheckin
2019-07-11 15:31hgbotNote Added: 0113275
2019-07-11 15:31hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/8e5a9920aa7b2e1022cef58d1313a732da66b143 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal-discounts/rev/22d52041fdbbc10dde3ec61c24da3d4399c876af [^]
2019-07-11 15:32hgbotCheckin
2019-07-11 15:32hgbotNote Added: 0113291
2019-07-11 15:32hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal-discounts/rev/22d52041fdbbc10dde3ec61c24da3d4399c876af [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal-discounts/rev/8e5a9920aa7b2e1022cef58d1313a732da66b143 [^]
2019-07-12 14:51guilleaerNote Deleted: 0113275
2019-07-12 14:51guilleaerNote Deleted: 0113291
2019-07-12 15:01guilleaerReview Assigned To => guilleaer
2019-07-12 15:01guilleaerStatusresolved => closed
2019-07-12 15:01guilleaerFixed in Version => RR19Q4

Notes
(0113156)
hgbot   
2019-07-03 15:39   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 22d52041fdbbc10dde3ec61c24da3d4399c876af
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Jul 03 19:08:33 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/22d52041fdbbc10dde3ec61c24da3d4399c876af [^]

Fixed issue 41203 : Invoice Payment schedule should be validated before creating payment terms

* If invoice amount is zero, then invoice payment schedule will not be created.
  When creating invoice payment terms, Invoice Payment schedule should be validated

---
M src/org/openbravo/retail/posterminal/utility/InvoiceUtils.java
---
(0113163)
marvintm   
2019-07-03 19:22   
A better fix would be to just ignore payments of origAmount 0 in the handlePayments method in OrderLoader. In this way we would save quite a bit of processing which is pointless in this case.
(0113267)
hgbot   
2019-07-11 11:03   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 8e5a9920aa7b2e1022cef58d1313a732da66b143
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Jul 11 14:32:47 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/8e5a9920aa7b2e1022cef58d1313a732da66b143 [^]

Fixed issue 41203 : Payments should not be processed if payment origAmount is zero

---
M src/org/openbravo/retail/posterminal/OrderLoader.java
---