Author: jacopoc
Date: Wed Sep 16 09:14:39 2009 New Revision: 815678 URL: http://svn.apache.org/viewvc?rev=815678&view=rev Log: Improved ui to better expose relationship between Payments and Gateway Responses. Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml ofbiz/trunk/applications/accounting/widget/Menus.xml ofbiz/trunk/applications/accounting/widget/TransactionForms.xml ofbiz/trunk/applications/accounting/widget/TransactionScreens.xml Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy?rev=815678&r1=815677&r2=815678&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy Wed Sep 16 09:14:39 2009 @@ -40,19 +40,22 @@ orderPaymentPreference = paymentGatewayResponse.getRelatedOne("OrderPaymentPreference"); context.orderId = orderPaymentPreference.orderId; context.orderPaymentPreferenceId = orderPaymentPreference.orderPaymentPreferenceId; - return; -} - -// second purpose: grab the latest gateway response of the orderpaymentpreferenceId -orderPaymentPreference = delegator.findByPrimaryKey("OrderPaymentPreference", [orderPaymentPreferenceId : orderPaymentPreferenceId]); -gatewayResponses = orderPaymentPreference.getRelated("PaymentGatewayResponse", ["transactionDate DESC"]); -EntityUtil.filterByCondition(gatewayResponses, EntityCondition.makeCondition("transCodeEnumId", EntityOperator.EQUALS, "PGT_AUTHORIZE")); - -if (gatewayResponses) { - latestAuth = gatewayResponses[0]; - context.paymentGatewayResponse = latestAuth; } else { - // todo: some kind of error telling user to re-authorize + // second purpose: grab the latest gateway response of the orderpaymentpreferenceId + orderPaymentPreference = delegator.findByPrimaryKey("OrderPaymentPreference", [orderPaymentPreferenceId : orderPaymentPreferenceId]); + gatewayResponses = orderPaymentPreference.getRelated("PaymentGatewayResponse", ["transactionDate DESC"]); + EntityUtil.filterByCondition(gatewayResponses, EntityCondition.makeCondition("transCodeEnumId", EntityOperator.EQUALS, "PGT_AUTHORIZE")); + + if (gatewayResponses) { + latestAuth = gatewayResponses[0]; + context.paymentGatewayResponse = latestAuth; + } else { + // todo: some kind of error telling user to re-authorize + } + + context.orderId = orderPaymentPreference.orderId; +} +// get the list of payments associated to gateway response +if (context.paymentGatewayResponse) { + context.payments = context.paymentGatewayResponse.getRelated("Payment"); } - -context.orderId = orderPaymentPreference.orderId; Modified: ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml?rev=815678&r1=815677&r2=815678&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/payment/PaymentForms.xml Wed Sep 16 09:14:39 2009 @@ -45,6 +45,7 @@ <field position="2" name="partyIdTo"><lookup target-form-name="LookupPartyName"/></field> <field position="1" name="amount"><text/></field> <field name="paymentRefNum"><text-find default-option="contains" ignore-case="true"/></field> + <field name="paymentGatewayResponseId"><text/></field> <field name="searchButton" widget-style="smallSubmit"><submit button-type="button"/></field> </form> <form name="ListPayments" type="list" separate-columns="true" default-entity-name="Payment" list-name="listIt" paginate-target="findPayments" paginate="true" @@ -434,8 +435,12 @@ <field name="actualCurrencyAmount" title="${uiLabelMap.AccountingActualCurrencyAmount}" position="2"><display type="currency" currency="${payment.actualCurrencyUomId}"/></field> <field name="effectiveDate" position="1"><display type="date"/></field> <field name="comments" position="2"><display/></field> - <!--field name="paymentGatewayResponseId" title="Paym Gatw Resp." position="2"><display/></field--> <field name="overrideGlAccountId" position="1"><display/></field> + <field name="paymentGatewayResponseId" position="2"> + <hyperlink description="${payment.paymentGatewayResponseId}" target="ViewGatewayResponse"> + <parameter param-name="paymentGatewayResponseId" from-field="payment.paymentGatewayResponseId"/> + </hyperlink> + </field> </form> <form name="paymentApplications" type="list" list-name="paymentApplications" Modified: ofbiz/trunk/applications/accounting/widget/Menus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/Menus.xml?rev=815678&r1=815677&r2=815678&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/Menus.xml (original) +++ ofbiz/trunk/applications/accounting/widget/Menus.xml Wed Sep 16 09:14:39 2009 @@ -350,7 +350,6 @@ <parameter param-name="paymentId" from-field="payment.paymentId"/> </link> </menu-item> - <menu-item name="editPayment" title="${uiLabelMap.AccountingPaymentTabHeader}"> <condition> <and> @@ -377,6 +376,14 @@ <parameter param-name="paymentId" from-field="payment.paymentId"/> </link> </menu-item> + <menu-item name="paymentGatewayTransactions" title="${uiLabelMap.AccountingTransactions}"> + <condition> + <not><if-empty field="payment.paymentId"/></not> + </condition> + <link target="paymentGatewayTransactions"> + <parameter param-name="paymentId" from-field="payment.paymentId"/> + </link> + </menu-item> </menu> <menu name="PaymentSubTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml" Modified: ofbiz/trunk/applications/accounting/widget/TransactionForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/TransactionForms.xml?rev=815678&r1=815677&r2=815678&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/TransactionForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/TransactionForms.xml Wed Sep 16 09:14:39 2009 @@ -98,12 +98,39 @@ <form name="ViewGatewayResponseRelations" type="single" target="" title="" header-row-style="header-row" default-table-style="basic-table"> <field name="orderId" widget-style="buttontext"> - <hyperlink also-hidden="false" target-type="inter-app" description="${orderId}" target="/ordermgr/control/orderview"> + <hyperlink also-hidden="false" target-type="inter-app" description="${orderId}" target="/ordermgr/control/orderview"> <parameter param-name="orderId"/> </hyperlink> </field> <field name="orderPaymentPreferenceId"><display/></field> </form> + <form name="ViewGatewayResponsePayments" type="list" list-name="payments" title=""> + <field name="paymentId" widget-style="buttontext"> + <hyperlink description="${paymentId}" target="paymentOverview"> + <parameter param-name="paymentId"/> + </hyperlink> + </field> + <field name="paymentTypeId" title="${uiLabelMap.AccountingPaymentType}"><display-entity entity-name="PaymentType"/></field> + <field name="statusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem"/></field> + <field name="comments"><display/></field> + <field name="partyIdFrom" title="${uiLabelMap.AccountingFromParty}"> + <display-entity entity-name="PartyNameView" key-field-name="partyId" description="${groupName}${lastName},${firstName}"> + <sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="[${partyIdFrom}]" > + <parameter param-name="partyId" from-field="partyIdFrom"/> + </sub-hyperlink> + </display-entity> + </field> + <field name="partyIdTo" title="${uiLabelMap.AccountingToParty}"> + <display-entity entity-name="PartyNameView" key-field-name="partyId" description="${groupName}${lastName},${firstName}"> + <sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="[${partyIdTo}]" > + <parameter param-name="partyId" from-field="partyIdTo"/> + </sub-hyperlink> + </display-entity> + </field> + <field name="effectiveDate"><display/></field> + <field name="currencyUomId"><hidden/></field> + <field name="amount"><display also-hidden="false" type="currency" currency="${currencyUomId}"/></field> + </form> <!-- displays the gateway response in detail --> <form name="ViewGatewayResponse" type="single" target="processCaptureTransaction" title="" default-map-name="paymentGatewayResponse" Modified: ofbiz/trunk/applications/accounting/widget/TransactionScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/TransactionScreens.xml?rev=815678&r1=815677&r2=815678&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/TransactionScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/TransactionScreens.xml Wed Sep 16 09:14:39 2009 @@ -114,6 +114,20 @@ <container style="screenlet"> <container style="screenlet-title-bar"> <container style="h3"> + <label text="${uiLabelMap.AccountingPaymentsMenu}"/> + </container> + </container> + <container style="screenlet-body"> + <section> + <widgets> + <include-form name="ViewGatewayResponsePayments" location="component://accounting/widget/TransactionForms.xml"/> + </widgets> + </section> + </container> + </container> + <container style="screenlet"> + <container style="screenlet-title-bar"> + <container style="h3"> <label text="${uiLabelMap.PageTitleViewGatewayResponse}"/> </container> </container> |
Free forum by Nabble | Edit this page |