details:   https://code.openbravo.com/erp/devel/pi/rev/a94d701d0892
changeset: 32713:a94d701d0892
user:      Carlos Sousa <carlos.sousa <at> openbravo.com>
date:      Wed Apr 19 09:01:34 2017 +0200
summary:   Fixes issue 35449: Movement date of Goods movements
created from Stock Reservations window should be truncated.

Movement date of Goods movements
created from Stock Reservations window has been truncated.

diffstat:

 src/org/openbravo/common/actionhandler/ReservedGoodMovementActionHandler.java 
|  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r e47262bb76d3 -r a94d701d0892 
src/org/openbravo/common/actionhandler/ReservedGoodMovementActionHandler.java
--- 
a/src/org/openbravo/common/actionhandler/ReservedGoodMovementActionHandler.java 
    Tue Jul 25 17:45:37 2017 -0400
+++ 
b/src/org/openbravo/common/actionhandler/ReservedGoodMovementActionHandler.java 
    Wed Apr 19 09:01:34 2017 +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) 2014-2016 Openbravo SLU 
+ * All portions are Copyright (C) 2014-2017 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -19,9 +19,11 @@
 package org.openbravo.common.actionhandler;
 
 import java.math.BigDecimal;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.Map;
 
+import org.apache.commons.lang.time.DateUtils;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.exception.OBException;
@@ -96,9 +98,8 @@
           gmHeader = OBProvider.getInstance().get(InternalMovement.class);
           gmHeader.setOrganization(resStock.getOrganization());
           gmHeader.setClient(resStock.getClient());
-          gmHeader.setMovementDate(new Date());
-          gmHeader.setName(resStock.getReservation().getProduct().getName()); 
// + " "
-          // + gmHeader.getMovementDate().get);
+          gmHeader.setMovementDate(DateUtils.truncate(new Date(), 
Calendar.DATE));
+          gmHeader.setName(resStock.getReservation().getProduct().getName());
           OBDal.getInstance().save(gmHeader);
           OBDal.getInstance().flush();
         }

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to