details:   https://code.openbravo.com/erp/devel/pi/rev/3d6754bc564f
changeset: 23504:3d6754bc564f
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Wed Jun 18 14:21:18 2014 +0530
summary:   Fixes Issue 26199:Set Post Disabled status if work effort has total 
cost zero

diffstat:

 src/org/openbravo/erpCommon/ad_forms/DocProduction.java |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r 8e54e76894f2 -r 3d6754bc564f 
src/org/openbravo/erpCommon/ad_forms/DocProduction.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocProduction.java   Wed Jun 18 
09:45:39 2014 +0000
+++ b/src/org/openbravo/erpCommon/ad_forms/DocProduction.java   Wed Jun 18 
14:21:18 2014 +0530
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2008-2012 Openbravo SLU
+ * All portions are Copyright (C) 2008-2014 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -166,6 +166,17 @@
     String Fact_Acct_Group_ID = SequenceIdData.getUUID();
     log4jDocProduction.debug("createFact - object created");
     // Lines
+    int countProductionlinesWithTrnCostZero = 0;
+    for (int i = 0; i < p_lines.length; i++) {
+      DocLine_Material line = (DocLine_Material) p_lines[i];
+      if (line.transaction.getTransactionCost() != null
+          && line.transaction.getTransactionCost().compareTo(ZERO) == 0) {
+        countProductionlinesWithTrnCostZero++;
+      }
+    }
+    if (p_lines.length == countProductionlinesWithTrnCostZero) {
+      setStatus(STATUS_DocumentDisabled);
+    }
     fact = new Fact(this, as, Fact.POST_Actual);
     for (int i = 0; p_lines != null && i < p_lines.length; i++) {
       DocLine_Material line = (DocLine_Material) p_lines[i];

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to