|
Author: jacopoc
Date: Mon Jan 18 10:24:07 2010 New Revision: 900329 URL: http://svn.apache.org/viewvc?rev=900329&view=rev Log: Improved error handling of fixed asset depreciation algorithm in the "Depreciation" tab. Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml ofbiz/trunk/applications/accounting/widget/FixedAssetForms.xml ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.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=900329&r1=900328&r2=900329&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 Mon Jan 18 10:24:07 2010 @@ -733,8 +733,8 @@ <field field="endIndex" type="int"/> </call-object-method> <else> - <add-error><fail-property resource="AccountingUiLabels" property="AccountingExpEndOfLifeIsEmpty"/></add-error> - <check-errors/> + <property-to-field resource="AccountingUiLabels" property="AccountingExpEndOfLifeIsEmpty" field="successMessageList[]"/> + <return/> </else> </if-not-empty> @@ -747,8 +747,8 @@ <field field="endIndex" type="int"/> </call-object-method> <else> - <add-error><fail-property resource="AccountingUiLabels" property="AccountingDateAcquiredIsEmpty"/></add-error> - <check-errors/> + <property-to-field resource="AccountingUiLabels" property="AccountingDateAcquiredIsEmpty" field="successMessageList[]"/> + <return/> </else> </if-not-empty> @@ -801,8 +801,8 @@ <field-to-result field="assetNBVAfterDepreciation"/> <field-to-result field="assetDepreciationInfoList"/> <else> - <add-error><fail-property resource="AccountingUiLabels" property="AccountingFixedAssetDepreciationMethodNotFound"/></add-error> - <check-errors/> + <property-to-field resource="AccountingUiLabels" property="AccountingFixedAssetDepreciationMethodNotFound" field="successMessageList[]"/> + <return/> </else> </if-not-empty> </simple-method> Modified: ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml?rev=900329&r1=900328&r2=900329&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml Mon Jan 18 10:24:07 2010 @@ -299,9 +299,9 @@ location="component://accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml" invoke="calculateFixedAssetDepreciation" auth="true"> <description>Select the depreciation method according to the entry in FixedAssetDepMethod</description> <attribute name="fixedAssetId" type="String" mode="IN"/> - <attribute name="assetDepreciationTillDate" type="List" mode="OUT" optional="false"/> - <attribute name="assetNBVAfterDepreciation" type="List" mode="OUT" optional="false"/> - <attribute name="assetDepreciationInfoList" type="List" mode="OUT" optional="false"/> + <attribute name="assetDepreciationTillDate" type="List" mode="OUT" optional="true"/> + <attribute name="assetNBVAfterDepreciation" type="List" mode="OUT" optional="true"/> + <attribute name="assetDepreciationInfoList" type="List" mode="OUT" optional="true"/> </service> <!-- FixedAssetGeoPoint services --> Modified: ofbiz/trunk/applications/accounting/widget/FixedAssetForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FixedAssetForms.xml?rev=900329&r1=900328&r2=900329&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/FixedAssetForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/FixedAssetForms.xml Mon Jan 18 10:24:07 2010 @@ -613,11 +613,6 @@ </form> <form name="ListFixedAssetDepreciations" type="list" list-name="assetDepreciationInfoList" default-map-name="assetDepreciationInfo" odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar"> - <actions> - <service service-name="calculateFixedAssetDepreciation" result-map-list="assetDepreciationInfoList"> - <field-map field-name="fixedAssetId" from-field="parameters.fixedAssetId"/> - </service> - </actions> <field name="index"><display description="${itemIndex + 1}"/></field> <field name="year"><display/></field> <field name="depreciation"><display type="currency" currency="${fixedAsset.purchaseCostUomId}"/></field> Modified: ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml?rev=900329&r1=900328&r2=900329&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml Mon Jan 18 10:24:07 2010 @@ -514,16 +514,37 @@ <set field="labelTitleProperty" value="PageTitleFixedAssetDepreciationReport"/> <set field="fixedAssetId" from-field="parameters.fixedAssetId"/> <entity-one entity-name="FixedAsset" value-field="fixedAsset" auto-field-map="true"/> + <service service-name="calculateFixedAssetDepreciation" result-map="assetDepreciationResultMap"> + <field-map field-name="fixedAssetId" from-field="parameters.fixedAssetId"/> + </service> + <set field="assetDepreciationInfoList" from-field="assetDepreciationResultMap.assetDepreciationInfoList"/> + <set field="assetDepreciationResultMessages" from-field="assetDepreciationResultMap.successMessageList"/> </actions> <widgets> <decorator-screen name="CommonFixedAssetDecorator" location="${parameters.fixedAssetDecoratorLocation}"> <decorator-section name="body"> <section> <widgets> - <screenlet title="${uiLabelMap.PageTitleFixedAssetDepreciationReport}"> + <screenlet title="${uiLabelMap.FixedAssetDepMethod}"> <include-form name="AddFixedAssetDepMethod" location="component://accounting/widget/FixedAssetForms.xml"/> <include-form name="ListFixedAssetDepMethods" location="component://accounting/widget/FixedAssetForms.xml"/> - <include-form name="ListFixedAssetDepreciations" location="component://accounting/widget/FixedAssetForms.xml"/> + </screenlet> + <section> + <condition> + <not><if-empty field="assetDepreciationInfoList"/></not> + </condition> + <widgets> + <screenlet title="${uiLabelMap.PageTitleFixedAssetDepreciationReport}"> + <include-form name="ListFixedAssetDepreciations" location="component://accounting/widget/FixedAssetForms.xml"/> + </screenlet> + </widgets> + <fail-widgets> + <screenlet title="${uiLabelMap.PageTitleFixedAssetDepreciationReport}"> + <label style="h3">${assetDepreciationResultMessages}</label> + </screenlet> + </fail-widgets> + </section> + <screenlet title="${uiLabelMap.AccountingTransactions}"> <include-form name="FixedAssetTransactions" location="component://accounting/widget/FixedAssetForms.xml"/> </screenlet> </widgets> |
| Free forum by Nabble | Edit this page |
