Skip to content

Commit

Permalink
Fixed: liniting issues introduced by commit d00208c
Browse files Browse the repository at this point in the history
(OFBIZ-10585)

Thanks: Mathieu Lirzin for report
  • Loading branch information
pwverma committed Nov 25, 2019
1 parent 174b924 commit fc1e1b4
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2802,10 +2802,11 @@ public static Map<String, Object> createProductionRunForMktgPkg(DispatchContext
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);
Expand All @@ -2816,11 +2817,16 @@ public static Map<String, Object> createProductionRunForMktgPkg(DispatchContext
if (ServiceUtil.isError(serviceResult)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResult));
}
String productionRunIdForRemainingQty = (String)serviceResult.get("productionRunId");
String productionRunIdForRemainingQty = (String) serviceResult.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));
}
}

Expand Down

0 comments on commit fc1e1b4

Please sign in to comment.