details:   https://code.openbravo.com/erp/devel/pi/rev/861974c450d8
changeset: 20491:861974c450d8
user:      Sandra Huguet <sandra.huguet <at> openbravo.com>
date:      Tue May 28 17:40:59 2013 +0200
summary:   Fixed bug 23541 It is not allow negative quantities in BOMProducts

diffstat:

 src-db/database/sourcedata/AD_MESSAGE.xml             |  12 ++++++++++++
 src/org/openbravo/erpCommon/ad_process/VerifyBOM.java |   7 +++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diffs (39 lines):

diff -r f6a4fd1a4a26 -r 861974c450d8 src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml Wed May 29 12:16:05 2013 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml Tue May 28 17:40:59 2013 +0200
@@ -21409,6 +21409,18 @@
 <!--A007BE413E154F23B3CAA4BA40153736-->  
<ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--A007BE413E154F23B3CAA4BA40153736--></AD_MESSAGE>
 
+<!--A01BC7E3D1804395A64CD6C78B4EE4A9--><AD_MESSAGE>
+<!--A01BC7E3D1804395A64CD6C78B4EE4A9-->  
<AD_MESSAGE_ID><![CDATA[A01BC7E3D1804395A64CD6C78B4EE4A9]]></AD_MESSAGE_ID>
+<!--A01BC7E3D1804395A64CD6C78B4EE4A9-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A01BC7E3D1804395A64CD6C78B4EE4A9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A01BC7E3D1804395A64CD6C78B4EE4A9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A01BC7E3D1804395A64CD6C78B4EE4A9-->  
<VALUE><![CDATA[BOM_NegativeQty]]></VALUE>
+<!--A01BC7E3D1804395A64CD6C78B4EE4A9-->  <MSGTEXT><![CDATA[It is not allowed 
to insert negative quantities in BOM Products]]></MSGTEXT>
+<!--A01BC7E3D1804395A64CD6C78B4EE4A9-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--A01BC7E3D1804395A64CD6C78B4EE4A9-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--A01BC7E3D1804395A64CD6C78B4EE4A9-->  
<ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--A01BC7E3D1804395A64CD6C78B4EE4A9--></AD_MESSAGE>
+
 <!--A028CFDE75274327BF364041696938AE--><AD_MESSAGE>
 <!--A028CFDE75274327BF364041696938AE-->  
<AD_MESSAGE_ID><![CDATA[A028CFDE75274327BF364041696938AE]]></AD_MESSAGE_ID>
 <!--A028CFDE75274327BF364041696938AE-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r f6a4fd1a4a26 -r 861974c450d8 
src/org/openbravo/erpCommon/ad_process/VerifyBOM.java
--- a/src/org/openbravo/erpCommon/ad_process/VerifyBOM.java     Wed May 29 
12:16:05 2013 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/VerifyBOM.java     Tue May 28 
17:40:59 2013 +0200
@@ -56,6 +56,13 @@
             OBContext.getOBContext().getLanguage().getLanguage()));
       }
 
+      for (ProductBOM productBom : productBOMList) {
+        if (productBom.getBOMQuantity().floatValue() < 0) {
+          throw new Exception(Utility.messageBD(new DalConnectionProvider(), 
"BOM_NegativeQty",
+              OBContext.getOBContext().getLanguage().getLanguage()));
+        }
+      }
+
       boolean cycle = checkForcycles(productList, productBOMList);
 
       if (cycle) {

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to