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/11/24 07:23:23 UTC

svn commit: r883601 - in /ofbiz/trunk/applications/accounting: script/org/ofbiz/accounting/finaccount/FinAccountServices.xml servicedef/services_finaccount.xml webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl widget/FinAccountScreens.xml

Author: ashish
Date: Tue Nov 24 06:23:22 2009
New Revision: 883601

URL: http://svn.apache.org/viewvc?rev=883601&view=rev
Log:
Applied patch from jira issue OFBIZ-3236 - Add new field - Closing balance to Reconciliation Screen.

At https://localhost:8443/accounting/control/ViewGlReconciliationWithTransaction?glReconciliationId=9000&finAccountId=SC_CHECKING

    * Add a new field to represent Closing balance of Reconciliation. This will sum of Opening Balance(default 0) + Reconciled Balance (default 0).
    * Also rearrange rows showing information. It is as follows -
          o OLD :
            Gl Reconciliation Name
            Reconciled Balance
            Status
            Reconciled Date
            Opening Balance
          o NEW :
            Gl Reconciliation Name
            Status
            Reconciled Date
            Opening Balance
            Reconciled Balance
            Closing Balance

Thanks Sumit for the contribution.

Modified:
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml
    ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl
    ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml

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=883601&r1=883600&r2=883601&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 Tue Nov 24 06:23:22 2009
@@ -1043,4 +1043,12 @@
         </entity-condition>
         <field-to-result field="acctgTransAndEntries"/>
     </simple-method>
+    
+    <simple-method method-name="getReconciliationClosingBalance" short-description="Get Reconciliation Closing Balance.">
+        <entity-one entity-name="GlReconciliation" value-field="glReconciliation"/>
+        <set field="reconciledBalance" from-field="glReconciliation.reconciledBalance" default-value="0" type="BigDecimal"/>
+        <set field="openingBalance" from-field="glReconciliation.openingBalance" default-value="0" type="BigDecimal"/>
+        <set field="closingBalance" value="${reconciledBalance + openingBalance}" type="BigDecimal"/>
+        <field-to-result field="closingBalance"/>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml?rev=883601&r1=883600&r2=883601&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml Tue Nov 24 06:23:22 2009
@@ -266,6 +266,12 @@
             location="component://accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml" invoke="reconcileWithdrawalFinAcctgTrans">
         <description>Reconcile Financial Accounting Financial Transactions</description>
         <attribute name="finAccountTrans" type="org.ofbiz.entity.GenericValue" mode="IN" optional="false"/>
+    </service>    
+    <service name="getReconciliationClosingBalance" engine="simple"
+            location="component://accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml" invoke="getReconciliationClosingBalance">
+        <description>Service to Get Reconciliation closing balance.</description>
+        <attribute name="glReconciliationId" type="String" mode="IN" optional="false"/>
+        <attribute name="closingBalance" type="BigDecimal" mode="OUT" optional="false"/>
     </service>
 
     <!-- service credit account w/ transaction -->

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl?rev=883601&r1=883600&r2=883601&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl Tue Nov 24 06:23:22 2009
@@ -21,10 +21,6 @@
   <input name="_useRowSubmit" type="hidden" value="Y"/>
   <input name="finAccountId" type="hidden" value="${finAccountId}"/>
   <input name="glReconciliationId" type="hidden" value="${glReconciliationId}"/>
-  <#assign previousGlReconciliation = ""/>
-  <#if glReconciliationList?has_content>
-    <#assign previousGlReconciliation = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(glReconciliationList)/>
-  </#if>
   <div class="screenlet"> 
     <div class="screenlet-title-bar">
       <span class="label">${uiLabelMap.AccountingCurrentBankReconciliation}</span>
@@ -41,12 +37,6 @@
             <td><span class="label">${uiLabelMap.FormFieldTitle_glReconciliationName}</span></td>
             <td>${currentGlReconciliation.glReconciliationName?if_exists}</td>
           </tr>
-          <#if currentGlReconciliation.reconciledBalance?exists>
-            <tr>
-              <td><span class="label">${uiLabelMap.FormFieldTitle_reconciledBalance}</span></td>
-              <td>${currentGlReconciliation.reconciledBalance?if_exists}</td>
-            </tr>
-          </#if>
           <#if currentGlReconciliation.statusId?exists>
             <tr>
               <td><span class="label">${uiLabelMap.CommonStatus}</span></td>
@@ -62,6 +52,18 @@
             <td><span class="label">${uiLabelMap.AccountingOpeningBalance}</span></td>
             <td><@ofbizCurrency amount=currentGlReconciliation.openingBalance?default('0')/></td>
           </tr>
+          <#if currentGlReconciliation.reconciledBalance?exists>
+            <tr>
+              <td><span class="label">${uiLabelMap.FormFieldTitle_reconciledBalance}</span></td>
+              <td><@ofbizCurrency amount=currentGlReconciliation.reconciledBalance?default('0')/></td>
+            </tr>
+          </#if>
+          <#if currentClosingBalance?exists>
+            <tr>
+              <td><span class="label">${uiLabelMap.FormFieldTitle_closingBalance}</span></td>
+              <td><@ofbizCurrency amount=currentClosingBalance/></td>
+            </tr>
+          </#if>
         </table>
       </#if>
     </div>
@@ -77,12 +79,6 @@
             <td><span class="label">${uiLabelMap.FormFieldTitle_glReconciliationName}</span></td>
             <td>${previousGlReconciliation.glReconciliationName?if_exists}</td>
           </tr>
-          <#if previousGlReconciliation.reconciledBalance?exists>
-            <tr>
-              <td><span class="label">${uiLabelMap.FormFieldTitle_reconciledBalance}</span></td>
-              <td>${previousGlReconciliation.reconciledBalance?if_exists}</td>
-            </tr>
-          </#if>
           <#if previousGlReconciliation.statusId?exists>
             <tr>
               <td><span class="label">${uiLabelMap.CommonStatus}</span></td>
@@ -98,6 +94,18 @@
             <td><span class="label">${uiLabelMap.AccountingOpeningBalance}</span></td>
             <td><@ofbizCurrency amount=previousGlReconciliation.openingBalance?default('0')/></td>
           </tr>
+          <#if previousGlReconciliation.reconciledBalance?exists>
+            <tr>
+              <td><span class="label">${uiLabelMap.FormFieldTitle_reconciledBalance}</span></td>
+              <td><@ofbizCurrency amount=previousGlReconciliation.reconciledBalance?default('0')/></td>
+            </tr>
+          </#if>
+          <#if previousClosingBalance?exists>
+            <tr>
+              <td><span class="label">${uiLabelMap.FormFieldTitle_closingBalance}</span></td>
+              <td><@ofbizCurrency amount=previousClosingBalance/></td>
+            </tr>
+          </#if>
         </table>
       </#if>
     </div>

Modified: ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml?rev=883601&r1=883600&r2=883601&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml Tue Nov 24 06:23:22 2009
@@ -629,6 +629,7 @@
                     </condition-list>
                     <order-by field-name="reconciledDate DESC"/>
                 </entity-condition>
+                <set field="previousGlReconciliation" from-field="glReconciliationList[0]"/>
                 <service service-name="getFinAccountTransListAndTotals" result-map="transactionTotalAmount"/>
                 <set field="finAccountTransList" from-field="transactionTotalAmount.finAccountTransList" type="List"/>
                 <set field="finAccountTransIds" value="${groovy:org.ofbiz.entity.util.EntityUtil.getFieldListFromEntityList(finAccountTransList, 'finAccountTransId', true);}" type="List"/>
@@ -640,6 +641,13 @@
                 </entity-condition>
                 <service service-name="isGlReconciliationReconciled" result-map="reconciledMap"/>
                 <set field="isReconciled" from-field="reconciledMap.isReconciled"/>
+                <service service-name="getReconciliationClosingBalance" result-map="currentRecnciliationClosingBalance"/>
+                <set field="currentClosingBalance" from-field="currentRecnciliationClosingBalance.closingBalance"/>
+                <set field="previousGlReconciliationId" from-field="previousGlReconciliation.glReconciliationId" default-value="${glReconciliationId}"/>
+                <service service-name="getReconciliationClosingBalance" result-map="previousReconciliationClosingBalance">
+                    <field-map field-name="glReconciliationId" from-field="previousGlReconciliationId"/>
+                </service>
+                <set field="previousClosingBalance" from-field="previousReconciliationClosingBalance.closingBalance"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonFinAccountDecorator" location="${parameters.finAccountDecoratorLocation}">