svn commit: r832433 - in /ofbiz/trunk/applications/product/widget/catalog: ProductForms.xml ProductScreens.xml

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

svn commit: r832433 - in /ofbiz/trunk/applications/product/widget/catalog: ProductForms.xml ProductScreens.xml

jacopoc
Author: jacopoc
Date: Tue Nov  3 14:36:23 2009
New Revision: 832433

URL: http://svn.apache.org/viewvc?rev=832433&view=rev
Log:
Added form to filter cost components by currency; when used, the grand total for the currency selected is also shown.

Modified:
    ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml
    ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml

Modified: ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml?rev=832433&r1=832432&r2=832433&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml Tue Nov  3 14:36:23 2009
@@ -1149,8 +1149,35 @@
         </field>
     </form>
 
-    <form name="ListCostComponents" type="list" title="" list-name="costs"
+    <form name="FilterCostComponents" type="single" target="EditProductCosts" title=""
+        header-row-style="header-row" default-table-style="basic-table">
+        <field name="productId"><hidden value="${productId}"/></field>
+        <field name="costComponentTypePrefix">
+            <drop-down allow-empty="false">
+                <option key="EST_STD" description="${uiLabelMap.ProductEstimatedCosts}"/>
+            </drop-down>
+        </field>
+        <field name="costUomId" title="${uiLabelMap.CommonCurrency}">
+            <drop-down allow-empty="false" no-current-selected-key="${defaultOrganizationPartyCurrencyUomId}">
+                <entity-options entity-name="Uom" key-field-name="uomId" description="${description} [${uomId}]">
+                    <entity-constraint name="uomTypeId" value="CURRENCY_MEASURE"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+    <form name="ListCostComponents" type="list" title="" list-name="listIt"
         odd-row-style="alternate-row" default-table-style="basic-table" paginate-target="EditProductCosts">
+        <actions>
+            <service service-name="performFind" result-map="result" result-map-list="listIt">
+                <field-map field-name="inputFields" from-field="requestParameters"/>
+                <field-map field-name="entityName" value="CostComponent"/>
+                <field-map field-name="viewIndex" from-field="viewIndex"/>
+                <field-map field-name="viewSize" from-field="viewSize"/>
+                <field-map field-name="orderBy" value="-fromDate"/>
+            </service>
+        </actions>
         <auto-fields-entity entity-name="CostComponent" default-field-type="display"/>
         <field name="cost">
             <display/>

Modified: ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml?rev=832433&r1=832432&r2=832433&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Tue Nov  3 14:36:23 2009
@@ -377,6 +377,27 @@
             <widgets>
                 <decorator-screen name="CommonProductDecorator"  location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.FilterProductCosts}">
+                            <include-form name="FilterCostComponents" location="component://product/widget/catalog/ProductForms.xml"/>
+                        </screenlet>
+                        <section>
+                            <condition>
+                                <and>
+                                    <not><if-empty field="parameters.costUomId"/></not>
+                                    <not><if-empty field="parameters.costComponentTypePrefix"/></not>
+                                </and>
+                            </condition>
+                            <actions>
+                                <service service-name="getProductCost" result-map="totalCostMap">
+                                    <field-map field-name="productId"/>
+                                    <field-map field-name="currencyUomId" from-field="parameters.costUomId"/>
+                                    <field-map field-name="costComponentTypePrefix" from-field="parameters.costComponentTypePrefix"/>
+                                </service>
+                            </actions>
+                            <widgets>
+                                <label style="h2">${uiLabelMap.CommonTotal}: ${totalCostMap.productCost}</label>
+                            </widgets>
+                        </section>
                         <screenlet title="${uiLabelMap.ProductCosts}">
                             <include-form name="ListCostComponents" location="component://product/widget/catalog/ProductForms.xml"/>
                         </screenlet>