gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147816795


##########
applications/product/groovyScripts/product/cost/CostServices.groovy:
##########
@@ -495,15 +497,14 @@ def getProductAverageCost() {
 
 /**
  * Formula that creates a cost component equal to a percentage of total 
product cost
- * @return
  */
-def productCostPercentageFormula() {
+Map productCostPercentageFormula() {
     Map result = success()
     GenericValue productCostComponentCalc = parameters.productCostComponentCalc
     GenericValue costComponentCalc = parameters.costComponentCalc
-    Map inputMap = [productId: productCostComponentCalc.productId, 
currencyUomId: parameters.currencyUomId, costComponentTypePrefix: 
parameters.costComponentTypePrefix]
-    Map serviceResult = run service: "getProductCost", with: inputMap
-    BigDecimal productCost = serviceResult.productCost
+    Map inputMap = [productId: productCostComponentCalc.productId, 
currencyUomId: parameters.currencyUomId,
+                    costComponentTypePrefix: 
parameters.costComponentTypePrefix]
+    run service: 'getProductCost', with: inputMap
     // set field="productCostAdjustment" value="${parameters.baseCost * 
costComponentCalc.fixedCost}" type="BigDecimal"/

Review Comment:
   Like Dan said in another comment, i had to refrain to change a lot of things 
during rule fixes, let's try to avoid mixing objectives in this pull-request :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to