svn commit: r793473 - in /ofbiz/trunk/applications/accounting: config/AccountingUiLabels.xml script/org/ofbiz/accounting/payment/PaymentServices.xml servicedef/services_payment.xml webapp/accounting/WEB-INF/controller.xml widget/Menus.xml

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

svn commit: r793473 - in /ofbiz/trunk/applications/accounting: config/AccountingUiLabels.xml script/org/ofbiz/accounting/payment/PaymentServices.xml servicedef/services_payment.xml webapp/accounting/WEB-INF/controller.xml widget/Menus.xml

ashish-18
Author: ashish
Date: Mon Jul 13 07:07:37 2009
New Revision: 793473

URL: http://svn.apache.org/viewvc?rev=793473&view=rev
Log:
Applied patch from jira issue OFBIZ-2718 - Cancel Check Run payments.
This patch includes:
-- Cancel all the payments and associated payment applicability with invoices.
-- Setting thruDate for associated paymentGroupMembers.

Thanks Chirag, Sumit & Rishi for the contribution.

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
    ofbiz/trunk/applications/accounting/servicedef/services_payment.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/widget/Menus.xml

Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=793473&r1=793472&r2=793473&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Mon Jul 13 07:07:37 2009
@@ -1485,6 +1485,12 @@
         <value xml:lang="nl">Per datum</value>
         <value xml:lang="th">โดยวันที่</value>
     </property>
+    <property key="AccountingCancelBatchPayments">
+        <value xml:lang="en">Cancel Batch Payments</value>
+    </property>
+    <property key="AccountingCancelCheckRun">
+        <value xml:lang="en">Cancel Check Run</value>
+    </property>
     <property key="AccountingCannotGetPaymentForApplication">
         <value xml:lang="ar">لا يمكن الحصول على التسديد للتطبيق  [${payAppl}] من أجل ${msg}</value>
         <value xml:lang="en">Cannot get payment for application [${payAppl}] due to ${msg}</value>

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml?rev=793473&r1=793472&r2=793473&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml Mon Jul 13 07:07:37 2009
@@ -551,4 +551,17 @@
             <call-service service-name="createPaymentGroupMember" in-map-name="createPaymentGroupMemberMap"/>
         </iterate>
     </simple-method>
+    
+    <simple-method method-name="cancelCheckRunPayments" short-description="Cancel all payments for payment group">
+        <entity-condition entity-name="PaymentGroupMember" list="paymentGroupMembers">
+            <condition-expr field-name="paymentGroupId" from-field="parameters.paymentGroupId"/>
+        </entity-condition>
+        <iterate list="paymentGroupMembers" entry="paymentGroupMember">
+            <get-related-one relation-name="Payment" value-field="paymentGroupMember" to-value-field="payment"/>
+            <set-service-fields service-name="voidPayment" map="payment" to-map="voidPaymentMap"/>
+            <call-service service-name="voidPayment" in-map-name="voidPaymentMap"/>
+            <set-service-fields service-name="deletePaymentGroupMember" map="paymentGroupMember" to-map="deletePaymentGroupMemberMap"/>
+            <call-service service-name="deletePaymentGroupMember" in-map-name="deletePaymentGroupMemberMap"/>
+        </iterate>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_payment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_payment.xml?rev=793473&r1=793472&r2=793473&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_payment.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_payment.xml Mon Jul 13 07:07:37 2009
@@ -187,4 +187,9 @@
         <attribute name="paymentGroupName" type="String" mode="IN" optional="true"/>
         <attribute name="paymentGroupId" type="String" mode="OUT" optional="false"/>
     </service>
+    <service name="cancelCheckRunPayments" engine="simple"
+            location="component://accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml" invoke="cancelCheckRunPayments" auth="true">
+        <description>Cancel all payments for payment group</description>
+        <attribute name="paymentGroupId" 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=793473&r1=793472&r2=793473&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Mon Jul 13 07:07:37 2009
@@ -438,6 +438,13 @@
         <response name="error" type="view" value="PaymentGroupOverview"/>
     </request-map>
     
+    <request-map uri="cancelCheckRunPayments">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="cancelCheckRunPayments"/>
+        <response name="success" type="view" value="PaymentGroupOverview"/>
+        <response name="error" type="view" value="PaymentGroupOverview"/>
+    </request-map>
+    
     <request-map uri="DepositSlip.pdf">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="DepositSlipPdf"/>

Modified: ofbiz/trunk/applications/accounting/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/Menus.xml?rev=793473&r1=793472&r2=793473&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/Menus.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/Menus.xml Mon Jul 13 07:07:37 2009
@@ -513,17 +513,30 @@
                 <parameter param-name="paymentGroupId" from-field="paymentGroup.paymentGroupId"/>
             </link>
         </menu-item>
-        <menu-item name="cancelpaymentGroup" title="${uiLabelMap.CommonCancel}">
+        <menu-item name="cancelpaymentGroup" title="${uiLabelMap.AccountingCancelBatchPayments}">
             <condition>
                 <and>
                     <not><if-empty field="paymentGroupMembers"/></not>
                     <not><if-empty field="paymentGroup"/></not>
+                    <if-compare field="paymentGroup.paymentGroupTypeId" operator="equals" value="BATCH_PAYMENT"/>
                 </and>
             </condition>
             <link target="cancelPaymentGroup">
                 <parameter param-name="paymentGroupId" from-field="paymentGroup.paymentGroupId"/>
             </link>
         </menu-item>
+        <menu-item name="cancelCheckRunPayments" title="${uiLabelMap.AccountingCancelCheckRun}">
+            <condition>
+                <and>
+                    <not><if-empty field="paymentGroupMembers"/></not>
+                    <not><if-empty field="paymentGroup"/></not>
+                    <if-compare field="paymentGroup.paymentGroupTypeId" operator="equals" value="CHECK_RUN"/>
+                </and>
+            </condition>
+            <link target="cancelCheckRunPayments">
+                <parameter param-name="paymentGroupId" from-field="paymentGroup.paymentGroupId"/>
+            </link>
+        </menu-item>
     </menu>
 
     <menu name="FixedAssetMaintTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"