details:   https://code.openbravo.com/erp/devel/pi/rev/07c5c7f6a897
changeset: 32405:07c5c7f6a897
user:      Armaignac <collazoandy4 <at> gmail.com>
date:      Thu Jun 29 15:30:59 2017 -0400
summary:   Fixes issue 36237: Internal Consumption is creating transaction for 
non stocked

The transactions created for the consumption lines doesn't take into account if
the product is not stocked. Now a join is made to select only the consumption 
lines
with stocked products

diffstat:

 src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST1.xml |  13 
++++++---
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r d960f963e0ff -r 07c5c7f6a897 
src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST1.xml
--- a/src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST1.xml  Tue Jul 
04 10:08:49 2017 +0200
+++ b/src-db/database/model/functions/M_INTERNAL_CONSUMPTION_POST1.xml  Thu Jun 
29 15:30:59 2017 -0400
@@ -22,7 +22,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) 2012-2016 Openbravo SLU
+* All portions are Copyright (C) 2012-2017 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -138,10 +138,13 @@
       Cur_MoveLine RECORD;
     BEGIN
       FOR Cur_MoveLine IN (
-          SELECT *
-          FROM M_Internal_ConsumptionLine
-          WHERE M_Internal_Consumption_ID=Record_ID
-          ORDER BY Line
+          SELECT icl.*
+          FROM M_Internal_ConsumptionLine icl
+          JOIN M_Product p
+          ON icl.M_Product_ID = p.M_Product_ID
+          WHERE icl.M_Internal_Consumption_ID = Record_ID
+          AND p.IsStocked = 'Y'
+          ORDER BY icl.Line
       ) LOOP
         v_ResultStr:='Transaction for line' || Cur_MoveLine.Line;
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to