svn commit: r530524 - in /ofbiz/trunk/applications/product: config/ entitydef/ servicedef/ src/org/ofbiz/shipment/shipment/ webapp/catalog/store/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r530524 - in /ofbiz/trunk/applications/product: config/ entitydef/ servicedef/ src/org/ofbiz/shipment/shipment/ webapp/catalog/store/

jacopoc
Author: jacopoc
Date: Thu Apr 19 12:12:04 2007
New Revision: 530524

URL: http://svn.apache.org/viewvc?view=rev&rev=530524
Log:
Implemented new Shipping Estimate Feature:
Flat Shipping Percent - shipamount=shipamount + (shipamount * percent)

Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.properties
    ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml
    ofbiz/trunk/applications/product/servicedef/services_shipment.xml
    ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
    ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.properties?view=diff&rev=530524&r1=530523&r2=530524
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.properties (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.properties Thu Apr 19 12:12:04 2007
@@ -604,6 +604,7 @@
 ProductFlatBasePercent=Flat Base Percent
 ProductFlatBasePrice=Flat Base Price
 ProductFlatItemPrice=Flat Item Price
+ProductFlatShippingPercent=Flat Shipping Percent
 ProductFlOz=Fl. Oz.
 ProductFromGeo=From Geo
 ProductFromLocation=From Location
@@ -1198,6 +1199,7 @@
 ProductShipOrder=Ship Order
 ProductShipamountOrderTotalPercent=shipamount=shipamount + (orderTotal * percent)
 ProductShipamountPrice=shipamount=shipamount + price
+ProductShipamountShippingTotalPercent=shipamount=shipamount + (shipamount * percent)
 ProductShipamountTotalQuantityPrice=shipamount=shipamount + (totalQuantity * price)
 ProductShipamount=shipamount
 ProductShipmentBoxType=Box Type

Modified: ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml?view=diff&rev=530524&r1=530523&r2=530524
==============================================================================
--- ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml (original)
+++ ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml Thu Apr 19 12:12:04 2007
@@ -729,6 +729,7 @@
       <field name="orderFlatPrice" type="currency-amount"></field>
       <field name="orderPricePercent" type="floating-point"></field>
       <field name="orderItemFlatPrice" type="currency-amount"></field>
+      <field name="shippingPricePercent" type="floating-point"></field>
       <field name="productFeatureGroupId" type="id"></field>
       <field name="oversizeUnit" type="floating-point"></field>
       <field name="oversizePrice" type="currency-amount"></field>

Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?view=diff&rev=530524&r1=530523&r2=530524
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Thu Apr 19 12:12:04 2007
@@ -577,6 +577,7 @@
         <attribute name="flatPercent" type="Double" mode="IN" optional="false"/>
         <attribute name="flatPrice" type="Double" mode="IN" optional="true"/>
         <attribute name="flatItemPrice" type="Double" mode="IN" optional="true"/>
+        <attribute name="shippingPricePercent" type="Double" mode="IN" optional="true"/>
         <attribute name="productFeatureGroupId" type="String" mode="IN" optional="true"/>
         <attribute name="featurePercent" type="Double" mode="IN" optional="true"/>
         <attribute name="featurePrice" type="Double" mode="IN" optional="true"/>

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java?view=diff&rev=530524&r1=530523&r2=530524
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java Thu Apr 19 12:12:04 2007
@@ -78,6 +78,7 @@
         estimate.set("orderPricePercent", context.get("flatPercent"));
         estimate.set("orderFlatPrice", context.get("flatPrice"));
         estimate.set("orderItemFlatPrice", context.get("flatItemPrice"));
+        estimate.set("shippingPricePercent", context.get("shippingPricePercent"));
         estimate.set("productFeatureGroupId", context.get("productFeatureGroupId"));
         estimate.set("oversizeUnit", context.get("oversizeUnit"));
         estimate.set("oversizePrice", context.get("oversizePrice"));
@@ -433,11 +434,16 @@
         if (estimate.getDouble("orderPricePercent") != null)
             orderPercent = estimate.getDouble("orderPricePercent").doubleValue();
 
+        double shippingPricePercent = 0.00;
+        if (estimate.getDouble("shippingPricePercent") != null)
+            shippingPricePercent = estimate.getDouble("shippingPricePercent").doubleValue();
+
         double itemFlatAmount = shippableQuantity.doubleValue() * orderItemFlat;
         double orderPercentage = shippableTotal.doubleValue() * (orderPercent / 100);
 
         // flat total
         double flatTotal = orderFlat + itemFlatAmount + orderPercentage;
+        flatTotal = flatTotal + flatTotal * (shippingPricePercent / 100);
 
         // spans
         double weightUnit = 0.00;

Modified: ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml?view=diff&rev=530524&r1=530523&r2=530524
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml Thu Apr 19 12:12:04 2007
@@ -505,6 +505,7 @@
         <field name="flatPercent" title="${uiLabelMap.ProductFlatBasePercent}" tooltip="${uiLabelMap.ProductShipamountOrderTotalPercent}"><text/></field>
         <field name="flatPrice" title="${uiLabelMap.ProductFlatBasePrice}" tooltip="${uiLabelMap.ProductShipamountPrice}"><text/></field>
         <field name="flatItemPrice" title="${uiLabelMap.ProductFlatItemPrice}" tooltip="${uiLabelMap.ProductShipamountTotalQuantityPrice}"><text/></field>
+        <field name="shippingPricePercent" title="${uiLabelMap.ProductFlatShippingPercent}" tooltip="${uiLabelMap.ProductShipamountShippingTotalPercent}"><text/></field>
         
         <field name="FeatureTitle" title=" " title-area-style="group-label"><display description=" " also-hidden="false"/></field>
         <field name="productFeatureGroupId" title="${uiLabelMap.ProductFeatureGroup}" tooltip="${uiLabelMap.ProductFeatureMessage}"><text/></field>
@@ -602,6 +603,7 @@
         <field name="orderPricePercent" title="${uiLabelMap.ProductFlatBasePercent}" tooltip="${uiLabelMap.ProductShipamountOrderTotalPercent}"><display/></field>
         <field name="orderFlatPrice" title="${uiLabelMap.ProductFlatBasePrice}" tooltip="${uiLabelMap.ProductShipamountPrice}"><display/></field>
         <field name="orderItemFlatPrice" title="${uiLabelMap.ProductFlatItemPrice}" tooltip="${uiLabelMap.ProductShipamountTotalQuantityPrice}"><display/></field>
+        <field name="shippingPricePercent" title="${uiLabelMap.ProductFlatShippingPercent}" tooltip="${uiLabelMap.ProductShipamountShippingTotalPercent}"><display/></field>
         
         <field name="FeatureTitle" title=" " title-area-style="group-label"><display description=" " also-hidden="false"/></field>
         <field name="productFeatureGroupId" title="${uiLabelMap.ProductFeatureGroup}" tooltip="${uiLabelMap.ProductFeatureMessage}"><display/></field>