svn commit: r831638 - in /ofbiz/trunk/applications/accounting: script/org/ofbiz/accounting/finaccount/FinAccountServices.xml servicedef/services_finaccount.xml widget/PaymentForms.xml

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

svn commit: r831638 - in /ofbiz/trunk/applications/accounting: script/org/ofbiz/accounting/finaccount/FinAccountServices.xml servicedef/services_finaccount.xml widget/PaymentForms.xml

apatel-2
Author: apatel
Date: Sun Nov  1 04:28:33 2009
New Revision: 831638

URL: http://svn.apache.org/viewvc?rev=831638&view=rev
Log:
When creating AP payment use PaymentMethod of organizationParty. FinAccount Transactions are created by fetching finAccountId from PaymentMethod.

Modified:
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/finaccount/FinAccountServices.xml
    ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml
    ofbiz/trunk/applications/accounting/widget/PaymentForms.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=831638&r1=831637&r2=831638&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 Sun Nov  1 04:28:33 2009
@@ -891,12 +891,17 @@
     </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"/>
+        <if-not-empty field="parameters.paymentMethodId">
+            <entity-one entity-name="PaymentMethod" value-field="paymentMethod" auto-field-map="true"/>
+            <set field="createPaymentMap.paymentMethodTypeId" from-field="paymentMethod.paymentMethodTypeId"/>
+        </if-not-empty>
         <call-service service-name="createPayment" in-map-name="createPaymentMap">
             <result-to-field result-name="paymentId"/>
         </call-service>
-        <if-not-empty field="parameters.finAccountId">
+        <if-not-empty field="paymentMethod.finAccountId">
             <if-compare field="parameters.isDepositWithDrawPayment" operator="equals" value="Y">
                 <set-service-fields service-name="createFinAccountTrans" map="parameters" to-map="createFinAccountTransMap"/>
+                <set field="createFinAccountTransMap.finAccountId" from-field="paymentMethod.finAccountId"/>
                 <set field="createFinAccountTransMap.paymentId" from-field="paymentId"/>
                 <set field="createFinAccountTransMap.statusId" value="FINACT_TRNS_CREATED"/>
                 <set field="createFinAccountTransMap.partyId" from-field="parameters.partyIdFrom"/>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml?rev=831638&r1=831637&r2=831638&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_finaccount.xml Sun Nov  1 04:28:33 2009
@@ -470,9 +470,9 @@
         <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="true"/>
         <attribute name="finAccountTransTypeId" type="String" mode="IN" optional="false"/>
         <attribute name="paymentGroupTypeId" type="String" mode="IN" optional="true"/>
+        <attribute name="paymentMethodId" type="String" mode="IN" optional="true"/>
         <attribute name="paymentId" type="String" mode="OUT" optional="true"/>
     </service>
 

Modified: ofbiz/trunk/applications/accounting/widget/PaymentForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/PaymentForms.xml?rev=831638&r1=831637&r2=831638&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/PaymentForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/PaymentForms.xml Sun Nov  1 04:28:33 2009
@@ -100,39 +100,39 @@
                 </condition-list>
                 <order-by field-name="description"/>
             </entity-condition>
+            <entity-one entity-name="PartyGroup" use-cache="true" value-field="partyGroup">
+                <field-map field-name="partyId" from-field="parameters.partyIdFrom"/>
+            </entity-one>
+            <set field="partyGroupName" from-field="partyGroup.groupName"/>
+            <set field="paymentPartyId" from-field="parameters.partyIdFrom" default-value="${defaultOrganizationPartyId}"/>
         </actions>
         <field name="statusId"><hidden value="PMNT_NOT_PAID"/></field>
         <field name="currencyUomId"><hidden value="${defaultOrganizationPartyCurrencyUomId}"/></field>
-        <field position="1" name="organizationPartyId" parameter-name="partyIdFrom">
+        <field position="1" name="organizationPartyId" parameter-name="partyIdFrom" event="onFocus" action="javascript:(document.NewPaymentOut.action = 'newPayment'),(document.NewPaymentOut.submit())">
             <drop-down allow-empty="false" no-current-selected-key="${defaultOrganizationPartyId}">
+                <option key="${parameters.partryIdFrom}" description="${partyGroupName}"/>
                 <entity-options description="${groupName}" entity-name="PartyAcctgPrefAndGroup" key-field-name="partyId">
                     <entity-order-by field-name="groupName"/>
                 </entity-options>
             </drop-down>
         </field>
-        <field name="partyIdTo" position="2"><lookup target-form-name="LookupPartyName"/></field>
-        <field name="paymentTypeId" title="${uiLabelMap.AccountingPaymentType}" position="1">
+        <field name="paymentMethodId" id-name="paymentMethodId" position="2">
             <drop-down allow-empty="false">
-                <list-options list-name="paymentTypes" key-name="paymentTypeId" description="${description}"/>
+                <entity-options entity-name="PaymentMethod" description="${description}" filter-by-date="by-name">
+                     <entity-constraint name="partyId" operator="equals" value="${paymentPartyId}"/>
+                </entity-options>
             </drop-down>
         </field>
-        <field name="paymentMethodTypeId" position="2">
-            <drop-down allow-empty="true">
-                <entity-options entity-name="PaymentMethodType" description="${description}">
-                    <entity-order-by field-name="description"/>
-                </entity-options>
+        <field name="partyIdTo" position="1"><lookup target-form-name="LookupPartyName"/></field>
+        <field name="paymentTypeId" title="${uiLabelMap.AccountingPaymentType}" position="2">
+            <drop-down allow-empty="false">
+                <list-options list-name="paymentTypes" key-name="paymentTypeId" description="${description}"/>
             </drop-down>
         </field>
         <field name="paymentRefNum" position="1"><text/></field>
         <field name="overrideGlAccountId" position="2"><lookup target-form-name="LookupGlAccount"/></field>
         <field name="amount" position="1"><text/></field>
         <field name="comments" position="2"><text size="70"/></field>
-        <field name="finAccountId">
-            <drop-down allow-empty="true">
-                <entity-options entity-name="FinAccount" description="${finAccountName} [${finAccountId}]" filter-by-date="true">
-                </entity-options>
-            </drop-down>
-        </field>
         <field name="isDepositWithDrawPayment"><hidden value="Y"/></field>
         <field name="finAccountTransTypeId"><hidden value="WITHDRAWAL"/></field>
         <field position="1" name="createButton" widget-style="smallSubmit">