svn commit: r502824 - /ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml

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

svn commit: r502824 - /ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml

sichen
Author: sichen
Date: Fri Feb  2 17:16:36 2007
New Revision: 502824

URL: http://svn.apache.org/viewvc?view=rev&rev=502824
Log:
Fix a pretty significant bug with sequence of inventory item reservations for orders: FIFO and LIFO were reversed (I checked this) and the +/- notation does not work well with PostgreSQL

Modified:
    ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml?view=diff&rev=502824&r1=502823&r2=502824
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml Fri Feb  2 17:16:36 2007
@@ -42,23 +42,26 @@
         <entity-one entity-name="OrderHeader" value-name="orderHeader"/>
 
         <!-- before we do the find, put together the orderBy list based on which reserveOrderEnumId is specified -->
+        <!-- FIFO=first in first out, so it should be order by ASCending receive or expire date
+             LIFO=last in first out, so it means order by DESCending receive or expire date
+             -->
         <if-compare value="INVRO_GUNIT_COST" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
-            <set value="-unitCost" field="orderByString"/>
+            <set value="unitCost DESC" field="orderByString"/>
         <else>
             <if-compare value="INVRO_LUNIT_COST" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
-                <set value="+unitCost" field="orderByString"/>
+                <set value="unitCost ASC" field="orderByString"/>
             <else>
                 <if-compare value="INVRO_FIFO_EXP" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
-                    <set value="+expireDate" field="orderByString"/>
+                    <set value="expireDate ASC" field="orderByString"/>
                 <else>
                     <if-compare value="INVRO_LIFO_EXP" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
-                        <set value="-expireDate" field="orderByString"/>
+                        <set value="expireDate DESC" field="orderByString"/>
                     <else>
                         <if-compare value="INVRO_LIFO_REC" operator="equals" field-name="reserveOrderEnumId" map-name="parameters">
-                            <set value="+datetimeReceived" field="orderByString"/>
+                            <set value="datetimeReceived DESC" field="orderByString"/>
                         <else>
                             <!-- the default reserveOrderEnumId is INVRO_FIFO_REC, ie FIFO based on date received -->
-                            <set value="-datetimeReceived" field="orderByString"/>
+                            <set value="datetimeReceived ASC" field="orderByString"/>
                             <set value="INVRO_FIFO_REC" field="parameters.reserveOrderEnumId"/>
                         </else>
                         </if-compare>


Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r502824 - /ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryReserveServices.xml

David E Jones-2

Hold on a minute there.... did you actually test and find this to be  
a problem? The +/- notation is an entity engine ONLY thing and should  
never make it to the database.

This patch should be reverted and if +/- are making it to the  
database instead of being replaced with an ASC/DESC by the entity  
engine then THAT bug should be fixed.

This is a slippery slope and we should backup to the top before it  
gets going...

-David


On Feb 2, 2007, at 6:16 PM, [hidden email] wrote:

> Author: sichen
> Date: Fri Feb  2 17:16:36 2007
> New Revision: 502824
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=502824
> Log:
> Fix a pretty significant bug with sequence of inventory item  
> reservations for orders: FIFO and LIFO were reversed (I checked  
> this) and the +/- notation does not work well with PostgreSQL
>
> Modified:
>     ofbiz/trunk/applications/product/script/org/ofbiz/product/
> inventory/InventoryReserveServices.xml
>
> Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/
> inventory/InventoryReserveServices.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/ 
> script/org/ofbiz/product/inventory/InventoryReserveServices.xml?
> view=diff&rev=502824&r1=502823&r2=502824
> ======================================================================
> ========
> --- ofbiz/trunk/applications/product/script/org/ofbiz/product/
> inventory/InventoryReserveServices.xml (original)
> +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/
> inventory/InventoryReserveServices.xml Fri Feb  2 17:16:36 2007
> @@ -42,23 +42,26 @@
>          <entity-one entity-name="OrderHeader" value-
> name="orderHeader"/>
>
>          <!-- before we do the find, put together the orderBy list  
> based on which reserveOrderEnumId is specified -->
> +        <!-- FIFO=first in first out, so it should be order by  
> ASCending receive or expire date
> +             LIFO=last in first out, so it means order by  
> DESCending receive or expire date
> +             -->
>          <if-compare value="INVRO_GUNIT_COST" operator="equals"  
> field-name="reserveOrderEnumId" map-name="parameters">
> -            <set value="-unitCost" field="orderByString"/>
> +            <set value="unitCost DESC" field="orderByString"/>
>          <else>
>              <if-compare value="INVRO_LUNIT_COST" operator="equals"  
> field-name="reserveOrderEnumId" map-name="parameters">
> -                <set value="+unitCost" field="orderByString"/>
> +                <set value="unitCost ASC" field="orderByString"/>
>              <else>
>                  <if-compare value="INVRO_FIFO_EXP"  
> operator="equals" field-name="reserveOrderEnumId" map-
> name="parameters">
> -                    <set value="+expireDate" field="orderByString"/>
> +                    <set value="expireDate ASC"  
> field="orderByString"/>
>                  <else>
>                      <if-compare value="INVRO_LIFO_EXP"  
> operator="equals" field-name="reserveOrderEnumId" map-
> name="parameters">
> -                        <set value="-expireDate"  
> field="orderByString"/>
> +                        <set value="expireDate DESC"  
> field="orderByString"/>
>                      <else>
>                          <if-compare value="INVRO_LIFO_REC"  
> operator="equals" field-name="reserveOrderEnumId" map-
> name="parameters">
> -                            <set value="+datetimeReceived"  
> field="orderByString"/>
> +                            <set value="datetimeReceived DESC"  
> field="orderByString"/>
>                          <else>
>                              <!-- the default reserveOrderEnumId is  
> INVRO_FIFO_REC, ie FIFO based on date received -->
> -                            <set value="-datetimeReceived"  
> field="orderByString"/>
> +                            <set value="datetimeReceived ASC"  
> field="orderByString"/>
>                              <set value="INVRO_FIFO_REC"  
> field="parameters.reserveOrderEnumId"/>
>                          </else>
>                          </if-compare>
>
>


smime.p7s (3K) Download Attachment