details:   https://code.openbravo.com/erp/devel/pi/rev/09f464ff5bde
changeset: 30290:09f464ff5bde
user:      Mark <markmm82 <at> gmail.com>
date:      Tue Sep 13 11:43:16 2016 -0400
summary:   Fixes issue 33879: Avoid error when closing reservation from Stock 
Reservation

Avoided exception when the quantity of reservation stock lines have null value.
When the ManageReservationActionHandler processed the stock reservation it 
stores the realesed quantity with ZERO value instead of null.

details:   https://code.openbravo.com/erp/devel/pi/rev/61036197bbae
changeset: 30291:61036197bbae
user:      Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
date:      Thu Sep 15 14:04:47 2016 +0200
summary:   Related to issue 33879: Code review improvements

diffstat:

 src-db/database/model/functions/M_INOUT_POST.xml                              
|  4 ++--
 src/org/openbravo/common/actionhandler/ManagePrereservationActionHandler.java 
|  3 ++-
 src/org/openbravo/common/actionhandler/ManageReservationActionHandler.java    
|  1 +
 3 files changed, 5 insertions(+), 3 deletions(-)

diffs (49 lines):

diff -r 682415bc0aa9 -r 61036197bbae 
src-db/database/model/functions/M_INOUT_POST.xml
--- a/src-db/database/model/functions/M_INOUT_POST.xml  Tue Sep 13 18:24:02 
2016 +0200
+++ b/src-db/database/model/functions/M_INOUT_POST.xml  Thu Sep 15 14:04:47 
2016 +0200
@@ -1282,12 +1282,12 @@
                   INSERT INTO M_RESERVATION_STOCK (
                     m_reservation_stock_id, ad_client_id, ad_org_id, isactive,
                     created, createdby, updated, updatedby,
-                    m_reservation_id, quantity, isallocated,
+                    m_reservation_id, quantity, releasedqty, isallocated,
                     m_locator_id, m_attributesetinstance_id
                   ) VALUES (
                     get_uuid(), Cur_Reservation.ad_client_id, 
Cur_Reservation.ad_org_id, 'Y',
                     now(), v_user, now(), v_user,
-                    v_reservation_id, v_RS_Quantity, 'N',
+                    v_reservation_id, v_RS_Quantity, 0, 'N',
                     Cur_InOutLine.m_locator_id, 
Cur_InOutLine.m_attributesetinstance_id
                   );
                   v_R_Reservedqty := v_R_Reservedqty + v_RS_Quantity;
diff -r 682415bc0aa9 -r 61036197bbae 
src/org/openbravo/common/actionhandler/ManagePrereservationActionHandler.java
--- 
a/src/org/openbravo/common/actionhandler/ManagePrereservationActionHandler.java 
    Tue Sep 13 18:24:02 2016 +0200
+++ 
b/src/org/openbravo/common/actionhandler/ManagePrereservationActionHandler.java 
    Thu Sep 15 14:04:47 2016 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2012-2014 Openbravo SLU 
+ * All portions are Copyright (C) 2012-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -125,6 +125,7 @@
         resStock.setReservation(reservation);
         resStock.setOrganization(reservation.getOrganization());
         resStock.setSalesOrderLine(pol);
+        resStock.setReleased(BigDecimal.ZERO);
 
         List<ReservationStock> resStocks = 
pol.getMaterialMgmtReservationStockList();
         resStocks.add(resStock);
diff -r 682415bc0aa9 -r 61036197bbae 
src/org/openbravo/common/actionhandler/ManageReservationActionHandler.java
--- 
a/src/org/openbravo/common/actionhandler/ManageReservationActionHandler.java    
    Tue Sep 13 18:24:02 2016 +0200
+++ 
b/src/org/openbravo/common/actionhandler/ManageReservationActionHandler.java    
    Thu Sep 15 14:04:47 2016 +0200
@@ -183,6 +183,7 @@
           resStock.setSalesOrderLine((OrderLine) OBDal.getInstance().getProxy(
               OrderLine.ENTITY_NAME, strOrderLineId));
         }
+        resStock.setReleased(BigDecimal.ZERO);
 
         List<ReservationStock> resStocks = 
reservation.getMaterialMgmtReservationStockList();
         resStocks.add(resStock);

------------------------------------------------------------------------------
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to