Author: jacopoc
Date: Wed Jan 13 18:22:14 2010
New Revision: 898869

URL: http://svn.apache.org/viewvc?rev=898869&view=rev
Log:
First step in the implementation of the screens and services to setup 
depreciation formulae for fixed assets.

Modified:
    ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
    ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/widget/FixedAssetForms.xml
    ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml
    ofbiz/trunk/applications/manufacturing/data/ManufacturingData.xml

Modified: ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml?rev=898869&r1=898868&r2=898869&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml (original)
+++ ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml Wed Jan 13 
18:22:14 2010
@@ -1077,4 +1077,10 @@
     <StatusItem statusId="GLREC_CREATED" statusTypeId="GLREC_STATUS" 
statusCode="CREATED" sequenceId="11" description="Created"/>
     <StatusItem statusId="GLREC_RECONCILED" statusTypeId="GLREC_STATUS" 
statusCode="RECONCILED" sequenceId="12" description="Reconciled"/>
     <StatusValidChange condition="" statusId="GLREC_CREATED" 
statusIdTo="GLREC_RECONCILED" transitionName="Set Created to Reconciled"/>
+
+    <!--Depreciation Formulae-->
+    <CustomMethodType customMethodTypeId="DEPRECIATION_FORMULA" 
description="Formula for calculating depreciation for fixed asset"/>
+    <CustomMethod customMethodId="STR_LINE_DEP_FORMULA" 
customMethodTypeId="DEPRECIATION_FORMULA" 
customMethodName="straightLineDepreciation" description="Straight Line 
depreciatiion algorithm for fixed asset((purchaseCost - 
salvageCost)/expectedLifeInYears)"/>
+    <CustomMethod customMethodId="DBL_DECL_DEP_FORMULA" 
customMethodTypeId="DEPRECIATION_FORMULA" 
customMethodName="doubleDecliningBalanceDepreciation" description="Double 
decline depreciatiion algorithm for fixed asset((NetBookValue - 
salvageCost)*2/remainingLifeInYears)"/>
+
 </entity-engine-xml>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml?rev=898869&r1=898868&r2=898869&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml 
(original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml Wed 
Jan 13 18:22:14 2010
@@ -249,6 +249,23 @@
     </service>
 
     <!-- Fixed Asset Depreciation Services -->
+    <service name="createFixedAssetDepMethod" 
default-entity-name="FixedAssetDepMethod" engine="entity-auto" invoke="create" 
auth="true">
+        <description>Create a Fixed Asset Depreciation Method</description>
+        <permission-service service-name="fixedAssetPermissionCheck" 
main-action="CREATE"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+    <service name="deleteFixedAssetDepMethod" 
default-entity-name="FixedAssetDepMethod" engine="entity-auto" invoke="delete" 
auth="true">
+        <description>Delete a Fixed Asset Depreciation Method</description>
+        <permission-service service-name="fixedAssetPermissionCheck" 
main-action="DELETE"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
+    <service name="updateFixedAssetDepMethod" 
default-entity-name="FixedAssetDepMethod" engine="entity-auto" invoke="update" 
auth="true">
+        <description>Create a Fixed Asset Depreciation Method</description>
+        <permission-service service-name="fixedAssetPermissionCheck" 
main-action="UPDATE"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
     <service name="fixedAssetDepCalcInterface" engine="interface">
         <description>Interface to describe base parameters for Depreciation 
Calculation Services</description>
         <attribute name="expEndOfLifeYear" type="Integer" mode="IN" 
optional="false"/>

Modified: 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=898869&r1=898868&r2=898869&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml 
(original)
+++ 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml 
Wed Jan 13 18:22:14 2010
@@ -2307,6 +2307,24 @@
         <response name="success" type="view" 
value="ShowFixedAssetDepreciation"/>
         <response name="error" type="view" value="ShowFixedAssetDepreciation"/>
     </request-map>
+    <request-map uri="createFixedAssetDepMethod">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createFixedAssetDepMethod"/>
+        <response name="success" type="view" 
value="ShowFixedAssetDepreciation"/>
+        <response name="error" type="view" value="ShowFixedAssetDepreciation"/>
+    </request-map>
+    <request-map uri="deleteFixedAssetDepMethod">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="deleteFixedAssetDepMethod"/>
+        <response name="success" type="view" 
value="ShowFixedAssetDepreciation"/>
+        <response name="error" type="view" value="ShowFixedAssetDepreciation"/>
+    </request-map>
+    <request-map uri="updateFixedAssetDepMethod">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updateFixedAssetDepMethod"/>
+        <response name="success" type="view" 
value="ShowFixedAssetDepreciation"/>
+        <response name="error" type="view" value="ShowFixedAssetDepreciation"/>
+    </request-map>
 
     <!-- Commented out for now WIP
     <request-map uri="taxAuthorityVATReport">

Modified: ofbiz/trunk/applications/accounting/widget/FixedAssetForms.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FixedAssetForms.xml?rev=898869&r1=898868&r2=898869&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/FixedAssetForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/FixedAssetForms.xml Wed Jan 13 
18:22:14 2010
@@ -577,4 +577,38 @@
          </field>
          <field name="submitButton" title="${uiLabelMap.CommonAdd}" 
widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
+
+    <form name="AddFixedAssetDepMethod" type="single" 
target="createFixedAssetDepMethod" title=""
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-service service-name="createFixedAssetDepMethod" 
default-field-type="edit"/>
+        <field name="fixedAssetId"><hidden/></field>
+        <field name="depreciationCustomMethodId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="CustomMethod" 
key-field-name="customMethodId" description="${description}">
+                    <entity-constraint name="customMethodTypeId" 
operator="equals" value="DEPRECIATION_FORMULA"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" 
widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+    <form name="ListFixedAssetDepMethods" type="list"
+        odd-row-style="alternate-row" header-row-style="header-row-2" 
default-table-style="basic-table hover-bar">
+        <actions>
+            <entity-condition entity-name="FixedAssetDepMethod" 
list="fixedAssetDepMethods">
+                <condition-expr field-name="fixedAssetId" 
from-field="parameters.fixedAssetId"/>
+            </entity-condition>
+        </actions>
+        <auto-fields-entity entity-name="FixedAssetDepMethod" 
default-field-type="display"/>
+        <field name="fixedAssetId"><hidden/></field>
+        <field name="depreciationCustomMethodId">
+            <display-entity entity-name="CustomMethod" 
key-field-name="customMethodId"/>
+        </field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" 
widget-style="buttontext">
+            <hyperlink target="deleteFixedAssetDepMethod" 
description="${uiLabelMap.CommonDelete}" also-hidden="false">
+                <parameter param-name="fixedAssetId"/>
+                <parameter param-name="depreciationCustomMethodId"/>
+                <parameter param-name="fromDate"/>
+            </hyperlink>
+        </field>
+    </form>
 </forms>

Modified: ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml?rev=898869&r1=898868&r2=898869&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml Wed Jan 13 
18:22:14 2010
@@ -522,6 +522,8 @@
                         <section>
                             <widgets>
                                 <screenlet 
title="${uiLabelMap.PageTitleFixedAssetDepreciationReport}">
+                                    <include-form 
name="AddFixedAssetDepMethod" 
location="component://accounting/widget/FixedAssetForms.xml"/>
+                                    <include-form 
name="ListFixedAssetDepMethods" 
location="component://accounting/widget/FixedAssetForms.xml"/>
                                     <platform-specific>
                                         <html><html-template 
location="component://accounting/webapp/accounting/fixedasset/DepreciationReport.ftl"/></html>
                                     </platform-specific>

Modified: ofbiz/trunk/applications/manufacturing/data/ManufacturingData.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/data/ManufacturingData.xml?rev=898869&r1=898868&r2=898869&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/data/ManufacturingData.xml (original)
+++ ofbiz/trunk/applications/manufacturing/data/ManufacturingData.xml Wed Jan 
13 18:22:14 2010
@@ -46,12 +46,7 @@
     <!-- Formulae -->
     <CustomMethodType customMethodTypeId="TASK_FORMULA" description="Formula 
for calculating time estimates for tasks"/>
     <CustomMethodType customMethodTypeId="BOM_FORMULA" description="Formula 
for calculating material estimates for boms"/>
-    <CustomMethodType customMethodTypeId="DEPRECIATION_FORMULA" 
description="Formula for calculating depreciatiion for fixed asset"/>
 
-    <!--Depreciation Formulae-->
-    <CustomMethod customMethodId="STR_LINE_DEP_FORMULA" 
customMethodTypeId="DEPRECIATION_FORMULA" 
customMethodName="straightLineDepreciation" description="Straight Line 
depreciatiion algorithm for fixed asset((purchaseCost - 
salvageCost)/expectedLifeInYears)"/>
-    <CustomMethod customMethodId="DBL_DECL_DEP_FORMULA" 
customMethodTypeId="DEPRECIATION_FORMULA" 
customMethodName="doubleDecliningBalanceDepreciation" description="Double 
decline depreciatiion algorithm for fixed asset((NetBookValue - 
salvageCost)*2/remainingLifeInYears)"/>
-    
     <WebSite webSiteId="MANUFACTURING" siteName="Manufacturing Manager" 
visualThemeSetId="BACKOFFICE"/>
 
 </entity-engine-xml>


Reply via email to