[ofbiz-framework] branch trunk updated: Improved: Purchase Invoice creation should be limited for parties with roleTypeId = SUPPLIER (OFBIZ-11024)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Improved: Purchase Invoice creation should be limited for parties with roleTypeId = SUPPLIER (OFBIZ-11024)

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

pawan 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 adb60c2  Improved: Purchase Invoice creation should be limited for parties with roleTypeId = SUPPLIER (OFBIZ-11024)
adb60c2 is described below

commit adb60c2a9efb87d2a96b363a9a2207ed4cc06e61
Author: Pawan Verma <[hidden email]>
AuthorDate: Tue May 5 13:48:54 2020 +0530

    Improved: Purchase Invoice creation should be limited for parties with roleTypeId = SUPPLIER
    (OFBIZ-11024)
   
    Added new LookupSupplier and used it.
   
    Thanks: Pierre, Rohit, Jacques, Nicolas for your contribution.
---
 .../webapp/accounting/WEB-INF/controller.xml       |  5 ++++
 applications/accounting/widget/InvoiceForms.xml    |  2 +-
 applications/party/widget/partymgr/LookupForms.xml | 34 ++++++++++++++++++++++
 .../party/widget/partymgr/LookupScreens.xml        | 28 ++++++++++++++++++
 4 files changed, 68 insertions(+), 1 deletion(-)

diff --git a/applications/accounting/webapp/accounting/WEB-INF/controller.xml b/applications/accounting/webapp/accounting/WEB-INF/controller.xml
index 4080996..3f2440b 100644
--- a/applications/accounting/webapp/accounting/WEB-INF/controller.xml
+++ b/applications/accounting/webapp/accounting/WEB-INF/controller.xml
@@ -2308,6 +2308,10 @@ under the License.
         <security auth="true" https="true"/>
         <response name="success" type="view" value="LookupCustomerName"/>
     </request-map>
+    <request-map uri="LookupSupplier">
+        <security auth="true" https="true"/>
+        <response name="success" type="view" value="LookupSupplier"/>
+    </request-map>
     <request-map uri="depositWithdrawPayments">
         <security auth="true" https="true"/>
         <event type="service" invoke="depositWithdrawPayments"/>
@@ -2859,6 +2863,7 @@ under the License.
     <view-map name="TransactionTotalsCsv" type="screencsv" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#TransactionTotalsCsv" content-type="text/csv" encoding="none"/>
     <view-map name="PaymentsDepositWithdraw" type="screen" page="component://accounting/widget/FinAccountScreens.xml#PaymentsDepositWithdraw"/>
     <view-map name="LookupCustomerName" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupCustomerName"/>
+    <view-map name="LookupSupplier" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupSupplier"/>
     <view-map name="NewDepositSlip" type="screen" page="component://accounting/widget/FinAccountScreens.xml#NewDepositSlip"/>
     <view-map name="InventoryValuation" type="screen" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#InventoryValuation"/>
     <view-map name="InventoryValuationPdf" type="screenfop" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#InventoryValuationPdf" content-type="application/pdf" encoding="none"/>
diff --git a/applications/accounting/widget/InvoiceForms.xml b/applications/accounting/widget/InvoiceForms.xml
index 14ac619..40e2550 100644
--- a/applications/accounting/widget/InvoiceForms.xml
+++ b/applications/accounting/widget/InvoiceForms.xml
@@ -289,7 +289,7 @@ under the License.
                 </entity-options>
             </drop-down>
         </field>
-        <field position="2" name="partyIdFrom" required-field="true"><lookup target-form-name="LookupPartyName"/></field>
+        <field position="2" name="partyIdFrom" required-field="true"><lookup target-form-name="LookupSupplier"/></field>
         <field position="1" name="createButton" widget-style="smallSubmit" title="${uiLabelMap.CommonCreate}">
             <submit button-type="button"/>
         </field>
diff --git a/applications/party/widget/partymgr/LookupForms.xml b/applications/party/widget/partymgr/LookupForms.xml
index dfec4e2..bcc03f5 100644
--- a/applications/party/widget/partymgr/LookupForms.xml
+++ b/applications/party/widget/partymgr/LookupForms.xml
@@ -433,4 +433,38 @@ under the License.
         <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
         <field name="submitButton" title="${uiLabelMap.CommonFind}"><submit button-type="button"/></field>
     </form>
+
+    <form name="LookupSupplier" target="LookupSupplier" type="single"
+          header-row-style="header-row" default-table-style="basic-table">
+        <field name="roleTypeId"><hidden value="SUPPLIER"/></field>
+        <field name="partyId" title="${uiLabelMap.PartyPartyId}"><text-find/></field>
+        <field name="partyTypeId" title="${uiLabelMap.PartyTypeId}">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="PartyType"/>
+            </drop-down>
+        </field>
+        <field name="firstName" title="${uiLabelMap.PartyFirstName}"><text-find/></field>
+        <field name="lastName"  title="${uiLabelMap.PartyLastName}"><text-find/></field>
+        <field name="groupName" title="${uiLabelMap.PartyGroupName}"><text-find/></field>
+        <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
+        <field name="submitButton" title="${uiLabelMap.CommonFind}"><submit button-type="button"/></field>
+    </form>
+    <form name="ListLookupSupplier" type="list" list-name="listIt" paginate-target="LookupSupplier"
+          odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+        <actions>
+            <set field="inputFields" from-field="parameters"/>
+            <set field="orderBy" value="partyId"/>
+            <set field="entityName" value="PartyRoleNameDetail"/>
+            <script location="component://party/groovyScripts/party/FindLookUp.groovy"/>
+        </actions>
+        <field name="partyId" title="${uiLabelMap.PartyPartyId}"  widget-style="smallSubmit">
+            <hyperlink description="${partyId}" target="javascript:set_value('${partyId}')" also-hidden="false" target-type="plain"/>
+        </field>
+        <field name="partyTypeId" title="${uiLabelMap.PartyTypeId}">
+            <display-entity also-hidden="false" entity-name="PartyType"/>
+        </field>
+        <field name="firstName" title="${uiLabelMap.PartyFirstName}"><display/></field>
+        <field name="lastName"  title="${uiLabelMap.PartyLastName}"><display/></field>
+        <field name="groupName" title="${uiLabelMap.PartyGroupName}"><display/></field>
+    </form>
 </forms>
diff --git a/applications/party/widget/partymgr/LookupScreens.xml b/applications/party/widget/partymgr/LookupScreens.xml
index 97dfcd1..9004c92 100644
--- a/applications/party/widget/partymgr/LookupScreens.xml
+++ b/applications/party/widget/partymgr/LookupScreens.xml
@@ -432,4 +432,32 @@ under the License.
             </widgets>
         </section>
     </screen>
+    <screen name="LookupSupplier">
+        <section>
+            <condition>
+                <if-service-permission service-name="partyBasePermissionCheck" main-action="VIEW"/>
+            </condition>
+            <actions>
+                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="title" from-field="uiLabelMap.PartyLookupPartyByName"/>
+                <set field="queryString" from-field="result.queryString"/>
+                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
+                <set field="viewSizeDefaultValue" value="${groovy: modelTheme.getDefaultViewSize()}" type="Integer"/>
+                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
+                <set field="entityName" value="PartyRoleNameDetail"/>
+                <set field="searchFields" value="[partyId, firstName, middleName, lastName, groupName]"/>
+                <set field="conditionFields.roleTypeId" value="SUPPLIER" />
+            </actions>
+            <widgets>
+                <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
+                    <decorator-section name="search-options">
+                        <include-form name="LookupSupplier" location="component://party/widget/partymgr/LookupForms.xml"/>
+                    </decorator-section>
+                    <decorator-section name="search-results">
+                        <include-form name="ListLookupSupplier" location="component://party/widget/partymgr/LookupForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>