Fixes Issue 30201. Fixes issue with more than 1000 Transactions in
authorDavid Miguelez <david.miguelez@openbravo.com>
Fri, 26 Jun 2015 13:14:29 +0200
changeset 27158 b9068c9d09d1
parent 27157 d7e8168bd47b
child 27159 f5b89bd131a9
Fixes Issue 30201. Fixes issue with more than 1000 Transactions in
Skip Status.
Also, removes Transactions in Skip Status from the Query to improve
performance.
src/org/openbravo/costing/CostingBackground.java
--- a/src/org/openbravo/costing/CostingBackground.java	Thu Jun 25 18:56:49 2015 +0200
+++ b/src/org/openbravo/costing/CostingBackground.java	Fri Jun 26 13:14:29 2015 +0200
@@ -112,6 +112,7 @@
               trxId);
           if ("S".equals(transaction.getCostingStatus())) {
             // Do not calculate trx in skip status.
+            transaction.setProcessed(true);
             continue;
           }
           log4j.debug("Start transaction process: " + transaction.getId());
@@ -211,7 +212,7 @@
     where.append(" join trx." + MaterialTransaction.PROPERTY_PRODUCT + " as p");
     where.append("\n , " + org.openbravo.model.ad.domain.List.ENTITY_NAME + " as trxtype");
     where.append("\n where trx." + MaterialTransaction.PROPERTY_ISPROCESSED + " = false");
-    where.append("   and trx." + MaterialTransaction.PROPERTY_ISCOSTCALCULATED + " = false");
+    where.append("   and trx." + MaterialTransaction.PROPERTY_COSTINGSTATUS + " <> 'S'");
     where.append("   and p." + Product.PROPERTY_PRODUCTTYPE + " = 'I'");
     where.append("   and p." + Product.PROPERTY_STOCKED + " = true");
     where.append("   and trxtype." + CostAdjustmentUtils.propADListReference + ".id = :refid");
@@ -246,7 +247,7 @@
     where.append(" join trx." + MaterialTransaction.PROPERTY_PRODUCT + " as p");
     where.append("\n , " + org.openbravo.model.ad.domain.List.ENTITY_NAME + " as trxtype");
     where.append("\n where trx." + MaterialTransaction.PROPERTY_ISPROCESSED + " = false");
-    where.append("   and trx." + MaterialTransaction.PROPERTY_ISCOSTCALCULATED + " = false");
+    where.append("   and trx." + MaterialTransaction.PROPERTY_COSTINGSTATUS + " <> 'S'");
     where.append("   and p." + Product.PROPERTY_PRODUCTTYPE + " = 'I'");
     where.append("   and p." + Product.PROPERTY_STOCKED + " = true");
     where.append("   and trxtype." + CostAdjustmentUtils.propADListReference + ".id = :refid");