Author: apatel
Date: Mon Aug  3 06:22:37 2009
New Revision: 800209

URL: http://svn.apache.org/viewvc?rev=800209&view=rev
Log:
Added create new deposit payment and create new withdrawal payment option in 
Financial Account --> deposit/withdraw tab.
Patch from OFBIZ-2768. Thanks Rishi and Arpit.

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
    
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml
    ofbiz/trunk/applications/accounting/servicedef/secas.xml
    ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/widget/FinAccountForms.xml
    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=800209&r1=800208&r2=800209&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Mon Aug  
3 06:22:37 2009
@@ -2001,6 +2001,10 @@
         <value 
xml:lang="th">สร้างบัตรเครดิตใหม่</value>
         <value xml:lang="zh">创建新信用卡</value>
     </property>
+    <property key="AccountingCreateNewDepositPayment">
+        <value xml:lang="en">Create New Deposit Payment</value>
+        <value xml:lang="hi_IN">नई जमा भुगतान 
बनाएँ</value>
+    </property>
     <property key="AccountingCreateNewDepositSlipForFinancialAccount">
         <value xml:lang="en">Create New Deposit Slip for Financial Account: 
${finAccountId}</value>
     </property>
@@ -2066,6 +2070,10 @@
         <value 
xml:lang="th">ใบกำกับสินค้าใหม่</value>
         <value xml:lang="zh">新建销售发票</value>
     </property>
+    <property key="AccountingCreateNewWithdrawalPayment">
+        <value xml:lang="en">Create New Withdrawal Payment</value>
+        <value xml:lang="hi_IN">नई वापसी भुगतान 
बनाएँ</value>
+    </property>
     <property key="AccountingCreatePayment">
         <value xml:lang="ar">تسديد جديد</value>
         <value xml:lang="de">Zahlung durchführen</value>
@@ -2394,6 +2402,10 @@
     <property key="AccountingDeposit">
         <value xml:lang="en">Deposit</value>
     </property>
+    <property key="AccountingDepositPaymentInFinAccount">
+        <value xml:lang="en">Deposit Payment in: 
${finAccount.finAccountName}</value>
+        <value xml:lang="hi_IN">वित्तीय खाते में 
जमा करे: ${finAccount.finAccountName}</value>
+    </property>
     <property key="AccountingDepositSlip">
         <value xml:lang="en">Deposit Slip</value>
     </property>
@@ -6271,6 +6283,10 @@
         <value xml:lang="th">วันที่ชำระเงิน</value>
         <value xml:lang="zh">支付日</value>
     </property>
+    <property key="AccountingWithdrawalPaymentInFinAccount">
+        <value xml:lang="en">Withdrawal Payment from: 
${finAccount.finAccountName}</value>
+        <value xml:lang="hi_IN">वित्तीय खाते 
द्वारा वापस भुगतान: 
${finAccount.finAccountName}</value>
+    </property>
     <property key="AccountingPaymentGatewayApprove">
         <value xml:lang="en">Approve</value>
         <value xml:lang="it">Approva</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=800209&r1=800208&r2=800209&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
 Mon Aug  3 06:22:37 2009
@@ -779,4 +779,18 @@
         </else>
         </if-compare>
     </simple-method>
+    <simple-method method-name="createPaymentAndFinAccountTrans" 
short-description="create new payment and associate with respective financial 
account in FinAccountTrans Entity.">
+        <set-service-fields service-name="createPayment" map="parameters" 
to-map="createPaymentMap"/>
+        <call-service service-name="createPayment" 
in-map-name="createPaymentMap">
+            <result-to-field result-name="paymentId"/>
+        </call-service>
+        <if-compare field="parameters.isDepositWithDrawPayment" 
operator="equals" value="Y">
+            <set-service-fields service-name="createFinAccountTrans" 
map="parameters" to-map="createFinAccountTransMap"/>
+            <set field="createFinAccountTransMap.paymentId" 
from-field="paymentId"/>
+            <set field="createFinAccountTransMap.statusId" 
value="FINACT_TRNS_CREATED"/>
+            <call-service service-name="createFinAccountTrans" 
in-map-name="createFinAccountTransMap"/>
+        </if-compare>
+        <field-to-list field="paymentId" list="paymentIds"/>
+        <field-to-result field="paymentIds"/>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/accounting/servicedef/secas.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/secas.xml?rev=800209&r1=800208&r2=800209&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/secas.xml Mon Aug  3 
06:22:37 2009
@@ -171,4 +171,9 @@
         <condition field-name="groupInOneTransaction" operator="equals" 
value="Y"/>
         <action service="createPaymentGroupAndMember" mode="async"/>
     </eca>
+    <eca service="createPaymentAndFinAccountTrans" event="commit">
+        <condition field-name="isDepositWithDrawPayment" operator="equals" 
value="Y"/>
+        <condition field-name="finAccountTransTypeId" operator="equals" 
value="DEPOSIT"/>
+        <action service="createPaymentGroupAndMember" mode="async"/>
+    </eca>
 </service-eca>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml?rev=800209&r1=800208&r2=800209&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml 
(original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml Mon 
Aug  3 06:22:37 2009
@@ -468,4 +468,15 @@
         <description>expire payment associations with paymentGroup on 
finAccountTrans cancel</description>
         <attribute name="finAccountTransId" type="String" mode="IN" 
optional="true"/>
     </service>
+    
+    <service name="createPaymentAndFinAccountTrans" engine="simple" 
+            
location="component://accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml"
 invoke="createPaymentAndFinAccountTrans" auth="true">
+        <description>create new payment and associate with respective 
financial account in FinAccountTrans Entity.</description>
+        <implements service="createPayment"/>
+        <attribute name="isDepositWithDrawPayment" type="String" mode="IN" 
optional="true"/>
+        <attribute name="finAccountId" type="String" mode="IN" 
optional="false"/>
+        <attribute name="finAccountTransTypeId" type="String" mode="IN" 
optional="false"/>
+        <attribute name="paymentGroupTypeId" type="String" mode="IN" 
optional="true"/>
+        <attribute name="paymentIds" type="List" mode="OUT" 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=800209&r1=800208&r2=800209&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml 
(original)
+++ 
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml 
Mon Aug  3 06:22:37 2009
@@ -1867,6 +1867,26 @@
         <response name="success" type="view" value="FindDepositSlips"/>
         <response name="error" type="view" value="FindDepositSlips"/>
     </request-map>
+    <request-map uri="NewDepositPayment">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="NewDepositPayment"/>
+    </request-map>
+    <request-map uri="NewWithdrawalPayment">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="NewWithdrawalPayment"/>
+    </request-map>
+    <request-map uri="createDepositPayment">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createPaymentAndFinAccountTrans"/>
+        <response name="success" type="view" value="PaymentsDepositWithdraw"/>
+        <response name="error" type="view" value="NewDepositPayment"/>
+    </request-map>
+    <request-map uri="createWithdrawalPayment">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createPaymentAndFinAccountTrans"/>
+        <response name="success" type="view" value="PaymentsDepositWithdraw"/>
+        <response name="error" type="view" value="NewWithdrawalPayment"/>
+    </request-map>
     <!-- Fin Account Roles -->
     <request-map uri="EditFinAccountRoles">
         <security https="true" auth="true"/>
@@ -2076,6 +2096,7 @@
     <request-map uri="LookupPerson"><security auth="true" 
https="true"/><response name="success" type="view" 
value="LookupPerson"/></request-map>
     <request-map uri="LookupPartyGroup"><security auth="true" 
https="true"/><response name="success" type="view" 
value="LookupPartyGroup"/></request-map>
     <request-map uri="LookupPartyName"><security auth="true" 
https="true"/><response name="success" type="view" 
value="LookupPartyName"/></request-map>
+    <request-map uri="LookupInternalOrganization"><security auth="true" 
https="true"/><response name="success" type="view" 
value="LookupInternalOrganization"/></request-map>
 
     <request-map uri="LookupGeo"><security auth="true" https="true"/><response 
name="success" type="view" value="LookupGeo"/></request-map>
 
@@ -2415,6 +2436,8 @@
     <view-map name="FinAccountMain" type="screen" 
page="component://accounting/widget/FinAccountScreens.xml#FinAccountMain"/>
     <view-map name="FindDepositSlips" type="screen" 
page="component://accounting/widget/FinAccountScreens.xml#FindDepositSlips"/>
     <view-map name="EditDepositSlipAndMembers" type="screen" 
page="component://accounting/widget/FinAccountScreens.xml#EditDepositSlipAndMembers"/>
+    <view-map name="NewDepositPayment" type="screen" 
page="component://accounting/widget/FinAccountScreens.xml#NewDepositPayment"/>
+    <view-map name="NewWithdrawalPayment" type="screen" 
page="component://accounting/widget/FinAccountScreens.xml#NewWithdrawalPayment"/>
 
     <!-- TO BE REMOVED
     <view-map name="ListFinAccount" type="screen" 
page="component://accounting/widget/FinAccountScreens.xml#ListFinAccount"/>
@@ -2536,6 +2559,7 @@
     <view-map name="LookupPerson" type="screen" 
page="component://party/widget/partymgr/LookupScreens.xml#LookupPerson"/>
     <view-map name="LookupPartyGroup" type="screen" 
page="component://party/widget/partymgr/LookupScreens.xml#LookupPartyGroup"/>
     <view-map name="LookupPartyName" type="screen" 
page="component://party/widget/partymgr/LookupScreens.xml#LookupPartyName"/>
+    <view-map name="LookupInternalOrganization" type="screen" 
page="component://party/widget/partymgr/LookupScreens.xml#LookupInternalOrganization"/>
 
     <view-map name="LookupProduct" type="screen" 
page="component://product/widget/catalog/LookupScreens.xml#LookupProduct"/>
     <view-map name="LookupProductFeature" type="screen" 
page="component://product/widget/catalog/LookupScreens.xml#LookupProductFeature"/>

Modified: ofbiz/trunk/applications/accounting/widget/FinAccountForms.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FinAccountForms.xml?rev=800209&r1=800208&r2=800209&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/FinAccountForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/FinAccountForms.xml Mon Aug  3 
06:22:37 2009
@@ -309,4 +309,41 @@
             extends="FindFinAccountTransactions">
         <field name="statusId" 
title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem" 
description="${description}"/></field>
     </form>
+    <form name="EditDepositPayment" extends="EditPayment" 
+            
extends-resource="component://accounting/webapp/accounting/payment/PaymentForms.xml"
 target="createDepositPayment">
+        <actions>
+            <entity-one entity-name="FinAccount" value-field="finAccount"/>
+            <set field="finAccountTypeId" 
from-field="finAccount.finAccountTypeId"/>
+        </actions>
+        <field name="paymentTypeId" 
title="${uiLabelMap.AccountingPaymentType}">
+            <drop-down allow-empty="false">
+                <entity-options entity-name="PaymentType" 
description="${description}">
+                    <entity-constraint name="parentTypeId" operator="equals" 
env-name="parentTypeId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="paymentMethodId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="PaymentMethod" 
description="${paymentMethodTypeId} (${paymentMethodId})"/>
+            </drop-down>
+        </field>
+        <field name="statusId"><display-entity entity-name="StatusItem" 
description="${description}"/></field>
+        <field name="partyIdTo" position="2"><lookup 
target-form-name="LookupInternalOrganization"/></field>
+        <field name="amount" position="2"><text size="6"/></field>
+        <field name="comments" position="2"><text size="35"/></field>
+        <field name="finAccountId"><hidden value="${finAccountId}"/></field>
+        <field name="finAccountTypeId"><hidden 
value="${finAccountTypeId}"/></field>
+        <field name="finAccountTransTypeId" position="1"><hidden/></field>
+        <field name="currencyUomId" position="2"><hidden 
value="${defaultOrganizationPartyCurrencyUomId}"/></field>
+        <field name="isDepositWithDrawPayment" 
title="${uiLabelMap.AccountingDepositPaymentInFinAccount}" ><check/></field>
+        <field name="paymentGroupTypeId"><hidden 
value="BATCH_PAYMENT"/></field>
+        <field name="updateButton"><ignored/></field>
+        <field name="createButton" title="${uiLabelMap.CommonCreate}"><submit 
button-type="button"/></field>
+
+    </form>
+    <form name="EditWithdrawalPayment" type="single" 
extends="EditDepositPayment" target="createWithdrawalPayment">
+        <field name="partyIdFrom" position="1"><lookup 
target-form-name="LookupInternalOrganization"/></field>
+        <field name="isDepositWithDrawPayment" 
title="${uiLabelMap.AccountingWithdrawalPaymentInFinAccount}" 
position="1"><check/></field>
+        <field name="paymentGroupTypeId"><ignored/></field>
+    </form>
 </forms>

Modified: ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml?rev=800209&r1=800208&r2=800209&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/FinAccountScreens.xml Mon Aug  3 
06:22:37 2009
@@ -229,6 +229,14 @@
                     <decorator-section name="body">
                         <section>
                             <widgets>
+                                <container style="button-bar">
+                                    <link target="NewDepositPayment" 
text="${uiLabelMap.AccountingCreateNewDepositPayment}" style="buttontext">
+                                        <parameter param-name="finAccountId"/>
+                                    </link>
+                                    <link target="NewWithdrawalPayment" 
text="${uiLabelMap.AccountingCreateNewWithdrawalPayment}" style="buttontext">
+                                        <parameter param-name="finAccountId"/>
+                                    </link>
+                                </container>
                                 <decorator-screen name="FindScreenDecorator" 
location="component://common/widget/CommonScreens.xml">
                                     <decorator-section name="search-options">
                                         <include-form 
name="PaymentsDepositWithdraw" 
location="component://accounting/widget/FinAccountForms.xml"/>
@@ -491,4 +499,44 @@
             </widgets>
         </section>
     </screen>
+    <screen name="NewDepositPayment">
+        <section>
+            <actions>
+                <set field="tabButtonItem" value="depositWithdraw"/>
+                <set field="finAccountId" 
from-field="parameters.finAccountId"/>
+                <set field="statusId" value="PMNT_RECEIVED"/>
+                <set field="parentTypeId" value="RECEIPT"/>
+                <set field="finAccountTransTypeId" value="DEPOSIT"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonFinAccountDecorator" 
location="${parameters.finAccountDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet 
title="${uiLabelMap.AccountingCreateNewDepositPayment}">
+                            <include-form name="EditDepositPayment" 
location="component://accounting/widget/FinAccountForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="NewWithdrawalPayment">
+        <section>
+            <actions>
+                <set field="tabButtonItem" value="depositWithdraw"/>
+                <set field="finAccountId" 
from-field="parameters.finAccountId"/>
+                <set field="statusId" value="PMNT_SENT"/>
+                <set field="parentTypeId" value="DISBURSEMENT"/>
+                <set field="finAccountTransTypeId" value="WITHDRAWAL"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonFinAccountDecorator" 
location="${parameters.finAccountDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet 
title="${uiLabelMap.AccountingCreateNewWithdrawalPayment}">
+                            <include-form name="EditWithdrawalPayment" 
location="component://accounting/widget/FinAccountForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>


Reply via email to