svn commit: r927014 - in /ofbiz/trunk/applications: accounting/webapp/accounting/reports/ accounting/widget/ product/entitydef/

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

svn commit: r927014 - in /ofbiz/trunk/applications: accounting/webapp/accounting/reports/ accounting/widget/ product/entitydef/

jacopoc
Author: jacopoc
Date: Wed Mar 24 11:28:17 2010
New Revision: 927014

URL: http://svn.apache.org/viewvc?rev=927014&view=rev
Log:
Reimplemented "inventory valuation" report (that was buggy) and its csv and pdf variants: the new version is now based on the new LIFO and FIFO costing methods and it is more efficient because it is based on a single view-entity (that I have extended in order to be used in the new report).

Removed:
    ofbiz/trunk/applications/accounting/webapp/accounting/reports/InventoryValuationReport.fo.ftl
Modified:
    ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml
    ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml
    ofbiz/trunk/applications/product/entitydef/entitymodel.xml

Modified: ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml?rev=927014&r1=927013&r2=927014&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml Wed Mar 24 11:28:17 2010
@@ -496,41 +496,34 @@ under the License.
                     <entity-order-by field-name="facilityId"/>
                 </entity-options>
             </drop-down>
-       </field>
-        <field name="cogsMethodId" position="2">
-            <drop-down allow-empty="false">
-                <!--TODO for now Average Cost is being calculated-->
-                <!--<entity-options entity-name="Enumeration" description="${description}" key-field-name="enumId">
-                    <entity-constraint name="enumTypeId" operator="equals" value="COGS_METHODS"/>
-                    <entity-order-by field-name="description"/>
-                </entity-options>-->
-                <option key="COGS_AVG_COST" description="${uiLabelMap.ProductAverageCost}"/>
-            </drop-down>
         </field>
-        <field name="productId" position="1"><lookup target-form-name="LookupProduct"/></field>
-        <field name="productCategoryId" position="2"><lookup target-form-name="LookupProductCategory"/></field>
-        <field name="fromDate" position="1"><date-time/></field>
-        <field name="thruDate" position="2"><date-time/></field>
+        <field name="productId"><lookup target-form-name="LookupProduct"/></field>
+        <field name="thruDate"><date-time default-value="${nowTimestamp}"/></field>
         <field name="organizationPartyId"><hidden/></field>
         <field name="showSearchResults"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
         <field name="submitButton" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
 
-    <form name="InventoryValuationList" extends="ListInventoryAverageCosts" extends-resource="component://product/widget/facility/FacilityForms.xml"
-            odd-row-style="alternate-row" default-table-style="basic-table hover-bar" list-name="inventoryValuationList" paginate-target="InventoryValuation">
-        <field name="productAverageCost" use-when="currencyUomId!=null"><display type="currency" currency="${currencyUomId}"/></field>
-        <field name="productAverageCost" use-when="currencyUomId==null" title="${uiLabelMap.FormFieldTitle_unitCost}"><display description="${uiLabelMap.ProductDifferentCurrencies}"/></field>
-        <field name="totalInventoryCost" use-when="currencyUomId!=null" title="${uiLabelMap.CommonTotalValue}"><display type="currency" currency="${currencyUomId}"/></field>
-        <field name="totalInventoryCost" use-when="currencyUomId==null" title="${uiLabelMap.CommonTotalValue}"><display description="${uiLabelMap.ProductDifferentCurrencies}"/></field>
-    </form>
-
-    <form name="InventoryValuationCsv" type="list" list-name="inventoryValuationList" view-size="99999">
-        <field name="productId" title="${uiLabelMap.AccountingProductId}"><display/></field>
-        <field name="totalQuantityOnHand" title="${uiLabelMap.AccountingTotalQuantityOnHand}"><display/></field>
-        <field name="productAverageCost" use-when="currencyUomId!=null" title="${uiLabelMap.FormFieldTitle_unitCost}" ><display type="currency" currency="${currencyUomId}"/></field>
-        <field name="productAverageCost" use-when="currencyUomId==null" title="${uiLabelMap.FormFieldTitle_unitCost}" ><display description="${uiLabelMap.ProductDifferentCurrencies}"/></field>
-        <field name="totalInventoryCost" use-when="currencyUomId!=null" title="${uiLabelMap.CommonTotalValue}" ><display type="currency" currency="${currencyUomId}"/></field>
-        <field name="totalInventoryCost" use-when="currencyUomId==null" title="${uiLabelMap.CommonTotalValue}"><display description="${uiLabelMap.ProductDifferentCurrencies}"/></field>
+    <form name="InventoryValuationList" type="list" list-name="inventoryValuationList" odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+        <actions>
+            <entity-condition entity-name="InventoryItemDetailForSum" list="inventoryValuationList" use-cache="false">
+                <condition-list>
+                    <condition-expr field-name="ownerPartyId" operator="equals" from-field="parameters.organizationPartyId"/>
+                    <condition-expr field-name="accountingQuantityDiff" operator="not-equals" value="0.0"/>
+                    <condition-expr field-name="effectiveDate" operator="less-equals" from-field="parameters.thruDate"/>
+                    <condition-expr field-name="facilityId" operator="equals" from-field="parameters.facilityId" ignore-if-empty="true"/>
+                    <condition-expr field-name="productId" operator="equals" from-field="parameters.productId" ignore-if-empty="true"/>
+                </condition-list>
+                <select-field field-name="productId"/>
+                <select-field field-name="unitCost"/>
+                <select-field field-name="currencyUomId"/>
+                <select-field field-name="accountingQuantitySum"/>
+            </entity-condition>
+        </actions>
+        <field name="productId"><display/></field>
+        <field name="unitCost" widget-style="tabletextright"><display currency="${currencyUomId}" type="currency"/></field>
+        <field name="accountingQuantitySum" widget-style="tabletextright"><display/></field>
+        <field name="value" widget-style="tabletextright"><display description="${accountingQuantitySum * unitCost}" currency="${currencyUomId}" type="currency"/></field>
     </form>
 
     <form name="TrialBalanceFinancialTimePeriodSelection" type="single" header-row-style="header-row" target="TrialBalance" default-table-style="basic-table">

Modified: ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml?rev=927014&r1=927013&r2=927014&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml Wed Mar 24 11:28:17 2010
@@ -1367,42 +1367,22 @@ under the License.
                                     <condition>
                                         <if-compare field="parameters.showSearchResults" operator="equals" value="Y"/>
                                     </condition>
-                                    <actions>
-                                        <service service-name="getInventoryValuationList" result-map="inventoryValuation"/>
-                                        <set field="inventoryValuationList" from-field="inventoryValuation.inventoryValuationList" type="List"/>
-                                    </actions>
                                     <widgets>
-                                        <section>
-                                            <condition>
-                                                <not><if-empty field="inventoryValuationList"/></not>
-                                            </condition>
-                                            <widgets>
-                                                <link text="${uiLabelMap.AccountingExportAsPdf}" style="button" target="InventoryValuation.pdf">
-                                                    <parameter param-name="organizationPartyId" from-field="parameters.organizationPartyId"/>
-                                                    <parameter param-name="facilityId" from-field="parameters.facilityId"/>
-                                                    <parameter param-name="productId" from-field="parameters.productId"/>
-                                                    <parameter param-name="productCategoryId" from-field="parameters.productCategoryId"/>
-                                                    <parameter param-name="fromDate" from-field="parameters.fromDate"/>
-                                                    <parameter param-name="thruDate" from-field="parameters.thruDate"/>
-                                                    <parameter param-name="cogsMethodId" from-field="parameters.cogsMethodId"/>
-                                                </link>
-                                                <link text="${uiLabelMap.AccountingExportAsCsv}" style="button" target="InventoryValuation.csv">
-                                                    <parameter param-name="organizationPartyId" from-field="parameters.organizationPartyId"/>
-                                                    <parameter param-name="facilityId" from-field="parameters.facilityId"/>
-                                                    <parameter param-name="productId" from-field="parameters.productId"/>
-                                                    <parameter param-name="productCategoryId" from-field="parameters.productCategoryId"/>
-                                                    <parameter param-name="fromDate" from-field="parameters.fromDate"/>
-                                                    <parameter param-name="thruDate" from-field="parameters.thruDate"/>
-                                                    <parameter param-name="cogsMethodId" from-field="parameters.cogsMethodId"/>
-                                                </link>
-                                                <screenlet title="${uiLabelMap.AccountingInventoryValuationList}">
-                                                    <include-form name="InventoryValuationList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
-                                                </screenlet>
-                                            </widgets>
-                                            <fail-widgets>
-                                                <label style="h3">${uiLabelMap.AccountingNoRecordFound}</label>
-                                            </fail-widgets>
-                                        </section>
+                                        <link text="${uiLabelMap.AccountingExportAsPdf}" style="button" target="InventoryValuation.pdf">
+                                            <parameter param-name="organizationPartyId" from-field="parameters.organizationPartyId"/>
+                                            <parameter param-name="facilityId" from-field="parameters.facilityId"/>
+                                            <parameter param-name="productId" from-field="parameters.productId"/>
+                                            <parameter param-name="thruDate" from-field="parameters.thruDate"/>
+                                        </link>
+                                        <link text="${uiLabelMap.AccountingExportAsCsv}" style="button" target="InventoryValuation.csv">
+                                            <parameter param-name="organizationPartyId" from-field="parameters.organizationPartyId"/>
+                                            <parameter param-name="facilityId" from-field="parameters.facilityId"/>
+                                            <parameter param-name="productId" from-field="parameters.productId"/>
+                                            <parameter param-name="thruDate" from-field="parameters.thruDate"/>
+                                        </link>
+                                        <screenlet title="${uiLabelMap.AccountingInventoryValuationList}">
+                                            <include-form name="InventoryValuationList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+                                        </screenlet>
                                     </widgets>
                                 </section>
                             </decorator-section>
@@ -1418,18 +1398,15 @@ under the License.
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
-                <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
-                <service service-name="getInventoryValuationList" result-map="inventoryValuation"/>
-                <set field="inventoryValuationList" from-field="inventoryValuation.inventoryValuationList" type="List"/>
+                <set field="viewSize" value="99999"/>
             </actions>
             <widgets>
                 <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml">
                     <decorator-section name="body">
-                        <platform-specific>
-                            <xsl-fo>
-                                <html-template location="component://accounting/webapp/accounting/reports/InventoryValuationReport.fo.ftl"/>
-                            </xsl-fo>
-                        </platform-specific>
+                        <container>
+                            <label style="h1" text="${uiLabelMap.AccountingInventoryValuation}"/>
+                            <include-form name="InventoryValuationList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+                        </container>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -1441,13 +1418,11 @@ under the License.
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
-                <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
-                <service service-name="getInventoryValuationList" result-map="inventoryValuation"/>
-                <set field="inventoryValuationList" from-field="inventoryValuation.inventoryValuationList" type="List"/>
+                <set field="viewSize" value="99999"/>
             </actions>
             <widgets>
                 <container>
-                    <include-form name="InventoryValuationCsv" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+                    <include-form name="InventoryValuationList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
                 </container>
             </widgets>
         </section>

Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?rev=927014&r1=927013&r2=927014&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Wed Mar 24 11:28:17 2010
@@ -2050,9 +2050,13 @@ under the License.
         <alias entity-alias="II" name="inventoryItemTypeId" group-by="true"></alias>
         <alias entity-alias="II" name="facilityId" group-by="true"></alias>
         <alias entity-alias="II" name="productId" group-by="true"></alias>
+        <alias entity-alias="II" name="unitCost" group-by="true"></alias>
+        <alias entity-alias="II" name="currencyUomId" group-by="true"></alias>
         <alias entity-alias="IID" name="effectiveDate"><description>For query only, not in fields to select.</description></alias>
         <alias entity-alias="IID" name="orderId"><description>For query only, not in fields to select.</description></alias>
+        <alias entity-alias="II" name="ownerPartyId"><description>For query only, not in fields to select.</description></alias>
         <alias entity-alias="IID" name="quantityOnHandDiff"><description>For query only, not in fields to select.</description></alias>
+        <alias entity-alias="IID" name="accountingQuantityDiff"><description>For query only, not in fields to select.</description></alias>
         <view-link entity-alias="II" rel-entity-alias="IID">
             <key-map field-name="inventoryItemId"/>
         </view-link>