details:   https://code.openbravo.com/erp/devel/pi/rev/f371e1261fd9
changeset: 23448:f371e1261fd9
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Tue Jun 03 19:54:57 2014 +0530
summary:   Fixes Issue 26541:Qty of P+ & P- products in Work effort should not 
be negative

details:   https://code.openbravo.com/erp/devel/pi/rev/54207c92f56c
changeset: 23449:54207c92f56c
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Thu Jun 05 16:10:17 2014 +0530
summary:   Fixes Issue 26171:Sets default warehouse in SalesOrder if its in on 
hand WH

diffstat:

 src-db/database/model/functions/MA_WORKEFFORT_VALIDATE.xml         |  36 
++++++++++
 src-db/database/sourcedata/AD_MESSAGE.xml                          |  12 +++
 src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java     |   5 +
 src/org/openbravo/erpCommon/ad_callouts/SE_Order_Organization.java |   9 +-
 4 files changed, 58 insertions(+), 4 deletions(-)

diffs (109 lines):

diff -r 3f6f5b7a0a45 -r 54207c92f56c 
src-db/database/model/functions/MA_WORKEFFORT_VALIDATE.xml
--- a/src-db/database/model/functions/MA_WORKEFFORT_VALIDATE.xml        Thu Jun 
05 13:25:41 2014 +0200
+++ b/src-db/database/model/functions/MA_WORKEFFORT_VALIDATE.xml        Thu Jun 
05 16:10:17 2014 +0530
@@ -232,6 +232,42 @@
         FINISH_PROCESS:=TRUE;
       END IF;
     END IF; --FINISH_PROCESS
+    --Check negative quantities for P+ and P- in Production Line if its a Work 
Effort
+    IF(NOT FINISH_PROCESS) THEN
+                       v_Message := NULL;
+                       v_Count:=0;
+                       SELECT COUNT(M_ProductionPlan_ID)
+        INTO v_Count
+        FROM M_ProductionPlan pp
+        WHERE pp.M_Production_ID = v_Record_ID
+        AND EXISTS
+        (SELECT 1 FROM M_ProductionLine
+        WHERE M_ProductionPlan_ID = pp.M_ProductionPlan_ID
+        AND pp.MA_Wrphase_ID IS NOT NULL
+        AND MovementQty < 0);
+                       IF (v_Count <> 0) THEN
+                               FOR Cur_ProductionPlan IN (
+                               SELECT PP.Line AS PPLine, PL.LINE AS PLLine
+                               FROM M_ProductionLine PL,
+                               M_ProductionPlan PP
+                               WHERE PL.M_ProductionPlan_ID = 
PP.M_ProductionPlan_ID
+                               AND PP.M_Production_ID = v_Record_ID
+                               AND PL.MovementQty < 0
+                               AND PP.MA_WrPhase_ID IS NOT NULL
+                               ORDER BY PP.Line, PL.Line
+                               )
+                               LOOP
+                                       IF v_Message IS NULL THEN
+                                               
v_Message:=Cur_ProductionPlan.PPLine||'-'||Cur_ProductionPlan.PLLine;
+                                       ELSE
+                                               v_Message:=v_Message || ', ' || 
Cur_ProductionPlan.PPLine||'-'||Cur_ProductionPlan.PLLine;
+                                       END IF;
+                               END LOOP;
+                               
v_Message:='@NoNegativeMovementQtyInWorkEffortProductLine@'||v_Message;
+                               RAISE_APPLICATION_ERROR(-20000, v_Message);
+        FINISH_PROCESS:=TRUE;
+                       END IF;
+    END IF;
     --Check if exist any product in a productionplan with the same locator and 
productiontype P+ and P-
     IF(NOT FINISH_PROCESS) THEN
       SELECT COUNT(*)
diff -r 3f6f5b7a0a45 -r 54207c92f56c src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml Thu Jun 05 13:25:41 2014 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml Thu Jun 05 16:10:17 2014 +0530
@@ -23410,6 +23410,18 @@
 <!--C8433C64354D44C6A76F2A09CAF85907-->  
<ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--C8433C64354D44C6A76F2A09CAF85907--></AD_MESSAGE>
 
+<!--C8534B0B881B4E7E9082A1E5BECB3B53--><AD_MESSAGE>
+<!--C8534B0B881B4E7E9082A1E5BECB3B53-->  
<AD_MESSAGE_ID><![CDATA[C8534B0B881B4E7E9082A1E5BECB3B53]]></AD_MESSAGE_ID>
+<!--C8534B0B881B4E7E9082A1E5BECB3B53-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C8534B0B881B4E7E9082A1E5BECB3B53-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C8534B0B881B4E7E9082A1E5BECB3B53-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C8534B0B881B4E7E9082A1E5BECB3B53-->  
<VALUE><![CDATA[NoNegativeMovementQtyInWorkEffortProductLine]]></VALUE>
+<!--C8534B0B881B4E7E9082A1E5BECB3B53-->  <MSGTEXT><![CDATA[Negative quantities 
are not allowed for P+ and P- products in Work Effort. Check 
ProductionRunLineNo-ProductLineNo. ]]></MSGTEXT>
+<!--C8534B0B881B4E7E9082A1E5BECB3B53-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--C8534B0B881B4E7E9082A1E5BECB3B53-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C8534B0B881B4E7E9082A1E5BECB3B53-->  
<ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--C8534B0B881B4E7E9082A1E5BECB3B53--></AD_MESSAGE>
+
 <!--C908626CE5A44AA0966E71C20ED3ECC1--><AD_MESSAGE>
 <!--C908626CE5A44AA0966E71C20ED3ECC1-->  
<AD_MESSAGE_ID><![CDATA[C908626CE5A44AA0966E71C20ED3ECC1]]></AD_MESSAGE_ID>
 <!--C908626CE5A44AA0966E71C20ED3ECC1-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r 3f6f5b7a0a45 -r 54207c92f56c 
src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java    Thu Jun 
05 13:25:41 2014 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_Order_BPartner.java    Thu Jun 
05 16:10:17 2014 +0530
@@ -138,6 +138,11 @@
       }
 
       for (int i = 0; i < td.length; i++) {
+        // If user's default warehouse [Login Warehouse] is present in the 
warehouse list, set it as
+        // selected
+        if (td[i].getField("id").equals(info.vars.getWarehouse())) {
+          strMwarehouse = info.vars.getWarehouse();
+        }
         info.addSelectResult(td[i].getField("id"), td[i].getField("name"), 
td[i].getField("id")
             .equalsIgnoreCase(strMwarehouse));
       }
diff -r 3f6f5b7a0a45 -r 54207c92f56c 
src/org/openbravo/erpCommon/ad_callouts/SE_Order_Organization.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_Order_Organization.java        
Thu Jun 05 13:25:41 2014 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_Order_Organization.java        
Thu Jun 05 16:10:17 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) 2013 Openbravo SLU 
+ * All portions are Copyright (C) 2013-2014 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -52,9 +52,10 @@
 
     try {
       ComboTableData comboTableData = new ComboTableData(info.vars, this, 
"TABLE",
-          "M_Warehouse_ID", "197", "C4053C0CD3DC420A9924F24FC1F860A0", 
Utility.getReferenceableOrg(
-              info.vars, info.vars.getStringParameter("inpadOrgId")), 
Utility.getContext(this,
-              info.vars, "#User_Client", info.getWindowId()), 0);
+          "M_Warehouse_ID", "197", strinpissotrx.equals("Y") ? 
"C4053C0CD3DC420A9924F24FC1F860A0"
+              : "", Utility.getReferenceableOrg(info.vars,
+              info.vars.getStringParameter("inpadOrgId")), 
Utility.getContext(this, info.vars,
+              "#User_Client", info.getWindowId()), 0);
       Utility.fillSQLParameters(this, info.vars, null, comboTableData, 
info.getWindowId(), "");
       td = comboTableData.select(false);
       comboTableData = null;

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to