svn commit: r894595 - /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml

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

svn commit: r894595 - /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml

mor-2
Author: mor
Date: Wed Dec 30 11:47:33 2009
New Revision: 894595

URL: http://svn.apache.org/viewvc?rev=894595&view=rev
Log:
Maintainenace for a fixed asset is also created based on the meter reading entered by the user. The code fails because of null value comparision when user does not specify any meter reading. These checks prevent the error. Bug reported and fix by Arun Patidar.

Modified:
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml?rev=894595&r1=894594&r2=894595&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml Wed Dec 30 11:47:33 2009
@@ -356,11 +356,14 @@
             </if-not-empty>
             <set field="maxIntervalQty" value="0" type="BigDecimal"/>
             <iterate list="maintList" entry="maintValue">
+                <if-not-empty field="maintValue.intervalQuantity">
                 <if-compare-field field="maintValue.intervalQuantity" operator="greater" to-field="maxIntervalQty" type="BigDecimal">
                     <set field="maxIntervalQty" from-field="maintValue.intervalQuantity" type="BigDecimal"/>
                 </if-compare-field>
+                </if-not-empty>
             </iterate>
             <set field="nextIntervalQty" value="${bsh:maxIntervalQty.add(productMaintValue.getBigDecimal(&quot;intervalQuantity&quot;));}" type="BigDecimal"/>
+            <if-not-empty field="meterValue.meterValue">
             <if-compare-field field="nextIntervalQty" operator="less-equals" to-field="meterValue.meterValue" type="BigDecimal">
                 <set field="maintDue" value="false"/>
                 <if-compare field="repeatCount" operator="greater" value="0" type="Long">
@@ -380,6 +383,7 @@
                     <check-errors/>
                 </if-compare>
             </if-compare-field>
+            </if-not-empty>
         </iterate>
     </simple-method>
     <simple-method method-name="createMaintsFromTimeInterval" short-description="Create Fixed Asset Maintenances From A Product Maint Time Interval">