This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 2508dd1dd1 Improved: Integrate AR Past Due into accounting-main 
(OFBIZ-12966) (#741)
2508dd1dd1 is described below

commit 2508dd1dd1cb7fe0f63bd546909e29575d833863
Author: Pierre Smits <pierre.sm...@somonar.com>
AuthorDate: Fri Apr 12 08:36:23 2024 +0200

    Improved: Integrate AR Past Due into accounting-main (OFBIZ-12966) (#741)
    
    * Improved: Integrate AR Past Due into accounting-main (OFBIZ-12966)
    
    Integrate the overview of invoices past due of accounts receivable as a 
portal page intoo the main screen of the accounting application.
    
    modified:
    - AccountingUiLabels.xml: added label AccountingAccountsReceivable
    - AccountingPortletData.xml: added PortalPortlet, PortalPage, 
PortalPageColumn and PortalPagePortlet
    - CommonScreens.xml: added (for portal page handling): field setter, script 
and incude-portal-page in screen Main
    - InvoiceForms.xml: added grid ListArReport
    - InvoiceScreens.xml: added screen InvoicesArPastDue
    
    * Update AccountingUiLabels.xml
    
    ---------
    
    Co-authored-by: Jacques Le Roux <jacques.le.r...@les7arts.com>
---
 .../accounting/config/AccountingUiLabels.xml       |   5 +
 .../accounting/data/AccountingPortletData.xml      |   5 +
 applications/accounting/widget/CommonScreens.xml   |   3 +
 applications/accounting/widget/InvoiceForms.xml    | 493 +++++++++++++++++-
 applications/accounting/widget/InvoiceScreens.xml  | 570 ++++++++++++++++++++-
 5 files changed, 1044 insertions(+), 32 deletions(-)

diff --git a/applications/accounting/config/AccountingUiLabels.xml 
b/applications/accounting/config/AccountingUiLabels.xml
index 154d26a94e..80c5cd11ca 100644
--- a/applications/accounting/config/AccountingUiLabels.xml
+++ b/applications/accounting/config/AccountingUiLabels.xml
@@ -130,6 +130,11 @@
         <value xml:lang="zh">缺少账户编号</value>
         <value xml:lang="zh-TW">沒有科目號碼</value>
     </property>
+    <property key="AccountingAccountsReceivable">
+        <value xml:lang="en">Accounts Receivable</value>
+        <value xml:lang="fr">Comptes débiteurs</value>
+        <value xml:lang="nl">Debiteuren</value>
+    </property>
     <property key="AccountingAccountTransactionId">
         <value xml:lang="ar">دليل العملية الحسابية</value>
         <value xml:lang="cs">ID transakčního účtu</value>
diff --git a/applications/accounting/data/AccountingPortletData.xml 
b/applications/accounting/data/AccountingPortletData.xml
index 4357a60647..27c56b3194 100644
--- a/applications/accounting/data/AccountingPortletData.xml
+++ b/applications/accounting/data/AccountingPortletData.xml
@@ -81,4 +81,9 @@
         description="List of Payments"
         editFormName="EditPaymentAttributes" 
editFormLocation="component://accounting/widget/PaymentForms.xml"/>
     <PortletPortletCategory portalPortletId="ListPayments" 
portletCategoryId="ACCOUNTING"/>
+    <PortalPortlet portalPortletId="InvoiceArPastDue" portletName="AR Invoices 
Past Due" screenName="InvoicesArPastDue"
+            screenLocation="component://accounting/widget/InvoiceScreens.xml" 
description="Invoices Past Due in Accounts Receivable"/>
+    <PortalPage portalPageId="ACC_MAIN" portalPageName="Accounting Main Page" 
description="The main portal page of the Accounting application" 
ownerUserLoginId="_NA_" sequenceNum="1"/>
+    <PortalPageColumn columnSeqId="00001" portalPageId="ACC_MAIN"/>
+    <PortalPagePortlet columnSeqId="00001" portalPageId="ACC_MAIN" 
portalPortletId="InvoiceArPastDue" portletSeqId="00001" sequenceNum="1"/>
 </entity-engine-xml>
diff --git a/applications/accounting/widget/CommonScreens.xml 
b/applications/accounting/widget/CommonScreens.xml
index cb935affda..076f33b4fe 100644
--- a/applications/accounting/widget/CommonScreens.xml
+++ b/applications/accounting/widget/CommonScreens.xml
@@ -278,6 +278,8 @@ under the License.
             <actions>
                 <set field="headerItem" value="main"/>
                 <set field="helpAnchor" 
value="_help_for_accounting_main_screen"/>
+                <set field="parameters.parentPortalPageId" 
from-field="parameters.parentPortalPageId" default-value="ACC_MAIN" 
global="true"/>
+                <script 
location="component://common/src/main/groovy/org/apache/ofbiz/common/GetParentPortalPageId.groovy"/>
                 <entity-condition entity-name="PaymentType" 
list="paymentTypes">
                     <order-by field-name="paymentTypeId"/>
                 </entity-condition>
@@ -302,6 +304,7 @@ under the License.
                         <include-menu name="MainActionMenu" 
location="${parameters.mainMenuLocation}"/>
                     </decorator-section>
                     <decorator-section name="body">
+                        <include-portal-page id="${parameters.portalPageId}"/>
                         <screenlet title="${uiLabelMap.AccountingMainPage}">
                             <platform-specific><html><html-template 
location="component://accounting/template/Main.ftl"/></html></platform-specific>
                         </screenlet>
diff --git a/applications/accounting/widget/InvoiceForms.xml 
b/applications/accounting/widget/InvoiceForms.xml
index 91e972d337..790cb9c83c 100644
--- a/applications/accounting/widget/InvoiceForms.xml
+++ b/applications/accounting/widget/InvoiceForms.xml
@@ -20,7 +20,6 @@ under the License.
 
 <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
     xmlns="http://ofbiz.apache.org/Widget-Form"; 
xsi:schemaLocation="http://ofbiz.apache.org/Widget-Form 
http://ofbiz.apache.org/dtds/widget-form.xsd";>
-
     <!-- Invoice forms -->
     <form name="FindInvoices" type="single" target="findInvoices" title="Find 
and list invoices" default-map-name="parameters"
         header-row-style="header-row" default-table-style="basic-table">
@@ -33,7 +32,7 @@ under the License.
             </drop-down>
         </field>
         <field name="statusId">
-            <drop-down allow-multiple="true" size="8">
+            <drop-down allow-multiple="true">
                 <entity-options entity-name="StatusItem" 
key-field-name="statusId">
                     <entity-constraint name="statusTypeId" operator="equals" 
value="INVOICE_STATUS"/>
                     <entity-order-by field-name="sequenceId"/>
@@ -97,17 +96,131 @@ under the License.
         <field name="amountToApply" widget-area-style="align-text"><display 
type="currency" currency="${currencyUomId}"/></field>
     </grid>
 
-    <grid name="ListCustomerInvoices" extends="ListInvoices" 
list-name="invoices"
+    <form name="InvoiceHeader" type="single" title="Invoice header 
information" default-map-name="invoice"
+        header-row-style="header-row" default-table-style="basic-table">
+        <actions>
+            <set field="total" 
value="${groovy:return(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(invoice));}"/>
+            <service service-name="getPartyNameForDate" 
result-map="partyNameResultFrom">
+                <field-map field-name="partyId" 
from-field="invoice.partyIdFrom"/>
+                <field-map field-name="compareDate" 
from-field="invoice.invoiceDate"/>
+                <field-map field-name="lastNameFirst" value="Y"/>
+            </service>
+            <service service-name="getPartyNameForDate" 
result-map="partyNameResultTo">
+                <field-map field-name="partyId" from-field="invoice.partyId"/>
+                <field-map field-name="compareDate" 
from-field="invoice.invoiceDate"/>
+                <field-map field-name="lastNameFirst" value="Y"/>
+            </service>
+        </actions>
+        <field name="invoiceId"><hidden/></field>
+        <field position="1" name="invoiceTypeId"><display-entity 
entity-name="InvoiceType"/></field>
+        <field name="statusId" title="${uiLabelMap.CommonStatus}" 
position="2"><display-entity entity-name="StatusItem"/></field>
+        <field position="1" name="description"><display/></field>
+        <field position="2" name="invoiceMessage"><display/></field>
+        <field position="1" name="partyIdFrom">
+            <hyperlink description="${partyNameResultFrom.fullName} 
[${invoice.partyIdFrom}]" target="/partymgr/control/viewprofile" 
target-type="inter-app">
+                <parameter param-name="partyId" 
from-field="invoice.partyIdFrom"/>
+            </hyperlink>
+        </field>
+        <field position="2" name="partyIdTo" entry-name="partyId">
+            <hyperlink description="${partyNameResultTo.fullName} 
[${invoice.partyId}]" target="/partymgr/control/viewprofile" 
target-type="inter-app">
+                <parameter param-name="partyId" from-field="invoice.partyId"/>
+            </hyperlink>
+        </field>
+        <field position="1" name="roleTypeId"><display/></field>
+        <field position="2" name="billingAccountId"><display/></field>
+        <field position="1" name="invoiceDate"><display 
description="${groovy:if(invoice.get(&quot;invoiceDate&quot;)!=null)return(invoice.getString(&quot;invoiceDate&quot;).substring(0,10));}"/></field>
+        <field position="2" name="dueDate"><display 
description="${groovy:if(invoice.get(&quot;dueDate&quot;)!=null)return(invoice.getString(&quot;dueDate&quot;).substring(0,10));}"/></field>
+        <field position="1" name="total"><display description="${total}" 
type="currency" currency="${invoice.currencyUomId}"/></field>
+        <field position="2" name="paidDate"><display 
description="${groovy:if(invoice.get(&quot;paidDate&quot;)!=null)return(invoice.getString(&quot;paidDate&quot;).substring(0,10));}"/></field>
+        <field position="1" name="referenceNumber" 
title="${uiLabelMap.FormFieldTitle_referenceNum}"><display/></field>
+        <field name="currencyUomId"><hidden/></field>
+    </form>
+    <grid name="InvoiceAttributes" list-name="invoiceAttributes" 
paginate-target="invoiceAttributes"
         odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
-        <field name="partyIdFrom"><ignored/></field>
-        <field name="partyIdTo"><ignored/></field>
+        <auto-fields-entity entity-name="InvoiceAttribute" 
default-field-type="display"/>
     </grid>
-    <grid name="ListSupplierInvoices" extends="ListInvoices" 
list-name="invoiceslistexternal"
+    <grid name="InvoiceContactMech" list-name="invoiceContactMechList" 
paginate-target="invoiceContactMech"
         odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
-        <field name="partyIdFrom"><ignored/></field>
-        <field name="partyIdTo"><ignored/></field>
+        <row-actions>
+            <entity-one entity-name="ContactMechDetail" 
value-field="contactMechDetail"/>
+        </row-actions>
+        <auto-fields-entity entity-name="InvoiceContactMech" 
default-field-type="display"/>
+        <field name="contactMechDetail" 
title="${uiLabelMap.FormFieldTitle_cmDetail}"><display/></field>
+    </grid>
+    <grid name="InvoiceContent" list-name="invoiceContentList" 
paginate-target="invoiceContent"
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <auto-fields-entity entity-name="InvoiceContent" 
default-field-type="display"/>
+    </grid>
+    <grid name="InvoiceNotes" list-name="invoiceNotesList" 
paginate-target="invoiceNotes"
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <auto-fields-entity entity-name="InvoiceNote" 
default-field-type="display"/>
+    </grid>
+    <grid name="InvoiceItems" list-name="invItemAndOrdItems" 
separate-columns="true" paginate-target="invoiceOverview"
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <row-actions>
+            <set field="quantity" value="${groovy: quantity ?: 1}" 
type="BigDecimal"/>
+            <set field="total" value="${groovy: quantity * amount ?: 0}" 
type="BigDecimal"/>
+        </row-actions>
+        <auto-fields-entity entity-name="InvoiceItem" 
default-field-type="display"/>
+        <field name="invoiceId"><hidden/></field>
+        <field name="invoiceItemSeqId"><display/></field>
+        <field name="invoiceItemTypeId"><display-entity 
entity-name="InvoiceItemType"/></field>
+        <field name="orderId" widget-style="linktext">
+            <hyperlink description="${orderId}" 
target="/ordermgr/control/orderview" target-type="inter-app">
+                <parameter param-name="orderId"/>
+            </hyperlink>
+        </field>
+        <field name="orderItemSeqId" 
widget-area-style="align-text"><display/></field>
+        <field name="inventoryItemId" 
widget-area-style="align-text"><display/></field>
+        <field name="quantity" 
widget-area-style="align-text"><display/></field>
+        <field name="amount" title="${uiLabelMap.AccountingUnitPrice}" 
widget-area-style="align-text"><display type="currency" 
currency="${invoice.currencyUomId}"/></field>
+        <field name="total"><display type="currency" 
currency="${invoice.currencyUomId}"/></field>
+        <field name="productId" widget-style="linktext">
+            <hyperlink description="${productId}" 
target="/catalog/control/EditProduct" target-type="inter-app">
+                <parameter param-name="productId"/>
+            </hyperlink>
+        </field>
+        <field name="overrideGlAccountId" widget-area-style="align-text">
+            <hyperlink description="${overrideGlAccountId}" 
target="GlAccountNavigate">
+                <parameter param-name="glAccountId" 
from-field="overrideGlAccountId"/>
+            </hyperlink>
+        </field>
+    </grid>
+    <grid name="InvoiceRoles" list-name="invoiceRoles" 
paginate-target="invoiceRoles" use-row-submit="true" 
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <!--auto-fields-entity entity-name="InvoiceRole" 
default-field-type="display"/-->
+        <field name="invoiceId"><hidden/></field>
+        <field name="partyId" widget-style="buttontext">
+            <hyperlink description="${partyId}" target-type="inter-app" 
target="/partymgr/control/viewprofile">
+                <parameter param-name="partyId"/>
+            </hyperlink>
+        </field>
+        <field name="name" entry-name="partyId">
+            <display-entity also-hidden="false" entity-name="PartyNameView" 
key-field-name="partyId" description="${groupName}${firstName} ${lastName}"/>
+        </field>
+        <field name="roleTypeId">
+            <display-entity also-hidden="false" entity-name="RoleType"/>
+        </field>
+        <field name="percentage"><display/></field>
+        <field name="datetimePerformed"><display/></field>
+    </grid>
+    <grid name="ListInvoiceApplications" list-name="invoiceApplications" 
default-entity-name="InvoiceItem" use-row-submit="true"
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar"
+        target="updatePaymentApplication" title="Apply payments to invoices" 
separate-columns="false">
+        <field name="invoiceItemSeqId"><display/></field>
+        <field name="productId"><display/></field>
+        <field name="description" encode-output="false"><display/></field>
+        <field name="total" widget-area-style="align-text"><display 
type="currency" currency="${invoice.currencyUomId}"/></field>
+        <field name="invoiceId"><hidden/></field>
+        <field name="paymentId" widget-style="linktext">
+            <hyperlink description="${paymentId}" target="paymentOverview">
+                <parameter param-name="paymentId"/>
+            </hyperlink>
+        </field>
+        <field name="billingAccountId"><hidden/></field>
+        <field name="paymentApplicationId"><hidden/></field>
+        <field name="amountApplied" widget-area-style="align-text"><display 
type="currency" currency="${invoice.currencyUomId}"/></field>
     </grid>
-
     <grid name="AcctgTransAndEntries" list-name="acctgTransAndEntries"
         odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
         <auto-fields-entity entity-name="AcctgTransAndEntries" 
default-field-type="display"/>
@@ -166,7 +279,6 @@ under the License.
             <submit button-type="button"/>
         </field>
     </form>
-
     <form name="NewPurchaseInvoice" type="single" target="createInvoice" 
title="Edit Invoice Header" default-map-name="invoice"
         header-row-style="header-row" default-table-style="basic-table">
         <actions>
@@ -259,6 +371,260 @@ under the License.
         </field>
     </form>
 
+   <form name="EditInvoiceItems" type="multi"  list-name="invoiceItems" 
default-entity-name="InvoiceItem" 
target="updateInvoiceItem?invoiceId=${invoiceId}&amp;viewSize=${viewSize}&amp;viewIndex=${viewIndex}"
 title="Edit Invoice Items" paginate-target="listInvoiceItems"
+       odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar" separate-columns="true">
+       <row-actions>
+           <set field="total" value="${groovy: (quantity ?: 1) * (amount ?: 
0)}" type="BigDecimal"/>
+       </row-actions>
+       <field name="viewSize"><hidden value="${viewSize}"/></field>
+       <field name="viewIndex"><hidden value="${viewIndex}"/></field>
+       <field name="invoiceId"><hidden/></field>
+       <field name="uomId"><hidden/></field>
+       <field name="taxableFlag"><hidden/></field>
+       <field name="invoiceItemSeqId" widget-style="buttontext">
+           <hyperlink target="listInvoiceItems"  
description="${invoiceItemSeqId}">
+                <parameter param-name="invoiceId"/>
+                <parameter param-name="invoiceItemSeqId"/>
+            </hyperlink>
+        </field>
+       <field name="quantity"><text size="10"/></field>
+       <field name="invoiceItemTypeId">
+           <drop-down allow-empty="false">
+               <list-options list-name="invoiceItemTypes" 
key-name="invoiceItemTypeId" 
description="${groovy:uiLabelMap.get('InvoiceItemType.description.'+invoiceItemTypeId)}"/>
+           </drop-down>
+       </field>
+       <field name="productId"><lookup target-form-name="LookupProduct" 
size="20"/></field>
+       <field name="description"><text size="50"/></field>
+       <field name="overrideGlAccountId">
+           <drop-down allow-empty="true">
+               <list-options list-name="glAccountOrganizationAndClassList" 
key-name="glAccountId" description="${glAccountId} ${accountName}"/>
+           </drop-down>
+       </field>
+       <field name="amount" title="${uiLabelMap.AccountingUnitPrice}"><text 
size="10"/></field>
+       <field name="total" widget-area-style="align-text"><display 
type="currency" currency="${invoice.currencyUomId}"/></field>  <!-- this should 
not look like something you can modify, hence display -->
+       <field name="updateButton" title="${uiLabelMap.CommonUpdate}" 
widget-style="buttontext" ><submit button-type="text-link"/></field>
+       <field name="removeButton" title=" " widget-style="buttontext">
+            <hyperlink description="${uiLabelMap.CommonRemove}" 
target="removeInvoiceItem">
+                <parameter param-name="invoiceId"/>
+                <parameter param-name="invoiceItemSeqId"/>
+                <parameter param-name="viewIndex"/>
+                <parameter param-name="viewSize"/>
+            </hyperlink>
+       </field>
+    </form>
+
+    <form name="EditInvoiceItem" type="single" target="createInvoiceItem" 
title="" default-map-name="invoiceItem" default-entity-name="InvoiceItem"
+        header-row-style="header-row" default-table-style="basic-table">
+        <field name="invoiceId"><hidden/></field>
+        <field position="1" name="invoiceItemTypeId">
+            <drop-down allow-empty="false">
+                <list-options list-name="invoiceItemTypes" 
key-name="invoiceItemTypeId" 
description="${groovy:uiLabelMap.get('InvoiceItemType.description.'+invoiceItemTypeId)}"/>
+            </drop-down>
+        </field>
+        <field position="1" name="description"><text size="80"/></field>
+        <field position="1" name="overrideGlAccountId">
+            <drop-down allow-empty="true">
+                <list-options list-name="glAccountOrganizationAndClassList" 
key-name="glAccountId" description="${glAccountId} ${accountName}"/>
+            </drop-down>
+        </field>
+        <field position="2" name="inventoryItemId"><text/></field>
+        <field position="1" name="productId">
+            <lookup target-form-name="LookupProduct"/>
+        </field>
+        <field position="2" name="productFeatureId">
+            <lookup target-form-name="LookupProductFeature"/>
+        </field>
+        <field position="1" name="quantity"><text size="10"/></field>
+        <field position="2" name="uomId">
+            <drop-down allow-empty="true">
+                <entity-options key-field-name="uomId" 
description="${description} - ${abbreviation}" entity-name="Uom">
+                    <entity-constraint name="uomTypeId" operator="not-equals" 
value="CURRENCY_MEASURE"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field position="1" name="amount" 
title="${uiLabelMap.AccountingUnitPrice}"><text size="10"/></field>
+        <field position="2" name="taxableFlag">
+        <drop-down allow-empty="false" current="selected">
+            <option key="Y" description="${uiLabelMap.CommonYes}"/>
+            <option key="N" description="${uiLabelMap.CommonNo}"/>
+        </drop-down>
+        </field>
+        <field name="addButton" title="${uiLabelMap.CommonAdd}" 
widget-style="smallSubmit" use-when="invoiceItem==null">
+            <submit button-type="button"/>
+        </field>
+        <field name="updateButton" title="${uiLabelMap.CommonAdd}" 
widget-style="smallSubmit" use-when="invoiceItem!=null">
+            <submit button-type="button"/>
+        </field>
+    </form>
+    <grid name="ListInvoiceStatus" list-name="invoiceStatus" 
paginate-target="ListInvoiceStatus"
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <field name="invoiceId"><hidden/></field>
+        <field name="statusDate"><display 
description="${groovy:statusDate.toString().substring(0,10)}"/></field>
+        <field name="statusId" 
title="${uiLabelMap.CommonStatus}"><display-entity 
entity-name="StatusItem"/></field>
+        <field name="changeByUserLoginId"><display /></field>
+    </grid>
+    <grid name="ListInvoiceTerms" list-name="invoiceTerms" 
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <auto-fields-entity entity-name="InvoiceTerm" 
default-field-type="display"/>
+        <field name="invoiceId"><hidden/></field>
+        <field name="invoiceTermId"><display/></field>
+        <field name="termTypeId">
+            <display-entity entity-name="TermType"/>
+        </field>
+        <field name="termDays" widget-area-style="align-right" 
title-area-style="align-right">
+            <display/>
+        </field>
+        <field name="uomId" title="${uiLabelMap.Uom}">
+            <display-entity entity-name="Uom"/>
+        </field>
+        <field name="edit" title="" widget-style="buttontext">
+            <hyperlink description="${uiLabelMap.CommonEdit}" 
target="editInvoiceTerm" also-hidden="false">
+                <parameter param-name="invoiceTermId"/>
+                <parameter param-name="invoiceId"/>
+            </hyperlink>
+        </field>
+        <field name="delete" title="" widget-style="buttontext">
+            <hyperlink description="${uiLabelMap.CommonDelete}" 
target="deleteInvoiceTerm" also-hidden="false">
+                <parameter param-name="invoiceTermId"/>
+                <parameter param-name="invoiceId"/>
+            </hyperlink>
+        </field>
+    </grid>
+    <grid name="InvoiceTerms" list-name="invoiceTerms" 
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <field name="invoiceId"><hidden/></field>
+        <field name="invoiceItemSeqId" 
title="${uiLabelMap.CommonItem}"><display/></field>
+        <field name="invoiceTermId"><display/></field>
+        <field name="termTypeId" title="${uiLabelMap.CommonType}">
+            <display-entity entity-name="TermType"/>
+        </field>
+        <field name="description" 
title="${uiLabelMap.CommonDescription}"><display/></field>
+        <field name="termDays" title="${uiLabelMap.CommonDays}" 
widget-area-style="align-right" title-area-style="align-right">
+            <display/>
+        </field>
+        <field name="termValue" title="${uiLabelMap.CommonValue}" 
widget-area-style="align-right" title-area-style="align-right">
+            <display type="currency" currency="${uomId}"/>
+        </field>
+        <field name="uomId" title="${uiLabelMap.CommonCurrency}">
+            <display-entity entity-name="Uom"/>
+        </field>
+        <field name="textValue" 
title="${uiLabelMap.CommonText}"><display/></field>
+    </grid>
+    
+    <form name="EditInvoiceTerm" type="single" target="createInvoiceTerm" 
title="" 
+        header-row-style="header-row" default-table-style="basic-table" 
default-map-name="invoiceTerm" default-entity-name="InvoiceTerm" >
+        <alt-target use-when="invoiceTerm!=null" target="updateInvoiceTerm"/>
+        <auto-fields-entity entity-name="InvoiceTerm"/>
+        <field name="invoiceId"><hidden/></field>
+        <field name="termTypeId">
+            <drop-down>
+                <entity-options entity-name="TermType">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="description"><textarea/></field>
+        <field name="uomId" title="${uiLabelMap.Uom}">
+            <drop-down allow-empty="true">
+                <entity-options key-field-name="uomId" 
description="${description} - ${abbreviation}" entity-name="Uom">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submitButton" widget-style="smallSubmit"><submit 
button-type="button"/></field>
+    </form>
+    <grid name="EditInvoiceApplications" list-name="invoiceApplications" 
default-entity-name="InvoiceItem" use-row-submit="true" 
target="updateInvoiceApplication" separate-columns="true"
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <field name="statusId"><hidden/></field>
+        <field name="paymentApplicationId"><hidden/></field>
+        <field name="invoiceItemSeqId"><display/></field>
+        <field name="productId"><display/></field>
+        <field name="description"><display/></field>
+        <field name="total"><display type="currency" 
currency="${invoice.currencyUomId}"/></field>
+        <field name="invoiceId"><hidden/></field>
+        <field name="paymentId"><lookup 
target-form-name="LookupPayment"/></field>
+        <field name="billingAccountId"><hidden/></field>
+        <field name="amountToApply" disabled="true"><text size="10"/></field>
+        <field name="updateButton" title="${uiLabelMap.CommonUpdate}" 
widget-style="buttontext"><submit button-type="text-link"/></field>
+        <field name="removeButton" title=" " widget-style="buttontext" 
use-when="paymentApplicationId!=null">
+            <hyperlink description="${uiLabelMap.CommonRemove}" 
target="removeInvoiceApplication">
+                <parameter param-name="paymentApplicationId"/>
+                <parameter param-name="invoiceId"/>
+                <parameter param-name="viewIndex"/>
+                <parameter param-name="viewSize"/>
+            </hyperlink>
+        </field>
+    </grid>
+    <form name="AddPayment" type="single" target="updateInvoiceApplication" 
title=""
+        header-row-style="header-row" default-table-style="basic-table">
+        <field name="invoiceId"><hidden/></field>
+        <field name="paymentId"><lookup 
target-form-name="LookupPayment"/></field>
+        <field name="amountToApply" parameter-name="amountApplied"><text 
size="10"/></field>
+        <field name="invoiceProcessing" 
use-when="&quot;${uiConfigMap.invoiceProcessing}&quot;.equals(&quot;Y&quot;)"><check/></field>
+        <field name="applyButton" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
+    <grid name="ListPaymentsNotApplied" list-name="payments" 
target="updateInvoiceApplication"
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <field name="invoiceId"><hidden/></field>
+        <field name="paymentId" widget-style="buttontext">
+            <hyperlink description="[${paymentId}]" target="paymentOverview">
+                <parameter param-name="paymentId"/>
+            </hyperlink>
+        </field>
+        <field name="amount"><display type="currency" 
currency="${currencyUomId}"/></field>
+        <field name="effectiveDate"><display type="date"/></field>
+        <field name="amountApplied" parameter-name="dummy"><display 
type="currency" currency="${currencyUomId}"/></field>
+        <field name="amountToApply" parameter-name="amountApplied"><text 
size="10"/></field>
+        <field name="applyButton" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </grid>
+    <grid name="ListPaymentsNotAppliedForeignCurrency" 
extends="ListPaymentsNotApplied" list-name="paymentsActualCurrency"/>
+    <grid name="ListInvoiceRoles" list-name="invoiceRoles" 
use-row-submit="true" paginate-target="invoiceRoles"
+        odd-row-style="alternate-row" header-row-style="header-row-2" 
default-table-style="basic-table hover-bar">
+        <!--auto-fields-entity entity-name="InvoiceRole" 
default-field-type="display"/-->
+        <field name="invoiceId"><hidden/></field>
+        <field name="partyId" widget-style="buttontext">
+            <hyperlink description="${partyId}" target-type="inter-app" 
target="/partymgr/control/viewprofile">
+                <parameter param-name="partyId"/>
+            </hyperlink>
+        </field>
+        <field name="name" entry-name="partyId">
+            <display-entity also-hidden="false" entity-name="PartyNameView" 
key-field-name="partyId" description="${groupName}${firstName} ${lastName}"/>
+        </field>
+        <field name="roleTypeId">
+            <display-entity also-hidden="false" entity-name="RoleType"/>
+        </field>
+        <field name="percentage"><display/></field>
+        <field name="datetimePerformed"><display/></field>
+        <field name="removeButton" widget-style="buttontext">
+           <hyperlink description="${uiLabelMap.CommonRemove}" 
target="removeInvoiceRole">
+                <parameter param-name="invoiceId"/>
+                <parameter param-name="partyId"/>
+                <parameter param-name="roleTypeId"/>
+                <parameter param-name="viewIndex"/>
+                <parameter param-name="viewSize"/>
+            </hyperlink>
+        </field>
+    </grid>
+    <form name="EditInvoiceRole" type="single" target="createInvoiceRole" 
title=""
+        header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-entity entity-name="InvoiceRole"/>
+        <field name="invoiceId"><hidden/></field>
+        <field name="partyId"><lookup 
target-form-name="LookupPartyName"/></field>
+        <field name="roleTypeId">
+            <drop-down allow-empty="false">
+                <entity-options entity-name="RoleType">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submitButton" widget-style="smallSubmit"><submit 
button-type="button"/></field>
+    </form>
+    
     <form name="SendPerEmail" type="single" target="executeSendPerEmail" 
title=""
         header-row-style="header-row" default-table-style="basic-table">
         <actions>
@@ -280,7 +646,62 @@ under the License.
         <field name="bodyText"><textarea/></field>
         <field name="submitButton" title="${uiLabelMap.CommonSubmit}" 
widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
-
+    <grid name="EditTimeEntries" list-name="timeEntries"
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <auto-fields-service service-name="updateTimeEntry" 
default-field-type="display"/>
+        <field name="invoiceId"><hidden/></field>
+        <field name="deleteLink" title=" " widget-style="buttontext">
+            <hyperlink description="${uiLabelMap.CommonDelete}" 
target="unlinkInvoiceFromTimeEntry" also-hidden="false">
+                <parameter param-name="timeEntryId"/>
+                <parameter param-name="invoiceId" value="null"/>
+                <parameter param-name="invoiceItemSeqId" value="null"/>
+                <parameter param-name="viewIndex"/>
+                <parameter param-name="viewSize"/>
+            </hyperlink>
+        </field>
+    </grid>
+    <grid name="ListTimeEntries" list-name="timeEntries"
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <row-actions>
+            <entity-one entity-name="Timesheet" value-field="timesheet">
+                <field-map field-name="timesheetId" from-field="timesheetId"/>
+            </entity-one>
+        </row-actions>
+        <field name="invoiceId"><hidden/></field>
+        <field name="invoiceItemSeqId"><display/></field>
+        <field name="timeEntryId"><display/></field>
+        <field name="timesheetId" entry-name="timesheet.timesheetId">
+            <hyperlink description="${timesheetId}" 
target="/workeffort/control/EditTimesheet" target-type="inter-app">
+                <parameter param-name="timesheetId"/>
+            </hyperlink>
+        </field>
+        <field name="partyId" entry-name="partyId">
+            <display-entity entity-name="PartyNameView" 
key-field-name="partyId" description="${groupName} ${firstName} ${middleName} 
${lastName}">
+                <sub-hyperlink target="/partymgr/control/viewprofile" 
target-type="inter-app"  description=" [${partyId}]">
+                    <parameter param-name="partyId"/>
+                </sub-hyperlink>
+            </display-entity>
+        </field>
+        <field name="timesheetPartyId" entry-name="timesheet.partyId">
+            <display-entity entity-name="PartyNameView" 
key-field-name="partyId" description="${groupName} ${firstName} ${middleName} 
${lastName}">
+                <sub-hyperlink target="/partymgr/control/viewprofile" 
target-type="inter-app" description=" [${timesheet.partyId}]">
+                    <parameter param-name="partyId" 
from-field="timesheet.partyId"/>
+                </sub-hyperlink>
+            </display-entity>
+        </field>
+        <field name="hours"><display/></field>
+        <field name="rateTypeId"><display-entity 
entity-name="RateType"/></field>
+        <field name="workEffortId">
+            <display-entity entity-name="WorkEffort" 
description="${workEffortName} [${workEffortId}]">
+                <sub-hyperlink description=" [${workEffortId}]" 
target="/workeffort/control/WorkEffortSummary" target-type="inter-app">
+                    <parameter param-name="workEffortId"/>
+                </sub-hyperlink>
+            </display-entity>
+        </field>
+        <field name="fromDate"><display type="date"/></field>
+        <field name="thruDate"><display type="date"/></field>
+        <field name="comments"><display/></field>
+    </grid>
     <form name="LookupInvoicesStatus" type="single" 
target="BillingAccountInvoices" title=""
         header-row-style="header-row" default-table-style="basic-table">
         <field name="billingAccountId"><hidden/></field>
@@ -294,7 +715,6 @@ under the License.
         </field>
         <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit 
button-type="button"/></field>
     </form>
-
     <grid name="ListInvoicePaymentInfo" list-name="invoicePaymentInfoList"
         odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
         <actions>
@@ -311,5 +731,52 @@ under the License.
         <field name="paidAmount"><display type="currency" 
currency="${invoice.currencyUomId}"/></field>
         <field name="outstandingAmount"><display type="currency" 
currency="${invoice.currencyUomId}"/></field>
     </grid>
-
+    <grid name="ListCustomerInvoices" extends="ListInvoices" 
list-name="invoices"
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <field name="partyIdFrom"><ignored/></field>
+        <field name="partyIdTo"><ignored/></field>
+    </grid>
+    <grid name="ListSupplierInvoices" extends="ListInvoices" 
list-name="invoiceslistexternal"
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <field name="partyIdFrom"><ignored/></field>
+        <field name="partyIdTo"><ignored/></field>
+    </grid>
+    <grid name="ListArReport" separate-columns="true" title="Invoice List" 
list-name="invoices" target=""
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar" paginate="true" paginate-target="main">
+        <row-actions>
+            <set field="invoiceTypeId" from-field="invoiceTypeId"/>
+            <service service-name="getPartyNameForDate" 
result-map="partyNameResultFrom">
+                <field-map field-name="partyId" from-field="partyIdFrom"/>
+                <field-map field-name="compareDate" from-field="invoiceDate"/>
+                <field-map field-name="lastNameFirst" value="Y"/>
+            </service>
+            <service service-name="getPartyNameForDate" 
result-map="partyNameResultTo">
+                <field-map field-name="partyId" from-field="partyId"/>
+                <field-map field-name="compareDate" from-field="invoiceDate"/>
+                <field-map field-name="lastNameFirst" value="Y"/>
+            </service>
+            <set field="amountToApply" value="${groovy:
+                import java.text.NumberFormat;
+                
return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId)));}"/>
+            <set field="total" value="${groovy:
+                import java.text.NumberFormat;
+                
return(NumberFormat.getNumberInstance(context.get(&quot;locale&quot;)).format(org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)));}"/>
+        </row-actions>
+        <field name="invoiceId"  title="${uiLabelMap.CommonInvoice}" 
widget-style="buttontext">
+            <hyperlink description="${invoiceId}" target="invoiceOverview">
+                <parameter param-name="invoiceId"/>
+            </hyperlink>
+        </field>
+        <field name="partyIdTo" title="${uiLabelMap.AccountingCustomer}">
+            <hyperlink description="${partyNameResultTo.fullName} 
[${partyId}]" target="/partymgr/control/viewprofile" target-type="inter-app">
+                <parameter param-name="partyId"/>
+            </hyperlink>
+        </field>
+        <field name="invoiceTypeId" 
title="${uiLabelMap.CommonType}"><display-entity 
entity-name="InvoiceType"/></field>
+        <field name="statusId" 
title="${uiLabelMap.CommonStatus}"><display-entity 
entity-name="StatusItem"/></field>
+        <field name="invoiceDate"><display type="date"/></field>
+        <field name="dueDate"><display type="date"/></field>
+        <field name="total" widget-area-style="align-text"><display 
type="currency" currency="${currencyUomId}"/></field>
+        <field name="amountToApply" widget-area-style="align-text"><display 
type="currency" currency="${currencyUomId}"/></field>
+    </grid>
 </forms>
diff --git a/applications/accounting/widget/InvoiceScreens.xml 
b/applications/accounting/widget/InvoiceScreens.xml
index 80a22ed7ca..d1d1a8cd22 100644
--- a/applications/accounting/widget/InvoiceScreens.xml
+++ b/applications/accounting/widget/InvoiceScreens.xml
@@ -41,10 +41,6 @@ under the License.
                             <widgets>
                                 <section>
                                     <condition><not><if-empty 
field="parameters.invoiceId"/></not></condition>
-                                    <actions>
-                                        <set field="invoiceId" 
from-field="parameters.invoiceId"/>
-                                        <entity-one entity-name="Invoice" 
value-field="invoice" use-cache="true"/>
-                                    </actions>
                                     <widgets>
                                         <label 
style="h1">${uiLabelMap.CommonInvoice}: ${invoiceId}</label>
                                         <include-menu name="InvoiceTabBar" 
location="${parameters.mainMenuLocation}"/>
@@ -73,7 +69,7 @@ under the License.
     </screen>
     <screen name="FindInvoices">
         <section>
-           <actions>
+            <actions>
                 <set field="headerItem" value="invoices"/>
                 <set field="tabButtonItem" value="find"/>
                 <set field="titleProperty" value="PageTitleFindInvoice"/>
@@ -87,7 +83,27 @@ under the License.
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                        <include-screen name="FindInvoices" 
location="component://accounting/widget/accounting/AccountingInvoiceCpd.xml"/>
+                        <section>
+                            <widgets>
+                                <decorator-screen name="FindScreenDecorator" 
location="component://common/widget/CommonScreens.xml">
+                                    <decorator-section name="menu-bar">
+                                        <include-menu name="InvoiceSubTabBar" 
location="${parameters.mainMenuLocation}"/>
+                                        <container style="clear"/>
+                                    </decorator-section>
+                                    <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="FindInvoices" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                    </decorator-section>
+                                    <decorator-section name="search-results">
+                                        <include-grid name="ListInvoices" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                    </decorator-section>
+                                </decorator-screen>
+                            </widgets>
+                        </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -95,10 +111,24 @@ under the License.
     </screen>
     <screen name="NewInvoice">
         <section>
+            <actions>
+                <set field="titleProperty" value="AccountingCreateNewInvoice"/>
+                <set field="helpAnchor" value="_help_for_new_invoice"/>
+                <entity-one entity-name="Invoice" value-field="invoice"/>
+            </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                        <include-screen name="NewInvoice" 
location="component://accounting/widget/accounting/AccountingInvoiceCpd.xml"/>
+                        <section>
+                            <widgets>
+                                <screenlet 
title="${uiLabelMap.AccountingCreateNewSalesInvoice}">
+                                    <include-form name="NewSalesInvoice" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                                <screenlet 
title="${uiLabelMap.AccountingCreateNewPurchaseInvoice}">
+                                    <include-form name="NewPurchaseInvoice" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                            </widgets>
+                        </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -143,12 +173,143 @@ under the License.
             </widgets>
         </section>
     </screen>
-    <screen name="InvoiceOverview">
+    <screen name="invoiceOverview">
         <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleInvoiceOverview"/>
+                <set field="tabButtonItem" value="invoiceOverview"/>
+                <set field="helpAnchor" value="_help_for_invoice_overview"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <entity-one entity-name="Invoice" value-field="invoice"/>
+                <entity-and entity-name="InvoiceRole" list="invoiceRoles">
+                    <field-map field-name="invoiceId" 
from-field="parameters.invoiceId"/>
+                    <order-by field-name="partyId"/>
+                </entity-and>
+                <entity-and entity-name="InvoiceStatus" list="invoiceStatus">
+                    <field-map field-name="invoiceId" 
from-field="parameters.invoiceId"/>
+                    <order-by field-name="statusDate"/>
+                </entity-and>
+                <entity-and entity-name="InvoiceTerm" list="invoiceTerms">
+                    <field-map field-name="invoiceId" 
from-field="parameters.invoiceId"/>
+                    <order-by field-name="invoiceTermId"/>
+                </entity-and>
+                <entity-and entity-name="TimeEntry" list="timeEntries">
+                    <field-map field-name="invoiceId" 
from-field="parameters.invoiceId"/>
+                    <order-by field-name="invoiceItemSeqId"/>
+                </entity-and>
+                <script 
location="component://accounting/src/main/groovy/org/apache/ofbiz/accounting/invoice/CreateApplicationList.groovy"/>
+                <set field="parameters.statusId" 
from-field="invoice.statusId"/>
+                <set field="invoiceAmount" 
value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(invoice)}"
 type="BigDecimal"/>
+                <set field="notAppliedAmount" 
value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(invoice)}"
 type="BigDecimal"/>
+                <set field="appliedAmount" 
value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceApplied(invoice)}"
 type="BigDecimal"/>
+                <entity-condition entity-name="InvItemAndOrdItem" 
list="invItemAndOrdItems">
+                    <condition-expr field-name="invoiceId"  operator="equals" 
from-field="invoiceId"/>
+                    <order-by field-name="invoiceItemSeqId"/>
+                </entity-condition>
+                <entity-condition entity-name="AcctgTransAndEntries" 
list="acctgTransAndEntries">
+                    <condition-expr field-name="invoiceId"  operator="equals" 
from-field="invoiceId"/>
+                    <order-by field-name="acctgTransId"/>
+                    <order-by field-name="acctgTransEntrySeqId"/>
+                </entity-condition>
+            </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                        <include-screen name="ViewInvoice" 
location="component://accounting/widget/accounting/AccountingInvoiceCpd.xml"/>
+                        <section>
+                            <condition>
+                                <not><if-empty field="invoice"/></not>
+                            </condition>
+                            <widgets>
+                                <section>
+                            <condition>
+                                <if-compare field="invoice.statusId" 
operator="equals" value="INVOICE_IN_PROCESS"/>
+                            </condition>
+                            <widgets>
+                                <screenlet 
title="${uiLabelMap.AccountingInvoiceHeader}">
+                                    <include-form name="InvoiceHeader" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                                <container style="lefthalf">
+                                    <screenlet 
title="${uiLabelMap.CommonStatus}" navigation-form-name="ListInvoiceStatus">
+                                        <include-grid name="ListInvoiceStatus" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                    </screenlet>
+                                    <screenlet 
title="${uiLabelMap.AccountingAppliedPayments} 
${appliedAmount?currency(${invoice.currencyUomId})} 
${uiLabelMap.AccountingOpenPayments} 
${notAppliedAmount?currency(${invoice.currencyUomId})}"
+                                        
navigation-form-name="ListInvoiceApplications">
+                                        <include-grid 
name="ListInvoiceApplications" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                    </screenlet>
+                                </container>
+                                <container style="righthalf">
+                                    <screenlet 
title="${uiLabelMap.AccountingInvoiceRoles}" 
navigation-form-name="InvoiceRoles">
+                                        <include-grid name="InvoiceRoles" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                    </screenlet>
+                                    <screenlet 
title="${uiLabelMap.PartyTerms}">
+                                        <include-grid name="InvoiceTerms" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                        <include-grid 
name="ListInvoicePaymentInfo" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                    </screenlet>
+                                </container>
+                                <container style="clear"/>
+                                <screenlet 
title="${uiLabelMap.AccountingInvoiceItems}" 
navigation-form-name="InvoiceItems">
+                                    <include-grid name="InvoiceItems" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                                <section>
+                                    <condition>
+                                        <not><if-empty 
field="timeEntries"/></not>
+                                    </condition>
+                                    <widgets>
+                                        <screenlet 
title="${uiLabelMap.AccountingInvoiceTimeEntries}" 
navigation-form-name="ListTimeEntries">
+                                            <include-grid 
name="ListTimeEntries" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                        </screenlet>
+                                    </widgets>
+                                </section>
+                                <screenlet 
title="${uiLabelMap.AccountingTransactions}" 
navigation-form-name="AcctgTransAndEntries">
+                                    <include-grid name="AcctgTransAndEntries" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                            </widgets>
+                            <fail-widgets>
+                                <screenlet 
title="${uiLabelMap.AccountingInvoiceHeader}">
+                                    <include-form name="InvoiceHeader" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                                <container style="lefthalf">
+                                    <screenlet 
title="${uiLabelMap.CommonStatus}" navigation-form-name="ListInvoiceStatus">
+                                        <include-grid name="ListInvoiceStatus" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                    </screenlet>
+                                    <screenlet 
title="${uiLabelMap.AccountingAppliedPayments} 
${appliedAmount?currency(${invoice.currencyUomId})} 
${uiLabelMap.AccountingOpenPayments} 
${notAppliedAmount?currency(${invoice.currencyUomId})}"
+                                        
navigation-form-name="ListInvoiceApplications">
+                                        <include-grid 
name="ListInvoiceApplications" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                    </screenlet>
+                                </container>
+                                <container style="righthalf">
+                                    <screenlet 
title="${uiLabelMap.AccountingInvoiceRoles}" 
navigation-form-name="InvoiceRoles">
+                                        <include-grid name="InvoiceRoles" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                    </screenlet>
+                                    <screenlet 
title="${uiLabelMap.PartyTerms}">
+                                        <include-grid name="ListInvoiceTerms" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                        <include-grid 
name="ListInvoicePaymentInfo" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                    </screenlet>
+                                </container>
+                                <container style="clear"/>
+                                <screenlet 
title="${uiLabelMap.AccountingInvoiceItems}" 
navigation-form-name="InvoiceItems">
+                                    <include-grid name="InvoiceItems" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                                <section>
+                                    <condition>
+                                        <not><if-empty 
field="timeEntries"/></not>
+                                    </condition>
+                                    <widgets>
+                                        <screenlet 
title="${uiLabelMap.AccountingInvoiceTimeEntries}" 
navigation-form-name="ListTimeEntries">
+                                            <include-form 
name="ListTimeEntries" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                        </screenlet>
+                                    </widgets>
+                                </section>
+                                <screenlet 
title="${uiLabelMap.AccountingTransactions}" 
navigation-form-name="AcctgTransAndEntries">
+                                    <include-grid name="AcctgTransAndEntries" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                            </fail-widgets>
+                                </section>
+                            </widgets>
+                            <fail-widgets>
+                                <label 
text="${uiLabelMap.AccountingInvoiceDoesNotExists}"></label>
+                            </fail-widgets>
+                        </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -156,10 +317,22 @@ under the License.
     </screen>
     <screen name="InvoiceStatus">
         <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleListInvoices"/>
+                <set field="tabButtonItem" value="invoiceStatus"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <entity-one entity-name="Invoice" value-field="invoice" 
auto-field-map="true"/>
+                <entity-and entity-name="InvoiceStatus" list="invoiceStatus">
+                    <field-map field-name="invoiceId" 
from-field="invoice.invoiceId"/>
+                    <order-by field-name="statusDate"/>
+                </entity-and>
+            </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                        <include-screen name="InvoiceStatus" 
location="component://accounting/widget/accounting/AccountingInvoiceStatusCpd.xml"/>
+                        <screenlet 
title="${uiLabelMap.AccountingInvoiceStatusHistory}">
+                            <include-grid name="ListInvoiceStatus" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                        </screenlet>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -167,10 +340,108 @@ under the License.
     </screen>
     <screen name="EditInvoiceApplications">
         <section>
+            <actions>
+                <set field="titleProperty" 
value="PageTitleListEditInvoiceApplications"/>
+                <set field="tabButtonItem" value="editInvoiceApplications"/>
+                <set field="helpAnchor" 
value="_help_for_edit_invoice_applications"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <entity-one entity-name="Invoice" value-field="invoice"/>
+                <script 
location="component://accounting/src/main/groovy/org/apache/ofbiz/accounting/invoice/CreateApplicationList.groovy"/>
+                <script 
location="component://accounting/src/main/groovy/org/apache/ofbiz/accounting/invoice/ListNotAppliedPayments.groovy"/>
+                <set field="invoiceAmount" 
value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(invoice)}"
 type="BigDecimal"/>
+                <set field="notAppliedAmount" 
value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(invoice)}"
 type="BigDecimal"/>
+                <set field="appliedAmount" 
value="${groovy:org.apache.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceApplied(invoice)}"
 type="BigDecimal"/>
+            </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                        <include-screen name="InvoiceApplications" 
location="component://accounting/widget/accounting/AccountingInvoiceApplicationCpd.xml"/>
+                        <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-compare field="notAppliedAmount" 
operator="greater" value="0"/>
+                                    </condition>
+                                        <widgets>
+                                            <screenlet 
title="${uiLabelMap.AccountingPaymentsApplied} 
${appliedAmount?currency(${invoice.currencyUomId})}
+                                                
${uiLabelMap.AccountingOpenPayments} 
${notAppliedAmount?currency(${invoice.currencyUomId})}">
+                                                <include-grid 
name="EditInvoiceApplications" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                            </screenlet>
+                                            <section>
+                                                <condition>
+                                                    <if-empty 
field="invoiceApplications"/>
+                                                </condition>
+                                                <widgets>
+                                                    <container><label 
style="h3" 
text="${uiLabelMap.AccountingNoPaymentsApplicationsfound}"></label></container>
+                                                </widgets>
+                                            </section>
+                                            <section>
+                                                <condition>
+                                                    <or>
+                                                        <not><if-empty 
field="payments"/></not>
+                                                        <not><if-empty 
field="paymentsActualCurrency"/></not>
+                                                    </or>
+                                                </condition>
+                                                <widgets>
+                                                    <screenlet 
title="${uiLabelMap.AccountingListPaymentsNotYetApplied} 
[${invoice.partyIdFrom}]
+                                                        
${uiLabelMap.AccountingPaymentSentForm} [${invoice.partyId}]">
+                                                        <section>
+                                                            <condition>
+                                                                <not><if-empty 
field="payments"/></not>
+                                                            </condition>
+                                                            <widgets>
+                                                                <include-grid 
name="ListPaymentsNotApplied" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                                            </widgets>
+                                                        </section>
+                                                        <section>
+                                                            <condition>
+                                                                <not><if-empty 
field="paymentsActualCurrency"/></not>
+                                                            </condition>
+                                                            <widgets>
+                                                                <include-grid 
name="ListPaymentsNotAppliedForeignCurrency" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                                            </widgets>
+                                                        </section>
+                                                    </screenlet>
+                                                </widgets>
+                                            </section>
+                                            <screenlet 
title="${uiLabelMap.AccountingAssignPaymentToInvoice}">
+                                                <include-form 
name="AddPayment" location="component://accounting/widget/InvoiceForms.xml"/>
+                                            </screenlet>
+                                        </widgets>
+                                        <fail-widgets>
+                                            <screenlet 
title="${uiLabelMap.AccountingPaymentsApplied} 
${appliedAmount?currency(${invoice.currencyUomId})}
+                                                
${uiLabelMap.AccountingOpenPayments} 
${notAppliedAmount?currency(${invoice.currencyUomId})}">
+                                                <include-grid 
name="EditInvoiceApplications" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                            </screenlet>
+                                            <section>
+                                                <condition>
+                                                    <if-empty 
field="invoiceApplications"/>
+                                                </condition>
+                                                <widgets>
+                                                    <container>
+                                                        <label style="h3" 
text="${uiLabelMap.AccountingNoPaymentsApplicationsfound}"></label>
+                                                    </container>
+                                                </widgets>
+                                            </section>
+                                        </fail-widgets>
+                                </section>
+                            </widgets>
+                            <fail-widgets>
+                                <screenlet
+                                    
title="${uiLabelMap.AccountingAppliedPayments} 
${appliedAmount?currency(${invoice.currencyUomId})}
+                                        ${uiLabelMap.AccountingOpenPayments} 
${notAppliedAmount?currency(${invoice.currencyUomId})}"
+                                        
navigation-form-name="ListInvoiceApplications">
+                                    <include-grid 
name="ListInvoiceApplications" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                            </fail-widgets>
+                        </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -178,10 +449,84 @@ under the License.
     </screen>
     <screen name="EditInvoiceItems">
         <section>
+            <actions>
+                <property-map resource="AccountingEntityLabels" 
map-name="uiLabelMap" global="true"/>
+                <set field="viewIndex" from-field="parameters.viewIndex"/>
+                <set field="viewSize" from-field="parameters.viewSize"/>
+                <set field="titleProperty" value="PageTitleListInvoices"/>
+                <set field="tabButtonItem" value="listInvoiceItems"/>
+                <set field="helpAnchor" 
value="_help_for_edit_invoice_time_entries"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <set field="invoiceItemSeqd" 
from-field="parameters.invoiceItemSeqId"/>
+                <property-to-field field="defaultCurrencyUomId" 
resource="general" property="currency.uom.id.default" default="USD"/>
+                <entity-one entity-name="Invoice" value-field="invoice"/>
+                <entity-one entity-name="InvoiceItem" 
value-field="invoiceItem"/>
+                <entity-and entity-name="InvoiceItem" list="invoiceItems">
+                    <field-map field-name="invoiceId" 
from-field="parameters.invoiceId"/>
+                    <order-by field-name="invoiceItemSeqId"/>
+                </entity-and>
+                <entity-condition entity-name="InvoiceItemType" 
list="PayrolGroup">
+                    <condition-expr field-name="parentTypeId" value="PAYROL"/>
+                </entity-condition>
+                <entity-condition entity-name="InvoiceItemType" 
list="PayrolList"/>
+                <entity-condition entity-name="InvItemAndOrdItem" 
list="invItemAndOrdItems">
+                    <condition-expr field-name="invoiceId"  operator="equals" 
from-field="invoiceId"/>
+                    <order-by field-name="invoiceItemSeqId"/>
+                </entity-condition>
+                <script 
location="component://accounting/src/main/groovy/org/apache/ofbiz/accounting/invoice/GetAccountOrganizationAndClass.groovy"/>
+            </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                         <include-screen name="InvoiceItems" 
location="component://accounting/widget/accounting/AccountingInvoiceItemCpd.xml"/>
+                        <section>
+                            <condition>
+                                <and>
+                                    <or>
+                                        <if-has-permission 
permission="ACCOUNTING" action="_CREATE"/>
+                                        <if-has-permission 
permission="ACCOUNTING" action="_UPDATE"/>
+                                    </or>
+                                </and>
+                            </condition>
+                            <widgets>
+                                <screenlet 
title="${uiLabelMap.AccountingInvoiceItemAdd}">
+                                    <section>
+                                    <condition>
+                                        <not><if-compare 
field="invoice.invoiceTypeId" operator="equals" value="PAYROL_INVOICE"/></not>
+                                    </condition>
+                                    <widgets>
+                                        <include-form name="EditInvoiceItem" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                    </widgets>
+                                    <fail-widgets>
+                                        <platform-specific><html>
+                                            <html-template 
location="component://accounting/template/invoice/InvoiceItemsPayrol.ftl"/>
+                                        </html></platform-specific>
+                                        </fail-widgets>
+                                    </section>
+                                </screenlet>
+                                <screenlet 
title="${uiLabelMap.AccountingInvoiceItems}">
+                                    <include-form name="EditInvoiceItems" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                            </widgets>
+                            <fail-widgets>
+                                <section>
+                                    <condition>
+                                        <not><if-compare 
field="invoice.invoiceTypeId" operator="equals" value="PAYROL_INVOICE"/></not>
+                                    </condition>
+                                    <widgets>
+                                        <screenlet>
+                                            <include-grid name="InvoiceItems" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                        </screenlet>
+                                    </widgets>
+                                    <fail-widgets>
+                                        <platform-specific>
+                                            <html>
+                                            <html-template 
location="component://accounting/template/invoice/InvoiceItemsPayrol.ftl"/>
+                                            </html>
+                                        </platform-specific>
+                                    </fail-widgets>
+                                </section>
+                            </fail-widgets>
+                            </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -189,10 +534,40 @@ under the License.
     </screen>
     <screen name="EditInvoiceTimeEntries">
         <section>
+            <actions>
+                <set field="viewIndex" from-field="parameters.viewIndex"/>
+                <set field="viewSize" from-field="parameters.viewSize"/>
+                <set field="titleProperty" 
value="PageTitleListInvoiceTimeEntries"/>
+                <set field="tabButtonItem" value="EditInvoiceTimeEntries"/>
+                <set field="helpAnchor" 
value="_help_for_edit_invoice_time_entries"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <entity-one entity-name="Invoice" value-field="invoice"/>
+                <entity-and entity-name="TimeEntry" list="timeEntries">
+                    <field-map field-name="invoiceId" 
from-field="parameters.invoiceId"/>
+                    <order-by field-name="timeEntryId"/>
+                </entity-and>
+            </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                         <include-screen name="InvoiceTimeEntries" 
location="component://accounting/widget/accounting/AccountingInvoiceTimeEntryCpd.xml"/>
+                        <screenlet 
title="${uiLabelMap.AccountingInvoiceTimeEntries}">
+                        <section>
+                            <condition>
+                                <and>
+                                    <or>
+                                        <if-has-permission 
permission="ACCOUNTING" action="_CREATE"/>
+                                        <if-has-permission 
permission="ACCOUNTING" action="_UPDATE"/>
+                                    </or>
+                                </and>
+                            </condition>
+                            <widgets>
+                                <include-grid name="EditTimeEntries" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                            </widgets>
+                            <fail-widgets>
+                                <include-grid name="ListTimeEntries" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                            </fail-widgets>
+                        </section>
+                        </screenlet>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -200,10 +575,26 @@ under the License.
     </screen>
     <screen name="InvoiceAttributes">
         <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleInvoiceAttributes"/>
+                <set field="tabButtonItem" value="invoiceAttributes"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <entity-one entity-name="Invoice" value-field="invoice"/>
+                <entity-and entity-name="InvoiceAttribute" 
list="invoiceAttributes">
+                    <field-map field-name="invoiceId" from-field="invoiceId"/>
+                    <order-by field-name="attrName"/>
+                </entity-and>
+            </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                        <include-screen name="InvoiceAttributes" 
location="component://accounting/widget/accounting/AccountingInvoiceAttributeCpd.xml"/>
+                    <section>
+                        <widgets>
+                            <screenlet title="${uiLabelMap.CommonAttributes}">
+                                <include-grid name="InvoiceAttributes" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                            </screenlet>
+                        </widgets>
+                    </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -211,10 +602,26 @@ under the License.
     </screen>
     <screen name="InvoiceContactMech">
         <section>
+            <actions>
+                <set field="titleProperty" 
value="PageTitleInvoiceContactMech"/>
+                <set field="tabButtonItem" value="invoiceContactMech"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <entity-one entity-name="Invoice" value-field="invoice"/>
+                <entity-and entity-name="InvoiceContactMech" 
list="invoiceContactMechList">
+                    <field-map field-name="invoiceId" from-field="invoiceId"/>
+                    <order-by field-name="contactMechId"/>
+                </entity-and>
+            </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                        <include-screen name="InvoiceContactMechs" 
location="component://accounting/widget/accounting/AccountingInvoiceContactMechCpd.xml"/>
+                    <section>
+                        <widgets>
+                            <screenlet title="${uiLabelMap.PartyContactMechs}">
+                                <include-grid name="InvoiceContactMech" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                            </screenlet>
+                        </widgets>
+                    </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -222,10 +629,26 @@ under the License.
     </screen>
     <screen name="InvoiceContent">
         <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleInvoiceContent"/>
+                <set field="tabButtonItem" value="invoiceContent"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <entity-one entity-name="Invoice" value-field="invoice"/>
+                <entity-and entity-name="InvoiceContent" 
list="invoiceContentList">
+                    <field-map field-name="invoiceId" from-field="invoiceId"/>
+                    <order-by field-name="contentId"/>
+                </entity-and>
+            </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                        <include-screen name="InvoiceContents" 
location="component://accounting/widget/accounting/AccountingInvoiceContentCpd.xml"/>
+                    <section>
+                        <widgets>
+                            <screenlet title="${uiLabelMap.CommonContent}">
+                                <include-grid name="InvoiceContent" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                            </screenlet>
+                        </widgets>
+                    </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -233,10 +656,26 @@ under the License.
     </screen>
     <screen name="InvoiceNotes">
         <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleInvoiceNotes"/>
+                <set field="tabButtonItem" value="invoiceNotes"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <entity-one entity-name="Invoice" value-field="invoice"/>
+                <entity-and entity-name="InvoiceNote" list="invoiceNotesList">
+                    <field-map field-name="invoiceId" from-field="invoiceId"/>
+                    <order-by field-name="noteId"/>
+                </entity-and>
+            </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                        <include-screen name="InvoiceNotes" 
location="component://accounting/widget/accounting/AccountingInvoiceNoteCpd.xml"/>
+                    <section>
+                        <widgets>
+                            <screenlet title="${uiLabelMap.CommonNotes}">
+                                <include-grid name="InvoiceNotes" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                            </screenlet>
+                        </widgets>
+                    </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -244,10 +683,43 @@ under the License.
     </screen>
     <screen name="InvoiceRoles">
         <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleListInvoiceRoles"/>
+                <set field="tabButtonItem" value="invoiceRoles"/>
+                <set field="helpAnchor" value="_help_for_invoice_roles"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <entity-one entity-name="Invoice" value-field="invoice"/>
+                <entity-and entity-name="InvoiceRole" list="invoiceRoles">
+                    <field-map field-name="invoiceId" from-field="invoiceId"/>
+                    <order-by field-name="partyId"/>
+                </entity-and>
+            </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                        <include-screen name="InvoiceRoles" 
location="component://accounting/widget/accounting/AccountingInvoiceRoleCpd.xml"/>
+                        <section>
+                            <condition>
+                                <and>
+                                    <or>
+                                        <if-has-permission 
permission="ACCOUNTING" action="_CREATE"/>
+                                        <if-has-permission 
permission="ACCOUNTING" action="_UPDATE"/>
+                                    </or>
+                                </and>
+                            </condition>
+                            <widgets>
+                                <screenlet id="PartyInvoiceRolePanel" 
title="${uiLabelMap.AccountingPartyRoleAdd}" collapsible="true">
+                                    <include-form name="EditInvoiceRole" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                                <screenlet title="${uiLabelMap.CommonRoles}">
+                                    <include-grid name="ListInvoiceRoles" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                            </widgets>
+                            <fail-widgets>
+                                <screenlet title="${uiLabelMap.CommonRoles}">
+                                    <include-grid name="InvoiceRoles" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                            </fail-widgets>
+                        </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -255,10 +727,54 @@ under the License.
     </screen>
     <screen name="InvoiceTerms">
         <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleListInvoiceTerms"/>
+                <set field="tabButtonItem" value="invoiceTerms"/>
+                <set field="invoiceId" from-field="parameters.invoiceId"/>
+                <entity-one entity-name="Invoice" value-field="invoice"/>
+                <entity-and entity-name="InvoiceTerm" list="invoiceTerms">
+                    <field-map field-name="invoiceId" from-field="invoiceId"/>
+                    <order-by field-name="invoiceTermId"/>
+                </entity-and>
+                <entity-one entity-name="InvoiceTerm" 
value-field="invoiceTerm">
+                    <field-map field-name="invoiceTermId" 
from-field="parameters.invoiceTermId"/>
+                </entity-one>
+            </actions>
             <widgets>
                 <decorator-screen name="CommonInvoiceDecorator" 
location="${parameters.invoiceDecoratorLocation}">
                     <decorator-section name="body">
-                        <include-screen name="InvoiceTerms" 
location="component://accounting/widget/accounting/AccountingInvoiceTermCpd.xml"/>
+                        <section>
+                            <condition>
+                                <and>
+                                    <or>
+                                        <if-has-permission 
permission="ACCOUNTING" action="_CREATE"/>
+                                        <if-has-permission 
permission="ACCOUNTING" action="_UPDATE"/>
+                                    </or>
+                                </and>
+                            </condition>
+                            <widgets>
+                                <section>
+                                    <condition>
+                                        <not>
+                                            <if-compare 
field="invoice.statusId" operator="equals" value="INVOICE_APPROVED"/>
+                                        </not>
+                                    </condition>
+                                    <widgets>
+                                        <screenlet id="PartyInvoiceTermPanel" 
collapsible="true">
+                                            <include-form 
name="EditInvoiceTerm" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                        </screenlet>
+                                    </widgets>
+                                </section>
+                                <screenlet title="${uiLabelMap.PartyTerms}">
+                                    <include-grid name="ListInvoiceTerms" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                            </widgets>
+                            <fail-widgets>
+                                <screenlet title="${uiLabelMap.PartyTerms}">
+                                    <include-grid name="InvoiceTerms" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                                </screenlet>
+                            </fail-widgets>
+                        </section>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -341,4 +857,20 @@ under the License.
             </widgets>
         </section>
     </screen>
+    <screen name="InvoicesArPastDue">
+        <section>
+           <actions>
+                <property-map resource="AccountingUiLabels" 
map-name="uiLabelMap" global="true"/>
+                <set field="invoiceTypeId" value="SALES_INVOICE"/>
+                <set field="organizationPartyId" 
from-field="organizationPartyId" default-value="${defaultOrganizationPartyId}"/>
+                <script 
location="component://accounting/src/main/groovy/org/apache/ofbiz/accounting/invoice/InvoiceReport.groovy"/>
+                <set field="invoices" from-field="PastDueInvoices"/>
+            </actions>
+            <widgets>
+                <screenlet title="${uiLabelMap.AccountingAccountsReceivable} 
${uiLabelMap.AccountingPastDueInvoices}: ${PastDueInvoicestotalAmount}">
+                    <include-grid name="ListArReport" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                </screenlet>
+            </widgets>
+        </section>
+    </screen>
 </screens>

Reply via email to