Fixed: liniting issues introduced by commit d00208c

(OFBIZ-10585)

Thanks: Mathieu Lirzin for report
This commit is contained in:
Pawan Verma
2019-11-25 12:57:34 +05:30
parent f249f27382
commit 3d05f5ae28
@@ -2579,10 +2579,11 @@ public class ProductionRunServices {
BigDecimal qtyToProduce = qtyRequired.min(mktgPackagesAvailable);
/*
Creating production run job for remaining quantity in created status
This will handle cases like if production run job creates for partial quantities or in case of fully backordered scenario.
This will handle cases like if production run job creates for partial quantities
or in case of fully backordered scenario.
*/
BigDecimal remainingQty = orderItem.getBigDecimal("quantity").subtract(qtyToProduce);
if(remainingQty.compareTo(ZERO) > 0) {
if (remainingQty.compareTo(ZERO) > 0) {
serviceContext.clear();
serviceContext.put("facilityId", facilityId);
serviceContext.put("userLogin", userLogin);
@@ -2593,11 +2594,17 @@ public class ProductionRunServices {
if (ServiceUtil.isError(resultService)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(resultService));
}
String productionRunIdForRemainingQty = (String)resultService.get("productionRunId");
String productionRunIdForRemainingQty = (String) resultService.get("productionRunId");
try {
delegator.create("WorkOrderItemFulfillment", UtilMisc.toMap("workEffortId", productionRunIdForRemainingQty, "orderId", orderId, "orderItemSeqId", orderItemSeqId));
delegator.create("WorkOrderItemFulfillment",
UtilMisc.toMap("workEffortId", productionRunIdForRemainingQty,
"orderId", orderId, "orderItemSeqId", orderItemSeqId));
} catch (GenericEntityException e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunForMarketingPackagesCreationError", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, "errorString", e.getMessage()), locale));
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingProductionRunForMarketingPackagesCreationError",
UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId,
"errorString", e.getMessage()), locale));
}
}