ilscipio/scipio-erp

View on GitHub
applications/accounting/widget/settings/TaxAuthorityScreens.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.taxAuthDecoratorLocation pattern that existed here has been supplanted
        by the decorator default-fallback-location pattern for parameters.mainDecoratorLocation (see CommonScreens.xml). -->

    <screen name="FindTaxAuthority">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleFindTaxAuthority"/>
                <!-- SCIPIO: use exact 'us' name so the menu definition can decide how to handle this screen
                <set field="activeSubMenuItem" value="TaxAuthorities"/>-->
                <set field="activeSubMenuItem" value="FindTaxAuthority"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonTaxAuthorityDecorator" 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="NewTaxAuthoritySubTabBar" location="component://accounting/widget/AccountingMenus.xml"/>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindTaxAuthority" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListTaxAuthorities" location="component://accounting/widget/settings/TaxAuthorityForms.xml" />
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section>
                </decorator-screen>
            </widgets>
         </section>
    </screen>

    <screen name="EditTaxAuthority">
        <section>
            <actions>
                <set field="taxAuthPartyId" from-field="parameters.taxAuthPartyId"/>
                <set field="taxAuthGeoId" from-field="parameters.taxAuthGeoId"/>
                <entity-one entity-name="TaxAuthority" value-field="taxAuthority"/>
                
                <set field="titleProperty" value="${groovy: context.taxAuthority ? 'PageTitleEditTaxAuthority' : 'AccountingNewTaxAuthority'}"/>
                <set field="activeSubMenuItem" value="${groovy: context.taxAuthority ? 'EditTaxAuthority' : 'NewTaxAuthority'}"/>
                <set field="labelTitleProperty" value="${groovy: context.taxAuthority ? 'PageTitleEditTaxAuthority' : 'AccountingNewTaxAuthority'}"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonTaxAuthorityDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-menu name="EditTaxAuthoritySubTabBar" location="component://accounting/widget/AccountingMenus.xml"/>
                        <screenlet>
                            <include-form name="EditTaxAuthority" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
                        </screenlet>
                        <!-- SCIPIO: 2017-04-20: combined screens -->
                        <section>
                            <condition>
                                <not><if-empty field="taxAuthority"/></not>
                            </condition>
                            <widgets>
                                <include-screen name="ListTaxAuthorityPartiesWidgets"/>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <!-- SCIPIO: 2017-04-20: DEPRECATED: now integrated into EditTaxAuthorityRateProducts -->
    <screen name="EditTaxAuthorityCategories">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditTaxAuthorityCategories"/>
                <set field="activeSubMenuItem" value="EditTaxAuthorityCategories"/>
                <set field="labelTitleProperty" value="PageTitleEditTaxAuthorityCategories"/>

                <set field="taxAuthPartyId" from-field="parameters.taxAuthPartyId"/>
                <set field="taxAuthGeoId" from-field="parameters.taxAuthGeoId"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonTaxAuthorityDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-screen name="EditTaxAuthorityCategoriesWidgets"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <!-- SCIPIO: 2017-04-20: factored out for reuse -->
    <screen name="EditTaxAuthorityCategoriesWidgets">
        <section>
            <widgets>
                <screenlet id="TaxAuthorityCategoriesPanel" title="${uiLabelMap.ProductCategories}" collapsible="true"><!-- PageTitleAddTaxAuthorityCategory -->
                    <include-form name="AddTaxAuthorityCategory" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
                </screenlet>
                <include-form name="ListTaxAuthorityCategories" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
            </widgets>
        </section>
    </screen>
    
    <screen name="EditTaxAuthorityAssocs">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditTaxAuthorityAssocs"/>
                <set field="activeSubMenuItem" value="EditTaxAuthorityAssocs"/>
                <set field="labelTitleProperty" value="PageTitleEditTaxAuthorityAssocs"/>

                <set field="taxAuthPartyId" from-field="parameters.taxAuthPartyId"/>
                <set field="taxAuthGeoId" from-field="parameters.taxAuthGeoId"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonTaxAuthorityDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet id="TaxAuthorityAssocsPanel" title="${uiLabelMap.PageTitleAddTaxAuthorityAssoc}" collapsible="true">
                            <include-form name="AddTaxAuthorityAssoc" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
                        </screenlet>
                        <include-form name="ListTaxAuthorityAssocs" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    
    <screen name="EditTaxAuthorityGlAccounts">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditTaxAuthorityGlAccounts"/>
                <set field="activeSubMenuItem" value="EditTaxAuthorityGlAccounts"/>
                <set field="labelTitleProperty" value="PageTitleEditTaxAuthorityGlAccounts"/>

                <set field="taxAuthPartyId" from-field="parameters.taxAuthPartyId"/>
                <set field="taxAuthGeoId" from-field="parameters.taxAuthGeoId"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonTaxAuthorityDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet id="TaxAuthorityGlAccountPanel" title="${uiLabelMap.PageTitleAddTaxAuthorityGlAccount}" collapsible="true">
                            <include-form name="AddTaxAuthorityGlAccount" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
                        </screenlet>
                        <include-form name="ListTaxAuthorityGlAccounts" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="EditTaxAuthorityRateProducts">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditTaxAuthorityRateProducts"/>
                <set field="activeSubMenuItem" value="EditTaxAuthorityRateProducts"/>
                <set field="labelTitleProperty" value="PageTitleEditTaxAuthorityRateProducts"/>

                <set field="taxAuthPartyId" from-field="parameters.taxAuthPartyId"/>
                <set field="taxAuthGeoId" from-field="parameters.taxAuthGeoId"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonTaxAuthorityDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <!-- SCIPIO: 2017-04-20: combined screens -->
                        <include-screen name="EditTaxAuthorityCategoriesWidgets"/>
                        <include-screen name="EditTaxAuthorityRateProductWidgets"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <!-- SCIPIO: 2017-04-20: factored out for reuse -->
    <screen name="EditTaxAuthorityRateProductWidgets">
        <section>
            <widgets>
                <screenlet id="TaxAuthorityCategoryPanel" title="${uiLabelMap.AccountingProductRates}" collapsible="true">
                    <label>${uiLabelMap.AccountingTaxAuthorityCategoryAdvice}</label>
                    <include-form name="AddTaxAuthorityRateProduct" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
                </screenlet>
                <!--<label>${uiLabelMap.AccountingTaxAuthorityCategoryAdvice}</label>-->                      
                <include-form name="ListTaxAuthorityRateProducts" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
            </widgets>
        </section>
    </screen>

    <!-- SCIPIO: 2017-04-20: DEPRECATED: now integrated into EditTaxAuthority -->
    <screen name="ListTaxAuthorityParties">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleListTaxAuthorityParties"/>
                <set field="activeSubMenuItem" value="ListTaxAuthorityParties"/>
                <set field="labelTitleProperty" value="Standard costs"/>

                <set field="taxAuthPartyId" from-field="parameters.taxAuthPartyId"/>
                <set field="taxAuthGeoId" from-field="parameters.taxAuthGeoId"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonTaxAuthorityDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-screen name="ListTaxAuthorityPartiesWidgets"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <!-- SCIPIO: 2017-04-20: factored out for reuse -->
    <screen name="ListTaxAuthorityPartiesWidgets">
        <section>
            <widgets>
                <screenlet title="${uiLabelMap.PartyParties}" navigation-menu-name="ListTaxAuthorityPartiesSubTabBar"><!-- PageTitleListTaxAuthorityParties -->
                    <include-menu name="ListTaxAuthorityPartiesSubTabBar" location="component://accounting/widget/AccountingMenus.xml"/>
                    <include-form name="FindTaxAuthorityParties" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
                </screenlet>
                <!-- <screenlet> title="${uiLabelMap.PageTitleListTaxAuthorityParties}" -->
                <include-form name="ListTaxAuthorityParties" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
                <!-- </screenlet> -->
            </widgets>
        </section>
    </screen>
    
    <screen name="EditTaxAuthorityPartyInfo">
        <section>
            <actions>
                <set field="taxAuthPartyId" from-field="parameters.taxAuthPartyId"/>
                <set field="taxAuthGeoId" from-field="parameters.taxAuthGeoId"/>
                <!-- NOTE: assumes taxAuthPartyId & taxAuthGeoId in context -->
                <set field="partyId" from-field="parameters.partyId"/>
                <set field="fromDate" from-field="parameters.fromDate"/>
                <entity-one entity-name="PartyTaxAuthInfo" value-field="partyTaxAuthInfo"/>
                
                <set field="titleProperty" value="${groovy: context.partyTaxAuthInfo ? 'PageTitleEditTaxAuthorityPartyInfo' : 'PageTitleNewTaxAuthorityPartyInfo'}"/>
                <set field="activeSubMenuItem" value="${groovy: context.partyTaxAuthInfo ? 'EditTaxAuthorityPartyInfo' : 'NewTaxAuthorityPartyInfo'}"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonTaxAuthorityDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-menu name="EditTaxAuthorityPartyInfoSubTabBar" location="component://accounting/widget/AccountingMenus.xml"/>
                        <include-screen name="EditTaxAuthorityPartyInfoWidgets"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <!-- SCIPIO: 2017-04-20: factored out for reuse -->
    <screen name="EditTaxAuthorityPartyInfoWidgets">
        <section>
            <actions>
                <!-- NOTE: assumes taxAuthPartyId & taxAuthGeoId in context -->
                <set field="partyId" from-field="parameters.partyId"/>
                <set field="fromDate" from-field="parameters.fromDate"/>
                <entity-one entity-name="PartyTaxAuthInfo" value-field="partyTaxAuthInfo"/>
            </actions>
            <widgets>
                <screenlet>
                    <include-form name="EditTaxAuthorityPartyInfo" location="component://accounting/widget/settings/TaxAuthorityForms.xml"/>
                </screenlet>
            </widgets>
        </section>
    </screen>
</screens>