Fixes issue 40722:MovementDate is filled with time and should contain only with
authorArmaignac <collazoandy4@gmail.com>
Wed, 14 Aug 2019 12:29:32 +0200
changeset 36433 52183b3014d4
parent 36432 110e54591950
child 36434 6b96ea4a4f6d
Fixes issue 40722:MovementDate is filled with time and should contain only with
the date

The M_Inventory and M_Movement movementDate was truncated to the date
src/org/openbravo/erpCommon/ad_actionButton/ProcessGoods.java
src/org/openbravo/materialmgmt/refinventory/ReferencedInventoryUtil.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/ProcessGoods.java	Tue Aug 06 16:19:32 2019 +0530
+++ b/src/org/openbravo/erpCommon/ad_actionButton/ProcessGoods.java	Wed Aug 14 12:29:32 2019 +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-2018 Openbravo SLU
+ * All portions are Copyright (C) 2012-2019 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -23,6 +23,7 @@
 import java.io.PrintWriter;
 import java.math.BigDecimal;
 import java.text.ParseException;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -33,6 +34,7 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DateUtils;
 import org.hibernate.query.Query;
 import org.openbravo.base.filter.IsIDFilter;
 import org.openbravo.base.provider.OBProvider;
@@ -467,7 +469,7 @@
     inv.setOrganization(receipt.getOrganization());
     inv.setName(OBDateUtils.formatDate(new Date()));
     inv.setWarehouse(receipt.getWarehouse());
-    inv.setMovementDate(new Date());
+    inv.setMovementDate(DateUtils.truncate(new Date(), Calendar.DATE));
     inv.setInventoryType("N");
     inv.setDescription(Utility.messageBD(this, "AutoInventory", language));
     OBDal.getInstance().save(inv);
--- a/src/org/openbravo/materialmgmt/refinventory/ReferencedInventoryUtil.java	Tue Aug 06 16:19:32 2019 +0530
+++ b/src/org/openbravo/materialmgmt/refinventory/ReferencedInventoryUtil.java	Wed Aug 14 12:29:32 2019 +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) 2017-2018 Openbravo SLU 
+ * All portions are Copyright (C) 2017-2019 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -20,9 +20,11 @@
 package org.openbravo.materialmgmt.refinventory;
 
 import java.math.BigDecimal;
+import java.util.Calendar;
 import java.util.Date;
 
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DateUtils;
 import org.hibernate.ScrollMode;
 import org.hibernate.ScrollableResults;
 import org.hibernate.Session;
@@ -186,7 +188,7 @@
     header.setClient(OBContext.getOBContext().getCurrentClient());
     header.setOrganization(organization);
     header.setName(name);
-    header.setMovementDate(new Date());
+    header.setMovementDate(DateUtils.truncate(new Date(), Calendar.DATE));
     OBDal.getInstance().save(header);
     return header;
   }