svn commit: r687143 - /ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy

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

svn commit: r687143 - /ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy

jleroux@apache.org
Author: jleroux
Date: Tue Aug 19 13:18:07 2008
New Revision: 687143

URL: http://svn.apache.org/viewvc?rev=687143&view=rev
Log:
Fix number of bugs. This allow to export but there is still bug(s?) in the FO->PDF transformation
Unable to transform FO file: javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.

Modified:
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy?rev=687143&r1=687142&r2=687143&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy Tue Aug 19 13:18:07 2008
@@ -30,6 +30,8 @@
 // is not computed; you can use the ViewFacilityInventoryByProduct.groovy if you
 // need it (but it is slower than this one).
 
+import org.ofbiz.base.util.Debug
+import org.ofbiz.base.util.ObjectType
 import org.ofbiz.entity.*
 import org.ofbiz.entity.condition.*
 import org.ofbiz.entity.transaction.*
@@ -138,7 +140,8 @@
         discontinuationDateCondition = EntityCondition.makeCondition(
                [
                 EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.EQUALS, null),
-                EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.GREATER_THAN, productsSoldThruTimestamp)
+                EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.GREATER_THAN,
+                ObjectType.simpleTypeConvert(productsSoldThruTimestamp, "Timestamp", null, null, false))
                ],
                EntityOperator.OR);
         whereConditionsList.add(discontinuationDateCondition);
@@ -246,15 +249,16 @@
 
             oneInventory = [:];
             oneInventory.productId = oneProd.productId;
-            oneInventory.minimumStock = oneProd.minimumStock;
-            oneInventory.reorderQuantity = oneProd.reorderQuantity;
-            oneInventory.daysToShip = oneProd.daysToShip;
+            oneInventory.minimumStock = oneProd.getString("minimumStock");
+            oneInventory.reorderQuantity = oneProd.getString("reorderQuantity");
+            oneInventory.daysToShip = oneProd.getString("daysToShip");
             oneInventory.totalQuantityOnHand = oneProd.totalQuantityOnHandTotal;
             oneInventory.totalAvailableToPromise = oneProd.totalAvailableToPromiseTotal;
             oneInventory.offsetQOHQtyAvailable = offsetQOHQtyAvailable;
             oneInventory.offsetATPQtyAvailable = offsetATPQtyAvailable;
             oneInventory.quantityOnOrder = InventoryWorker.getOutstandingPurchasedQuantity(oneProd.productId, delegator);
 
+            
             if (checkTime) {
             
                 // Make a query against the sales usage view entity
@@ -354,7 +358,7 @@
         // after rolling back, rethrow the exception
         throw e;
     } finally {
-        if (prodsEli) {
+        if (prodsEli != null) {
             try {
                 prodsEli.close();
             } catch (Exception exc) {}