diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/InvoiceReport.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/InvoiceReport.groovy index 688182dad8..6c7a9dc9af 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/InvoiceReport.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/InvoiceReport.groovy @@ -45,7 +45,7 @@ if (invoiceTypeId) { PastDueInvoices = delegator.findList("Invoice", expr, null, ["dueDate DESC"], null, false); if (PastDueInvoices) { invoiceIds = PastDueInvoices.invoiceId; - totalAmount = dispatcher.runSync("getInvoiceRunningTotal", [invoiceIds: invoiceIds, organizationPartyId: organizationPartyId, userLogin: userLogin]); + totalAmount = runService('getInvoiceRunningTotal', [invoiceIds: invoiceIds, organizationPartyId: organizationPartyId, userLogin: userLogin]); if (totalAmount) { context.PastDueInvoicestotalAmount = totalAmount.invoiceRunningTotal; } @@ -61,7 +61,7 @@ if (invoiceTypeId) { InvoicesDueSoon = delegator.findList("Invoice", invoicesCond, null, ["dueDate ASC"], findOptions, false); if (InvoicesDueSoon) { invoiceIds = InvoicesDueSoon.invoiceId; - totalAmount = dispatcher.runSync("getInvoiceRunningTotal", [invoiceIds: invoiceIds, organizationPartyId: organizationPartyId, userLogin: userLogin]); + totalAmount = runService('getInvoiceRunningTotal', [invoiceIds: invoiceIds, organizationPartyId: organizationPartyId, userLogin: userLogin]); if (totalAmount) { context.InvoicesDueSoonTotalAmount = totalAmount.invoiceRunningTotal; } diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy index dafa616ccb..4c10f0904d 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy @@ -65,7 +65,7 @@ GenericValue accumAmortizationGlAccountClass = delegator.findOne("GlAccountClass List accumAmortizationAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(accumAmortizationGlAccountClass); // Find the last closed time period to get the fromDate for the transactions in the current period and the ending balances of the last closed period -Map lastClosedTimePeriodResult = dispatcher.runSync("findLastClosedDate", UtilMisc.toMap("organizationPartyId", organizationPartyId, "findDate", new Date(thruDate.getTime()),"userLogin", userLogin)); +Map lastClosedTimePeriodResult = runService('findLastClosedDate', ["organizationPartyId": organizationPartyId, "findDate": new Date(thruDate.getTime()),"userLogin": userLogin]); Timestamp fromDate = (Timestamp)lastClosedTimePeriodResult.lastClosedDate; if (!fromDate) { return; @@ -410,7 +410,7 @@ transactionTotals.each { transactionTotal -> transactionTotalsMap.put(transactionTotal.glAccountId, accountMap); } // Add the "retained earnings" account -Map netIncomeResult = dispatcher.runSync("prepareIncomeStatement", UtilMisc.toMap("organizationPartyId", organizationPartyId, "glFiscalTypeId", glFiscalTypeId, "fromDate", fromDate, "thruDate", thruDate,"userLogin", userLogin)); +Map netIncomeResult = runService('prepareIncomeStatement', ["organizationPartyId": organizationPartyId, "glFiscalTypeId": glFiscalTypeId, "fromDate": fromDate, "thruDate": thruDate, "userLogin": userLogin]); BigDecimal netIncome = (BigDecimal)netIncomeResult.totalNetIncome; GenericValue retainedEarningsAccount = delegator.findOne("GlAccountTypeDefault", UtilMisc.toMap("glAccountTypeId", "RETAINED_EARNINGS", "organizationPartyId", organizationPartyId), true); if (retainedEarningsAccount) { diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy index ba0c0c9779..e0bac0fe7c 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/CashFlowStatement.groovy @@ -56,7 +56,7 @@ List glAccountClassIds = UtilAccounting.getDescendantGlAccountClassIds(glAccount List cashFlowBalanceTotalList = []; // Find the last closed time period to get the fromDate for the transactions in the current period and the ending balances of the last closed period -Map lastClosedTimePeriodResult = dispatcher.runSync("findLastClosedDate", ["organizationPartyId":organizationPartyId, "findDate":new Date(parametersFromDate.getTime()),"userLogin":userLogin]); +Map lastClosedTimePeriodResult = runService('findLastClosedDate', ["organizationPartyId":organizationPartyId, "findDate":new Date(parametersFromDate.getTime()),"userLogin":userLogin]); Timestamp periodClosingFromDate = (Timestamp)lastClosedTimePeriodResult.lastClosedDate; if (!periodClosingFromDate) { return; diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/GlAccountTrialBalance.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/GlAccountTrialBalance.groovy index 22aabd8b92..7151bb218c 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/GlAccountTrialBalance.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/GlAccountTrialBalance.groovy @@ -26,7 +26,7 @@ import com.ibm.icu.util.Calendar; if (organizationPartyId) { onlyIncludePeriodTypeIdList = []; onlyIncludePeriodTypeIdList.add("FISCAL_YEAR"); - customTimePeriodResults = dispatcher.runSync("findCustomTimePeriods", [findDate : UtilDateTime.nowTimestamp(), organizationPartyId : organizationPartyId, onlyIncludePeriodTypeIdList : onlyIncludePeriodTypeIdList, userLogin : userLogin]); + customTimePeriodResults = runService('findCustomTimePeriods', [findDate : UtilDateTime.nowTimestamp(), organizationPartyId : organizationPartyId, onlyIncludePeriodTypeIdList : onlyIncludePeriodTypeIdList, userLogin : userLogin]); customTimePeriodList = customTimePeriodResults.customTimePeriodList; if (UtilValidate.isNotEmpty(customTimePeriodList)) { context.timePeriod = customTimePeriodList.first().customTimePeriodId; @@ -46,8 +46,7 @@ if (organizationPartyId) { if (parameters.timePeriod) { currentTimePeriod = delegator.findOne("CustomTimePeriod", [customTimePeriodId : parameters.timePeriod], false); - previousTimePeriodResult = dispatcher.runSync("getPreviousTimePeriod", - [customTimePeriodId : parameters.timePeriod, userLogin : userLogin]); + previousTimePeriodResult = runService('getPreviousTimePeriod', [customTimePeriodId : parameters.timePeriod, userLogin : userLogin]); previousTimePeriod = previousTimePeriodResult.previousTimePeriod; if (UtilValidate.isNotEmpty(previousTimePeriod)) { glAccountHistory = delegator.findOne("GlAccountHistory", @@ -76,7 +75,7 @@ if (organizationPartyId) { if ("ALL".equals(isPosted)) { isPosted = ""; } - acctgTransEntriesAndTransTotal = dispatcher.runSync("getAcctgTransEntriesAndTransTotal", + acctgTransEntriesAndTransTotal = runService('getAcctgTransEntriesAndTransTotal', [customTimePeriodStartDate : customTimePeriodStartDate, customTimePeriodEndDate : customTimePeriodEndDate, organizationPartyId : organizationPartyId, glAccountId : parameters.glAccountId, isPosted : isPosted, userLogin : userLogin]); totalOfYearToDateDebit = totalOfYearToDateDebit + acctgTransEntriesAndTransTotal.debitTotal; acctgTransEntriesAndTransTotal.totalOfYearToDateDebit = totalOfYearToDateDebit.setScale(decimals, rounding); diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy index 03f7d1928c..82d064f2de 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TransactionTotals.groovy @@ -43,7 +43,7 @@ if (!glFiscalTypeId) { } // Find the last closed time period to get the fromDate for the transactions in the current period and the ending balances of the last closed period -Map lastClosedTimePeriodResult = dispatcher.runSync("findLastClosedDate", UtilMisc.toMap("organizationPartyId", organizationPartyId, "findDate", new Date(fromDate.getTime()),"userLogin", userLogin)); +Map lastClosedTimePeriodResult = runService('findLastClosedDate', ["organizationPartyId": organizationPartyId, "findDate": new Date(fromDate.getTime()),"userLogin": userLogin]); Timestamp lastClosedDate = (Timestamp)lastClosedTimePeriodResult.lastClosedDate; GenericValue lastClosedTimePeriod = null; if (lastClosedDate) { diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TrialBalance.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TrialBalance.groovy index 9a4d7afde9..7fc9ebc175 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TrialBalance.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/TrialBalance.groovy @@ -41,7 +41,7 @@ if (parameters.customTimePeriodId) { postedCreditsTotal = 0 organizationGlAccounts.each { organizationGlAccount -> accountBalance = [:] - accountBalance = dispatcher.runSync('computeGlAccountBalanceForTimePeriod', [organizationPartyId: organizationGlAccount.organizationPartyId, customTimePeriodId: customTimePeriod.customTimePeriodId, glAccountId: organizationGlAccount.glAccountId, userLogin: userLogin]); + accountBalance = runService('computeGlAccountBalanceForTimePeriod', [organizationPartyId: organizationGlAccount.organizationPartyId, customTimePeriodId: customTimePeriod.customTimePeriodId, glAccountId: organizationGlAccount.glAccountId, userLogin: userLogin]); if (accountBalance.postedDebits != 0 || accountBalance.postedCredits != 0) { accountBalance.glAccountId = organizationGlAccount.glAccountId accountBalance.accountCode = organizationGlAccount.accountCode diff --git a/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionRun.groovy b/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionRun.groovy index 4402bc654f..7fd6029c04 100644 --- a/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionRun.groovy +++ b/applications/accounting/webapp/ap/WEB-INF/actions/invoices/CommissionRun.groovy @@ -39,7 +39,7 @@ if (fromDate) { List invoices = []; if (invoiceList) { - resultMap = dispatcher.runSync("getInvoicesFilterByAssocType", [invoiceItemAssocTypeId : "COMMISSION_INVOICE", invoiceList : invoiceList, userLogin : userLogin]); + resultMap = runService('getInvoicesFilterByAssocType', [invoiceItemAssocTypeId : "COMMISSION_INVOICE", invoiceList : invoiceList, userLogin : userLogin]); invoices = resultMap.filteredInvoiceList; context.invoices = invoices; } diff --git a/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/BomSimulation.groovy b/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/BomSimulation.groovy index 0973671cc2..27491ea0e8 100644 --- a/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/BomSimulation.groovy +++ b/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/BomSimulation.groovy @@ -44,7 +44,7 @@ if (tree) { try { outMap = [:]; if (currencyUomId) { - outMap = dispatcher.runSync("getProductCost", [productId : node.getProduct().productId, + outMap = runService('getProductCost', [productId : node.getProduct().productId, currencyUomId : currencyUomId, costComponentTypePrefix : "EST_STD", userLogin : userLogin]); @@ -53,7 +53,7 @@ if (tree) { grandTotalCost = grandTotalCost + totalCost ?: 0; } if (facilityId) { - outMap = dispatcher.runSync("getInventoryAvailableByFacility", [productId : node.getProduct().productId, + outMap = runService('getInventoryAvailableByFacility', [productId : node.getProduct().productId, facilityId : facilityId, userLogin : userLogin]); qoh = outMap.quantityOnHandTotal; diff --git a/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy b/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy index d094e556c2..66c60f2f58 100644 --- a/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy +++ b/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy @@ -49,7 +49,7 @@ if (shipment) { userLogin: userLogin]; result = [:]; - result = dispatcher.runSync("getNotAssembledComponents",inputPar); + result = runService('getNotAssembledComponents',inputPar); if (result) { components = (List)result.get("notAssembledComponents"); } @@ -63,7 +63,7 @@ if (shipment) { if (facilityId) { if (!inventoryStock.containsKey(oneComponent.getProduct().productId)) { serviceInput = [productId : oneComponent.getProduct().productId , facilityId : facilityId]; - serviceOutput = dispatcher.runSync("getInventoryAvailableByFacility",serviceInput); + serviceOutput = runService('getInventoryAvailableByFacility',serviceInput); qha = serviceOutput.quantityOnHandTotal ?: 0.0; inventoryStock.put(oneComponent.getProduct().productId, qha); } @@ -75,7 +75,7 @@ if (shipment) { // Now we get the products qty already reserved by production runs serviceInput = [productId : oneComponent.getProduct().productId, userLogin : userLogin]; - serviceOutput = dispatcher.runSync("getProductionRunTotResQty", serviceInput); + serviceOutput = runSevice('getProductionRunTotResQty', serviceInput); resQty = serviceOutput.reservedQuantity; record.reservedQuantity = resQty; records.add(record); diff --git a/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy b/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy index b04f485007..5826b419da 100644 --- a/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy +++ b/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy @@ -94,7 +94,7 @@ if (productStore) { productStoreFacilityId = productStore.inventoryFacilityId; } context.facilityId = productStoreFacilityId; -inventorySummary = dispatcher.runSync("getProductInventorySummaryForItems", [orderItems : shoppingCart.makeOrderItems(), facilityId : productStoreFacilityId]); +inventorySummary = runService('getProductInventorySummaryForItems', [orderItems : shoppingCart.makeOrderItems(), facilityId : productStoreFacilityId]); context.availableToPromiseMap = inventorySummary.availableToPromiseMap; context.quantityOnHandMap = inventorySummary.quantityOnHandMap; context.mktgPkgATPMap = inventorySummary.mktgPkgATPMap; diff --git a/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.groovy b/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.groovy index a38c96903f..b67f02c2b8 100644 --- a/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.groovy +++ b/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.groovy @@ -115,7 +115,7 @@ for (supplierProduct in supplierProducts) { } product = delegator.findOne("Product", ["productId" : productId], true); productFacilityList.each { productFacility -> - result = dispatcher.runSync("getInventoryAvailableByFacility", ["productId" : productId, "facilityId" : productFacility.facilityId]); + result = runService('getInventoryAvailableByFacility', ["productId" : productId, "facilityId" : productFacility.facilityId]); qohAtp = result.quantityOnHandTotal.toPlainString() + "/" + result.availableToPromiseTotal.toPlainString(); productInfoMap = [:]; diff --git a/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy b/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy index 51330fc9cf..14d74fe9b2 100644 --- a/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy +++ b/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy @@ -64,7 +64,7 @@ if (context.orderByFields) { } else { andMap.put("orderByFields", ["sequenceNum", "productId"]); } -catResult = dispatcher.runSync("getProductCategoryAndLimitedMembers", andMap); +catResult = runService('getProductCategoryAndLimitedMembers', andMap); productCategory = catResult.productCategory; productCategoryMembers = catResult.productCategoryMembers; context.productCategoryMembers = productCategoryMembers; diff --git a/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CompareProducts.groovy b/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CompareProducts.groovy index 24b706f13f..4708bca6d4 100644 --- a/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CompareProducts.groovy +++ b/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CompareProducts.groovy @@ -54,7 +54,7 @@ compareList.each { product -> priceContext.agreementId = cart.getAgreementId(); priceContext.partyId = cart.getPartyId(); // IMPORTANT: otherwise it'll be calculating prices using the logged in user which could be a CSR instead of the customer priceContext.checkIncludeVat = "Y"; - productData.priceMap = dispatcher.runSync("calculateProductPrice", priceContext); + productData.priceMap = runService('calculateProductPrice', priceContext); condList = [ EntityCondition.makeCondition("productId", product.productId), diff --git a/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/InlineProductDetail.groovy b/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/InlineProductDetail.groovy index b28cbd87fd..cb165c8183 100644 --- a/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/InlineProductDetail.groovy +++ b/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/InlineProductDetail.groovy @@ -134,13 +134,13 @@ if (inlineProduct) { priceContext.checkIncludeVat = "Y"; priceContext.agreementId = cart.getAgreementId(); priceContext.partyId = cart.getPartyId(); // IMPORTANT: must put this in, or price will be calculated for the CSR instead of the customer - priceMap = dispatcher.runSync("calculateProductPrice", priceContext); + priceMap = runService('calculateProductPrice', priceContext); context.priceMap = priceMap; } else { // purchase order: run the "calculatePurchasePrice" service priceContext = [product : inlineProduct, currencyUomId : cart.getCurrency(), partyId : cart.getPartyId(), userLogin : userLogin]; - priceMap = dispatcher.runSync("calculatePurchasePrice", priceContext); + priceMap = runService('calculatePurchasePrice', priceContext); context.priceMap = priceMap; } @@ -154,10 +154,10 @@ if (inlineProduct) { if ("VV_FEATURETREE".equals(ProductWorker.getProductVirtualVariantMethod(delegator, inlineProductId))) { context.featureLists = ProductWorker.getSelectableProductFeaturesByTypesAndSeq(inlineProduct); } else { - featureMap = dispatcher.runSync("getProductFeatureSet", [productId : inlineProductId]); + featureMap = runService("getProductFeatureSet", [productId : inlineProductId]); featureSet = featureMap.featureSet; if (featureSet) { - variantTreeMap = dispatcher.runSync("getProductVariantTree", [productId : inlineProductId, featureOrder : featureSet, productStoreId : productStoreId]); + variantTreeMap = runService('getProductVariantTree', [productId : inlineProductId, featureOrder : featureSet, productStoreId : productStoreId]); variantTree = variantTreeMap.variantTree; imageMap = variantTreeMap.variantSample; virtualVariant = variantTreeMap.virtualVariant; @@ -268,7 +268,7 @@ if (inlineProduct) { } // make a list of variant sku with requireAmount - variantsRes = dispatcher.runSync("getAssociatedProducts", [productId : inlineProductId, type : "PRODUCT_VARIANT", checkViewAllow : true, prodCatalogId : currentCatalogId]); + variantsRes = runService('getAssociatedProducts', [productId : inlineProductId, type : "PRODUCT_VARIANT", checkViewAllow : true, prodCatalogId : currentCatalogId]); variants = variantsRes.assocProducts; if (variants) { amt = new StringBuffer(); @@ -289,7 +289,7 @@ if (inlineProduct) { if (cart.isSalesOrder()) { // sales order: run the "calculateProductPrice" service priceContext.product = variant; - variantPriceMap = dispatcher.runSync("calculateProductPrice", priceContext); + variantPriceMap = runService('calculateProductPrice', priceContext); } amt.append(" if (sku == \"" + variant.productId + "\") return \"" + (variant.requireAmount ?: "N") + "\"; "); variantPriceJS.append(" if (sku == \"" + variant.productId + "\") return \"" + numberFormat.format(variantPriceMap.basePrice) + "\"; "); diff --git a/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy b/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy index 17fb02c50d..bfd80540a5 100644 --- a/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy +++ b/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy @@ -136,7 +136,7 @@ if (product) { if (categoryId) { prevNextMap = [categoryId : categoryId, productId : productId]; prevNextMap.orderByFields = context.orderByFields ?: ["sequenceNum", "productId"]; - catNextPreviousResult = dispatcher.runSync("getPreviousNextProducts", prevNextMap); + catNextPreviousResult = runService('getPreviousNextProducts', prevNextMap); if (ServiceUtil.isError(catNextPreviousResult)) { request.setAttribute("errorMessageList", [ServiceUtil.getErrorMessage(catNextPreviousResult)]); return; @@ -182,13 +182,13 @@ if (product) { priceContext.checkIncludeVat = "Y"; priceContext.agreementId = cart.getAgreementId(); priceContext.partyId = cart.getPartyId(); // IMPORTANT: must put this in, or price will be calculated for the CSR instead of the customer - priceMap = dispatcher.runSync("calculateProductPrice", priceContext); + priceMap = runService('calculateProductPrice', priceContext); context.priceMap = priceMap; } else { // purchase order: run the "calculatePurchasePrice" service priceContext = [product : product, currencyUomId : cart.getCurrency(), partyId : cart.getPartyId(), userLogin : userLogin]; - priceMap = dispatcher.runSync("calculatePurchasePrice", priceContext); + priceMap = runService('calculatePurchasePrice', priceContext); context.priceMap = priceMap; } @@ -219,7 +219,7 @@ if (product) { context.daysToShip = productFacility?.daysToShip */ - resultOutput = dispatcher.runSync("getInventoryAvailableByFacility", [productId : productId, facilityId : facilityId, useCache : false]); + resultOutput = runService('getInventoryAvailableByFacility', [productId : productId, facilityId : facilityId, useCache : false]); totalAvailableToPromise = resultOutput.availableToPromiseTotal; if (totalAvailableToPromise) { productFacility = delegator.findOne("ProductFacility", [productId : productId, facilityId : facilityId], true); @@ -236,7 +236,7 @@ if (product) { } // get the product distinguishing features - disFeatureMap = dispatcher.runSync("getProductFeatures", [productId : productId, type : "DISTINGUISHING_FEAT"]); + disFeatureMap = runService('getProductFeatures', [productId : productId, type : "DISTINGUISHING_FEAT"]); disFeatureList = disFeatureMap.productFeatures; context.disFeatureList = disFeatureList; @@ -269,14 +269,14 @@ if (product) { if ("VV_FEATURETREE".equals(ProductWorker.getProductVirtualVariantMethod(delegator, productId))) { context.featureLists = ProductWorker.getSelectableProductFeaturesByTypesAndSeq(product); } else { - featureMap = dispatcher.runSync("getProductFeatureSet", [productId : productId]); + featureMap = runService('getProductFeatureSet', [productId : productId]); featureSet = featureMap.featureSet; if (featureSet) { //if order is purchase then don't calculate available inventory for product. if (cart.isPurchaseOrder()) { - variantTreeMap = dispatcher.runSync("getProductVariantTree", [productId : productId, featureOrder : featureSet, checkInventory: false]); + variantTreeMap = runService('getProductVariantTree', [productId : productId, featureOrder : featureSet, checkInventory: false]); } else { - variantTreeMap = dispatcher.runSync("getProductVariantTree", [productId : productId, featureOrder : featureSet, productStoreId : productStoreId]); + variantTreeMap = runService('getProductVariantTree', [productId : productId, featureOrder : featureSet, productStoreId : productStoreId]); } variantTree = variantTreeMap.variantTree; imageMap = variantTreeMap.variantSample; @@ -392,7 +392,7 @@ if (product) { } // make a list of variant sku with requireAmount - variantsRes = dispatcher.runSync("getAssociatedProducts", [productId : productId, type : "PRODUCT_VARIANT", checkViewAllow : true, prodCatalogId : currentCatalogId]); + variantsRes = runService('getAssociatedProducts', [productId : productId, type : "PRODUCT_VARIANT", checkViewAllow : true, prodCatalogId : currentCatalogId]); variants = variantsRes.assocProducts; variantPriceList = []; if (variants) { @@ -414,7 +414,7 @@ if (product) { priceContext.product = variant; if (cart.isSalesOrder()) { // sales order: run the "calculateProductPrice" service - variantPriceMap = dispatcher.runSync("calculateProductPrice", priceContext); + variantPriceMap = runService('calculateProductPrice', priceContext); BigDecimal calculatedPrice = (BigDecimal)variantPriceMap.get("price"); // Get the minimum quantity for variants if MINIMUM_ORDER_PRICE is set for variants. variantPriceMap.put("minimumQuantity", ShoppingCart.getMinimumOrderQuantity(delegator, calculatedPrice, variant.get("productId"))); @@ -440,7 +440,7 @@ if (product) { } variantPriceList.add(variantPriceMap); } else { - variantPriceMap = dispatcher.runSync("calculatePurchasePrice", priceContext); + variantPriceMap = runService('calculatePurchasePrice', priceContext); } amt.append(" if (sku == \"" + variant.productId + "\") return \"" + (variant.requireAmount ?: "N") + "\"; "); if (variantPriceMap && variantPriceMap.basePrice) { @@ -448,7 +448,7 @@ if (product) { } // make a list of virtual variants sku with requireAmount - virtualVariantsRes = dispatcher.runSync("getAssociatedProducts", [productIdTo : variant.productId, type : "ALTERNATIVE_PACKAGE", checkViewAllow : true, prodCatalogId : currentCatalogId]); + virtualVariantsRes = runService('getAssociatedProducts', [productIdTo : variant.productId, type : "ALTERNATIVE_PACKAGE", checkViewAllow : true, prodCatalogId : currentCatalogId]); virtualVariants = virtualVariantsRes.assocProducts; if(virtualVariants){ @@ -458,7 +458,7 @@ if (product) { priceContext.product = virtual; if (cart.isSalesOrder()) { // sales order: run the "calculateProductPrice" service - virtualPriceMap = dispatcher.runSync("calculateProductPrice", priceContext); + virtualPriceMap = runService('calculateProductPrice', priceContext); BigDecimal calculatedPrice = (BigDecimal)virtualPriceMap.get("price"); // Get the minimum quantity for variants if MINIMUM_ORDER_PRICE is set for variants. virtualPriceMap.put("minimumQuantity", ShoppingCart.getMinimumOrderQuantity(delegator, calculatedPrice, virtual.get("productId"))); @@ -485,7 +485,7 @@ if (product) { variantPriceList.add(virtualPriceMap); variantPriceJS.append(" if (sku == \"" + virtual.productId + "\") return \"" + UtilFormatOut.formatCurrency(variantPriceMap.basePrice, currencyUomId, locale, 10) + "\"; "); } else { - virtualPriceMap = dispatcher.runSync("calculatePurchasePrice", priceContext); + virtualPriceMap = runService('calculatePurchasePrice', priceContext); variantPriceJS.append(" if (sku == \"" + virtual.productId + "\") return \"" + UtilFormatOut.formatCurrency(variantPriceMap.price, currencyUomId, locale, 10) + "\"; "); } } @@ -512,7 +512,7 @@ if (product) { jsBuf.append("