svn commit: r423426 - in /incubator/ofbiz/trunk/applications/product: src/org/ofbiz/product/subscription/SubscriptionServices.java widget/catalog/SubscriptionForms.xml

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

svn commit: r423426 - in /incubator/ofbiz/trunk/applications/product: src/org/ofbiz/product/subscription/SubscriptionServices.java widget/catalog/SubscriptionForms.xml

hansbak-2
Author: hansbak
Date: Wed Jul 19 03:32:53 2006
New Revision: 423426

URL: http://svn.apache.org/viewvc?rev=423426&view=rev
Log:
 make Uom mandatory on subscription resource because also required in processExtendSubscription service. Removed null pointer possibility on empty field useTime

Modified:
    incubator/ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java
    incubator/ofbiz/trunk/applications/product/widget/catalog/SubscriptionForms.xml

Modified: incubator/ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java?rev=423426&r1=423425&r2=423426&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java (original)
+++ incubator/ofbiz/trunk/applications/product/src/org/ofbiz/product/subscription/SubscriptionServices.java Wed Jul 19 03:32:53 2006
@@ -184,7 +184,10 @@
                 GenericValue productSubscriptionResource = (GenericValue) productSubscriptionResourceIter.next();
 
                 Long useTime = (Long) productSubscriptionResource.get("useTime");
-                Integer newUseTime = new Integer(useTime.intValue() * qty.intValue());
+                Integer newUseTime = new Integer(0);
+                if (useTime != null) {
+                    newUseTime = new Integer(useTime.intValue() * qty.intValue());
+                }
                 context.put("useTime", newUseTime);
                 context.put("useTimeUomId", productSubscriptionResource.get("useTimeUomId"));
                 context.put("useRoleTypeId", productSubscriptionResource.get("useRoleTypeId"));

Modified: incubator/ofbiz/trunk/applications/product/widget/catalog/SubscriptionForms.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/widget/catalog/SubscriptionForms.xml?rev=423426&r1=423425&r2=423426&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/product/widget/catalog/SubscriptionForms.xml (original)
+++ incubator/ofbiz/trunk/applications/product/widget/catalog/SubscriptionForms.xml Wed Jul 19 03:32:53 2006
@@ -271,7 +271,7 @@
         <field name="subscriptionResourceId"><hidden/></field>
         <field name="productId" widget-style="tabletext"><display/></field>
         <field name="useTimeUomId" widget-style="selectBox">
-            <drop-down allow-empty="true">
+            <drop-down>
                 <entity-options entity-name="Uom" description="${description} (${abbreviation})" key-field-name="uomId">
                     <entity-constraint name="uomTypeId" value="TIME_FREQ_MEASURE"/>
                     <entity-order-by field-name="description"/>
@@ -300,7 +300,7 @@
         <field name="subscriptionResourceId"><hidden/></field>
         <field name="productId"><lookup target-form-name="LookupProduct"/></field>
         <field name="useTimeUomId" widget-style="selectBox">
-            <drop-down allow-empty="true">
+            <drop-down allow-empty="false">
                 <entity-options entity-name="Uom" description="${description} (${abbreviation})" key-field-name="uomId">
                     <entity-constraint name="uomTypeId" value="TIME_FREQ_MEASURE"/>
                     <entity-order-by field-name="description"/>