svn commit: r806517 - in /ofbiz/trunk/applications/accounting: config/ script/org/ofbiz/accounting/finaccount/ servicedef/ webapp/accounting/WEB-INF/ webapp/accounting/finaccounttrans/ widget/

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

svn commit: r806517 - in /ofbiz/trunk/applications/accounting: config/ script/org/ofbiz/accounting/finaccount/ servicedef/ webapp/accounting/WEB-INF/ webapp/accounting/finaccounttrans/ widget/

apatel-2
Author: apatel
Date: Fri Aug 21 12:01:58 2009
New Revision: 806517

URL: http://svn.apache.org/viewvc?rev=806517&view=rev
Log:
Ability to remove fin account transaction from bank reconciliation.

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
    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/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl
    ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl
    ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml

Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=806517&r1=806516&r2=806517&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Fri Aug 21 12:01:58 2009
@@ -3227,6 +3227,10 @@
         <value xml:lang="th">รายการ</value>
         <value xml:lang="zh">交易</value>
     </property>
+    <property key="AccountingFinAccountTransInvalidStatusError">
+        <value xml:lang="en">FinAccountTrans must be in created status.</value>
+        <value xml:lang="hi_IN">FinAccountTrans निर्मित स्थिति में होना चाहिए</value>
+    </property>
     <property key="AccountingFinAccountTypeGlAccount">
         <value xml:lang="de">Finanzkonto-Buchungskonto</value>
         <value xml:lang="en">FinAccount Type Gl Account</value>
@@ -7999,6 +8003,10 @@
         <value xml:lang="th">หมายเลขอ้างอิง</value>
         <value xml:lang="zh">优先方法编号</value>
     </property>
+    <property key="AccountingRemoveFromGlReconciliation">
+        <value xml:lang="en">Remove From GlReconciliation</value>
+        <value xml:lang="hi_IN">GlReconciliation से हटाये</value>
+    </property>
     <property key="AccountingReports">
         <value xml:lang="ar">تقارير</value>
         <value xml:lang="de">Berichte</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=806517&r1=806516&r2=806517&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 Aug 21 12:01:58 2009
@@ -952,4 +952,15 @@
             </if-compare>
         </iterate>
     </simple-method>
+    <simple-method method-name="removeFinAccountTransFromReconciliation" short-description="Remove finAccountTrans from reconciliation">
+        <entity-one entity-name="FinAccountTrans" value-field="finAccountTrans"/>
+        <if-compare field="finAccountTrans.statusId" operator="equals" value="FINACT_TRNS_CREATED">
+            <clear-field field="finAccountTrans.glReconciliationId"/>
+            <store-value value-field="finAccountTrans"/>
+        <else>
+            <add-error><fail-property resource="AccountingUiLabel" property="AccountingFinAccountTransInvalidStatusError"/></add-error>
+            <check-errors/>
+        </else>
+        </if-compare>
+    </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=806517&r1=806516&r2=806517&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml Fri Aug 21 12:01:58 2009
@@ -497,4 +497,9 @@
         <attribute name="finAccountTransId" type="String" mode="IN" optional="false"/>
         <attribute name="glReconciliationId" type="String" mode="IN" optional="false"/>
     </service>
+    <service name="removeFinAccountTransFromReconciliation" engine="simple"
+            location="component://accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml" invoke="removeFinAccountTransFromReconciliation">
+        <description>Remove finaAccountTrans association with gl reconciliation</description>
+        <attribute name="finAccountTransId" type="String" mode="IN" optional="false"/>
+    </service>
 </services>

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=806517&r1=806516&r2=806517&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Fri Aug 21 12:01:58 2009
@@ -1981,6 +1981,18 @@
         <response name="error" type="view" value="FindFinAccountTrans"/>
     </request-map>
 
+    <request-map uri="removeFinAccountTransFromReconciliation">
+        <security auth="true" https="true"/>
+        <event type="service" invoke="removeFinAccountTransFromReconciliation"/>
+        <response name="success" type="view" value="BankReconciliation"/>
+        <response name="error" type="view" value="BankReconciliation"/>
+    </request-map>
+    <request-map uri="reomveFinAccountTransAssociation">
+        <security auth="true" https="true"/>
+        <event type="service" invoke="removeFinAccountTransFromReconciliation"/>
+        <response name="success" type="view" value="ViewGlReconciliationWithTransaction"/>
+        <response name="error" type="view" value="ViewGlReconciliationWithTransaction"/>
+    </request-map>
     <!-- Fin Account Authority-->
     <request-map uri="EditFinAccountAuths">
         <security https="true" auth="true"/>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl?rev=806517&r1=806516&r2=806517&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl Fri Aug 21 12:01:58 2009
@@ -132,6 +132,11 @@
           <#if grandTotal?exists>
             <th>${uiLabelMap.AccountingCancelTransactionStatus}</th>
           </#if>
+          <#if !grandTotal?exists>
+            <#if (parameters.glReconciliationId?has_content && parameters.glReconciliationId != "_NA_")>
+              <th>${uiLabelMap.AccountingRemoveFromGlReconciliation}</th>
+            </#if>
+          </#if>
           <#if ((glReconciliationId?has_content && glReconciliationId == "_NA_") && (glReconciliations?has_content && finAccountTransList?has_content)) || !grandTotal?exists>
             <th>${uiLabelMap.CommonSelectAll} <input name="selectAll" type="checkbox" value="N" id="checkAllTransactions" onclick="javascript:togglefinAccountTransId(this);"/></th>
           </#if>
@@ -237,6 +242,13 @@
             <#if glReconciliationId?has_content && glReconciliationId != "_NA_">
               <input name="glReconciliationId_o_${finAccountTrans_index}" type="hidden" value="${glReconciliationId}"/>
             </#if>
+            <#if !(grandTotal?exists)>
+              <#if (parameters.glReconciliationId?has_content && parameters.glReconciliationId != "_NA_")>
+                <#if finAccountTrans.statusId == "FINACT_TRNS_CREATED">
+                  <td><a href="javascript:document.removeFinAccountTransFromReconciliation_${finAccountTrans.finAccountTransId}.submit();" class="buttontext">${uiLabelMap.CommonRemove}</a></td>
+                </#if>
+              </#if>
+            </#if>
             <#if ((glReconciliationId?has_content && glReconciliationId == "_NA_") && (glReconciliations?has_content && finAccountTransList?has_content)) || !grandTotal?exists>
               <#if finAccountTrans.statusId == "FINACT_TRNS_CREATED">
                 <td><input id="finAccountTransId_${finAccountTrans_index}" name="_rowSubmit_o_${finAccountTrans_index}" type="checkbox" value="Y" onclick="javascript:getFinAccountTransRunningTotalAndBalances();"/></td>
@@ -248,6 +260,12 @@
         </#list>
       </table>
     </form>
+    <#list finAccountTransList as finAccountTrans>
+      <form name="cancelFinAccountTransAssociation_${finAccountTrans.finAccountTransId}" method="post" action="<@ofbizUrl>cancelFinAccountTransAssociation</@ofbizUrl>">
+        <input name="finAccountTransId" type="hidden" value="${finAccountTrans.finAccountTransId}"/>
+        <input name="finAccountId" type="hidden" value="${finAccountTrans.finAccountId}"/>
+      </form>
+    </#list>
     <#if grandTotal?exists>
       <#list finAccountTransList as finAccountTrans>
         <#if finAccountTrans.statusId?has_content && finAccountTrans.statusId == 'FINACT_TRNS_CREATED'>

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=806517&r1=806516&r2=806517&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl Fri Aug 21 12:01:58 2009
@@ -95,6 +95,9 @@
             <th>${uiLabelMap.FormFieldTitle_paymentMethodTypeId}</th>
             <th>${uiLabelMap.CommonStatus}</th>
             <th>${uiLabelMap.CommonComments}</th>
+            <#if FinAccountTranstions?has_content>
+              <th>${uiLabelMap.AccountingRemoveFromGlReconciliation}</th>
+            </#if>
           </tr>
           <#assign alt_row = false/>
           <#list finAccountTransList as finAccountTrans>
@@ -139,6 +142,11 @@
               <td><#if paymentMethodType?has_content>${paymentMethodType.description?if_exists}</#if></td>
               <td><#if status?has_content>${status.description?if_exists}</#if></td>
               <td>${finAccountTrans.comments?if_exists}</td>
+              <#if finAccountTrans.statusId == "FINACT_TRNS_CREATED">
+                <td align="center"><a href="javascript:document.reomveFinAccountTransAssociation_${finAccountTrans.finAccountTransId}.submit();" class="buttontext">${uiLabelMap.CommonRemove}</a></td>
+              <#else>
+                <td/>
+              </#if>
             </tr>
             <#assign alt_row = !alt_row/>
           </#list>
@@ -153,3 +161,10 @@
     </div>
   </div>
 </form>
+<#list finAccountTransList as finAccountTrans>
+  <form name="reomveFinAccountTransAssociation_${finAccountTrans.finAccountTransId}" method="post" action="<@ofbizUrl>reomveFinAccountTransAssociation</@ofbizUrl>">
+    <input name="finAccountTransId" type="hidden" value="${finAccountTrans.finAccountTransId}"/>
+    <input name="finAccountId" type="hidden" value="${finAccountTrans.finAccountId}"/>
+    <input name="glReconciliationId" type="hidden" value="${glReconciliationId}"/>
+  </form>
+</#list>
\ No newline at end of file

Modified: ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml?rev=806517&r1=806516&r2=806517&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml Fri Aug 21 12:01:58 2009
@@ -630,6 +630,13 @@
                 </entity-condition>
                 <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"/>
+                <entity-condition entity-name="FinAccountTrans" list="FinAccountTranstions">
+                    <condition-list>
+                        <condition-expr field-name="finAccountTransId" operator="in" from-field="finAccountTransIds"/>
+                        <condition-expr field-name="statusId" value="FINACT_TRNS_CREATED"/>
+                    </condition-list>
+                </entity-condition>
             </actions>
             <widgets>
                 <decorator-screen name="CommonFinAccountDecorator" location="${parameters.finAccountDecoratorLocation}">