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 32c4b6b  Improved: VIEW permissions - invoice notes (OFBIZ-1243        
1) (#383)
32c4b6b is described below

commit 32c4b6b8833601612a7e1c7dcc6c9b62a655ce66
Author: Pierre Smits <[email protected]>
AuthorDate: Sat Dec 4 09:07:33 2021 +0100

    Improved: VIEW permissions - invoice notes (OFBIZ-1243      1) (#383)
    
    Though there is an entity InvoiceNote, this cannot be accessed by user with 
VIEW permissions when accessing an invoice.
    See:
    for entity 
data:https://demo-trunk.ofbiz.apache.org/webtools/control/entity/find/InvoiceNote
    test invoice: 
https://demo-trunk.ofbiz.apache.org/accounting/control/invoiceOverview?invoiceId=demo11001
    
    Modified:
    AccountingMenus.xml
    - added menu-item for invoice notes to InvoiceTabBar menu, reordered 
menu-items alphabetically
    controller.xml
    - added request-map and view-map for request invoiceNotes
    InvoiceScreens.xml
    - added screen for invoice notes
    InvoiceForms.xml
    - added grid to display InvoiceNote records
    AccountingUiLabels.xml
    - added label for page title invoice notes.
---
 .../accounting/config/AccountingUiLabels.xml       |  4 ++++
 .../webapp/accounting/WEB-INF/controller.xml       |  5 ++++
 applications/accounting/widget/AccountingMenus.xml | 23 ++++++++++++------
 applications/accounting/widget/InvoiceForms.xml    |  4 ++++
 applications/accounting/widget/InvoiceScreens.xml  | 27 ++++++++++++++++++++++
 5 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/applications/accounting/config/AccountingUiLabels.xml 
b/applications/accounting/config/AccountingUiLabels.xml
index f1927b7..85d2dbe 100644
--- a/applications/accounting/config/AccountingUiLabels.xml
+++ b/applications/accounting/config/AccountingUiLabels.xml
@@ -24175,6 +24175,10 @@
         <value xml:lang="en">Invoice Content</value>
         <value xml:lang="nl">Factuurcontent</value>
     </property>
+    <property key="PageTitleInvoiceNotes">
+        <value xml:lang="en">Invoice Notes</value>
+        <value xml:lang="nl">Factuurnotities</value>
+    </property>
     <property key="PageTitleListAccounts">
         <value xml:lang="ar">قائمة الحسابات</value>
         <value xml:lang="cs">Seznam účtů</value>
diff --git a/applications/accounting/webapp/accounting/WEB-INF/controller.xml 
b/applications/accounting/webapp/accounting/WEB-INF/controller.xml
index fe1ffde..05ebcb9 100644
--- a/applications/accounting/webapp/accounting/WEB-INF/controller.xml
+++ b/applications/accounting/webapp/accounting/WEB-INF/controller.xml
@@ -245,6 +245,10 @@ under the License.
         <security https="true" auth="true"/>
         <response name="success" type="view" value="invoiceContent"/>
     </request-map>
+    <request-map uri="invoiceNotes">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="invoiceNotes"/>
+    </request-map>
     
     <!-- re Invoice Roles -->
     <request-map uri="invoiceRoles">
@@ -2643,6 +2647,7 @@ under the License.
     <view-map name="invoiceAttributes" type="screen" 
page="component://accounting/widget/InvoiceScreens.xml#InvoiceAttributes"/>
     <view-map name="invoiceContactMech" type="screen" 
page="component://accounting/widget/InvoiceScreens.xml#InvoiceContactMech"/>
     <view-map name="invoiceContent" type="screen" 
page="component://accounting/widget/InvoiceScreens.xml#InvoiceContent"/>
+    <view-map name="invoiceNotes" type="screen" 
page="component://accounting/widget/InvoiceScreens.xml#InvoiceNotes"/>
     <view-map name="invoiceRoles" type="screen" 
page="component://accounting/widget/InvoiceScreens.xml#InvoiceRoles"/>
     <view-map name="invoiceTerms" type="screen" 
page="component://accounting/widget/InvoiceScreens.xml#InvoiceTerms"/>
     <view-map name="sendPerEmail" type="screen" 
page="component://accounting/widget/InvoiceScreens.xml#SendPerEmail"/>
diff --git a/applications/accounting/widget/AccountingMenus.xml 
b/applications/accounting/widget/AccountingMenus.xml
index 6e82f8f..12c9984 100644
--- a/applications/accounting/widget/AccountingMenus.xml
+++ b/applications/accounting/widget/AccountingMenus.xml
@@ -159,17 +159,29 @@ under the License.
                 <parameter param-name="invoiceId" 
from-field="invoice.invoiceId"/>
             </link>
         </menu-item>
-        <menu-item name="EditInvoiceTimeEntries" 
title="${uiLabelMap.AccountingInvoiceTimeEntries}">
+        <menu-item name="invoiceNotes" title="${uiLabelMap.CommonNotes}">
+            <condition>
+                <and>
+                    <not><if-empty field="invoice.invoiceId"/></not>
+                </and>
+            </condition>
+            <link target="invoiceNotes">
+                <parameter param-name="invoiceId" 
from-field="invoice.invoiceId"/>
+            </link>
+        </menu-item>
+        <menu-item name="editInvoiceApplications" 
title="${uiLabelMap.AccountingPaymentsApplications}">
             <condition>
                 <and>
                     <not><if-empty field="invoice.invoiceId"/></not>
                     <or>
                         <if-compare field="invoice.statusId" operator="equals" 
value="INVOICE_IN_PROCESS"/>
+                        <if-compare field="invoice.statusId" operator="equals" 
value="INVOICE_SENT"/>
                         <if-compare field="invoice.statusId" operator="equals" 
value="INVOICE_RECEIVED"/>
+                        <if-compare field="invoice.statusId" operator="equals" 
value="INVOICE_APPROVED"/>
                     </or>
                 </and>
             </condition>
-            <link target="editInvoiceTimeEntries">
+            <link target="editInvoiceApplications">
                 <parameter param-name="invoiceId" 
from-field="invoice.invoiceId"/>
             </link>
         </menu-item>
@@ -201,26 +213,23 @@ under the License.
                 <parameter param-name="invoiceId" 
from-field="invoice.invoiceId"/>
             </link>
         </menu-item>
-        <menu-item name="editInvoiceApplications" 
title="${uiLabelMap.AccountingPaymentsApplications}">
+        <menu-item name="EditInvoiceTimeEntries" 
title="${uiLabelMap.AccountingInvoiceTimeEntries}">
             <condition>
                 <and>
                     <not><if-empty field="invoice.invoiceId"/></not>
                     <or>
                         <if-compare field="invoice.statusId" operator="equals" 
value="INVOICE_IN_PROCESS"/>
-                        <if-compare field="invoice.statusId" operator="equals" 
value="INVOICE_SENT"/>
                         <if-compare field="invoice.statusId" operator="equals" 
value="INVOICE_RECEIVED"/>
-                        <if-compare field="invoice.statusId" operator="equals" 
value="INVOICE_APPROVED"/>
                     </or>
                 </and>
             </condition>
-            <link target="editInvoiceApplications">
+            <link target="editInvoiceTimeEntries">
                 <parameter param-name="invoiceId" 
from-field="invoice.invoiceId"/>
             </link>
         </menu-item>
         <menu-item name="commissionRun" 
title="${uiLabelMap.AccountingCommissionRun}">
             <link target="CommissionRun"/>
         </menu-item>
-        
     </menu>
     
     <menu name="InvoiceSubTabBar" menu-container-style="button-bar 
button-style-2" default-selected-style="selected">
diff --git a/applications/accounting/widget/InvoiceForms.xml 
b/applications/accounting/widget/InvoiceForms.xml
index 6d9b1a2..1961cfc 100644
--- a/applications/accounting/widget/InvoiceForms.xml
+++ b/applications/accounting/widget/InvoiceForms.xml
@@ -152,6 +152,10 @@ under the License.
         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>
     <form name="InvoiceItems" list-name="invItemAndOrdItems" target="" 
title="" type="list" separate-columns="true" paginate-target="invoiceOverview"
         odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
         <row-actions>
diff --git a/applications/accounting/widget/InvoiceScreens.xml 
b/applications/accounting/widget/InvoiceScreens.xml
index c65031f..37701d0 100644
--- a/applications/accounting/widget/InvoiceScreens.xml
+++ b/applications/accounting/widget/InvoiceScreens.xml
@@ -638,6 +638,33 @@ under the License.
             </widgets>
         </section>
     </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">
+                    <section>
+                        <widgets>
+                            <screenlet title="${uiLabelMap.CommonNotes}">
+                                <include-grid name="InvoiceNotes" 
location="component://accounting/widget/InvoiceForms.xml"/>
+                            </screenlet>
+                        </widgets>
+                    </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
     <screen name="InvoiceRoles">
         <section>
             <actions>

Reply via email to