Fix issue 0020469: Product without Guaranteed Days breaks
authorRafa de Miguel <rafael.demiguel@openbravo.com>
Thu, 10 May 2012 17:50:29 +0200
changeset 16490 bca89372cadc
parent 16489 78d28661d80a
child 16491 29d705534d05
Fix issue 0020469: Product without Guaranteed Days breaks
src/org/openbravo/erpCommon/ad_actionButton/CreateStandards.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateStandards.java	Thu May 10 17:43:01 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateStandards.java	Thu May 10 17:50:29 2012 +0200
@@ -305,7 +305,8 @@
             if (attSet.isExpirationDate()) {
               Date movementdate = ((productionPlan.getProductionplandate() != null) ? productionPlan
                   .getProductionplandate() : productionPlan.getProduction().getMovementDate());
-              int days = attSet.getGuaranteedDays().intValue();
+              int days = (attSet.getGuaranteedDays() == null ? 0 : attSet.getGuaranteedDays()
+                  .intValue());
               attSetInstance.setGuaranteeDate(dateToString(addDays(movementdate, days)));
             }
             OBError createAttributeInstanceError = attSetInstance.setAttributeInstance(conn, vars,