ilscipio/scipio-erp

View on GitHub
applications/accounting/widget/payments/PaymentScreens.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is subject to the terms and conditions defined in the
files 'LICENSE' and 'NOTICE', which are part of this source
code package.
-->

<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">

    <!-- SCIPIO: NOTE: The old parameters.paymentDecoratorLocation pattern that existed here has been supplanted
        by the decorator default-fallback-location pattern for parameters.mainDecoratorLocation (see CommonScreens.xml). -->

    <screen name="FindPayments">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleFindPayment"/>
                <set field="activeSubMenuItem" value="findPayments"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="menu-bar">
                                <include-menu name="PaymentsSubTabBar" location="component://accounting/widget/AccountingMenus.xml"/>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindPayments" location="component://accounting/widget/payments/PaymentForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListPayments"  location="component://accounting/widget/payments/PaymentForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="ListPayments">
        <section>
            <actions>
                <set field="noConditionFind" value="Y"/>
                <set field="parameters.statusId" from-field="statusId"/>
                <set field="isReduced" from-field="isReduced" default-value="false" type="Boolean" />                
            </actions>
            <widgets>
                <screenlet title="${uiLabelMap.AccountingRecentPayments}">
                    <include-form name="ListPayments"  location="component://accounting/widget/payments/PaymentForms.xml"/>
                </screenlet>
            </widgets>
        </section>
    </screen>
    <screen name="NewPayment">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingNewPayment"/>
                <set field="activeSubMenuItem" value="newPayment"/>
                <set field="paymentId" from-field="parameters.paymentId"/>
                <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.AccountingNewPaymentIncoming}">
                            <include-form name="NewPaymentIn" location="component://accounting/widget/payments/PaymentForms.xml"/>
                        </screenlet>
                        <screenlet title="${uiLabelMap.AccountingNewPaymentOutgoing}">
                            <include-form name="NewPaymentOut" location="component://accounting/widget/payments/PaymentForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditPayment">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditPayment"/>
                <set field="activeSubMenuItem" value="editPayment"/>
                <set field="paymentId" from-field="parameters.paymentId"/>
                <entity-one entity-name="Payment" value-field="payment">
                    <field-map field-name="paymentId" from-field="parameters.paymentId"/>
                </entity-one>
            </actions>
            <widgets>
                <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <not><if-empty field="payment"/></not>
                            </condition>
                            <widgets>
                                <screenlet title="${uiLabelMap.AccountingInvoiceHeaderDetailedInformation}">
                                    <include-form name="EditPayment" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                </screenlet>
                            </widgets>
                            <fail-widgets>
                                <label style="common-msg-error" text="${uiLabelMap.AccountingPaymentNotFound}"/>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditPaymentApplications">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleListPaymentApplications"/>
                <set field="activeSubMenuItem" value="editPaymentApplications"/>
                <set field="paymentId" from-field="parameters.paymentId"/>
                <entity-one entity-name="Payment" value-field="payment"/>
                <set field="appliedAmount" type="String" value="${groovy:
                    import java.text.NumberFormat;
                    return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(org.ofbiz.accounting.payment.PaymentWorker.getPaymentApplied(payment)));}"/>
                <set field="notAppliedAmount" type="BigDecimal" value="${groovy:org.ofbiz.accounting.payment.PaymentWorker.getPaymentNotApplied(payment)}"/>
                <set field="notAppliedAmountStr" type="String" value="${groovy:
                    import java.text.NumberFormat;
                    return(NumberFormat.getCurrencyInstance(context.get(&quot;locale&quot;)).format(org.ofbiz.accounting.payment.PaymentWorker.getPaymentNotApplied(payment)));}"/>
                <script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedInvoices.groovy"/>
                <script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedPayments.groovy"/>
                <entity-one entity-name="PartyNameView" value-field="partyNameViewTo">
                    <field-map field-name="partyId" from-field="payment.partyIdTo"/>
                </entity-one>
                <entity-one entity-name="PartyNameView" value-field="partyNameViewFrom">
                    <field-map field-name="partyId" from-field="payment.partyIdFrom"/>
                </entity-one>
                <entity-condition entity-name="PaymentApplication" list="paymentApplications">
                    <condition-expr field-name="paymentId" operator="equals" value="${paymentId}"/>
                </entity-condition>
                <entity-condition entity-name="PaymentApplication" list="paymentApplicationsInv">
                    <condition-list combine="and">
                        <condition-expr field-name="paymentId" operator="equals" value="${paymentId}"/>
                        <condition-expr field-name="invoiceId" operator="not-equals" from-field="null"/>
                    </condition-list>
                    <order-by field-name="invoiceId"/>
                    <order-by field-name="invoiceItemSeqId"/>
                </entity-condition>
                <entity-condition entity-name="PaymentApplication" list="paymentApplicationsPay">
                    <condition-list combine="and">
                        <condition-expr field-name="paymentId" operator="equals" from-field="paymentId"/>
                        <condition-expr field-name="toPaymentId" operator="not-equals" from-field="nullField"/>
                    </condition-list>
                    <order-by field-name="toPaymentId"/>
                </entity-condition>
                <entity-condition entity-name="PaymentApplication" list="paymentApplicationsBil">
                    <condition-list combine="and">
                        <condition-expr field-name="paymentId" from-field="paymentId"/>
                        <condition-expr field-name="billingAccountId" operator="not-equals" from-field="nullField"/>
                    </condition-list>
                    <order-by field-name="billingAccountId"/>
                </entity-condition>
                <entity-condition entity-name="PaymentApplication" list="paymentApplicationsTax">
                    <condition-list combine="and">
                        <condition-expr field-name="paymentId" from-field="paymentId"/>
                        <condition-expr field-name="taxAuthGeoId" operator="not-equals" from-field="nullField"/>
                    </condition-list>
                    <order-by field-name="taxAuthGeoId"/>
                </entity-condition>
            </actions>
            <widgets>
                <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <if-empty field="paymentApplications"/>
                            </condition>
                            <widgets>
                                <label style="heading" text="${uiLabelMap.AccountingPayment} ${uiLabelMap.AccountingApplications}"/>
                                <container><label text="${uiLabelMap.CommonAmount} ${uiLabelMap.CommonTotal} ${payment.amount?currency(${payment.currencyUomId})} ${uiLabelMap.AccountingAmountNotApplied} ${notAppliedAmount?currency(${payment.currencyUomId})}"/></container>
                                <container><label text="${uiLabelMap.AccountingNoPaymentsApplicationsfound}"></label></container>
                            </widgets>
                            <fail-widgets>
                                 <section>
                                    <condition>
                                        <not><if-empty field="paymentApplicationsInv"/></not>
                                    </condition>
                                    <widgets>
                                        <screenlet title="${uiLabelMap.AccountingPayment} ${uiLabelMap.AccountingApplications}">
                                            <include-form name="editPaymentApplicationsInv" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                        </screenlet>
                                    </widgets>
                                </section>
                                <section>
                                    <condition>
                                        <or>
                                            <not><if-empty field="paymentApplicationsPay"/></not>
                                            <not><if-empty field="paymentApplicationsBil"/></not>
                                            <not><if-empty field="paymentApplicationsTax"/></not>
                                        </or>
                                    </condition>
                                    <widgets>
                                        <screenlet title="${uiLabelMap.CommonAmount} ${uiLabelMap.CommonTotal} ${payment.amount?currency(${payment.currencyUomId})} ${uiLabelMap.AccountingAmountNotApplied} ${notAppliedAmount?currency(${payment.currencyUomId})}">
                                            <section>
                                                <condition>
                                                    <not><if-empty field="paymentApplicationsPay"/></not>
                                                </condition>
                                                <widgets>
                                                    <include-form name="editPaymentApplicationsPay" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                                </widgets>
                                            </section>
                                            <section>
                                                <condition>
                                                    <not><if-empty field="paymentApplicationsBil"/></not>
                                                </condition>
                                                <widgets>
                                                    <include-form name="editPaymentApplicationsBil" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                                </widgets>
                                            </section>
                                            <section>
                                                <condition>
                                                    <not><if-empty field="paymentApplicationsTax"/></not>
                                                </condition>
                                                <widgets>
                                                    <include-form name="editPaymentApplicationsTax" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                                </widgets>
                                            </section>
                                        </screenlet>
                                    </widgets>
                                </section>
                            </fail-widgets>
                        </section>
                        <section>
                            <condition>
                                <if-compare field="notAppliedAmount" operator="greater" value="0.00" type="BigDecimal"/>
                            </condition>
                            <widgets>
                                <section>
                                    <condition>
                                        <or>
                                            <not><if-empty field="invoices"/></not>
                                            <not><if-empty field="invoicesOtherCurrency"/></not>
                                        </or>
                                    </condition>
                                    <widgets>
                                        <screenlet title="${uiLabelMap.AccountingListInvoicesNotYetApplied}">
                                            <container>
                                                <label style="p" text="${uiLabelMap.CommonFrom} ${partyNameViewTo.groupName}${partyNameViewTo.lastName},${partyNameViewTo.firstName} ${partyNameViewTo.middleName}[${payment.partyIdTo}]"/>
                                                <label style="p" text="${uiLabelMap.CommonTo} ${partyNameViewFrom.groupName}${partyNameViewFrom.lastName},${partyNameViewFrom.firstName} ${partyNameViewFrom.middleName} [${payment.partyIdFrom}]"/>
                                            </container>
                                            <section>
                                                <condition>
                                                    <not><if-empty field="invoices"/></not>
                                                </condition>
                                                <widgets>
                                                    <include-form name="listInvoicesNotApplied" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                                </widgets>
                                            </section>
                                            <section>
                                                <condition>
                                                    <not><if-empty field="invoicesOtherCurrency"/></not>
                                                </condition>
                                                <widgets>
                                                    <label style="heading" text="${uiLabelMap.FormFieldTitle_otherCurrency}"/>
                                                    <include-form name="listInvoicesNotAppliedOtherCurrency" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                                </widgets>
                                            </section>
                                        </screenlet>
                                    </widgets>
                                </section>
                                <section>
                                    <condition>
                                        <not><if-empty field="payments"/></not>
                                    </condition>
                                    <widgets>
                                        <screenlet title="${uiLabelMap.AccountingListPaymentsNotYetApplied}">
                                            <container>
                                                <label style="p" text="${uiLabelMap.CommonFrom}: ${partyNameViewTo.groupName}${partyNameViewTo.lastName},${partyNameViewTo.firstName} ${partyNameViewTo.middleName}[${payment.partyIdTo}]"/>
                                                <label style="p" text="${uiLabelMap.CommonTo}: ${partyNameViewFrom.groupName}${partyNameViewFrom.lastName},${partyNameViewFrom.firstName} ${partyNameViewFrom.middleName} [${payment.partyIdFrom}]"/>
                                            </container>
                                            <include-form name="listPaymentsNotApplied" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                        </screenlet>
                                    </widgets>
                                </section>
                                <screenlet title="${uiLabelMap.AccountingApplyPaymentoTo}">
                                   <include-form name="addPaymentApplication" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                </screenlet>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="PaymentOverview">
        <section>
            <actions>
                <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>

                <set field="title" value="${uiLabelMap.AccountingPayment}: ${parameters.paymentId}"/>
                <set field="activeSubMenuItem" value="paymentOverview"/>
                <set field="paymentId" from-field="parameters.paymentId"/>
                <entity-one entity-name="Payment" value-field="payment"/>
                <entity-condition entity-name="AcctgTransAndEntries" list="AcctgTransAndEntries">
                    <condition-expr field-name="paymentId" from-field="paymentId"/>
                    <order-by field-name="acctgTransId"/>
                    <order-by field-name="acctgTransEntrySeqId"/>
                </entity-condition>
            </actions>
            <widgets>
                <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <if-compare field="payment.statusId" operator="equals"  value="PMNT_NOT_PAID"/>
                            </condition>
                            <widgets>
                                <container style="${styles.grid_row}">
                                    <container style="${styles.grid_large}6 ${styles.grid_cell}">
                                        <include-screen name="ScipioPaymentInfo"/>
                                    </container>
                                    <container style="${styles.grid_large}6 ${styles.grid_cell}">
                                        <include-screen name="ScipioPaymentAppliedPayment"/>
                                    </container>
                               </container>
                               <container style="${styles.grid_row}">
                                    <container style="${styles.grid_large}6 ${styles.grid_cell}">
                                        <include-screen name="ScipioPaymentFinancialTrans"/>
                                    </container>
                                    <container style="${styles.grid_large}6 ${styles.grid_cell}">
                                    </container>
                               </container>
                            
                                <!--  SCIPIO: Remove once fully migrated  
                                The following is more of an overview type of ongoing transactions - To be ignored for this screen                                                     
                                <screenlet title="${uiLabelMap.AccountingTransactions}" navigation-form-name="AcctgTransAndEntries">
                                    <include-form name="AcctgTransAndEntries" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                </screenlet>
                                -->
                            </widgets>
                            <fail-widgets>
                                <container style="${styles.grid_row}">
                                    <container style="${styles.grid_large}6 ${styles.grid_cell}">
                                        <include-screen name="ScipioPaymentInfo"/>
                                    </container>
                                    <container style="${styles.grid_large}6 ${styles.grid_cell}">
                                        <include-screen name="ScipioPaymentAppliedPayment"/>
                                    </container>
                               </container>
                               <container style="${styles.grid_row}">
                                    <container style="${styles.grid_large}6 ${styles.grid_cell}">
                                        <include-screen name="ScipioPaymentFinancialTrans"/>
                                    </container>
                                    <container style="${styles.grid_large}6 ${styles.grid_cell}">
                                    </container>
                               </container>
                                <!-- SCIPIO: Delete once fully migrated  
                                The following is more of an overview type of ongoing transactions - To be ignored for this screen                  
                                <screenlet title="${uiLabelMap.AccountingTransactions}" navigation-form-name="AcctgTransAndEntries">
                                    <include-form name="AcctgTransAndEntries" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                </screenlet>
                                -->
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="ManualTransaction">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingManualTransaction"/>
                <set field="activeSubMenuItem" value="manualTransaction"/>
                <script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/ManualTx.groovy"/>
                <property-map resource="OrderUiLabels" map-name="uiLabelMap" global="true"/>
            </actions>
            <widgets>
                <!-- SCIPIO: TODO: REVIEW: GenericTransactionDecorator was removed...
                <decorator-screen name="GenericTransactionDecorator" location="component://accounting/widget/TransactionScreens.xml">-->
                <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <platform-specific>
                            <html><html-template location="component://accounting/webapp/accounting/payment/manualTx.ftl"/></html>
                        </platform-specific>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="manualCCTx">
         <section>
            <widgets>
                <platform-specific>
                    <html><html-template location="component://accounting/webapp/accounting/payment/manualCCTx.ftl"/></html>
                </platform-specific>
            </widgets>
        </section>
    </screen>
    <screen name="manualGCTx">
        <section>
            <widgets>
                <platform-specific>
                    <!-- TODO: problem here: the original manualTx file referred to manualGCTx, but no such ftl files seems to exist, so this will blow up -->
                    <!-- SCIPIO: FIXME?: The missing template and previous comment are from stock; commenting out so it doesn't crash...
                    <html><html-template location="component://accounting/webapp/accounting/payment/manualGCTx.ftl"/></html>-->
                </platform-specific>
            </widgets>
        </section>
    </screen>

    <screen name="PrintChecks">
        <section>
            <actions>
                <!-- pass in paymentId to print one check, otherwise use multi form input -->
                <set field="paymentId" from-field="parameters.paymentId"/>
                <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                <script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/PrintChecks.groovy"/>
                <entity-condition entity-name="InvoiceItemType" list="PayrolGroup">
                    <condition-expr field-name="parentTypeId" value="PAYROL"/>
                </entity-condition>
            </actions>
            <widgets>
                <platform-specific>
                    <xsl-fo><html-template location="component://accounting/webapp/accounting/payment/PrintChecks.fo.ftl"/></xsl-fo>
                </platform-specific>
            </widgets>
        </section>
    </screen>

    <screen name="FindSalesInvoicesByDueDate">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingFindSalesInvoicesByDueDate"/>
                <set field="activeSubMenuItem" value="payments"/>
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
                <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
                <script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonAccountingAppDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.CommonSearchOptions}">
                            <include-form name="FindSalesInvoicesByDueDate" location="component://accounting/widget/payments/PaymentForms.xml"/>
                        </screenlet>
                        <section>
                            <condition>
                                <not><if-empty field="invoicePaymentInfoList"/></not>
                            </condition>
                            <widgets>
                                <screenlet title="${uiLabelMap.CommonSearchResults}">
                                    <include-form name="ListInvoicesByDueDate"  location="component://accounting/widget/payments/PaymentForms.xml"/>
                                </screenlet>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
   
    <screen name="FindPurchaseInvoicesByDueDate">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingFindPurchaseInvoicesByDueDate"/>
                <set field="activeSubMenuItem" value="payments"/>
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
                <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
                <script location="component://accounting/webapp/accounting/WEB-INF/actions/payment/FindInvoicesByDueDate.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonAccountingAppDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.CommonSearchOptions}">
                            <include-form name="FindPurchaseInvoicesByDueDate" location="component://accounting/widget/payments/PaymentForms.xml"/>
                        </screenlet>
                        <section>
                            <condition>
                                <not><if-empty field="invoicePaymentInfoList"/></not>
                            </condition>
                            <widgets>
                                <screenlet title="${uiLabelMap.CommonSearchResults}">
                                    <include-form name="ListInvoicesByDueDate" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                </screenlet>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    
    <!-- 
    *****************
    * Accounts Payable
    *****************
     -->
     
     <screen name="FindApPaymentGroups">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingFindApPaymentGroups"/>
                <set field="activeSubMenuItem" value="apPaymentGroups"/>
                <entity-condition entity-name="PaymentGroup" list="paymentGroupList">
                    <condition-list combine="and">
                        <condition-expr field-name="paymentGroupId" from-field="parameters.paymentGroupId" ignore-if-empty="true"/>
                        <condition-expr field-name="paymentGroupTypeId" value="CHECK_RUN"/>
                    </condition-list>
                </entity-condition>
            </actions>
            <widgets>
                <decorator-screen name="CommonApDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="menu-bar">
                                <container style="button-bar">
                                    <include-menu name="PaymentGroupSubTabBar" location="component://accounting/widget/AccountingMenus.xml"/>
                                </container>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindApPaymentGroups" location="component://accounting/widget/ap/VendorForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListPaymentGroup" location="component://accounting/widget/payments/PaymentGroupForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section> 
                </decorator-screen>   
            </widgets>
        </section>
    </screen>
    
    <screen name="FindApPayments">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingFindApPayments"/>
                <set field="activeSubMenuItem" value="findApPayments"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonApDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="menu-bar">
                                <container style="button-bar">
                                    <link target="newPayment" text="${uiLabelMap.AccountingNewPayment}" style="${styles.link_nav} ${styles.action_add}"/>
                                </container>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindApPayments" location="component://accounting/widget/ap/VendorForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListPayments" location="component://accounting/widget/payments/PaymentForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
     
     <!-- 
     ****************
     * Accounts Receivable
     ****************
      -->
      <screen name="FindArPayments">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingFindArPayments"/>
                <set field="activeSubMenuItem" value="findArPayments"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonArDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="menu-bar">
                                <container style="button-bar">
                                    <link target="newPayment" text="${uiLabelMap.AccountingNewPayment}" style="${styles.link_nav} ${styles.action_add}"/>
                                </container>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindArPayments" location="component://accounting/widget/payments/PaymentForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListPayments"  location="component://accounting/widget/payments/PaymentForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
      
      <screen name="BatchPayments">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleDepositPaymentsAndCreateBatch"/>
                <set field="activeSubMenuItem" value="batchPayments"/>
                <set field="paymentMethodTypeId" from-field="parameters.paymentMethodTypeId"/>
                <set field="cardType" from-field="parameters.cardType"/>
                <set field="fromDate" type="Timestamp" from-field="parameters.fromDate"/>
                <set field="thruDate" type="Timestamp" from-field="parameters.thruDate"/>
                <set field="partyIdFrom" from-field="parameters.partyIdFrom"/>
                <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
                <script location="component://accounting/webapp/ar/WEB-INF/actions/BatchPayments.groovy"/>
                <entity-and entity-name="FinAccount" list="finAccounts">
                    <field-map field-name="finAccountTypeId" value="BANK_ACCOUNT"/>
                </entity-and>
            </actions>
            <widgets>
                <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="search-options">
                                <include-form name="FindBatchPayments" location="component://accounting/widget/payments/PaymentForms.xml"/>
                            </decorator-section> 
                            <decorator-section name="search-results">
                                <platform-specific>
                                    <html><html-template location="component://accounting/webapp/ar/payment/batchPayments.ftl"/></html>
                                </platform-specific>
                            </decorator-section>
                        </decorator-screen>  
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="NewIncomingPayment">
       <section>
            <actions>
                <set field="titleProperty" value="AccountingNewPaymentIncoming"/>
                <set field="activeSubMenuItem" value="newPayment"/>
            </actions>
            <widgets>
               <decorator-screen name="CommonArDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet>
                            <include-form name="NewPaymentIn" location="component://accounting/widget/payments/PaymentForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="FindArPaymentGroups">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingFindArPaymentGroups"/>
                <set field="activeSubMenuItem" value="arPaymentGroups"/>
                <entity-condition entity-name="PaymentGroup" list="paymentGroupList">
                    <condition-list combine="and">
                        <condition-expr field-name="paymentGroupId" from-field="parameters.paymentGroupId" ignore-if-empty="true"/>
                        <condition-expr field-name="paymentGroupTypeId" value="BATCH_PAYMENT"/>
                    </condition-list>
                </entity-condition>
            </actions>
            <widgets>
                <decorator-screen name="CommonArDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="menu-bar">
                                <container style="button-bar">
                                    <include-menu name="PaymentGroupSubTabBar" location="component://accounting/widget/AccountingMenus.xml"/>
                                </container>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindArPaymentGroups" location="component://accounting/widget/payments/PaymentForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListPaymentGroup" location="component://accounting/widget/payments/PaymentGroupForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section> 
                </decorator-screen>   
            </widgets>
        </section>
    </screen>
    
    
    <!-- SCIPIO: Form migration --> 
    <!-- SCIPIO: Form widget replacement: component://accounting/widget/payments/PaymentForms.xml#paymentHeader -->
    <screen name="ScipioPaymentInfo">
        <section>
            <actions>
                <service service-name="getPartyNameForDate" result-map="partyNameResultFrom">
                    <field-map field-name="partyId" from-field="payment.partyIdFrom"/>
                    <field-map field-name="compareDate" from-field="payment.effectiveDate"/>
                    <field-map field-name="lastNameFirst" value="Y"/>
                </service>
                <service service-name="getPartyNameForDate" result-map="partyNameResultTo">
                    <field-map field-name="partyId" from-field="payment.partyIdTo"/>
                    <field-map field-name="compareDate" from-field="payment.effectiveDate"/>
                    <field-map field-name="lastNameFirst" value="Y"/>
                </service>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <not>
                            <if-empty field="payment"/>
                        </not>
                    </condition>
                    <widgets>
                        <screenlet>        
                            <platform-specific>
                                <html><html-template location="component://accounting/webapp/accounting/payment/ScipioPaymentInfo.ftl"/></html>
                            </platform-specific>
                        </screenlet>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>
    
    <!-- SCIPIO: Form widget replacement: component://accounting/widget/payments/PaymentForms.xml#paymentApplication -->
    <screen name="ScipioPaymentAppliedPayment">
        <section>
            <actions>
                <set field="appliedAmount" value="${groovy:org.ofbiz.accounting.payment.PaymentWorker.getPaymentApplied(payment).toString()}"/>
                <set field="notAppliedAmount" value="${groovy:org.ofbiz.accounting.payment.PaymentWorker.getPaymentNotApplied(payment).toString()}"/>                
               <entity-condition entity-name="PaymentApplication" list="paymentList">
                    <condition-list combine="or">
                        <condition-expr field-name="paymentId" from-field="paymentId"/>
                        <condition-expr field-name="toPaymentId" from-field="paymentId"/>
                    </condition-list>
                    <order-by field-name="invoiceId"/>
                    <order-by field-name="invoiceItemSeqId"/>
                </entity-condition>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <and>
                            <not>
                                <if-empty field="parameters.paymentId"/>
                            </not>
                        </and>
                    </condition>
                    <widgets>
                        <screenlet>        
                            <platform-specific>
                                <html><html-template location="component://accounting/webapp/accounting/payment/ScipioPaymentAppliedPayment.ftl"/></html>
                            </platform-specific>
                        </screenlet>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>
    
    <!-- SCIPIO: Form widget replacement: component://accounting/widget/payments/PaymentForms.xml#FinAccountTransAssociatedWithPayment -->
    <screen name="ScipioPaymentFinancialTrans">
        <section>
            <actions>
                <set field="finAccountTransId" from-field="payment.finAccountTransId"/>
                <entity-one entity-name="FinAccountTrans" value-field="finAccountTrans"/>
            </actions>
            <widgets>
                <screenlet>        
                    <platform-specific>
                        <html><html-template location="component://accounting/webapp/accounting/payment/ScipioPaymentFinancialTrans.ftl"/></html>
                    </platform-specific>
                </screenlet>
            </widgets>
        </section>
    </screen>
    
    
    <!-- SCIPIO: Form widget replacement: component://accounting/widget/TransactionScreens.xml#ViewGatewayResponse -->
        <!-- view a particular gateway response -->
    <screen name="ViewGatewayResponse">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleViewGatewayResponse"/>
                <set field="activeSubMenuItem" value="gatewayResponses"/>

                <set field="paymentGatewayResponseId" from-field="parameters.paymentGatewayResponseId"/>
                <set field="orderPaymentPreferenceId" from-field="parameters.orderPaymentPreferenceId"/>

                <entity-one entity-name="PaymentGatewayResponse" value-field="paymentGatewayResponse" auto-field-map="true"/>

                <script location="component://accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.PageTitleViewGatewayResponse}">
                            <include-form name="ViewGatewayResponseRelations" location="component://accounting/widget/payments/PaymentForms.xml"/>
                        </screenlet>
                        <screenlet title="${uiLabelMap.AccountingPaymentsMenu}">
                            <include-form name="ViewGatewayResponsePayments" location="component://accounting/widget/payments/PaymentForms.xml"/>
                        </screenlet>
                        <screenlet title="${uiLabelMap.PageTitleViewGatewayResponse}">
                            <include-form name="ViewGatewayResponse" location="component://accounting/widget/payments/PaymentForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    
    <!-- SCIPIO (02/01/2019): Form widget replacement: component://accounting/widget/TransactionScreens.xml#FindGatewayResponse -->
    <screen name="FindGatewayResponses">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleFindGatewayResponses"/> <!-- shows up in browser title bar -->
                <set field="activeSubMenuItem" value="gatewayResponses"/>
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
                <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <widgets>
                                <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                                    <decorator-section name="search-options">
                                        <include-form name="FindGatewayResponses" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                    </decorator-section>
                                    <decorator-section name="search-results">
                                        <include-form name="ListGatewayResponses" location="component://accounting/widget/payments/PaymentForms.xml"/>
                                    </decorator-section>
                                </decorator-screen>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    
    <!-- SCIPIO (02/01/2019): Form widget replacement: component://accounting/widget/TransactionScreens.xml#FindGatewayResponse -->
    <!-- form to authorize a transaction -->
    <screen name="AuthorizeTransaction">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingAuthorize"/>
                <set field="activeSubMenuItem" value="authorizeTransaction"/>

                <set field="orderId" from-field="parameters.orderId"/>
                <set field="orderPaymentPreferenceId" from-field="parameters.orderPaymentPreferenceId"/>

                <entity-one entity-name="OrderPaymentPreference" value-field="opp">
                    <field-map field-name="orderPaymentPreferenceId" from-field="orderPaymentPreferenceId"/>
                </entity-one>
                <set field="paymentMethodTypeId" from-field="opp.paymentMethodTypeId"/>

                <script location="component://accounting/webapp/accounting/WEB-INF/actions/transaction/AuthorizeTransaction.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet>
                            <include-form name="AuthorizeTransaction" location="component://accounting/widget/payments/PaymentForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <!-- form to capture a transaction -->
    <screen name="CaptureTransaction">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingCapture"/>
                <set field="activeSubMenuItem" value="captureTransaction"/>

                <set field="orderId" from-field="parameters.orderId"/>
                <set field="orderPaymentPreferenceId" from-field="parameters.orderPaymentPreferenceId"/>

                <entity-one entity-name="OrderPaymentPreference" value-field="opp">
                    <field-map field-name="orderPaymentPreferenceId" from-field="orderPaymentPreferenceId"/>
                </entity-one>
                <set field="paymentMethodTypeId" from-field="opp.paymentMethodTypeId"/>
                <script location="component://accounting/webapp/accounting/WEB-INF/actions/transaction/CaptureTransaction.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonPaymentDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet>
                            <include-form name="CaptureTransaction" location="component://accounting/widget/payments/PaymentForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    
</screens>