No functional change, completes r179986 which was framework only, this is for
plugins ================================================================================ While checking there were no other cases like in OFBIZ-9432 (missing path to class), to be consistent I removed the trailing semicolons in groovy scripts and made few formatting ================================================================================ git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1800450 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -190,20 +190,20 @@ under the License.
|
||||
<check-errors/>
|
||||
<else>
|
||||
<script>groovy:
|
||||
webPosSession = org.apache.ofbiz.webpos.WebPosEvents.getWebPosSession(request, null);
|
||||
webPosSession = org.apache.ofbiz.webpos.WebPosEvents.getWebPosSession(request, null)
|
||||
if (webPosSession != null) {
|
||||
parameters.put("webPosSession", webPosSession);
|
||||
parameters.put("productStoreId", org.apache.ofbiz.product.store.ProductStoreWorker.getProductStoreId(request));
|
||||
parameters.put("catalogId", org.apache.ofbiz.product.catalog.CatalogWorker.getCurrentCatalogId(request));
|
||||
parameters.put("webSiteId", org.apache.ofbiz.webapp.website.WebSiteWorker.getWebSiteId(request));
|
||||
session = request.getSession();
|
||||
parameters.put("autoUserLogin", session.getAttribute("autoUserLogin"));
|
||||
cart = webPosSession.getCart();
|
||||
parameters.put("webPosSession", webPosSession)
|
||||
parameters.put("productStoreId", org.apache.ofbiz.product.store.ProductStoreWorker.getProductStoreId(request))
|
||||
parameters.put("catalogId", org.apache.ofbiz.product.catalog.CatalogWorker.getCurrentCatalogId(request))
|
||||
parameters.put("webSiteId", org.apache.ofbiz.webapp.website.WebSiteWorker.getWebSiteId(request))
|
||||
session = request.getSession()
|
||||
parameters.put("autoUserLogin", session.getAttribute("autoUserLogin"))
|
||||
cart = webPosSession.getCart()
|
||||
if (cart != null) {
|
||||
parameters.put("cart", cart);
|
||||
parameters.put("currencyId", cart.getCurrency());
|
||||
parameters.put("agreementId", cart.getAgreementId());
|
||||
parameters.put("partyId", cart.getPartyId());
|
||||
parameters.put("cart", cart)
|
||||
parameters.put("currencyId", cart.getCurrency())
|
||||
parameters.put("agreementId", cart.getAgreementId())
|
||||
parameters.put("partyId", cart.getPartyId())
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -338,9 +338,9 @@ under the License.
|
||||
<check-errors/>
|
||||
<set field="dispatcher" from-field="parameters.dispatcher" type="Object"/>
|
||||
<script>groovy:
|
||||
import org.apache.ofbiz.order.shoppingcart.shipping.ShippingEstimateWrapper;
|
||||
shippingEstWpr = ShippingEstimateWrapper.getWrapper(dispatcher, shoppingCart, 0);
|
||||
parameters.put("shippingEstWpr", shippingEstWpr);
|
||||
import org.apache.ofbiz.order.shoppingcart.shipping.ShippingEstimateWrapper
|
||||
shippingEstWpr = ShippingEstimateWrapper.getWrapper(dispatcher, shoppingCart, 0)
|
||||
parameters.put("shippingEstWpr", shippingEstWpr)
|
||||
</script>
|
||||
<set field="shippingEstWpr" from-field="parameters.shippingEstWpr"/>
|
||||
<call-object-method obj-field="shippingEstWpr" method-name="getShippingMethods" ret-field="carrierShipmentMethodList"/>
|
||||
@@ -392,18 +392,18 @@ under the License.
|
||||
<call-object-method obj-field="webPosSession" method-name="getCurrentTransaction" ret-field="webPosTransaction"/>
|
||||
<check-errors/>
|
||||
<script>groovy:
|
||||
shippingMethod = parameters.get("shipMethod");
|
||||
shippingMethod = parameters.get("shipMethod")
|
||||
if(shippingMethod != null) {
|
||||
shipmentMethodTypeId = shippingMethod.substring(0, shippingMethod.indexOf("@"));
|
||||
shipmentMethodTypeId = shippingMethod.substring(0, shippingMethod.indexOf("@"))
|
||||
if (shippingMethod.indexOf(":") != -1) {
|
||||
carrierPartyId = shippingMethod.substring(shippingMethod.indexOf("@")+1, shippingMethod.indexOf(":"));
|
||||
productStoreShipMethId = shippingMethod.substring(shippingMethod.indexOf(":")+1);
|
||||
parameters.put("productStoreShipMethId", productStoreShipMethId);
|
||||
carrierPartyId = shippingMethod.substring(shippingMethod.indexOf("@")+1, shippingMethod.indexOf(":"))
|
||||
productStoreShipMethId = shippingMethod.substring(shippingMethod.indexOf(":")+1)
|
||||
parameters.put("productStoreShipMethId", productStoreShipMethId)
|
||||
} else {
|
||||
carrierPartyId = shippingMethod.substring(shippingMethod.indexOf("@")+1);
|
||||
carrierPartyId = shippingMethod.substring(shippingMethod.indexOf("@")+1)
|
||||
}
|
||||
parameters.put("shipmentMethodTypeId", shipmentMethodTypeId);
|
||||
parameters.put("carrierPartyId", carrierPartyId);
|
||||
parameters.put("shipmentMethodTypeId", shipmentMethodTypeId)
|
||||
parameters.put("carrierPartyId", carrierPartyId)
|
||||
}
|
||||
</script>
|
||||
<set field="shipmentMethodTypeId" from-field="parameters.shipmentMethodTypeId"/>
|
||||
@@ -430,22 +430,22 @@ under the License.
|
||||
<set field="locale" from-field="parameters.locale" type="Object"/>
|
||||
<script>groovy:
|
||||
Map shipCost = org.apache.ofbiz.order.shoppingcart.shipping.ShippingEvents.getShipGroupEstimate(dispatcher, delegator, shoppingCart, 0);
|
||||
shippingTotal = shipCost.get("shippingTotal");
|
||||
shippingTotal = shipCost.get("shippingTotal")
|
||||
if (shippingTotal == null) {
|
||||
shippingTotal = BigDecimal.ZERO;
|
||||
}
|
||||
shoppingCart.setItemShipGroupEstimate(shippingTotal, 0);
|
||||
parameters.put("shippingTotal", org.apache.ofbiz.base.util.UtilFormatOut.formatCurrency(shippingTotal, isoCode, locale));
|
||||
shoppingCart.setItemShipGroupEstimate(shippingTotal, 0)
|
||||
parameters.put("shippingTotal", org.apache.ofbiz.base.util.UtilFormatOut.formatCurrency(shippingTotal, isoCode, locale))
|
||||
|
||||
// Calculate and add the tax adjustments
|
||||
webPosTransaction.calcTax();
|
||||
webPosTransaction.calcTax()
|
||||
|
||||
salesTax = shoppingCart.getTotalSalesTax();
|
||||
totalSalesTax = org.apache.ofbiz.base.util.UtilFormatOut.formatCurrency(salesTax, isoCode, locale);
|
||||
parameters.put("totalSalesTax", totalSalesTax);
|
||||
salesTax = shoppingCart.getTotalSalesTax()
|
||||
totalSalesTax = org.apache.ofbiz.base.util.UtilFormatOut.formatCurrency(salesTax, isoCode, locale)
|
||||
parameters.put("totalSalesTax", totalSalesTax)
|
||||
|
||||
cartGrandTotal = org.apache.ofbiz.base.util.UtilFormatOut.formatCurrency(shoppingCart.getGrandTotal(), isoCode, locale);
|
||||
parameters.put("cartGrandTotal", cartGrandTotal);
|
||||
cartGrandTotal = org.apache.ofbiz.base.util.UtilFormatOut.formatCurrency(shoppingCart.getGrandTotal(), isoCode, locale)
|
||||
parameters.put("cartGrandTotal", cartGrandTotal)
|
||||
</script>
|
||||
<call-class-method method-name="doPromotions" class-name="org.apache.ofbiz.order.shoppingcart.product.ProductPromoWorker">
|
||||
<field field="shoppingCart" type="org.apache.ofbiz.order.shoppingcart.ShoppingCart"/>
|
||||
|
||||
Reference in New Issue
Block a user