svn commit: r1768174 - in /ofbiz/trunk/applications/product: ./ config/ servicedef/ webapp/catalog/WEB-INF/ widget/catalog/

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

svn commit: r1768174 - in /ofbiz/trunk/applications/product: ./ config/ servicedef/ webapp/catalog/WEB-INF/ widget/catalog/

diveshdutta
Author: diveshdutta
Date: Sat Nov  5 09:59:54 2016
New Revision: 1768174

URL: http://svn.apache.org/viewvc?rev=1768174&view=rev
Log:
New Feature: Introduce a quick way for adding Sales Price agreements with customers for any specific product from Catalog

(OFBIZ-7713)

Thanks: Swapnil Shah for suggesting this new featuer and Mohammad Kathawala for giving the patch

Added:
    ofbiz/trunk/applications/product/servicedef/groups.xml
Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.xml
    ofbiz/trunk/applications/product/ofbiz-component.xml
    ofbiz/trunk/applications/product/servicedef/services.xml
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml
    ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=1768174&r1=1768173&r2=1768174&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Sat Nov  5 09:59:54 2016
@@ -78,6 +78,9 @@
         <value xml:lang="zh">新建产品特征类型</value>
         <value xml:lang="zh-TW">新建產品特色類型</value>
     </property>
+    <property key="CreateSalesAgreement">
+        <value xml:lang="en">Create Sales Agreement</value>
+    </property>
     <property key="FacilityActualShippingCharges">
         <value xml:lang="de">Aktuelle Lieferkosten</value>
         <value xml:lang="en">Actual shipping charges</value>

Modified: ofbiz/trunk/applications/product/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/ofbiz-component.xml?rev=1768174&r1=1768173&r2=1768174&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/ofbiz-component.xml (original)
+++ ofbiz/trunk/applications/product/ofbiz-component.xml Sat Nov  5 09:59:54 2016
@@ -68,6 +68,7 @@ under the License.
     <service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
     <service-resource type="eca" loader="main" location="servicedef/secas_shipment.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_upgrade.xml"/>
+    <service-resource type="group" loader="main" location="servicedef/groups.xml"/>
 
     <!-- test suite -->
     <test-suite loader="main" location="testdef/CatalogTests.xml"/>

Added: ofbiz/trunk/applications/product/servicedef/groups.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/groups.xml?rev=1768174&view=auto
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/groups.xml (added)
+++ ofbiz/trunk/applications/product/servicedef/groups.xml Sat Nov  5 09:59:54 2016
@@ -0,0 +1,9 @@
+<service-group xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-group.xsd">
+
+    <group name="createSalesAgreement" send-mode="all">
+        <invoke name="createAgreement" mode="sync" result-to-context="true"/>
+        <invoke name="createAgreementItem" mode="sync" result-to-context="true"/>
+        <invoke name="createAgreementProductAppl" mode="sync"/>
+    </group>
+</service-group>
\ No newline at end of file

Modified: ofbiz/trunk/applications/product/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services.xml?rev=1768174&r1=1768173&r2=1768174&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services.xml Sat Nov  5 09:59:54 2016
@@ -113,6 +113,13 @@ under the License.
         <attribute name="sequenceNum" type="Long" mode="IN" optional="true"/>
     </service>
 
+    <service name="createSalesAgreement" engine="group" location="createSalesAgreement" invoke="" auth="true">
+        <description>Create a new sales agreement with customer for the product</description>
+        <implements service="createAgreement"/>
+        <implements service="createAgreementItem"/>
+        <implements service="createAgreementProductAppl"/>
+    </service>
+
     <service name="quickCreateVirtualWithVariants" engine="java"
             location="org.apache.ofbiz.product.product.ProductServices" invoke="quickCreateVirtualWithVariants">
         <description>

Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml?rev=1768174&r1=1768173&r2=1768174&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml Sat Nov  5 09:59:54 2016
@@ -850,6 +850,15 @@ under the License.
         <security https="true" auth="true"/>
         <response name="success" type="view" value="ViewProductAgreements"/>
     </request-map>
+    <request-map uri="CreateSalesAgreement">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="CreateSalesAgreement"/>
+    </request-map>
+    <request-map uri="createSalesAgreement">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createSalesAgreement"/>
+        <response name="success" type="view" value="ViewProductAgreements"/>
+    </request-map>
 
     <!-- ================ Product Costs Requests ================= -->
     <request-map uri="EditProductCosts">
@@ -3103,6 +3112,7 @@ under the License.
     <view-map name="EditProductAssoc" type="screen" page="component://product/widget/catalog/ProductScreens.xml#EditProductAssoc"/>
     <view-map name="ViewProductManufacturing" type="screen" page="component://product/widget/catalog/ProductScreens.xml#ViewProductManufacturing"/>
     <view-map name="ViewProductAgreements" type="screen" page="component://product/widget/catalog/ProductScreens.xml#ViewProductAgreements"/>
+    <view-map name="CreateSalesAgreement" type="screen" page="component://product/widget/catalog/ProductScreens.xml#CreateSalesAgreement"/>
     <view-map name="EditProductCosts" type="screen" page="component://product/widget/catalog/ProductScreens.xml#EditProductCosts"/>
 
     <view-map name="EditProductAttributes" type="screen" page="component://product/widget/catalog/ProductScreens.xml#EditProductAttributes"/>

Modified: ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml?rev=1768174&r1=1768173&r2=1768174&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml Sat Nov  5 09:59:54 2016
@@ -1822,6 +1822,34 @@ under the License.
         <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
 
+    <form name="CreateSalesAgreement" type="single" target="createSalesAgreement" title=""
+          header-row-style="header-row" default-table-style="basic-table">
+        <!--<auto-fields-service service-name="createAgreement" default-field-type="edit"/>-->
+        <field name="productId" parameter-name="productId"><hidden></hidden></field>
+        <field name="roleTypeIdFrom" ><hidden value="CUSTOMER"></hidden></field>
+        <field name="roleTypeIdTo" ><hidden value="INTERNAL_ORGANIZATIO"></hidden></field>
+        <field name="agreementTypeId" ><hidden value="SALES_AGREEMENT"></hidden></field>
+        <field name="agreementItemTypeId" ><hidden value="AGREEMENT_PRICING_PR"></hidden></field>
+        <field name="partyIdFrom" title="${uiLabelMap.AccountingPartyIdFrom}" required-field="true">
+            <lookup target-form-name="LookupPartyName"/>
+        </field>
+        <field name="partyIdTo" title="${uiLabelMap.AccountingPartyIdTo}" required-field="true">
+            <lookup target-form-name="LookupPartyName"/>
+        </field>
+        <field name="fromDate"><date-time/></field>
+        <field name="thruDate"><date-time/></field>
+        <field name="description" title="${uiLabelMap.CommonDescription}"><text></text></field>
+        <field name="price" title="Price" ><text></text></field>
+        <field name="currencyUomId" title="${uiLabelMap.CommonCurrency}">
+            <drop-down allow-empty="false" no-current-selected-key="${defaultOrganizationPartyCurrencyUomId}">
+                <entity-options key-field-name="uomId" description="${description} - ${abbreviation}" entity-name="Uom">
+                    <entity-constraint name="uomTypeId" operator="equals" value="CURRENCY_MEASURE"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submitForm" title="${uiLabelMap.CommonCreate}"><submit/></field>
+    </form>
     <form name="ListSupplierProductAgreements" type="list" list-name="supplierProductAgreements"
         odd-row-style="alternate-row" default-table-style="basic-table">
         <row-actions>

Modified: ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml?rev=1768174&r1=1768173&r2=1768174&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Sat Nov  5 09:59:54 2016
@@ -237,6 +237,9 @@ under the License.
                             <link target="/accounting/control/EditAgreement" url-mode="inter-app" text="${uiLabelMap.AccountingNewAgreement}" style="buttontext">
                                 <parameter param-name="productId"/>
                             </link>
+                            <link target="CreateSalesAgreement" text="${uiLabelMap.CreateSalesAgreement}" style="buttontext">
+                                <parameter param-name="productId"/>
+                            </link>
                         </container>
                         <screenlet title="${uiLabelMap.ProductPurchases}">
                             <include-form name="ListSupplierProductAgreements" location="component://product/widget/catalog/ProductForms.xml"/>
@@ -252,6 +255,25 @@ under the License.
                         </screenlet>
                     </decorator-section>
                 </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="CreateSalesAgreement">
+        <section>
+            <actions>
+                <property-map resource="AccountingUiLabels" map-name="uiLabelMap"/>
+                <set field="titleProperty" value="Create Sales Agreement"/>
+                <set field="tabButtonItem" value="ViewProductAgreements"/>
+                <set field="labelTitleProperty" value="ProductAgreements"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonProductDecorator" location="${parameters.productDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet title="Create Sales Agreement">
+                            <include-form name="CreateSalesAgreement" location="component://product/widget/catalog/ProductForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
             </widgets>
         </section>
     </screen>