svn commit: r1783419 - in /ofbiz/branches/release16.11: ./ applications/accounting/minilang/fixedasset/FixedAssetServices.xml applications/accounting/widget/FixedAssetScreens.xml

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

svn commit: r1783419 - in /ofbiz/branches/release16.11: ./ applications/accounting/minilang/fixedasset/FixedAssetServices.xml applications/accounting/widget/FixedAssetScreens.xml

jacopoc
Author: jacopoc
Date: Fri Feb 17 16:12:06 2017
New Revision: 1783419

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

Fixed: straight line fixed asset depreciation method was not computing properly
depreciation transactions for assets that are used after their expected end of
life.


Modified:
    ofbiz/branches/release16.11/   (props changed)
    ofbiz/branches/release16.11/applications/accounting/minilang/fixedasset/FixedAssetServices.xml
    ofbiz/branches/release16.11/applications/accounting/widget/FixedAssetScreens.xml

Propchange: ofbiz/branches/release16.11/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 17 16:12:06 2017
@@ -10,5 +10,5 @@
 /ofbiz/branches/json-integration-refactoring:1634077-1635900
 /ofbiz/branches/multitenant20100310:921280-927264
 /ofbiz/branches/release13.07:1547657
-/ofbiz/ofbiz-framework/trunk:1783202
+/ofbiz/ofbiz-framework/trunk:1783202,1783388
 /ofbiz/trunk:1770481,1770490,1770540,1771440,1771448,1771516,1771935,1772346,1772880,1774772,1775441,1779724,1780659,1781109,1781125,1781979,1782498,1782520

Modified: ofbiz/branches/release16.11/applications/accounting/minilang/fixedasset/FixedAssetServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release16.11/applications/accounting/minilang/fixedasset/FixedAssetServices.xml?rev=1783419&r1=1783418&r2=1783419&view=diff
==============================================================================
--- ofbiz/branches/release16.11/applications/accounting/minilang/fixedasset/FixedAssetServices.xml (original)
+++ ofbiz/branches/release16.11/applications/accounting/minilang/fixedasset/FixedAssetServices.xml Fri Feb 17 16:12:06 2017
@@ -402,6 +402,9 @@ under the License.
                     </calculate>
                 </if-compare>
                 <set field="depreciationYear" from-field="assetAcquiredYear" type="BigDecimal"/>
+                <if-compare-field field="numberOfYears" operator="less" to-field="intUsageYears" type="BigDecimal">
+                    <set field="intUsageYears" from-field="numberOfYears" type="BigDecimal"/>
+                </if-compare-field>
                 <loop count="${intUsageYears}">
                     <calculate field="purchaseCost">
                         <calcop operator="subtract">
@@ -478,7 +481,13 @@ under the License.
             </then>
         </if>
         <field-to-result field="nextDepreciationAmount"/>
-        <field-to-result field="depreciationTotal" result-name="plannedPastDepreciationTotal"/>
+        <calculate field="plannedPastDepreciationTotal">
+            <calcop operator="subtract">
+                <calcop operator="get" field="depreciationTotal"/>
+                <calcop operator="get" field="fixedAsset.depreciation"/>
+            </calcop>
+        </calculate>
+        <field-to-result field="plannedPastDepreciationTotal"/>
     </simple-method>
 
     <simple-method method-name="doubleDecliningBalanceDepreciation" short-description="Calculate double declining balance depreciation to Fixed Asset">

Modified: ofbiz/branches/release16.11/applications/accounting/widget/FixedAssetScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release16.11/applications/accounting/widget/FixedAssetScreens.xml?rev=1783419&r1=1783418&r2=1783419&view=diff
==============================================================================
--- ofbiz/branches/release16.11/applications/accounting/widget/FixedAssetScreens.xml (original)
+++ ofbiz/branches/release16.11/applications/accounting/widget/FixedAssetScreens.xml Fri Feb 17 16:12:06 2017
@@ -538,7 +538,6 @@ under the License.
                                             <and>
                                                 <not><if-empty field="assetDepreciationResultMap.plannedPastDepreciationTotal"/></not>
                                                 <not><if-empty field="fixedAsset.partyId"/></not>
-                                                <if-compare-field field="assetDepreciationResultMap.plannedPastDepreciationTotal" to-field="depreciation" operator="greater" type="BigDecimal"/>
                                             </and>
                                         </condition>
                                         <actions>