You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2009/12/11 14:02:44 UTC

svn commit: r889604 - in /ofbiz/trunk/applications/accounting: config/AccountingUiLabels.xml script/org/ofbiz/accounting/finaccount/FinAccountServices.xml widget/AccountingMenus.xml

Author: ashish
Date: Fri Dec 11 13:02:43 2009
New Revision: 889604

URL: http://svn.apache.org/viewvc?rev=889604&view=rev
Log:
Applied patch from jira issue - OFBIZ-3330 - Restrict Canceled/Frozen Financial Account operation in Financial Account tab.

    *  User can not perform following operation for Cancelled or Manually Frozen FinAccount, Provide check on Ui as well as at service level .

   1. Can not assign role from screen https://localhost:8443/accounting/control/EditFinAccountRoles?finAccountId=SC_CHECKING
   2. Can not create transaction from screen https://localhost:8443/accounting/control/EditFinAccountTrans?finAccountId=SC_CHECKING
   3. "Create New Financial Account Reconciliations" button will not display on screen https://localhost:8443/accounting/control/FindFinAccountReconciliations?finAccountId=SC_CHECKING
   4. If FinAccount is frozen or canceled then do not allow user to update the financial account, first user have to change status to active then he/she can update FinAccount Record .

Thanks Awdesh & Sumit for the contribution.

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml
    ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml

Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=889604&r1=889603&r2=889604&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Fri Dec 11 13:02:43 2009
@@ -3284,6 +3284,12 @@
         <value xml:lang="th">การอนุญาต</value>
         <value xml:lang="zh">授权</value>
     </property>
+    <property key="AccountingFinAccountInactiveStatusError">
+        <value xml:lang="en">FinAccount must be in active status</value>
+    </property>
+    <property key="AccountingFinAccountNotValidError">
+        <value xml:lang="en">FinAccount not in valid status</value>
+    </property>    
     <property key="AccountingFinAccountTransaction">
         <value xml:lang="en">Financial Account Transaction</value>
         <value xml:lang="hi_IN">वित्तीय खाता लेन-देन</value>

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml?rev=889604&r1=889603&r2=889604&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml Fri Dec 11 13:02:43 2009
@@ -118,6 +118,15 @@
                 <set-service-fields service-name="createFinAccountStatus" map="parameters" to-map="createFinAccountStatusMap"/>
                 <call-service service-name="createFinAccountStatus" in-map-name="createFinAccountStatusMap"/>
             </then>
+            <else>
+                <if-compare field="lookedUpValue.statusId" operator="equals" value="FNACT_MANFROZEN">
+                    <add-error><fail-property resource="AccountingUiLabels" property="AccountingFinAccountInactiveStatusError"/></add-error>
+                </if-compare>
+                <if-compare field="lookedUpValue.statusId" operator="equals" value="FNACT_CANCELLED">
+                    <add-error><fail-property resource="AccountingUiLabels" property="AccountingFinAccountNotValidError"/></add-error>
+                </if-compare>
+                <check-errors/>
+            </else>
         </if>
 
         <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
@@ -160,6 +169,14 @@
 
     <!-- FinAccountTrans Services -->
     <simple-method method-name="createFinAccountTrans" short-description="Create a Financial Account Transaction">
+        <entity-one entity-name="FinAccount" value-field="finAccount"/>
+        <if-compare field="finAccount.statusId" operator="equals" value="FNACT_MANFROZEN">
+            <add-error><fail-property resource="AccountingUiLabels" property="AccountingFinAccountInactiveStatusError"/></add-error>
+        </if-compare>
+        <if-compare field="finAccount.statusId" operator="equals" value="FNACT_CANCELLED">
+            <add-error><fail-property resource="AccountingUiLabels" property="AccountingFinAccountNotValidError"/></add-error>
+        </if-compare>
+        <check-errors/>
         <call-simple-method method-name="getArithmeticSettingsInline"/>
 
         <make-value value-field="newEntity" entity-name="FinAccountTrans"/>
@@ -193,6 +210,14 @@
 
     <!-- FinAccountRole Services -->
     <simple-method method-name="createFinAccountRole" short-description="Create a Financial Account Role">
+        <entity-one entity-name="FinAccount" value-field="finAccount"/>
+        <if-compare field="finAccount.statusId" operator="equals" value="FNACT_MANFROZEN">
+            <add-error><fail-property resource="AccountingUiLabels" property="AccountingFinAccountInactiveStatusError"/></add-error>
+        </if-compare>
+        <if-compare field="finAccount.statusId" operator="equals" value="FNACT_CANCELLED">
+            <add-error><fail-property resource="AccountingUiLabels" property="AccountingFinAccountNotValidError"/></add-error>
+        </if-compare>
+        <check-errors/>
         <make-value value-field="newEntity" entity-name="FinAccountRole"/>
         <set-pk-fields value-field="newEntity" map="parameters"/>
         <set-nonpk-fields value-field="newEntity" map="parameters"/>

Modified: ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml?rev=889604&r1=889603&r2=889604&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml Fri Dec 11 13:02:43 2009
@@ -1237,10 +1237,16 @@
         </menu-item>
         <menu-item name="NewFinAccountReconciliations" title="${uiLabelMap.AccountingCreateNewFinAccountReconciliations}">
             <condition>
-                <or>
-                    <not><if-empty field="glReconciliationId"/></not>
-                    <if-compare field="tabButtonItem2" operator="equals" value="Find"/>
-                </or>
+                <and>
+                    <and>
+                        <if-compare field="finAccount.statusId" operator="not-equals" value="FNACT_MANFROZEN"/>
+                        <if-compare field="finAccount.statusId" operator="not-equals" value="FNACT_CANCELLED"/>                        
+                    </and>
+                    <or>
+                        <not><if-empty field="glReconciliationId"/></not>
+                        <if-compare field="tabButtonItem2" operator="equals" value="Find"/>
+                    </or>
+                </and>
             </condition>
             <link target="EditFinAccountReconciliations">
                 <parameter param-name="finAccountId"/>