<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

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

    <screen name="CommonPaymentDecorator">
        <section>
            <actions>
                <set field="headerItem" value="payments"/>
            </actions>
            <widgets>
                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="pre-body">
                        <include-menu name="MainActionMenu" location="${parameters.mainMenuLocation}"/>
                        <section>
                            <widgets>
                                <container style="leftclear">
                                    <label style="h1" text="${uiLabelMap.CommonPayment}: ${paymentId}"/>
                                </container>
                                <include-menu name="PaymentTabBar" location="${parameters.mainMenuLocation}"/>
                                <include-menu name="PaymentSubTabBar" location="${parameters.mainMenuLocation}"/>
                            </widgets>
                        </section>
                    </decorator-section>
                    <decorator-section name="body">
                        <section>
                            <!-- do check for ACCOUNTING, _VIEW permission -->
                            <condition>
                                <if-service-permission service-name="acctgBasePermissionCheck" main-action="VIEW"/>
                            </condition>
                            <widgets>
                                <decorator-section-include name="body"/>
                            </widgets>
                            <fail-widgets>
                                <label style="h3" text="${uiLabelMap.AccountingViewPermissionError}"/>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="FindPayments">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleFindPayment"/>
                <set field="headerItem" value="payments"/>
                <set field="tabButtonItem" value="findPayment"/>
                <set field="helpAnchor" value="_help_for_find_payments"/>
                <set field="asm_multipleSelectForm" value="FindPayments"/>
                <set field="statusId.asm_multipleSelect" value="FindPayments_statusId"/>
                <set field="statusId.asm_sortable" value="true"/>
                <set field="statusId.asm_title" value=" "/>
                <set field="asm_listField[]" from-field="statusId"/>
            </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">
                                        <platform-specific>
                                            <html><html-template multi-block="true" location="component://common-theme/template/includes/SetMultipleSelectJsList.ftl"/></html>
                                        </platform-specific>
                                        <include-form name="FindPayments" location="component://accounting/widget/PaymentForms.xml"/>
                                    </decorator-section>
                                    <decorator-section name="search-results">
                                        <include-grid name="ListPayments" location="component://accounting/widget/PaymentForms.xml"/>
                                    </decorator-section>
                                </decorator-screen>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="ListPayments">
        <section>
            <actions>
                <set field="noConditionFind" value="Y"/>
                <set field="parameters.statusId" from-field="statusId"/>
            </actions>
            <widgets>
                <screenlet title="${uiLabelMap.AccountingInvoicePayments}">
                    <include-grid name="ListPayments"  location="component://accounting/widget/PaymentForms.xml"/>
                </screenlet>
            </widgets>
        </section>
    </screen>
    <screen name="NewPayment">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditPayment"/>
                <set field="headerItem" value="payments"/>
                <set field="tabButtonItem" value="editPayment"/>
                <set field="helpAnchor" value="_help_for_new_payment"/>
                <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">
                        <section>
                            <widgets>
                                <screenlet title="${uiLabelMap.AccountingNewPaymentIncoming}">
                                    <include-form name="NewPaymentIn" location="component://accounting/widget/PaymentForms.xml"/>
                                </screenlet>
                                <screenlet title="${uiLabelMap.AccountingNewPaymentOutgoing}">
                                    <include-form name="NewPaymentOut" location="component://accounting/widget/PaymentForms.xml"/>
                                </screenlet>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditPayment">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditPayment"/>
                <set field="tabButtonItem" value="editPayment"/>
                <set field="helpAnchor" value="_help_for_payment_header"/>
                <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.paymentDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <widgets>
                                <screenlet title="${uiLabelMap.AccountingInvoiceHeaderDetailedInformation}">
                                    <include-form name="EditPayment" location="component://accounting/widget/PaymentForms.xml"/>
                                </screenlet>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditPaymentApplications">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleListPaymentApplications"/>
                <set field="tabButtonItem" value="editPaymentApplications"/>
                <set field="helpAnchor" value="_help_for_payment_applications"/>
                <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.apache.ofbiz.accounting.payment.PaymentWorker.getPaymentApplied(payment)));}"/>
                <set field="notAppliedAmount" type="BigDecimal" value="${groovy:org.apache.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.apache.ofbiz.accounting.payment.PaymentWorker.getPaymentNotApplied(payment)));}"/>
                <script location="component://accounting/src/main/groovy/org/apache/ofbiz/accounting/payment/ListNotAppliedInvoices.groovy"/>
                <script location="component://accounting/src/main/groovy/org/apache/ofbiz/accounting/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.paymentDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <and>
                                    <or>
                                        <if-has-permission permission="ACCOUNTING" action="_CREATE"/>
                                        <if-has-permission permission="ACCOUNTING" action="_UPDATE"/>
                                    </or>
                                </and>
                            </condition>
                            <widgets>
                                <section>
                                    <condition>
                                    <if-empty field="paymentApplications"/>
                                    </condition>
                                    <widgets>
                                        <container><label style="h1" text="${uiLabelMap.AccountingAppliedPayments}"/></container>
                                        <container><label style="h1" text="${uiLabelMap.CommonAmount} ${uiLabelMap.CommonTotal} ${payment.amount?currency(${payment.currencyUomId})} ${uiLabelMap.AccountingAmountNotApplied} ${notAppliedAmount?currency(${payment.currencyUomId})}"/></container>
                                        <container><label style="h3" text="${uiLabelMap.AccountingNoPaymentsApplicationsfound}"></label></container>
                                    </widgets>
                                    <fail-widgets>
                                        <section>
                                            <condition>
                                                <not><if-empty field="paymentApplicationsInv"/></not>
                                            </condition>
                                            <widgets>
                                                <screenlet title="${uiLabelMap.AccountingAppliedPayments}">
                                                    <include-grid name="EditPaymentApplicationsInv" location="component://accounting/widget/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-grid name="EditPaymentApplicationsPay" location="component://accounting/widget/PaymentForms.xml"/>
                                                        </widgets>
                                                    </section>
                                                    <section>
                                                        <condition>
                                                            <not><if-empty field="paymentApplicationsBil"/></not>
                                                        </condition>
                                                        <widgets>
                                                            <include-grid name="EditPaymentApplicationsBil" location="component://accounting/widget/PaymentForms.xml"/>
                                                        </widgets>
                                                    </section>
                                                    <section>
                                                        <condition>
                                                            <not><if-empty field="paymentApplicationsTax"/></not>
                                                        </condition>
                                                        <widgets>
                                                            <include-grid name="EditPaymentApplicationsTax" location="component://accounting/widget/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="h2" text="${uiLabelMap.CommonFrom} ${partyNameViewTo.groupName}${partyNameViewTo.lastName},${partyNameViewTo.firstName} ${partyNameViewTo.middleName}[${payment.partyIdTo}]"/>
                                                        <label style="h2" 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-grid name="ListInvoicesNotApplied" location="component://accounting/widget/PaymentForms.xml"/>
                                                        </widgets>
                                                    </section>
                                                    <section>
                                                        <condition>
                                                            <not><if-empty field="invoicesOtherCurrency"/></not>
                                                        </condition>
                                                        <widgets>
                                                            <label style="h2" text="${uiLabelMap.FormFieldTitle_otherCurrency}"/>
                                                            <include-form name="ListInvoicesNotAppliedOtherCurrency" location="component://accounting/widget/PaymentForms.xml"/>
                                                        </widgets>
                                                    </section>
                                                </screenlet>
                                            </widgets>
                                        </section>
                                        <section>
                                            <condition>
                                                <not><if-empty field="payments"/></not>
                                            </condition>
                                            <widgets>
                                                <screenlet title="${uiLabelMap.AccountingListPaymentsNotYetApplied}">
                                                    <container>
                                                        <label style="h2" text="${uiLabelMap.CommonFrom}: ${partyNameViewTo.groupName}${partyNameViewTo.lastName},${partyNameViewTo.firstName} ${partyNameViewTo.middleName}[${payment.partyIdTo}]"/>
                                                        <label style="h2" text="${uiLabelMap.CommonTo}: ${partyNameViewFrom.groupName}${partyNameViewFrom.lastName},${partyNameViewFrom.firstName} ${partyNameViewFrom.middleName} [${payment.partyIdFrom}]"/>
                                                    </container>
                                                    <include-grid name="ListPaymentsNotApplied" location="component://accounting/widget/PaymentForms.xml"/>
                                                </screenlet>
                                            </widgets>
                                        </section>
                                        <screenlet title="${uiLabelMap.AccountingApplyPaymentoTo}">
                                            <include-form name="AddPaymentApplication" location="component://accounting/widget/PaymentForms.xml"/>
                                        </screenlet>
                                    </widgets>
                                </section>
                            </widgets>
                            <fail-widgets>
                                <container><label style="h1" text="${uiLabelMap.AccountingAppliedPayments}"/></container>
                                <container><label style="h1" text="${uiLabelMap.CommonAmount} ${uiLabelMap.CommonTotal} ${payment.amount?currency(${payment.currencyUomId})} ${uiLabelMap.AccountingAmountNotApplied} ${notAppliedAmount?currency(${payment.currencyUomId})}"/></container>
                                <container><label style="h3" text="${uiLabelMap.AccountingNoPaymentsApplicationsfound}"></label></container>
                                <screenlet title="${uiLabelMap.AccountingPaymentsApplied} ${appliedAmount?currency(${payment.currencyUomId})} ${uiLabelMap.AccountingOpenPayments} ${notAppliedAmount?currency(${payment.currencyUomId})}">
                                    <include-grid name="PaymentApplications" location="component://accounting/widget/PaymentForms.xml"/>
                                </screenlet>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="PaymentOverview">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitlePaymentOverview"/>
                <set field="tabButtonItem" value="paymentOverview"/>
                <set field="helpAnchor" value="_help_for_payment_overview"/>
                <set field="labelTitleProperty" value="PageTitlePaymentOverview"/>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="paymentId" from-field="parameters.paymentId"/>
                <entity-one entity-name="Payment" value-field="payment"/>
                <set field="finAccountTransId" from-field="payment.finAccountTransId"/>
                <entity-one entity-name="FinAccountTrans" value-field="finAccountTrans"/>
                <set field="appliedAmount" value="${groovy:org.apache.ofbiz.accounting.payment.PaymentWorker.getPaymentApplied(payment).toString()}"/>
                <set field="notAppliedAmount" value="${groovy:org.apache.ofbiz.accounting.payment.PaymentWorker.getPaymentNotApplied(payment).toString()}"/>
                <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.paymentDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <if-compare field="payment.statusId" operator="equals"  value="PMNT_NOT_PAID"/>
                            </condition>
                            <widgets>
                                <container style="lefthalf">
                                    <screenlet title="${uiLabelMap.AccountingPaymentHeader}">
                                        <include-form name="PaymentHeader" location="component://accounting/widget/PaymentForms.xml"/>
                                    </screenlet>
                                </container>
                                <container style="righthalf">
                                    <screenlet title="${uiLabelMap.AccountingPaymentsApplied} ${appliedAmount?currency(${payment.currencyUomId})} ${uiLabelMap.AccountingOpenPayments} ${notAppliedAmount?currency(${payment.currencyUomId})}">
                                        <include-grid name="PaymentApplications" location="component://accounting/widget/PaymentForms.xml"/>
                                    </screenlet>
                                    <section>
                                        <condition>
                                            <not><if-empty field="finAccountTransId"/></not>
                                        </condition>
                                        <widgets>
                                            <screenlet title="${uiLabelMap.AccountingFinAccountTransaction}">
                                                <include-form name="FinAccountTransAssociatedWithPayment" location="component://accounting/widget/PaymentForms.xml"/>
                                            </screenlet>
                                        </widgets>
                                    </section>
                                </container>
                                <container style="clear"/>
                                <screenlet title="${uiLabelMap.AccountingTransactions}" navigation-form-name="AcctgTransAndEntries">
                                    <include-form name="AcctgTransAndEntries" location="component://accounting/widget/PaymentForms.xml"/>
                                </screenlet>
                            </widgets>
                            <fail-widgets>
                                <container style="lefthalf">
                                    <screenlet title="${uiLabelMap.AccountingPaymentHeader}">
                                        <include-form name="PaymentHeader" location="component://accounting/widget/PaymentForms.xml"/>
                                    </screenlet>
                                </container>
                                <container style="righthalf">
                                    <screenlet title="${uiLabelMap.AccountingPaymentsApplied} ${appliedAmount?currency(${payment.currencyUomId})} ${uiLabelMap.AccountingOpenPayments} ${notAppliedAmount?currency(${payment.currencyUomId})}">
                                        <include-grid name="PaymentApplications" location="component://accounting/widget/PaymentForms.xml"/>
                                    </screenlet>
                                        <section>
                                            <condition>
                                                <not><if-empty field="finAccountTransId"/></not>
                                            </condition>
                                            <widgets>
                                                <screenlet title="${uiLabelMap.AccountingFinAccountTransaction}">
                                                    <include-form name="FinAccountTransAssociatedWithPayment" location="component://accounting/widget/PaymentForms.xml"/>
                                                </screenlet>
                                            </widgets>
                                        </section>
                                </container>
                                <container style="clear"/>
                                <screenlet title="${uiLabelMap.AccountingTransactions}" navigation-form-name="AcctgTransAndEntries">
                                    <include-form name="AcctgTransAndEntries" location="component://accounting/widget/PaymentForms.xml"/>
                                </screenlet>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="PaymentAttributes">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitlePaymentAttributes"/>
                <set field="tabButtonItem" value="paymentAttributes"/>
                <set field="paymentId" from-field="parameters.paymentId"/>
                <entity-one entity-name="Payment" value-field="payment"/>
                <entity-and entity-name="PaymentAttribute" list="paymentAttributes">
                    <field-map field-name="paymentId" from-field="paymentId"/>
                    <order-by field-name="attrName"/>
                </entity-and>
            </actions>
            <widgets>
                <decorator-screen name="CommonPaymentDecorator" location="${parameters.paymentDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <widgets>
                                <screenlet title="${uiLabelMap.CommonAttributes}">
                                    <include-grid name="PaymentAttributes" location="component://accounting/widget/PaymentForms.xml"/>
                                </screenlet>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="ManualTransaction">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingManualTransaction"/>
                <set field="headerItem" value="transaction"/>
                <set field="tabButtonItem" value="manualtransactiontab"/>
                <set field="helpAnchor" value="_help_for_manual_transaction"/>
                <script location="component://accounting/src/main/groovy/org/apache/ofbiz/accounting/payment/ManualTx.groovy"/>
                <property-map resource="OrderUiLabels" map-name="uiLabelMap" global="true"/>
            </actions>
            <widgets>
                <decorator-screen name="GenericTransactionDecorator" location="component://accounting/widget/TransactionScreens.xml">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.AccountingManualTransaction}">
                            <platform-specific>
                                <html><html-template location="component://accounting/template/payment/ManualTx.ftl"/></html>
                            </platform-specific>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="manualCCTx">
         <section>
            <widgets>
                <platform-specific>
                    <html><html-template multi-block="true" location="component://accounting/template/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 -->
                    <html><html-template location="component://accounting/template/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/src/main/groovy/org/apache/ofbiz/accounting/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/template/payment/PrintChecks.fo.ftl"/></xsl-fo>
                </platform-specific>
            </widgets>
        </section>
    </screen>
    <screen name="InvoiceAcctgTransEntry">
        <section>
            <actions>
                <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                <script location="component://accounting/src/main/groovy/org/apache/ofbiz/accounting/reports/InvoiceAcctgTransEntryParameters.groovy"/>
            </actions>
            <widgets>
                <platform-specific>
                    <xsl-fo><html-template location="component://accounting/template/reports/InvoiceAcctgTransEntry.fo.ftl"/></xsl-fo>
                </platform-specific>
            </widgets>
        </section>
    </screen>
    <screen name="FindSalesInvoicesByDueDate">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingFindSalesInvoicesByDueDate"/>
                <set field="headerItem" value="payments"/>
                <set field="helpAnchor" value="_help_for_find_sales_invoices_by_due_date"/>
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
                <set field="viewSizeDefaultValue" value="${groovy: modelTheme.getDefaultViewSize()}" type="Integer"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
                <script location="component://accounting/src/main/groovy/org/apache/ofbiz/accounting/payment/FindInvoicesByDueDate.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.AccountingFindSalesInvoicesByDueDate}">
                            <include-form name="FindSalesInvoicesByDueDate" location="component://accounting/widget/PaymentForms.xml"/>
                        </screenlet>
                        <section>
                            <condition>
                                <not><if-empty field="invoicePaymentInfoList"/></not>
                            </condition>
                            <widgets>
                                <screenlet title="${uiLabelMap.AccountingFindSalesInvoicesByDueDate}">
                                    <include-grid name="ListInvoicesByDueDate"  location="component://accounting/widget/PaymentForms.xml"/>
                                </screenlet>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="FindPurchaseInvoicesByDueDate">
        <section>
            <actions>
                <set field="titleProperty" value="AccountingFindPurchaseInvoicesByDueDate"/>
                <set field="headerItem" value="payments"/>
                <set field="helpAnchor" value="_help_for_find_purchase_invoices_by_due_date"/>
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
                <set field="viewSizeDefaultValue" value="${groovy: modelTheme.getDefaultViewSize()}" type="Integer"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
                <script location="component://accounting/src/main/groovy/org/apache/ofbiz/accounting/payment/FindInvoicesByDueDate.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.AccountingFindPurchaseInvoicesByDueDate}">
                            <include-form name="FindPurchaseInvoicesByDueDate" location="component://accounting/widget/PaymentForms.xml"/>
                        </screenlet>
                        <section>
                            <condition>
                                <not><if-empty field="invoicePaymentInfoList"/></not>
                            </condition>
                            <widgets>
                                <screenlet title="${uiLabelMap.AccountingFindPurchaseInvoicesByDueDate}">
                                    <include-grid name="ListInvoicesByDueDate" location="component://accounting/widget/PaymentForms.xml"/>
                                </screenlet>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
</screens>
