Author: jacopoc
Date: Thu May 3 02:39:45 2007
New Revision: 534765
URL:
http://svn.apache.org/viewvc?view=rev&rev=534765Log:
When the completed date of scheduled production runs is changed, the estimated delivery date of the backordered items is updated.
Modified:
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java?view=diff&rev=534765&r1=534764&r2=534765==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java Thu May 3 02:39:45 2007
@@ -117,8 +117,8 @@
* <li> the productComponent list related data
* @return true if success false otherwise
**/
- public boolean store(){
- if (exist()){
+ public boolean store() {
+ if (exist()) {
if (updateCompletionDate){
this.estimatedCompletionDate = recalculateEstimatedCompletionDate();
}
@@ -434,4 +434,7 @@
return (long) totalTaskTime;
}
+ public boolean isUpdateCompletionDate() {
+ return updateCompletionDate;
+ }
}
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?view=diff&rev=534765&r1=534764&r2=534765==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Thu May 3 02:39:45 2007
@@ -488,7 +488,17 @@
productionRun.getGenericValue().set("facilityId", facilityId);
}
+ boolean updateEstimatedOrderDates = productionRun.isUpdateCompletionDate();
if (productionRun.store()) {
+ if (updateEstimatedOrderDates && "PRUN_SCHEDULED".equals(productionRun.getGenericValue().getString("currentStatusId"))) {
+ try {
+ Map resultService = dispatcher.runSync("setEstimatedDeliveryDates",
+ UtilMisc.toMap("userLogin", userLogin));
+ } catch (GenericServiceException e) {
+ Debug.logError(e, "Problem calling the setEstimatedDeliveryDates service", module);
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunNotUpdated", locale));
+ }
+ }
return ServiceUtil.returnSuccess();
} else {
Debug.logError("productionRun.store() fail for productionRunId ="+productionRunId,module);