svn commit: r608345 - in /ofbiz/branches/release4.0/applications: order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java party/webapp/partymgr/party/PartyForms.xml

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

svn commit: r608345 - in /ofbiz/branches/release4.0/applications: order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java party/webapp/partymgr/party/PartyForms.xml

jleroux@apache.org
Author: jleroux
Date: Wed Jan  2 21:52:28 2008
New Revision: 608345

URL: http://svn.apache.org/viewvc?rev=608345&view=rev
Log:
Applied fix from trunk for revision: 608283

Modified:
    ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
    ofbiz/branches/release4.0/applications/party/webapp/partymgr/party/PartyForms.xml

Modified: ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=608345&r1=608344&r2=608345&view=diff
==============================================================================
--- ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java (original)
+++ ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java Wed Jan  2 21:52:28 2008
@@ -1225,7 +1225,7 @@
 
                         // create an adjustment and add it to the cartItem that implements the promotion action
                         double percentModifier = productPromoAction.get("amount") == null ? 0.0 : (productPromoAction.getDouble("amount").doubleValue()/100.0);
-                        double lineAmount = quantityUsed * cartItem.getBasePrice();
+                        double lineAmount = quantityUsed * cartItem.getBasePrice() * cartItem.getRentalAdjustment();
                         double discountAmount = -(lineAmount * percentModifier);
                         discountAmountTotal += discountAmount;
                         // not doing this any more, now distributing among conditions and actions (see call below): doOrderItemPromoAction(productPromoAction, cartItem, discountAmount, "amount", delegator);
@@ -1270,8 +1270,8 @@
                     // create an adjustment and add it to the cartItem that implements the promotion action
                     double discount = productPromoAction.get("amount") == null ? 0.0 : productPromoAction.getDouble("amount").doubleValue();
                     // don't allow the discount to be greater than the price
-                    if (discount > cartItem.getBasePrice()) {
-                        discount = cartItem.getBasePrice();
+                    if (discount > cartItem.getBasePrice() * cartItem.getRentalAdjustment()) {
+                        discount = cartItem.getBasePrice() * cartItem.getRentalAdjustment();
                     }
                     double discountAmount = -(quantityUsed * discount);
                     discountAmountTotal += discountAmount;
@@ -1312,7 +1312,7 @@
                     double quantityUsed = cartItem.addPromoQuantityCandidateUse(quantityDesired, productPromoAction, false);
                     if (quantityUsed > 0) {
                         quantityDesired -= quantityUsed;
-                        totalAmount += quantityUsed * cartItem.getBasePrice();
+                        totalAmount += quantityUsed * cartItem.getBasePrice() * cartItem.getRentalAdjustment();
                         cartItemsUsed.add(cartItem);
                     }
                 }
@@ -1371,7 +1371,7 @@
                 }
                 
                 // get difference between basePrice and specialPromoPrice and adjust for that
-                double difference = -(cartItem.getBasePrice() - cartItem.getSpecialPromoPrice().doubleValue());
+                double difference = -(cartItem.getBasePrice() * cartItem.getRentalAdjustment() - cartItem.getSpecialPromoPrice().doubleValue());
 
                 if (difference != 0.0) {
                     double quantityUsed = cartItem.addPromoQuantityCandidateUse(cartItem.getQuantity(), productPromoAction, false);

Modified: ofbiz/branches/release4.0/applications/party/webapp/partymgr/party/PartyForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/party/webapp/partymgr/party/PartyForms.xml?rev=608345&r1=608344&r2=608345&view=diff
==============================================================================
--- ofbiz/branches/release4.0/applications/party/webapp/partymgr/party/PartyForms.xml (original)
+++ ofbiz/branches/release4.0/applications/party/webapp/partymgr/party/PartyForms.xml Wed Jan  2 21:52:28 2008
@@ -275,10 +275,10 @@
         <field name="USER_HOME_CONTACT" title="${uiLabelMap.PartyPhoneNumber}"><text size="15" maxlength="15"/></field>
         <field name="USER_HOME_EXT" title="${uiLabelMap.PartyContactExt}"><text size="6" maxlength="10"/></field>
         <field name="USER_HOME_ALLOW_SOL" title="${uiLabelMap.PartyContactAllowSolicitation}?"><drop-down allow-empty="true"><option key="Y"/><option key="N"/></drop-down></field>
-        <field name="WorkPhoneTitle" title="${uiLabelMap.PartyContactWorkPhoneNumber}" title-area-style="group-label"><display description=" " also-hidden="false"/></field>
+        <field name="WorkPhoneTitle" title="${uiLabelMap.PartyContactWorkPhoneNumber}" title-area-style="group-label" ><display description=" " also-hidden="false"/></field>
         <field name="USER_WORK_COUNTRY" title="${uiLabelMap.PartyCountryCode}"><text size="4" maxlength="10"/></field>
         <field name="USER_WORK_AREA" title="${uiLabelMap.PartyAreaCode}"><text size="4" maxlength="10"/></field>
-        <field name="USER_WORK_CONTACT" title="${uiLabelMap.PartyPhoneNumber}"><text size="15" maxlength="15"/></field>
+        <field name="USER_WORK_CONTACT" title="${uiLabelMap.PartyPhoneNumber}" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text size="15" maxlength="15"/></field>
         <field name="USER_WORK_EXT" title="${uiLabelMap.PartyContactExt}"><text size="6" maxlength="10"/></field>
         <field name="USER_WORK_ALLOW_SOL" title="${uiLabelMap.PartyContactAllowSolicitation}?"><drop-down allow-empty="true"><option key="Y"/><option key="N"/></drop-down></field>
         <field name="FaxPhoneTitle" title="${uiLabelMap.PartyContactFaxPhoneNumber}" title-area-style="group-label"><display description=" " also-hidden="false"/></field>