svn commit: r832312 - in /ofbiz/trunk/applications/accounting: entitydef/entitymodel.xml webapp/accounting/WEB-INF/actions/payment/DepositWithdrawPayments.groovy webapp/accounting/payment/depositWithdrawPayments.ftl

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

svn commit: r832312 - in /ofbiz/trunk/applications/accounting: entitydef/entitymodel.xml webapp/accounting/WEB-INF/actions/payment/DepositWithdrawPayments.groovy webapp/accounting/payment/depositWithdrawPayments.ftl

apatel-2
Author: apatel
Date: Tue Nov  3 06:44:30 2009
New Revision: 832312

URL: http://svn.apache.org/viewvc?rev=832312&view=rev
Log:
Added view entity to fetch Payment, PaymentType desc, PaymentMethodType desc, status desc and Party names for display in UI. Fixed depositWithdrawPayment.ftl, now uses view.

Modified:
    ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/DepositWithdrawPayments.groovy
    ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl

Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?rev=832312&r1=832311&r2=832312&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Tue Nov  3 06:44:30 2009
@@ -2730,6 +2730,41 @@
         <key-map field-name="overrideGlAccountId" rel-field-name="glAccountId"/>
       </relation>
     </entity>
+    <view-entity entity-name="PaymentAndTypePartyNameView"
+      package-name="org.ofbiz.accounting.payment"
+      title="Payment PaymentType PaymentMethodType StatusItem and Party Name View Entity">
+      <member-entity entity-alias="PY" entity-name="Payment"/>
+      <member-entity entity-alias="FPNV" entity-name="PartyNameView"/>
+      <member-entity entity-alias="TPNV" entity-name="PartyNameView"/>
+      <member-entity entity-alias="TY" entity-name="PaymentType"/>
+      <member-entity entity-alias="PMT" entity-name="PaymentMethodType"/>
+      <member-entity entity-alias="SI" entity-name="StatusItem"/>
+      <alias-all entity-alias="PY"/>
+      <alias name="partyFromFirstName" entity-alias="FPNV" field="firstName"/>
+      <alias name="partyFromLastName" entity-alias="FPNV" field="lastName"/>
+      <alias name="partyFromGroupName" entity-alias="FPNV" field="groupName"/>
+      <alias name="partyToFirstName" entity-alias="TPNV" field="firstName"/>
+      <alias name="partyToLastName" entity-alias="TPNV" field="lastName"/>
+      <alias name="partyToGroupName" entity-alias="TPNV" field="groupName"/>
+      <alias name="paymentTypeDesc" entity-alias="TY" field="description"/>
+      <alias name="statusDesc" entity-alias="SI" field="description"/>
+      <alias name="paymentMethodTypeDesc" entity-alias="PMT" field="description"/>
+      <view-link entity-alias="PY" rel-entity-alias="FPNV">
+        <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
+      </view-link>
+      <view-link entity-alias="PY" rel-entity-alias="TPNV">
+        <key-map field-name="partyIdTo" rel-field-name="partyId"/>
+      </view-link>
+      <view-link entity-alias="PY" rel-entity-alias="TY">
+        <key-map field-name="paymentTypeId"/>
+      </view-link>
+      <view-link entity-alias="PY" rel-entity-alias="PMT">
+        <key-map field-name="paymentMethodTypeId"/>
+      </view-link>
+      <view-link entity-alias="PY" rel-entity-alias="SI">
+        <key-map field-name="statusId"/>
+      </view-link>
+    </view-entity>
     <view-entity entity-name="PaymentAndType"
       package-name="org.ofbiz.accounting.payment"
       never-cache="true"

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/DepositWithdrawPayments.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/DepositWithdrawPayments.groovy?rev=832312&r1=832311&r2=832312&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/DepositWithdrawPayments.groovy (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/DepositWithdrawPayments.groovy Tue Nov  3 06:44:30 2009
@@ -50,7 +50,7 @@
     exprListForParameters.add(EntityCondition.makeCondition("finAccountTransId", EntityOperator.EQUALS, null));
     paramCond = EntityCondition.makeCondition(exprListForParameters, EntityOperator.AND);
     combinedPaymentCond = EntityCondition.makeCondition([partyCond, statusCond, paramCond], EntityOperator.AND);
-    payments = delegator.findList("Payment", combinedPaymentCond, null, null, null, false);
+    payments = delegator.findList("PaymentAndTypePartyNameView", combinedPaymentCond, null, null, null, false);
     paymentListWithCreditCard = [];
     paymentListWithoutCreditCard = [];
     payments.each { payment ->

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl?rev=832312&r1=832311&r2=832312&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl Tue Nov  3 06:44:30 2009
@@ -84,7 +84,7 @@
                     <span class="label" id="showPaymentRunningTotal"></span>
                 </div>
                 <table class="basic-table">
-                    <tr class="header-row">
+                    <tr class="header-row-2">
                         <td>${uiLabelMap.FormFieldTitle_paymentId}</td>
                         <td>${uiLabelMap.AccountingPaymentType}</td>
                         <td>${uiLabelMap.AccountingFromParty}</td>
@@ -96,22 +96,18 @@
                             <input type="checkbox" id="checkAllPayments" name="checkAllPayments" onchange="javascript:togglePaymentId(this);"/>
                         </td>
                     </tr>
+                    <#assign alt_row = false>
                     <#list paymentList as payment>
-                        <#if payment.paymentTypeId?has_content>
-                            <#assign paymentType = delegator.findOne("PaymentType", {"paymentTypeId" : payment.paymentTypeId}, false)/>
-                        </#if>
-                        <tr>
+                        <tr <#if alt_row> class="alternate-row"</#if>>
                             <td><a href="<@ofbizUrl>paymentOverview?paymentId=${payment.paymentId}</@ofbizUrl>">${payment.paymentId}</a></td>
                             <td>
-                                ${paymentType.description?if_exists}
+                                ${payment.paymentTypeDesc?if_exists}
                             </td>
                             <td>
-                                <#assign partyNameFrom = (delegator.findOne("PartyNameView", {"partyId" : payment.partyIdFrom}, true))!>
-                                ${(partyNameFrom.firstName)!} ${(partyNameFrom.lastName)!} ${(partyNameFrom.groupName)!}
+                                ${(payment.partyFromFirstName)!} ${(payment.partyFromLastName)!} ${(payment.partyFromGroupName)!}
                             </td>
                             <td>
-                                <#assign partyNameTo = (delegator.findOne("PartyNameView", {"partyId" : payment.partyIdTo}, true))!>
-                                ${(partyNameTo.firstName)!} ${(partyNameTo.lastName)!} ${(partyNameTo.groupName)!}
+                                ${(payment.partyToFirstName)!} ${(payment.partyToLastName)!} ${(payment.partyToGroupName)!}
                             </td>
                             <td><@ofbizCurrency amount=payment.amount isoCode=payment.currencyUomId/></td>
                             <td>${payment.effectiveDate?if_exists}</td>
@@ -120,6 +116,7 @@
                                 <input type="checkbox" id="paymentId_${payment_index}" name="paymentIds" value="${payment.paymentId}" onclick="javascript:getPaymentRunningTotal();"/>
                             </td>
                         </tr>
+                        <#assign alt_row = !alt_row>
                     </#list>
                     <div align="right">
                         <span class="label">${uiLabelMap.AccountingPayment} ${uiLabelMap.PartyPartyGroupName}</span>