fixed bug 23008: Bom non-stocked is not working correctly
authorNaiara Martinez <naiara.martinez@openbravo.com>
Wed, 27 Feb 2013 17:16:35 +0100
changeset 19828 2e4dccb63f7d
parent 19827 6525ba36c962
child 19829 4446edd73038
fixed bug 23008: Bom non-stocked is not working correctly
src-db/database/model/functions/C_INVOICE_CREATE.xml
src-db/database/model/functions/C_INVOICE_POST.xml
src-db/database/model/functions/C_ORDER_POST1.xml
src-db/database/model/functions/M_EXPLODEBOMNOTSTOCK.xml
src-db/database/model/functions/M_INOUTEXPLODEBOMNOTSTOCK.xml
src-db/database/model/functions/M_INOUT_CREATE.xml
src-db/database/model/functions/M_INOUT_POST.xml
src-db/database/model/functions/M_INVEXPLODEBOMNOTSTOCK.xml
src-db/database/model/tables/C_INVOICELINE.xml
src-db/database/model/tables/C_ORDERLINE.xml
src-db/database/model/tables/M_INOUTLINE.xml
src-db/database/sourcedata/AD_AUXILIARINPUT.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_MESSAGE.xml
src-db/database/sourcedata/AD_PROCESS.xml
src-db/database/sourcedata/AD_TAB.xml
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice.html
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice.xml
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment.html
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment.xml
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO.html
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO.xml
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql
--- a/src-db/database/model/functions/C_INVOICE_CREATE.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/model/functions/C_INVOICE_CREATE.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -130,7 +130,8 @@
           ol.taxbaseamt,
           ol.gross_unit_price,
           ol.grosspricestd,
-          ol.grosspricelist
+          ol.grosspricelist, 
+          sl.explode
         FROM M_INOUT s, M_INOUTLINE sl
         RIGHT JOIN C_ORDERLINE ol
           ON sl.C_OrderLine_ID=ol.C_OrderLine_ID
@@ -526,7 +527,8 @@
                     C_Invoice_ID, C_OrderLine_ID, M_InOutLine_ID, Line,
                     Description, M_Product_ID, QtyInvoiced, PriceList,
                     PriceActual, PriceLimit, LineNetAmt, C_Charge_ID,
-                    ChargeAmt, C_UOM_ID, C_Tax_ID, PriceStd
+                    ChargeAmt, C_UOM_ID, C_Tax_ID, PriceStd, 
+                    explode, bom_parent_id 
                   )
                   VALUES
                   (
@@ -535,7 +537,13 @@
                     p_Invoice_ID, NULL, NULL, v_LineNo,
                     v_Reference, NULL, 0, 0,
                     0, 0, 0, NULL,
-                    0, NULL, NULL, 0
+                    0, NULL, NULL, 0, 
+                    ptr_ol.explode, (SELECT c_invoiceline_id 
+                                            FROM c_invoiceline 
+                                            WHERE c_invoice_id=p_Invoice_ID 
+                                               and c_orderline_id = (SELECT BOM_parent_id 
+                                                                     FROM c_orderline 
+                                                                     WHERE c_orderline_id = ptr_ol.c_orderline_id))
                   )
                   ;
               END IF;
@@ -612,7 +620,8 @@
                         m_attributesetinstance_id, taxbaseamt,
                         gross_unit_price, line_gross_amount,
                         grosspricestd, grosspricelist,
-                        isdeferred, defplantype, periodnumber, c_period_id                        
+                        isdeferred, defplantype, periodnumber, c_period_id,
+                        explode, bom_parent_id                        
                       )
                       VALUES
                       (
@@ -627,7 +636,13 @@
                         ptr_ol.m_attributesetinstance_id, ptr_ol.taxbaseamt,
                         ptr_ol.gross_unit_price, C_Currency_Round(v_Qty*ptr_ol.gross_unit_price, Cur_Order.C_Currency_ID, NULL),
                         COALESCE(ptr_ol.grosspricestd,0), COALESCE(ptr_ol.grosspricelist,0),
-                        v_isdeferred_inv, v_defplantype_inv, v_periodnumber_inv, v_period_inv
+                        v_isdeferred_inv, v_defplantype_inv, v_periodnumber_inv, v_period_inv,
+                        ptr_ol.explode, (SELECT c_invoiceline_id 
+                                            FROM c_invoiceline 
+                                            WHERE c_invoice_id=p_Invoice_ID 
+                                               and c_orderline_id = (SELECT BOM_parent_id 
+                                                                     FROM c_orderline 
+                                                                     WHERE c_orderline_id = ptr_ol.c_orderline_id))
                       )
                       ;
                   END IF;--Next_O_Line
@@ -702,7 +717,8 @@
                         m_attributesetinstance_id, taxbaseamt,
                         gross_unit_price, line_gross_amount,
                         grosspricestd, grosspricelist,
-                        isdeferred, defplantype, periodnumber, c_period_id
+                        isdeferred, defplantype, periodnumber, c_period_id, 
+                        explode, bom_parent_id
                       )
                       VALUES
                       (
@@ -717,7 +733,13 @@
                         ptr_sl.m_attributesetinstance_id, ptr_sl.taxbaseamt,
                         ptr_sl.gross_unit_price, C_Currency_Round(ptr_sl.MovementQty*ptr_sl.gross_unit_price, Cur_Order.C_Currency_ID, NULL),
                         COALESCE(ptr_sl.grosspricestd,0), COALESCE(ptr_sl.grosspricelist,0),
-                        v_isdeferred_inv, v_defplantype_inv, v_periodnumber_inv, v_period_inv
+                        v_isdeferred_inv, v_defplantype_inv, v_periodnumber_inv, v_period_inv,
+                        ptr_sl.explode, (SELECT c_invoiceline_id 
+                                            FROM c_invoiceline 
+                                            WHERE c_invoice_id=p_Invoice_ID 
+                                               and c_orderline_id = (SELECT BOM_parent_id 
+                                                                     FROM c_orderline 
+                                                                     WHERE c_orderline_id = ptr_sl.c_orderline_id))
                       )
                       ;
                   END IF;--Next_S_Line
@@ -860,7 +882,8 @@
                 ol.taxbaseamt, o.fin_paymentmethod_id,
                 pl.istaxincluded,
                 ol.grosspricestd,
-                ol.grosspricelist
+                ol.grosspricelist, 
+                sl.explode, sl.bom_parent_id
               FROM M_INOUT sh,
                 M_INOUTLINE sl,
                 C_ORDER o,
@@ -1232,7 +1255,8 @@
                     grosspricestd, grosspricelist,
                     isdeferred, defplantype, periodnumber, c_period_id,
                     c_project_id, c_costcenter_id, a_asset_id,
-                    user1_id, user2_id
+                    user1_id, user2_id,
+                    explode, bom_parent_id
                   )
                   VALUES
                   (
@@ -1249,7 +1273,13 @@
                     COALESCE(Cur_InvoiceSchedule.grosspricestd,0), COALESCE(Cur_InvoiceSchedule.grosspricelist,0),
                     v_isdeferred_inv, v_defplantype_inv, v_periodnumber_inv, v_period_inv,
                     coalesce(Cur_InvoiceSchedule.line_c_project_id, Cur_InvoiceSchedule.c_project_id), coalesce(Cur_InvoiceSchedule.line_c_costcenter_id, Cur_InvoiceSchedule.c_costcenter_id), coalesce(Cur_InvoiceSchedule.line_a_asset_id,Cur_InvoiceSchedule.a_asset_id),
-                    coalesce(Cur_InvoiceSchedule.line_user1_id, Cur_InvoiceSchedule.user1_id), coalesce(Cur_InvoiceSchedule.line_user2_id, Cur_InvoiceSchedule.user2_id)
+                    coalesce(Cur_InvoiceSchedule.line_user1_id, Cur_InvoiceSchedule.user1_id), coalesce(Cur_InvoiceSchedule.line_user2_id, Cur_InvoiceSchedule.user2_id),
+                    Cur_InvoiceSchedule.explode, (SELECT c_invoiceline_id 
+                                            FROM c_invoiceline 
+                                            WHERE c_invoice_id=p_Invoice_ID 
+                                               and c_orderline_id = (SELECT BOM_parent_id 
+                                                                     FROM c_orderline 
+                                                                     WHERE c_orderline_id = Cur_InvoiceSchedule.c_orderline_id))
                   )
                   ;
                 v_DateOrdered:=COALESCE(Cur_InvoiceSchedule.movementDate, COALESCE(Cur_InvoiceSchedule.DateOrdered, now())) ;
--- a/src-db/database/model/functions/C_INVOICE_POST.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/model/functions/C_INVOICE_POST.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -1069,192 +1069,30 @@
     /**************************************************************************
      * Resolve not-stocked BOMs
      *************************************************************************/
-    DECLARE
+   DECLARE
       -- Invoice Lines with non-stocked BOMs
       CUR_BOM_Line RECORD;
-      CUR_BOM RECORD;
-      CUR_PriceList_Version RECORD;
-      --
-      CountNo NUMBER;
-      v_PriceList_Version_ID VARCHAR2(32);
-      v_Line NUMBER;
-      v_ChargeAmt NUMBER;
-      -- v_Offer_ID       varchar2(32);
-      v_DateInvoiced DATE;
-      v_BPartner_ID VARCHAR2(32);
-      v_PriceList_ID VARCHAR2(32);
       --
     BEGIN
       v_ResultStr:='ResolveBOM';
-      LOOP
-        -- How many BOMs do we have:1
-        SELECT COUNT(*) INTO CountNo
-        FROM C_INVOICELINE l
-        WHERE l.C_Invoice_ID=v_Record_ID
-          AND EXISTS
+      FOR CUR_BOM_Line IN
+        (SELECT *
+         FROM C_INVOICELINE l
+         WHERE l.C_Invoice_ID=v_Record_ID
+           AND l.IsActive='Y'
+           AND l.explode='N'
+           AND EXISTS
               (SELECT *
                FROM M_PRODUCT p
                WHERE l.M_Product_ID=p.M_Product_ID
                  AND p.IsBOM='Y'
                  AND p.IsStocked='N'
                  AND p.productType='I'
-              );
-        -- Nothing to do:2
-        EXIT WHEN CountNo=0;
-        DBMS_OUTPUT.PUT_LINE('  BOMs to resolve=' || CountNo) ;
-        -- Get Price List Version
-        FOR CUR_PriceList_Version IN
-          (SELECT COALESCE(v.M_PriceList_Version_ID, '0') AS PriceList_Version_ID, o.M_PriceList_ID AS M_PriceLIst_ID
-           FROM M_PRICELIST_VERSION v, C_INVOICE o
-           WHERE v.M_PriceList_ID=o.M_PriceList_ID
-             AND v.ValidFrom<=COALESCE(o.DateOrdered, o.DateInvoiced)
-             AND v.IsActive='Y'
-             AND o.C_Invoice_ID=v_Record_ID
-           ORDER BY v.ValidFrom DESC
-          )
-        LOOP
-          v_PriceList_Version_ID:=CUR_PriceList_Version.PriceList_Version_ID;
-          v_PriceList_ID := CUR_PriceList_Version.M_PriceList_ID;
-          EXIT;
-        END LOOP;
-        --Reference Date for price DateOrdered
-        SELECT C_BPARTNER_ID, DATEORDERED
-          INTO v_BPartner_ID, v_DateInvoiced
-        FROM C_INVOICE
-        WHERE C_INVOICE_ID=v_Record_ID;
-        -- Replace Lines
-        FOR CUR_BOM_Line IN
-          (SELECT *
-           FROM C_INVOICELINE l
-           WHERE l.C_Invoice_ID=v_Record_ID
-             AND IsActive='Y'
-             AND EXISTS
-                (SELECT *
-                 FROM M_PRODUCT p
-                 WHERE l.M_Product_ID=p.M_Product_ID
-                   AND p.IsBOM='Y'
-                   AND p.IsStocked='N'
-                   AND p.productType='I'
-                 )
-           ORDER BY l.Line  FOR UPDATE
-          )
-        LOOP
-          v_Line:=CUR_BOM_Line.Line;
-          -- One Time variables
-          v_ChargeAmt:=CUR_BOM_Line.ChargeAmt;
-          -- Create New Lines
-          FOR CUR_BOM IN
-            (SELECT b.M_ProductBOM_ID, p.C_UOM_ID, b.BOMQty, b.Description,
-							revplantype, isdeferredrevenue, periodnumber, defaultperiod,
-							expplantype, isdeferredexpense, periodnumber_exp, defaultperiod_exp
-             FROM M_PRODUCT_BOM b, M_PRODUCT p
-             WHERE b.M_Product_ID=CUR_BOM_Line.M_Product_ID
-               AND b.M_ProductBOM_ID=p.M_Product_ID
-               AND b.isactive = 'Y'
-             ORDER BY Line
-            )
-          LOOP
-            v_Line:=v_Line + 10;
-            --     v_Offer_ID := M_GET_OFFER(v_DateInvoiced, v_BPartner_ID, CUR_BOM.M_ProductBOM_ID);
-            /* INSERT INTO C_INVOICELINE
-              (C_InvoiceLine_ID,
-               AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,
-                C_Invoice_ID,Line,
-                Description,
-                M_Product_ID,C_UOM_ID,
-                QtyInvoiced,
-                PriceList,PriceActual,PriceLimit,LineNetAmt,
-                C_Charge_ID,ChargeAmt,
-                C_Tax_ID,
-                PriceStd)
-              VALUES
-                (v_NextNo,
-                CUR_BOM_Line.AD_Client_ID,CUR_BOM_Line.AD_Org_ID,CUR_BOM_Line.IsActive,now(),v_UpdatedBy,now(),v_UpdatedBy,
-                CUR_BOM_Line.C_Invoice_ID,v_Line,
-                CUR_BOM.Description,
-                CUR_BOM.M_ProductBOM_ID, CUR_BOM.C_UOM_ID,
-                CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty,
-                M_BOM_PriceList(CUR_BOM.M_ProductBOM_ID, PriceList_Version_ID),M_GET_OFFER_PRICE(v_Offer_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, PriceList_Version_ID)td),
-                M_BOM_PriceLimit(CUR_BOM.M_ProductBOM_ID, PriceList_Version_ID),
-                M_GET_OFFER_PRICE(v_Offer_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, PriceList_Version_ID)) * CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty,
-                CUR_BOM_Line.C_Charge_ID,v_ChargeAmt,
-                CUR_BOM_Line.C_Tax_ID);
-                */
-            -- M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, PriceList_Version_ID), v_Offer_ID);
-            -- One Time variables
-                IF(CUR_BOM.M_ProductBOM_ID IS NOT NULL) THEN
-									IF(v_IsSOTrx = 'Y') THEN
-										v_period_inv:= c_get_default_period(CUR_BOM_Line.C_Invoice_ID, CUR_BOM.defaultperiod);
-										IF(v_period_inv IS NOT NULL AND CUR_BOM.isdeferredrevenue = 'Y') THEN
-											v_isdeferred_inv := CUR_BOM.isdeferredrevenue;
-											v_defplantype_inv := CUR_BOM.revplantype;
-											v_periodnumber_inv := CUR_BOM.periodnumber;
-									  ELSE
-									  	v_period_inv := NULL;
-											v_isdeferred_inv := 'N';
-											v_defplantype_inv := NULL;
-											v_periodnumber_inv := NULL;
-										END IF;
-									ELSE
-										v_period_inv:= c_get_default_period(CUR_BOM_Line.C_Invoice_ID, CUR_BOM.defaultperiod_exp);
-										IF(v_period_inv IS NOT NULL AND CUR_BOM.isdeferredexpense = 'Y') THEN
-											v_isdeferred_inv := CUR_BOM.isdeferredexpense;
-											v_defplantype_inv := CUR_BOM.expplantype;
-											v_periodnumber_inv := CUR_BOM.periodnumber_exp;
-									  ELSE
-									  	v_period_inv := NULL;
-											v_isdeferred_inv := 'N';
-											v_defplantype_inv := NULL;
-											v_periodnumber_inv := NULL;
-										END IF;
-									END IF;
-                END IF;
-            INSERT INTO C_INVOICELINE
-              (
-               C_InvoiceLine_ID, AD_Client_ID, AD_Org_ID, IsActive,
-               Created, CreatedBy, Updated, UpdatedBy,
-               C_Invoice_ID, Line, Description, M_Product_ID,
-               C_UOM_ID, QtyInvoiced, PriceList,
-               PriceActual,
-               PriceLimit, LineNetAmt, C_Charge_ID, ChargeAmt,
-               C_Tax_ID, PriceStd,
-               isdeferred, defplantype, periodnumber, c_period_id,
-               c_bpartner_id, c_project_id, c_projectline_id, a_asset_id,
-               user1_id, user2_id
-              )
-              VALUES
-              (
-               get_uuid(), CUR_BOM_Line.AD_Client_ID, CUR_BOM_Line.AD_Org_ID, CUR_BOM_Line.IsActive,
-               now(), v_UpdatedBy, now(), v_UpdatedBy,
-               CUR_BOM_Line.C_Invoice_ID, v_Line, CUR_BOM.Description, CUR_BOM.M_ProductBOM_ID,
-               CUR_BOM.C_UOM_ID, CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, M_BOM_PriceList(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
-               M_Get_Offers_Price(v_DateInvoiced, v_BPartner_ID, CUR_BOM.M_ProductBOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, v_PriceList_ID),
-               M_BOM_PriceLimit(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
-               M_Get_Offers_Price(v_DateInvoiced, v_BPartner_ID, CUR_BOM.M_ProductBOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, v_PriceList_ID) * CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, CUR_BOM_Line.C_Charge_ID, v_ChargeAmt,
-               CUR_BOM_Line.C_Tax_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
-               v_isdeferred_inv, v_defplantype_inv, v_periodnumber_inv, v_period_inv,
-               CUR_BOM_Line.c_bpartner_id, CUR_BOM_Line.c_project_id, CUR_BOM_Line.c_projectline_id, CUR_BOM_Line.a_asset_id,
-               CUR_BOM_Line.user1_id, CUR_BOM_Line.user2_id
-              );
-            v_ChargeAmt:=0;
-          END LOOP; -- Create New Lines
-          -- Convert into Comment Line
-          UPDATE C_INVOICELINE
-          SET M_Product_ID=NULL,
-              PriceList=0,
-              PriceActual=0,
-              PriceLimit=0,
-              LineNetAmt=0,
-              ChargeAmt=0,
-              Description=
-                (SELECT p.NAME || ' ' || COALESCE(TO_CHAR(C_INVOICELINE.Description), '')
-                 FROM M_PRODUCT p
-                 WHERE p.M_Product_ID=CUR_BOM_Line.M_Product_ID
-                ),
-              PriceStd=0,
-              M_Offer_ID=NULL
-          WHERE C_InvoiceLine_ID=CUR_BOM_Line.C_InvoiceLine_ID;
-        END LOOP; -- Replace Lines
+               )
+         ORDER BY l.Line  FOR UPDATE
+        )
+      LOOP
+        M_INVEXPLODEBOMNOTSTOCK(null, CUR_BOM_Line.c_invoiceline_ID);
       END LOOP; -- BOM Loop
     END;
   END IF;--FINISH_PROCESS
--- a/src-db/database/model/functions/C_ORDER_POST1.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/model/functions/C_ORDER_POST1.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -19,7 +19,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) 2001-2012 Openbravo SLU
+* All portions are Copyright (C) 2001-2013 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -945,144 +945,26 @@
         -- Order Lines with non-stocked BOMs
         CUR_BOM_Line RECORD;
         -- BOM Product List
-        CUR_BOM RECORD;
         CountNo NUMBER;
-        v_PriceList_Version_ID VARCHAR2(32);
-        NextNo varchar2(32);
-        v_Line NUMBER;
-        v_FreightAmt NUMBER;
-        v_ChargeAmt NUMBER;
-        v_Parner_ID VARCHAR2(32);
-        --v_PriceList_ID VARCHAR2(32);
       BEGIN
-        LOOP
-          -- How many BOMs do we have:3
-          SELECT COUNT(*)
-            INTO CountNo
-          FROM C_ORDERLINE l
-          WHERE l.C_Order_ID=v_Record_ID
-            AND EXISTS
+        FOR CUR_BOM_Line IN
+          (SELECT l.c_orderline_id
+           FROM C_ORDERLINE l
+           WHERE l.C_Order_ID=v_Record_ID
+             AND l.IsActive='Y'
+             AND l.explode='N'
+             AND EXISTS
                (SELECT *
                 FROM M_PRODUCT p
                 WHERE l.M_Product_ID=p.M_Product_ID
                   AND p.IsBOM='Y'
                   AND p.IsStocked='N'
                 )
-                ;
-          -- Nothing to do:4
-          EXIT WHEN CountNo=0;
-          DBMS_OUTPUT.PUT_LINE('  BOMs to resolve=' || CountNo) ;
-          DECLARE
-            Cur_MPriceListVersion RECORD;
-          BEGIN
-            -- last shipment
-            FOR Cur_MPriceListVersion IN
-               (SELECT COALESCE(v.M_PriceList_Version_ID, '0') AS PriceList_Version_ID, o.M_PriceList_ID
-                FROM M_PRICELIST_VERSION v, C_ORDER o
-                WHERE v.M_PriceList_ID=o.M_PriceList_ID
-                  AND v.ValidFrom<=o.DateOrdered
-                  AND v.IsActive='Y'
-                  AND o.C_Order_ID=v_Record_ID
-                ORDER BY v.ValidFrom DESC
-               )
-            LOOP
-              v_PriceList_Version_ID:=Cur_MPriceListVersion.PriceList_Version_ID;
-              -- v_PriceList_ID := Cur_MPriceListVersion.M_PriceList_Id;
-              EXIT;
-            END LOOP;
-          END;
-          -- Get Price List Version
-          -- Replace Lines
-          FOR CUR_BOM_Line IN
-             (SELECT *
-              FROM C_ORDERLINE l
-              WHERE l.C_Order_ID=v_Record_ID
-                AND IsActive='Y'
-                AND EXISTS
-                   (SELECT *
-                    FROM M_PRODUCT p
-                    WHERE l.M_Product_ID=p.M_Product_ID
-                      AND p.IsBOM='Y'
-                    AND p.IsStocked='N'
-                   )
-              ORDER BY l.Line  FOR UPDATE
+              ORDER BY l.Line
              )
-          LOOP
-            v_Line:=CUR_BOM_Line.Line;
-            -- One Time variables
-            v_FreightAmt:=CUR_BOM_Line.FreightAmt;
-            v_ChargeAmt:=CUR_BOM_Line.ChargeAmt;
-            -- Create New Lines
-            FOR CUR_BOM IN
-               (SELECT b.M_ProductBOM_ID, p.C_UOM_ID, b.BOMQty, b.Description
-                FROM M_PRODUCT_BOM b
-                      INNER JOIN M_PRODUCT p ON (b.M_ProductBOM_ID=p.M_Product_ID)
-                WHERE b.M_Product_ID=CUR_BOM_Line.M_Product_ID
-                AND b.isactive='Y'
-                ORDER BY Line
-               )
-            LOOP
-              Ad_Sequence_Next('C_OrderLine', CUR_BOM_Line.AD_Client_ID, NextNo) ;
-              v_Line:=v_Line + 1;
-              INSERT
-              INTO C_ORDERLINE
-                (
-                  C_OrderLine_ID, AD_Client_ID, AD_Org_ID, IsActive,
-                  Created, CreatedBy, Updated, UpdatedBy,
-                  C_Order_ID, Line, C_BPartner_ID, C_BPartner_Location_ID,
-                  DateOrdered, DatePromised, DateDelivered, DateInvoiced,
-                  Description, M_Product_ID, M_Warehouse_ID, DirectShip,
-                  C_UOM_ID, QtyOrdered, QtyReserved, QtyDelivered,
-                  QtyInvoiced, M_Shipper_ID, C_Currency_ID,
-                  PriceList,
-                  PriceActual, PriceLimit, LineNetAmt, Discount,
-                  FreightAmt, C_Charge_ID, ChargeAmt, C_Tax_ID,
-                  QuantityOrder, M_Product_Uom_ID, PriceStd,
-                  c_project_id, a_asset_id, c_costcenter_id,
-                  user1_id, user2_id
-                )
-              VALUES
-                (
-                  NextNo, CUR_BOM_Line.AD_Client_ID, CUR_BOM_Line.AD_Org_ID, CUR_BOM_Line.IsActive,
-                  now(), '0', now(), '0',
-                  CUR_BOM_Line.C_Order_ID, v_Line, CUR_BOM_Line.C_BPartner_ID, CUR_BOM_Line.C_BPartner_Location_ID,
-                  CUR_BOM_Line.DateOrdered, CUR_BOM_Line.DatePromised, CUR_BOM_Line.DateDelivered, CUR_BOM_Line.DateInvoiced,
-                  CUR_BOM.Description, CUR_BOM.M_ProductBOM_ID, CUR_BOM_Line.M_Warehouse_ID, CUR_BOM_Line.DirectShip,
-                  CUR_BOM.C_UOM_ID, CUR_BOM_Line.QtyOrdered*CUR_BOM.BOMQty, CUR_BOM_Line.QtyReserved*CUR_BOM.BOMQty, CUR_BOM_Line.QtyDelivered*CUR_BOM.BOMQty,
-                  CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, CUR_BOM_Line.M_Shipper_ID, CUR_BOM_Line.C_Currency_ID,
-                  M_BOM_PriceList(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
-                  M_Get_Offers_Price(CUR_BOM_Line.DateOrdered, v_CBPartner_ID, CUR_BOM.M_ProductBOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID), CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, v_PriceList_ID), M_BOM_PriceLimit(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
-                  M_Get_Offers_Price(CUR_BOM_Line.DateOrdered, v_CBPartner_ID, CUR_BOM.M_ProductBOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID), CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, v_PriceList_ID) * CUR_BOM_Line.QtyOrdered*CUR_BOM.BOMQty, CUR_BOM_Line.Discount,
-                  v_FreightAmt, CUR_BOM_Line.C_Charge_ID, v_ChargeAmt, CUR_BOM_Line.C_Tax_ID,
-                  CUR_BOM_Line.QuantityOrder, CUR_BOM_Line.M_Product_UOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
-                  CUR_BOM_Line.c_project_id, CUR_BOM_Line.a_asset_id, CUR_BOM_Line.c_costcenter_id,
-                  CUR_BOM_Line.user1_id, CUR_BOM_Line.user2_id
-                )
-              ; -- no Lot/SerNo for BOMs
-              -- One Time variables
-              v_FreightAmt:=0;
-              v_ChargeAmt:=0;
-            END LOOP; -- Create New Lines
-            -- Convert into Comment Line
-            UPDATE C_ORDERLINE
-            SET M_Product_ID=NULL,
-                PriceList=0,
-                PriceActual=0,
-                PriceLimit=0,
-                LineNetAmt=0,
-                FreightAmt=0,
-                ChargeAmt=0,
-                Description=
-                    (SELECT p.NAME || ' ' || COALESCE(TO_CHAR(C_ORDERLINE.Description), '')
-                    FROM M_PRODUCT p
-                    WHERE p.M_Product_ID=CUR_BOM_Line.M_Product_ID
-                    )
-                    ,
-                PriceStd=0,
-                M_Offer_ID=NULL
-            WHERE C_OrderLine_ID=CUR_BOM_Line.C_OrderLine_ID;
-          END LOOP; -- Replace Lines
-        END LOOP; -- BOM Loop
+        LOOP
+          M_EXPLODEBOMNOTSTOCK(null, CUR_BOM_Line.c_orderline_ID);
+        END LOOP;
       END;
     /**************************************************************************
       * Always check and (un) Reserve Inventory  (counterpart: M_InOut_Post)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/functions/M_EXPLODEBOMNOTSTOCK.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -0,0 +1,179 @@
+<?xml version="1.0"?>
+  <database name="FUNCTION M_EXPLODEBOMNOTSTOCK">
+    <function name="M_EXPLODEBOMNOTSTOCK" type="NULL">
+      <parameter name="p_pinstance_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <parameter name="p_orderline_id" type="VARCHAR" mode="in">
+        <default><![CDATA[null]]></default>
+      </parameter>
+      <body><![CDATA[/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* 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 Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+  -- Logistice
+  v_explode CHAR(1);
+  v_orderID VARCHAR2(32);
+  v_CBPartner_ID VARCHAR2(32);
+  v_PriceList_ID VARCHAR2(32);
+  v_PriceList_Version_ID VARCHAR2(32);
+  v_Record_ID VARCHAR2(32);
+  TYPE RECORD IS REF CURSOR;
+  Cur_Parameter RECORD;
+  Cur_MPriceListVersion RECORD;
+  CUR_BOM_Line RECORD;
+  CUR_BOM RECORD;
+  v_Line NUMBER:=0;
+  v_ResultStr VARCHAR2(2000):='';
+  v_result NUMBER:= 1;  
+  BEGIN
+  IF (p_PInstance_ID IS NOT NULL) THEN
+      --  Update AD_PInstance
+      DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || p_PInstance_ID) ;
+      v_ResultStr:='PInstanceNotFound';
+      AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'Y', NULL, NULL) ;
+      -- Get Parameters
+      v_ResultStr:='ReadingParameters';
+      FOR Cur_Parameter IN
+        (SELECT i.Record_ID, i.AD_User_ID, p.ParameterName, p.P_String,
+          p.P_Number, p.P_Date
+        FROM AD_PINSTANCE i
+        LEFT JOIN AD_PINSTANCE_PARA p
+          ON i.AD_PInstance_ID=p.AD_PInstance_ID
+        WHERE i.AD_PInstance_ID=p_PInstance_ID
+        ORDER BY p.SeqNo
+        )
+      LOOP
+        v_Record_ID:=Cur_Parameter.Record_ID;
+      END LOOP; -- Get Parameter
+  ELSE
+      v_Record_ID:=p_Orderline_ID;
+  END IF;
+    DBMS_OUTPUT.PUT_LINE('  Record_ID=' || v_Record_ID) ;
+  BEGIN --BODY
+     
+    SELECT C_ORDER.c_order_id, C_ORDER.c_bpartner_id, c_order.M_PriceList_ID, c_orderline.explode
+      INTO v_orderID, v_CBPartner_ID, v_PriceList_ID, v_explode
+    FROM C_ORDER JOIN m_pricelist ON c_order.m_pricelist_id = m_pricelist.m_pricelist_id JOIN c_orderline ON c_order.c_order_id = c_orderline.c_order_id
+    WHERE c_orderline.c_orderline_id=v_Record_ID  FOR UPDATE;
+
+    IF (v_explode = 'Y') THEN
+      v_ResultStr:='@ProdExploded@';
+      RAISE_APPLICATION_ERROR(-20000, '@ProdExploded@') ;
+    END IF;
+    
+    v_ResultStr:='Exploding';
+
+    -- Get Price List Version
+    FOR Cur_MPriceListVersion IN
+      (SELECT v.M_PriceList_Version_ID AS PriceList_Version_ID, o.M_PriceList_ID
+       FROM M_PRICELIST_VERSION v, C_ORDER o
+       WHERE v.M_PriceList_ID=o.M_PriceList_ID
+         AND v.ValidFrom<=o.DateOrdered
+         AND v.IsActive='Y'
+         AND o.C_Order_ID=v_orderID
+       ORDER BY v.ValidFrom DESC
+      )
+    LOOP
+      v_PriceList_Version_ID:=Cur_MPriceListVersion.PriceList_Version_ID;
+      EXIT;
+    END LOOP;
+ 
+    -- Replace Lines
+    v_ResultStr:='Inserting lines';
+    FOR CUR_BOM_Line IN
+      (SELECT *
+       FROM C_ORDERLINE l
+       WHERE l.C_Orderline_ID=v_Record_ID
+         AND IsActive='Y'
+         AND EXISTS
+           (SELECT *
+            FROM M_PRODUCT p
+            WHERE l.M_Product_ID=p.M_Product_ID
+              AND p.IsBOM='Y'
+              AND p.IsStocked='N'
+            )
+       ORDER BY l.Line  FOR UPDATE
+       )
+    LOOP
+      v_Line:=CUR_BOM_Line.Line;
+      -- Create New Lines
+      FOR CUR_BOM IN
+        (SELECT b.M_ProductBOM_ID, p.C_UOM_ID, b.BOMQty, b.Description
+         FROM M_PRODUCT_BOM b
+              INNER JOIN M_PRODUCT p ON (b.M_ProductBOM_ID=p.M_Product_ID)
+         WHERE b.M_Product_ID=CUR_BOM_Line.M_Product_ID
+           AND b.isactive='Y'
+         ORDER BY Line
+         )
+      LOOP
+        v_Line:=v_Line + 1;
+        INSERT
+        INTO C_ORDERLINE
+          (
+            C_OrderLine_ID, AD_Client_ID, AD_Org_ID, IsActive,
+            Created, CreatedBy, Updated, UpdatedBy,
+            C_Order_ID, Line, C_BPartner_ID, C_BPartner_Location_ID,
+            DateOrdered, DatePromised, DateDelivered, DateInvoiced,
+            Description, M_Product_ID, M_Warehouse_ID, DirectShip,
+            C_UOM_ID, QtyOrdered, QtyReserved, QtyDelivered,
+            QtyInvoiced, M_Shipper_ID, C_Currency_ID,
+            PriceList,
+            PriceActual, PriceLimit, LineNetAmt, Discount,
+            FreightAmt, C_Charge_ID, ChargeAmt, C_Tax_ID,
+            QuantityOrder, M_Product_Uom_ID, PriceStd,
+            c_project_id, a_asset_id, c_costcenter_id,
+            user1_id, user2_id, bom_parent_id
+          )
+        VALUES
+          (
+            get_uuid(), CUR_BOM_Line.AD_Client_ID, CUR_BOM_Line.AD_Org_ID, CUR_BOM_Line.IsActive,
+            now(), '0', now(), '0',
+            CUR_BOM_Line.C_Order_ID, v_Line, CUR_BOM_Line.C_BPartner_ID, CUR_BOM_Line.C_BPartner_Location_ID,
+            CUR_BOM_Line.DateOrdered, CUR_BOM_Line.DatePromised, CUR_BOM_Line.DateDelivered, CUR_BOM_Line.DateInvoiced,
+            CUR_BOM.Description, CUR_BOM.M_ProductBOM_ID, CUR_BOM_Line.M_Warehouse_ID, CUR_BOM_Line.DirectShip,
+            CUR_BOM.C_UOM_ID, CUR_BOM_Line.QtyOrdered*CUR_BOM.BOMQty, CUR_BOM_Line.QtyReserved*CUR_BOM.BOMQty, CUR_BOM_Line.QtyDelivered*CUR_BOM.BOMQty,
+            CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, CUR_BOM_Line.M_Shipper_ID, CUR_BOM_Line.C_Currency_ID,
+            M_BOM_PriceList(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
+            M_Get_Offers_Price(CUR_BOM_Line.DateOrdered, v_CBPartner_ID, CUR_BOM.M_ProductBOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID), CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, v_PriceList_ID), M_BOM_PriceLimit(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
+            M_Get_Offers_Price(CUR_BOM_Line.DateOrdered, v_CBPartner_ID, CUR_BOM.M_ProductBOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID), CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, v_PriceList_ID) * CUR_BOM_Line.QtyOrdered*CUR_BOM.BOMQty, CUR_BOM_Line.Discount,
+            CUR_BOM_Line.FreightAmt, CUR_BOM_Line.C_Charge_ID, CUR_BOM_Line.ChargeAmt, CUR_BOM_Line.C_Tax_ID,
+            CUR_BOM_Line.QuantityOrder, CUR_BOM_Line.M_Product_UOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
+            CUR_BOM_Line.c_project_id, CUR_BOM_Line.a_asset_id, CUR_BOM_Line.c_costcenter_id,
+            CUR_BOM_Line.user1_id, CUR_BOM_Line.user2_id, v_Record_ID
+          );
+      END LOOP; -- Create New Lines
+    END LOOP; -- Replace Lines
+    UPDATE c_orderline set explode='Y' where c_orderline_id = v_Record_ID;
+    
+    IF (p_PInstance_ID IS NOT NULL) THEN
+      DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ');
+      AD_UPDATE_PINSTANCE(p_pinstance_id, NULL, 'N', v_result, '');
+    END IF;
+   
+  END; --BODY
+EXCEPTION
+WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE(v_ResultStr) ;
+ v_ResultStr:= '@ERROR=' || SQLERRM;
+  DBMS_OUTPUT.PUT_LINE(v_ResultStr) ;
+  IF(p_PInstance_ID IS NOT NULL) THEN
+    ROLLBACK;
+    AD_UPDATE_PINSTANCE(p_pinstance_id, NULL, 'N', 0, v_resultstr);
+   END IF;
+END M_EXPLODEBOMNOTSTOCK
+]]></body>
+    </function>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/functions/M_INOUTEXPLODEBOMNOTSTOCK.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -0,0 +1,152 @@
+<?xml version="1.0"?>
+  <database name="FUNCTION M_INOUTEXPLODEBOMNOTSTOCK">
+    <function name="M_INOUTEXPLODEBOMNOTSTOCK" type="NULL">
+      <parameter name="p_pinstance_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <parameter name="p_inoutline_id" type="VARCHAR" mode="in">
+        <default><![CDATA[null]]></default>
+      </parameter>
+      <body><![CDATA[/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* 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 Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+  -- Logistice
+  v_explode CHAR(1);
+  v_inoutID VARCHAR2(32);
+  v_CBPartner_ID VARCHAR2(32);
+  v_PriceList_ID VARCHAR2(32);
+  v_PriceList_Version_ID VARCHAR2(32);
+  v_Record_ID VARCHAR2(32);
+  TYPE RECORD IS REF CURSOR;
+  Cur_Parameter RECORD;
+  Cur_MPriceListVersion RECORD;
+  CUR_BOM_Line RECORD;
+  CUR_BOM RECORD;
+  v_Line NUMBER:=0;
+  v_ResultStr VARCHAR2(2000):='';
+  v_result NUMBER:= 1;  
+  BEGIN
+  IF (p_PInstance_ID IS NOT NULL) THEN
+      --  Update AD_PInstance
+      DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || p_PInstance_ID) ;
+      v_ResultStr:='PInstanceNotFound';
+      AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'Y', NULL, NULL) ;
+      -- Get Parameters
+      v_ResultStr:='ReadingParameters';
+      FOR Cur_Parameter IN
+        (SELECT i.Record_ID, i.AD_User_ID, p.ParameterName, p.P_String,
+          p.P_Number, p.P_Date
+        FROM AD_PINSTANCE i
+        LEFT JOIN AD_PINSTANCE_PARA p
+          ON i.AD_PInstance_ID=p.AD_PInstance_ID
+        WHERE i.AD_PInstance_ID=p_PInstance_ID
+        ORDER BY p.SeqNo
+        )
+      LOOP
+        v_Record_ID:=Cur_Parameter.Record_ID;
+      END LOOP; -- Get Parameter
+  ELSE
+      v_Record_ID:=p_inoutline_ID;
+  END IF;
+    DBMS_OUTPUT.PUT_LINE('  Record_ID=' || v_Record_ID) ;
+  BEGIN --BODY
+     
+    SELECT M_INOUT.m_inout_id, M_INOUT.c_bpartner_id, m_inoutline.explode
+      INTO v_inoutID, v_CBPartner_ID, v_explode
+    FROM M_INOUT
+    JOIN m_inoutline ON M_INOUT.m_inout_id = m_inoutline.m_inout_id
+    WHERE m_inoutline.m_inoutline_id=v_Record_ID  FOR UPDATE;
+
+    IF (v_explode = 'Y') THEN
+      v_ResultStr:='@ProdExploded@';
+      RAISE_APPLICATION_ERROR(-20000, '@ProdExploded@') ;
+    END IF;
+    
+    v_ResultStr:='Exploding';
+ 
+    -- Replace Lines
+    v_ResultStr:='Inserting lines';
+    FOR CUR_BOM_Line IN
+      (SELECT *
+       FROM M_INOUTLINE l
+       WHERE l.m_inoutline_ID=v_Record_ID
+         AND IsActive='Y'
+         AND EXISTS
+           (SELECT *
+            FROM M_PRODUCT p
+            WHERE l.M_Product_ID=p.M_Product_ID
+              AND p.IsBOM='Y'
+              AND p.IsStocked='N'
+            )
+       ORDER BY l.Line  FOR UPDATE
+       )
+    LOOP
+      v_Line:=CUR_BOM_Line.Line;
+      -- Create New Lines
+      FOR CUR_BOM IN
+        (SELECT b.M_ProductBOM_ID, p.C_UOM_ID, b.BOMQty, b.Description
+         FROM M_PRODUCT_BOM b
+              INNER JOIN M_PRODUCT p ON (b.M_ProductBOM_ID=p.M_Product_ID)
+         WHERE b.M_Product_ID=CUR_BOM_Line.M_Product_ID
+           AND b.isactive='Y'
+         ORDER BY Line
+         )
+      LOOP
+        v_Line:=v_Line + 1;
+        INSERT
+        INTO M_INOUTLINE
+          (
+            M_InOutLine_ID,M_InOut_ID, AD_Client_ID,AD_Org_ID,
+            IsActive,Created,CreatedBy,Updated, UpdatedBy, 
+            Line,Description, M_Product_ID,
+            C_UOM_ID,MovementQty,
+            IsInvoiced, QuantityOrder, M_PRODUCT_UOM_ID,
+            A_ASSET_ID, C_PROJECT_ID, C_COSTCENTER_ID,
+            USER1_ID, USER2_ID, C_BPARTNER_ID, bom_parent_id
+          )
+        VALUES
+          (
+            get_uuid(),CUR_BOM_Line.m_inout_ID, CUR_BOM_Line.AD_Client_ID, CUR_BOM_Line.AD_Org_ID, 
+            CUR_BOM_Line.IsActive, now(), '0', now(), '0',
+            v_Line, CUR_BOM.Description, CUR_BOM.M_ProductBOM_ID, 
+            CUR_BOM.C_UOM_ID, CUR_BOM_Line.MovementQty*CUR_BOM.BOMQty, 
+            'N', CUR_BOM_Line.QuantityOrder, CUR_BOM_Line.M_Product_UOM_ID,
+            CUR_BOM_Line.a_asset_id, CUR_BOM_Line.c_project_id, CUR_BOM_Line.c_costcenter_id,
+            CUR_BOM_Line.user1_id, CUR_BOM_Line.user2_id, CUR_BOM_Line.C_BPartner_ID, v_Record_ID
+          );
+      END LOOP; -- Create New Lines
+    END LOOP; -- Replace Lines
+    UPDATE m_inoutline set explode='Y' where m_inoutline_id = v_Record_ID;
+    
+    IF (p_PInstance_ID IS NOT NULL) THEN
+      DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ');
+      AD_UPDATE_PINSTANCE(p_pinstance_id, NULL, 'N', v_result, '');
+    END IF;
+   
+  END; --BODY
+EXCEPTION
+WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE(v_ResultStr) ;
+ v_ResultStr:= '@ERROR=' || SQLERRM;
+  DBMS_OUTPUT.PUT_LINE(v_ResultStr) ;
+  IF(p_PInstance_ID IS NOT NULL) THEN
+    ROLLBACK;
+    AD_UPDATE_PINSTANCE(p_pinstance_id, NULL, 'N', 0, v_resultstr);
+   END IF;
+END M_INOUTEXPLODEBOMNOTSTOCK
+]]></body>
+    </function>
+  </database>
--- a/src-db/database/model/functions/M_INOUT_CREATE.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/model/functions/M_INOUT_CREATE.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -544,7 +544,8 @@
                         --MODIFIED BY F.IRIAZABAL
                         QuantityOrder, M_Product_Uom_ID, M_AttributeSetInstance_ID,
                         C_Project_ID, A_Asset_ID, 
-                        C_CostCenter_ID, User1_ID, User2_ID)
+                        C_CostCenter_ID, User1_ID, User2_ID, 
+                        explode, bom_parent_id)
                       VALUES
                         (v_NextNo, v_lines, p_InOut_ID, ol.C_OrderLine_ID,
                         ol.AD_Client_ID, ol.AD_Org_ID, 'Y', now(),
@@ -554,7 +555,11 @@
                         --MODIFIED BY F.IRIAZABAL
                         v_ActualQty, v_storage.M_PRODUCT_UOM_ID, v_storage.M_AttributeSetInstance_ID,
                         coalesce(ol.C_Project_ID, Cur_Order.C_Project_ID), coalesce(ol.A_Asset_ID, Cur_Order.A_Asset_ID), 
-                        coalesce(ol.C_CostCenter_ID, Cur_Order.C_CostCenter_ID), coalesce(ol.User1_ID, Cur_Order.User1_ID), coalesce(ol.User2_ID, Cur_Order.User2_ID));
+                        coalesce(ol.C_CostCenter_ID, Cur_Order.C_CostCenter_ID), coalesce(ol.User1_ID, Cur_Order.User1_ID), coalesce(ol.User2_ID, Cur_Order.User2_ID),
+                        ol.explode, (select m_inoutline_id 
+                                     from m_inoutline 
+                                     where m_inout_id = p_InOut_ID
+                                       and c_orderline_id = (SELECT BOM_parent_id from c_orderline WHERE c_orderline_id = ol.C_OrderLine_ID)));
                       v_lines:=v_lines + 10;
                       v_lines_per_orderline:= v_lines_per_orderline + 10;
                       DBMS_OUTPUT.PUT_LINE('v_lines' || v_lines) ;
@@ -603,7 +608,8 @@
                     --MODIFIED BY F.IRIAZABAL   ,
                     QuantityOrder, M_Product_Uom_ID, M_AttributeSetInstance_ID,
                     C_Project_ID, A_Asset_ID, 
-                    C_CostCenter_ID, User1_ID, User2_ID)
+                    C_CostCenter_ID, User1_ID, User2_ID,
+                    explode, bom_parent_id)
                   VALUES
                     (v_NextNo, v_lines, p_InOut_ID, ol.C_OrderLine_ID,
                     ol.AD_Client_ID, ol.AD_Org_ID, 'Y', now(),
@@ -613,7 +619,11 @@
                     --MODIFIED BY F.IRIAZABAL
                     v_ActualQty, ol.M_PRODUCT_UOM_ID, ol.M_AttributeSetInstance_ID,
                     coalesce(ol.C_Project_ID, Cur_Order.C_Project_ID), coalesce(ol.A_Asset_ID, Cur_Order.A_Asset_ID), 
-                    coalesce(ol.C_CostCenter_ID, Cur_Order.C_CostCenter_ID), coalesce(ol.User1_ID, Cur_Order.User1_ID), coalesce(ol.User2_ID, Cur_Order.User2_ID));
+                    coalesce(ol.C_CostCenter_ID, Cur_Order.C_CostCenter_ID), coalesce(ol.User1_ID, Cur_Order.User1_ID), coalesce(ol.User2_ID, Cur_Order.User2_ID),
+                    ol.explode, (select m_inoutline_id 
+                                     from m_inoutline 
+                                     where m_inout_id = p_InOut_ID
+                                       and c_orderline_id = (SELECT BOM_parent_id from c_orderline WHERE c_orderline_id = ol.C_OrderLine_ID)));
                   v_lines:=v_lines + 10;
                 ELSIF (v_qty <> 0) THEN
                   IF (cur_order.deliveryrule = 'O') THEN
@@ -660,7 +670,8 @@
                   --MODIFIED BY F.IRIAZABAL
                   QuantityOrder, M_Product_Uom_ID, M_AttributeSetInstance_ID,
                   C_Project_ID, A_Asset_ID, 
-                  C_CostCenter_ID, User1_ID, User2_ID)
+                  C_CostCenter_ID, User1_ID, User2_ID, 
+                  explode, bom_parent_id)
                 VALUES
                   (v_NextNo, v_lines, p_InOut_ID, ol.C_OrderLine_ID,
                   ol.AD_Client_ID, ol.AD_Org_ID, 'Y', now(),
@@ -670,7 +681,11 @@
                   --MODIFIED BY F.IRIAZABAL
                   v_QtyOrder, ol.M_PRODUCT_UOM_ID, ol.M_ATTRIBUTESETINSTANCE_ID,
                   coalesce(ol.C_Project_ID, Cur_Order.C_Project_ID), coalesce(ol.A_Asset_ID, Cur_Order.A_Asset_ID), 
-                  coalesce(ol.C_CostCenter_ID, Cur_Order.C_CostCenter_ID), coalesce(ol.User1_ID, Cur_Order.User1_ID), coalesce(ol.User2_ID, Cur_Order.User2_ID));
+                  coalesce(ol.C_CostCenter_ID, Cur_Order.C_CostCenter_ID), coalesce(ol.User1_ID, Cur_Order.User1_ID), coalesce(ol.User2_ID, Cur_Order.User2_ID),
+                  ol.explode, (select m_inoutline_id 
+                                     from m_inoutline 
+                                     where m_inout_id = p_InOut_ID
+                                       and c_orderline_id = (SELECT BOM_parent_id from c_orderline WHERE c_orderline_id = ol.C_OrderLine_ID)));
                 v_lines:=v_lines + 10;
               END IF;
             END IF;--Next_Line
@@ -868,7 +883,7 @@
             QuantityOrder, M_Product_Uom_ID, M_AttributeSetInstance_ID,
             C_Project_ID, A_Asset_ID, 
             C_CostCenter_ID, User1_ID,
-            User2_ID
+            User2_ID, explode, bom_parent_id
           ) VALUES (
             v_NextNo, Cur_Lines.Line, p_InOut_ID, Cur_Lines.C_OrderLine_ID,
             Cur_Lines.AD_Client_ID, Cur_Lines.AD_Org_ID, 'Y', now(),
@@ -879,8 +894,10 @@
             Cur_Lines.QuantityOrder, Cur_Lines.M_Product_Uom_ID, Cur_Lines.M_ATTRIBUTESETINSTANCE_ID,
             coalesce(Cur_Lines.C_Project_ID, Cur_Invoice.C_Project_ID), coalesce(Cur_Lines.A_Asset_ID, Cur_Invoice.A_Asset_ID), 
             coalesce(Cur_Lines.C_CostCenter_ID, Cur_Invoice.C_CostCenter_ID), coalesce(Cur_Lines.User1_ID, Cur_Invoice.User1_ID),
-            coalesce(Cur_Lines.User2_ID, Cur_Invoice.User2_ID)
-          );
+            coalesce(Cur_Lines.User2_ID, Cur_Invoice.User2_ID), ol.explode, (select m_inoutline_id 
+                                     from m_inoutline 
+                                     where m_inout_id = p_InOut_ID
+                                       and c_orderline_id = (SELECT BOM_parent_id from c_orderline WHERE c_orderline_id = ol.C_OrderLine_ID)));
           UPDATE C_INVOICELINE
           SET M_INOUTLINE_ID=v_NextNo,
               Updated=now(),
--- a/src-db/database/model/functions/M_INOUT_POST.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/model/functions/M_INOUT_POST.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -159,7 +159,7 @@
       FROM AD_CLIENTINFO
       WHERE AD_CLIENT_ID=v_AD_Client_ID
         AND CHECKINOUTORG='Y';
-      IF v_Count>0 THEN
+      IF (v_Count>0) THEN
         v_ResultStr:='CheckingRestrictions - M_INOUT ORG IS IN C_BPARTNER ORG TREE';
         SELECT count(*)
         INTO v_Count
@@ -195,7 +195,7 @@
       AND C_DocType.IsSOTrx=M.IsSOTrx
       AND AD_ISORGINCLUDED(m.AD_Org_ID,C_DocType.AD_Org_ID, m.AD_Client_ID) <> -1
        AND M.C_DOCTYPE_ID=C_DocType.C_DOCTYPE_ID;
-        IF v_Count=0 THEN
+        IF (v_Count=0) THEN
           RAISE_APPLICATION_ERROR(-20000, '@NotCorrectOrgDoctypeShipment@') ;
         END IF;
         SELECT COUNT(*), MAX(M.line)
@@ -221,7 +221,7 @@
           AND P.ISLOCKED='Y'
           AND I.ISSOTRX='Y'
           AND I.M_INOUT_ID=v_Record_ID;
-        IF v_Count<>0 THEN
+        IF (v_Count<>0) THEN
           RAISE_APPLICATION_ERROR(-20000, '@Inline@'||v_line||' '||'@lockedProduct@') ;
         END IF;
       -- check inout line instance location
@@ -234,10 +234,22 @@
           AND p.m_product_id = m.m_product_id
           AND p.isstocked = 'Y'
           AND p.producttype = 'I';
-        IF v_Count <> 0 THEN
+        IF (v_Count <> 0) THEN
           RAISE_APPLICATION_ERROR(-20000, '@Inline@'||v_line||' '||'@InoutLineWithoutLocator@') ;
         END IF;	  
-      
+      --check if bom non-stockable is exploded
+        SELECT COUNT(*), MAX(M.line)
+        INTO v_Count, v_Line
+        FROM M_InOutLine M,    
+          M_Product P
+        WHERE M.M_InOut_ID=v_Record_ID
+          AND P.isBOM='Y' 
+          AND P.isstocked='N'
+          AND M.explode='N'
+          AND p.m_product_id = m.m_product_id;
+        IF (v_Count <> 0) THEN
+          RAISE_APPLICATION_ERROR(-20000, '@Inline@'||v_line||' '||'@InoutLineNotExploded@') ;
+        END IF;
     --Check negative quantities on return inouts
     IF (v_isreturndoctype = 'Y') THEN
       SELECT count(*) INTO v_count
@@ -843,7 +855,8 @@
                 Description, IsInvoiced,  --MODIFIED BY F.IRIAZABAL
                 QuantityOrder, M_Product_UOM_ID, IsDescription,
                 canceled_inoutline_id, A_Asset_ID, C_Project_ID, C_BPartner_ID,
-                User1_ID, User2_ID, C_CostCenter_ID
+                User1_ID, User2_ID, C_CostCenter_ID, 
+                explode
               )
               VALUES
               (
@@ -854,7 +867,8 @@
                  '*R*: ' || COALESCE(TO_CHAR(Cur_InOutLine.Description), ''), Cur_InOutLine.IsInvoiced, --MODIFIED BY F.IRIAZABAL
                 Cur_InOutLine.QuantityOrder * -1, Cur_InOutLine.M_PRODUCT_UOM_ID, Cur_InOutLine.IsDescription,
                 Cur_InOutLine.M_InOutLine_ID, Cur_InOutLine.A_Asset_ID, Cur_InOutLine.C_Project_ID, Cur_InOutLine.C_BPartner_ID,
-                Cur_InOutLine.User1_ID, Cur_InOutLine.User2_ID, Cur_InOutLine.C_CostCenter_ID
+                Cur_InOutLine.User1_ID, Cur_InOutLine.User2_ID, Cur_InOutLine.C_CostCenter_ID, 
+                Cur_InOutLine.explode 
               )
               ;
             INSERT INTO M_MATCHINV
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/functions/M_INVEXPLODEBOMNOTSTOCK.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -0,0 +1,219 @@
+<?xml version="1.0"?>
+  <database name="FUNCTION M_INVEXPLODEBOMNOTSTOCK">
+    <function name="M_INVEXPLODEBOMNOTSTOCK" type="NULL">
+      <parameter name="p_pinstance_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <parameter name="p_invoiceline_id" type="VARCHAR" mode="in">
+        <default><![CDATA[null]]></default>
+      </parameter>
+      <body><![CDATA[/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* 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 Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+  -- Logistice
+  v_explode CHAR(1);
+  v_invoiceID VARCHAR2(32);
+  v_CBPartner_ID VARCHAR2(32);
+  v_PriceList_ID VARCHAR2(32);
+  v_PriceList_Version_ID VARCHAR2(32);
+  v_Record_ID VARCHAR2(32);
+  TYPE RECORD IS REF CURSOR;
+  Cur_Parameter RECORD;
+  Cur_MPriceListVersion RECORD;
+  CUR_BOM_Line RECORD;
+  CUR_BOM RECORD;
+  v_Line NUMBER:=0;
+  v_ResultStr VARCHAR2(2000):='';
+  v_result NUMBER:= 1;  
+  v_IsSOTrx CHAR(1);
+  v_period_inv C_InvoiceLine.c_period_id%TYPE;
+  v_isdeferred_inv C_InvoiceLine.IsDeferred%TYPE;
+  v_defplantype_inv C_InvoiceLine.DefPlanType%TYPE;
+  v_periodnumber_inv C_InvoiceLine.periodnumber%TYPE;
+  v_DateInvoiced DATE;
+
+
+
+  BEGIN
+  IF (p_PInstance_ID IS NOT NULL) THEN
+      --  Update AD_PInstance
+      DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || p_PInstance_ID) ;
+      v_ResultStr:='PInstanceNotFound';
+      AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'Y', NULL, NULL) ;
+      -- Get Parameters
+      v_ResultStr:='ReadingParameters';
+      FOR Cur_Parameter IN
+        (SELECT i.Record_ID, i.AD_User_ID, p.ParameterName, p.P_String,
+          p.P_Number, p.P_Date
+        FROM AD_PINSTANCE i
+        LEFT JOIN AD_PINSTANCE_PARA p
+          ON i.AD_PInstance_ID=p.AD_PInstance_ID
+        WHERE i.AD_PInstance_ID=p_PInstance_ID
+        ORDER BY p.SeqNo
+        )
+      LOOP
+        v_Record_ID:=Cur_Parameter.Record_ID;
+      END LOOP; -- Get Parameter
+  ELSE
+      v_Record_ID:=p_invoiceline_ID;
+  END IF;
+    DBMS_OUTPUT.PUT_LINE('  Record_ID=' || v_Record_ID) ;
+  BEGIN --BODY
+     
+    SELECT C_INVOICE.c_invoice_id, C_INVOICE.c_bpartner_id, C_INVOICE.M_PriceList_ID, DATEORDERED, c_invoiceline.explode
+      INTO v_invoiceID, v_CBPartner_ID, v_PriceList_ID, v_DateInvoiced, c_invoiceline, v_explode
+    FROM C_INVOICE JOIN m_pricelist ON C_INVOICE.m_pricelist_id = m_pricelist.m_pricelist_id JOIN c_invoiceline ON C_INVOICE.c_invoice_id = c_invoiceline.c_invoice_id
+    WHERE c_invoiceline.c_invoiceline_id=v_Record_ID  FOR UPDATE;
+
+    IF (v_explode = 'Y') THEN
+      v_ResultStr:='@ProdExploded@';
+      RAISE_APPLICATION_ERROR(-20000, '@ProdExploded@') ;
+    END IF;
+    
+    v_ResultStr:='Exploding';
+
+
+    -- Get Price List Version
+    FOR Cur_MPriceListVersion IN
+      (SELECT v.M_PriceList_Version_ID AS PriceList_Version_ID, o.M_PriceList_ID
+       FROM M_PRICELIST_VERSION v, C_INVOICE o
+       WHERE v.M_PriceList_ID=o.M_PriceList_ID
+         AND v.ValidFrom<=COALESCE(o.DateOrdered, o.DateInvoiced)
+         AND v.IsActive='Y'
+         AND o.C_Invoice_ID=v_invoiceID
+       ORDER BY v.ValidFrom DESC
+      )
+   LOOP
+      v_PriceList_Version_ID:=Cur_MPriceListVersion.PriceList_Version_ID;
+      EXIT;
+    END LOOP;
+ 
+    -- Replace Lines
+    v_ResultStr:='Inserting lines';
+        
+    FOR CUR_BOM_Line IN
+      (SELECT *
+       FROM C_INVOICELINE l
+       WHERE l.C_invoiceline_ID=v_Record_ID
+         AND IsActive='Y'
+         AND EXISTS
+           (SELECT *
+            FROM M_PRODUCT p
+            WHERE l.M_Product_ID=p.M_Product_ID
+              AND p.IsBOM='Y'
+              AND p.IsStocked='N'
+            )
+       ORDER BY l.Line  FOR UPDATE
+       )
+     LOOP
+      v_Line:=CUR_BOM_Line.Line;
+      -- Create New Lines
+      FOR CUR_BOM IN
+        (SELECT b.M_ProductBOM_ID, p.C_UOM_ID, b.BOMQty, b.Description,
+           revplantype, isdeferredrevenue, periodnumber, defaultperiod,
+           expplantype, isdeferredexpense, periodnumber_exp, defaultperiod_exp
+         FROM M_PRODUCT_BOM b, M_PRODUCT p
+             WHERE b.M_Product_ID=CUR_BOM_Line.M_Product_ID
+               AND b.M_ProductBOM_ID=p.M_Product_ID
+               AND b.isactive = 'Y'
+             ORDER BY Line
+         )
+      LOOP
+        v_Line:=v_Line + 1;
+        
+        IF(CUR_BOM.M_ProductBOM_ID IS NOT NULL) THEN
+          SELECT issotrx 
+          INTO v_IsSOTrx
+          from c_invoice
+          WHERE c_invoice_id = v_invoiceID;
+          
+          IF(v_IsSOTrx = 'Y') THEN
+ 	    v_period_inv:= c_get_default_period(CUR_BOM_Line.C_Invoice_ID, CUR_BOM.defaultperiod);
+	    IF(v_period_inv IS NOT NULL AND CUR_BOM.isdeferredrevenue = 'Y') THEN
+	      v_isdeferred_inv := CUR_BOM.isdeferredrevenue;
+	      v_defplantype_inv := CUR_BOM.revplantype;
+	      v_periodnumber_inv := CUR_BOM.periodnumber;
+	    ELSE
+	      v_period_inv := NULL;
+	      v_isdeferred_inv := 'N';
+	      v_defplantype_inv := NULL;
+	      v_periodnumber_inv := NULL;
+	    END IF;
+	  ELSE
+            v_period_inv:= c_get_default_period(CUR_BOM_Line.C_Invoice_ID, CUR_BOM.defaultperiod_exp);
+            IF(v_period_inv IS NOT NULL AND CUR_BOM.isdeferredexpense = 'Y') THEN
+              v_isdeferred_inv := CUR_BOM.isdeferredexpense;
+              v_defplantype_inv := CUR_BOM.expplantype;
+              v_periodnumber_inv := CUR_BOM.periodnumber_exp;
+            ELSE
+              v_period_inv := NULL;
+              v_isdeferred_inv := 'N';
+              v_defplantype_inv := NULL;
+              v_periodnumber_inv := NULL;
+            END IF;
+          END IF;
+        END IF;
+ 
+        INSERT INTO C_INVOICELINE
+          (
+            C_InvoiceLine_ID, AD_Client_ID, AD_Org_ID, IsActive,
+            Created, CreatedBy, Updated, UpdatedBy,
+            C_Invoice_ID, Line, Description, M_Product_ID,
+            C_UOM_ID, QtyInvoiced, PriceList,
+            PriceActual,
+            PriceLimit, LineNetAmt, C_Charge_ID, ChargeAmt,
+            C_Tax_ID, PriceStd,
+            isdeferred, defplantype, periodnumber, c_period_id,
+            c_bpartner_id, c_project_id, c_projectline_id, a_asset_id,
+            user1_id, user2_id, bom_parent_id
+          )
+        VALUES
+          (
+            get_uuid(), CUR_BOM_Line.AD_Client_ID, CUR_BOM_Line.AD_Org_ID, CUR_BOM_Line.IsActive,
+            now(), '0', now(), '0',
+            CUR_BOM_Line.C_Invoice_ID, v_Line, CUR_BOM.Description, CUR_BOM.M_ProductBOM_ID,
+            CUR_BOM.C_UOM_ID, CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, M_BOM_PriceList(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
+            M_Get_Offers_Price(v_DateInvoiced, v_CBPartner_ID, CUR_BOM.M_ProductBOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, v_PriceList_ID),
+            M_BOM_PriceLimit(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
+            M_Get_Offers_Price(v_DateInvoiced, v_CBPartner_ID, CUR_BOM.M_ProductBOM_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, v_PriceList_ID) * CUR_BOM_Line.QtyInvoiced*CUR_BOM.BOMQty, CUR_BOM_Line.C_Charge_ID, CUR_BOM_Line.ChargeAmt,
+            CUR_BOM_Line.C_Tax_ID, M_BOM_PriceStd(CUR_BOM.M_ProductBOM_ID, v_PriceList_Version_ID),
+            v_isdeferred_inv, v_defplantype_inv, v_periodnumber_inv, v_period_inv,
+            CUR_BOM_Line.c_bpartner_id, CUR_BOM_Line.c_project_id, CUR_BOM_Line.c_projectline_id, CUR_BOM_Line.a_asset_id,
+            CUR_BOM_Line.user1_id, CUR_BOM_Line.user2_id,v_Record_ID
+          );
+      END LOOP; -- Create New Lines
+    END LOOP; -- Replace Lines
+    UPDATE c_invoiceline set explode='Y' where c_invoiceline_id = v_Record_ID;
+    
+    IF (p_PInstance_ID IS NOT NULL) THEN
+      DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ');
+      AD_UPDATE_PINSTANCE(p_pinstance_id, NULL, 'N', v_result, '');
+    END IF;
+   
+  END; --BODY
+EXCEPTION
+WHEN OTHERS THEN
+ DBMS_OUTPUT.PUT_LINE(v_ResultStr) ;
+ v_ResultStr:= '@ERROR=' || SQLERRM;
+  DBMS_OUTPUT.PUT_LINE(v_ResultStr) ;
+  IF(p_PInstance_ID IS NOT NULL) THEN
+    ROLLBACK;
+    AD_UPDATE_PINSTANCE(p_pinstance_id, NULL, 'N', 0, v_resultstr);
+   END IF;
+END M_INVEXPLODEBOMNOTSTOCK
+]]></body>
+    </function>
+  </database>
--- a/src-db/database/model/tables/C_INVOICELINE.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/model/tables/C_INVOICELINE.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -209,6 +209,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="EXPLODE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault><![CDATA['N']]></onCreateDefault>
+      </column>
+      <column name="BOM_PARENT_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="C_INVOICELINE_AD_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
@@ -218,6 +226,9 @@
       <foreign-key foreignTable="A_ASSET" name="C_INVOICELINE_ASSET">
         <reference local="A_ASSET_ID" foreign="A_ASSET_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_INVOICELINE" name="C_INVOICELINE_BOMPARENTID">
+        <reference local="BOM_PARENT_ID" foreign="C_INVOICELINE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_BPARTNER" name="C_INVOICELINE_C_BPARTNER">
         <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
       </foreign-key>
@@ -295,6 +306,7 @@
       <check name="C_INVOICELINE_CHECK1"><![CDATA[((QUANTITYORDER IS NULL) AND (M_PRODUCT_UOM_ID IS NULL)) OR ((QUANTITYORDER IS NOT NULL) AND (M_PRODUCT_UOM_ID IS NOT NULL))]]></check>
       <check name="C_INVOICELINE_CHECK2"><![CDATA[(LINENETAMT = 0) OR (C_TAX_ID IS NOT NULL)]]></check>
       <check name="C_INVOICELINE_CHECK3"><![CDATA[(((((ISDEFERRED = 'Y') AND (C_PERIOD_ID IS NOT NULL)) AND (DEFPLANTYPE IS NOT NULL)) AND (M_PRODUCT_ID IS NOT NULL)) AND (PERIODNUMBER IS NOT NULL)) OR (ISDEFERRED = 'N')]]></check>
+      <check name="C_INVOICELINE_EXPLODE_CHECK"><![CDATA[EXPLODE IN ('Y', 'N')]]></check>
       <check name="C_INVOICELINE_FIN_INVLINE_CHK"><![CDATA[FINANCIAL_INVOICE_LINE IN ('Y', 'N')]]></check>
       <check name="C_INVOICELINE_FINACCT_CHK"><![CDATA[((FINANCIAL_INVOICE_LINE = 'Y') AND (ACCOUNT_ID IS NOT NULL)) OR ((FINANCIAL_INVOICE_LINE = 'N') AND (ACCOUNT_ID IS NULL))]]></check>
       <check name="C_INVOICELINE_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
--- a/src-db/database/model/tables/C_ORDERLINE.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/model/tables/C_ORDERLINE.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -261,6 +261,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="EXPLODE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault><![CDATA['N']]></onCreateDefault>
+      </column>
+      <column name="BOM_PARENT_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="A_ASSET" name="C_ORDERLINE_A_ASSET">
         <reference local="A_ASSET_ID" foreign="A_ASSET_ID"/>
       </foreign-key>
@@ -270,6 +278,9 @@
       <foreign-key foreignTable="AD_ORG" name="C_ORDERLINE_AD_ORG">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="C_ORDERLINE" name="C_ORDERLINE_BOMPARENTID">
+        <reference local="BOM_PARENT_ID" foreign="C_ORDERLINE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_BPARTNER" name="C_ORDERLINE_C_BPARTNER">
         <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
       </foreign-key>
@@ -354,6 +365,7 @@
       <check name="C_ORDERLINE_CHECK1"><![CDATA[((QUANTITYORDER IS NULL) AND (M_PRODUCT_UOM_ID IS NULL)) OR ((QUANTITYORDER IS NOT NULL) AND (M_PRODUCT_UOM_ID IS NOT NULL))]]></check>
       <check name="C_ORDERLINE_CHECK2"><![CDATA[(LINENETAMT = 0) OR (C_TAX_ID IS NOT NULL)]]></check>
       <check name="C_ORDERLINE_DIRECTSHIP_CHECK"><![CDATA[DIRECTSHIP IN ('Y', 'N')]]></check>
+      <check name="C_ORDERLINE_EXPLODE_CHECK"><![CDATA[EXPLODE IN ('Y', 'N')]]></check>
       <check name="C_ORDERLINE_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
     </table>
   </database>
--- a/src-db/database/model/tables/M_INOUTLINE.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/model/tables/M_INOUTLINE.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -121,6 +121,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="EXPLODE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="BOM_PARENT_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="M_CONDITION_GOODS" name="M_CONDITION_GOODS">
         <reference local="M_CONDITION_GOODS_ID" foreign="M_CONDITION_GOODS_ID"/>
       </foreign-key>
@@ -133,6 +141,9 @@
       <foreign-key foreignTable="AD_ORG" name="M_INOUTLINE_AD_ORG">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="M_INOUTLINE" name="M_INOUTLINE_BOMPARENTID">
+        <reference local="BOM_PARENT_ID" foreign="M_INOUTLINE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_BPARTNER" name="M_INOUTLINE_C_BPARTNER">
         <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
       </foreign-key>
@@ -182,6 +193,7 @@
         <index-column name="M_PRODUCT_ID"/>
       </index>
       <check name="M_INOUTLINE"><![CDATA[((QUANTITYORDER IS NULL) AND (M_PRODUCT_UOM_ID IS NULL)) OR ((QUANTITYORDER IS NOT NULL) AND (M_PRODUCT_UOM_ID IS NOT NULL))]]></check>
+      <check name="M_INOUTLINE_EXPLODE_CHECK"><![CDATA[EXPLODE IN ('Y', 'N')]]></check>
       <check name="M_INOUTLINE_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
       <check name="M_INOUTLINE_ISINVOICED_CHECK"><![CDATA[ISINVOICED IN ('Y', 'N')]]></check>
     </table>
--- a/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -761,6 +761,17 @@
 <!--0A17DEEA6AE34D0AAF8D7D789BBEB16A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--0A17DEEA6AE34D0AAF8D7D789BBEB16A--></AD_AUXILIARINPUT>
 
+<!--0AD5488DC1E74A3997B8D9D6C5E16841--><AD_AUXILIARINPUT>
+<!--0AD5488DC1E74A3997B8D9D6C5E16841-->  <AD_AUXILIARINPUT_ID><![CDATA[0AD5488DC1E74A3997B8D9D6C5E16841]]></AD_AUXILIARINPUT_ID>
+<!--0AD5488DC1E74A3997B8D9D6C5E16841-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0AD5488DC1E74A3997B8D9D6C5E16841-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0AD5488DC1E74A3997B8D9D6C5E16841-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0AD5488DC1E74A3997B8D9D6C5E16841-->  <AD_TAB_ID><![CDATA[297]]></AD_TAB_ID>
+<!--0AD5488DC1E74A3997B8D9D6C5E16841-->  <NAME><![CDATA[IsStocked]]></NAME>
+<!--0AD5488DC1E74A3997B8D9D6C5E16841-->  <CODE><![CDATA[@SQL=SELECT IsStocked FROM M_PRODUCT WHERE M_PRODUCT_ID = @M_PRODUCT_ID@]]></CODE>
+<!--0AD5488DC1E74A3997B8D9D6C5E16841-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--0AD5488DC1E74A3997B8D9D6C5E16841--></AD_AUXILIARINPUT>
+
 <!--0AE259D1B97E482BB593775EA3E73F57--><AD_AUXILIARINPUT>
 <!--0AE259D1B97E482BB593775EA3E73F57-->  <AD_AUXILIARINPUT_ID><![CDATA[0AE259D1B97E482BB593775EA3E73F57]]></AD_AUXILIARINPUT_ID>
 <!--0AE259D1B97E482BB593775EA3E73F57-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -886,6 +897,17 @@
 <!--15881B450C7B49BE863EB74EA921E3A1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--15881B450C7B49BE863EB74EA921E3A1--></AD_AUXILIARINPUT>
 
+<!--162BEBF77E8D419ABDAD4E87A5C17430--><AD_AUXILIARINPUT>
+<!--162BEBF77E8D419ABDAD4E87A5C17430-->  <AD_AUXILIARINPUT_ID><![CDATA[162BEBF77E8D419ABDAD4E87A5C17430]]></AD_AUXILIARINPUT_ID>
+<!--162BEBF77E8D419ABDAD4E87A5C17430-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--162BEBF77E8D419ABDAD4E87A5C17430-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--162BEBF77E8D419ABDAD4E87A5C17430-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--162BEBF77E8D419ABDAD4E87A5C17430-->  <AD_TAB_ID><![CDATA[291]]></AD_TAB_ID>
+<!--162BEBF77E8D419ABDAD4E87A5C17430-->  <NAME><![CDATA[isBOM]]></NAME>
+<!--162BEBF77E8D419ABDAD4E87A5C17430-->  <CODE><![CDATA[@SQL=SELECT isBOM FROM M_PRODUCT WHERE M_PRODUCT_ID = @M_PRODUCT_ID@]]></CODE>
+<!--162BEBF77E8D419ABDAD4E87A5C17430-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--162BEBF77E8D419ABDAD4E87A5C17430--></AD_AUXILIARINPUT>
+
 <!--17F5DEA4A5254BDDA77560A7D67667B6--><AD_AUXILIARINPUT>
 <!--17F5DEA4A5254BDDA77560A7D67667B6-->  <AD_AUXILIARINPUT_ID><![CDATA[17F5DEA4A5254BDDA77560A7D67667B6]]></AD_AUXILIARINPUT_ID>
 <!--17F5DEA4A5254BDDA77560A7D67667B6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -952,6 +974,17 @@
 <!--1F6072F3CE0F43F6AF71874398914072-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--1F6072F3CE0F43F6AF71874398914072--></AD_AUXILIARINPUT>
 
+<!--1FC6075EA994422F8CF3B041621F374D--><AD_AUXILIARINPUT>
+<!--1FC6075EA994422F8CF3B041621F374D-->  <AD_AUXILIARINPUT_ID><![CDATA[1FC6075EA994422F8CF3B041621F374D]]></AD_AUXILIARINPUT_ID>
+<!--1FC6075EA994422F8CF3B041621F374D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1FC6075EA994422F8CF3B041621F374D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1FC6075EA994422F8CF3B041621F374D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1FC6075EA994422F8CF3B041621F374D-->  <AD_TAB_ID><![CDATA[258]]></AD_TAB_ID>
+<!--1FC6075EA994422F8CF3B041621F374D-->  <NAME><![CDATA[IsStocked]]></NAME>
+<!--1FC6075EA994422F8CF3B041621F374D-->  <CODE><![CDATA[@SQL=SELECT IsStocked FROM M_PRODUCT WHERE M_PRODUCT_ID = @M_PRODUCT_ID@]]></CODE>
+<!--1FC6075EA994422F8CF3B041621F374D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1FC6075EA994422F8CF3B041621F374D--></AD_AUXILIARINPUT>
+
 <!--1FEA6AF375714E1A962C67E094001342--><AD_AUXILIARINPUT>
 <!--1FEA6AF375714E1A962C67E094001342-->  <AD_AUXILIARINPUT_ID><![CDATA[1FEA6AF375714E1A962C67E094001342]]></AD_AUXILIARINPUT_ID>
 <!--1FEA6AF375714E1A962C67E094001342-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1033,6 +1066,17 @@
 <!--2394571515C643119770FD8A5DCBC1C5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--2394571515C643119770FD8A5DCBC1C5--></AD_AUXILIARINPUT>
 
+<!--24824516BC4A40CB8E81F52301EF5F8E--><AD_AUXILIARINPUT>
+<!--24824516BC4A40CB8E81F52301EF5F8E-->  <AD_AUXILIARINPUT_ID><![CDATA[24824516BC4A40CB8E81F52301EF5F8E]]></AD_AUXILIARINPUT_ID>
+<!--24824516BC4A40CB8E81F52301EF5F8E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--24824516BC4A40CB8E81F52301EF5F8E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--24824516BC4A40CB8E81F52301EF5F8E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--24824516BC4A40CB8E81F52301EF5F8E-->  <AD_TAB_ID><![CDATA[297]]></AD_TAB_ID>
+<!--24824516BC4A40CB8E81F52301EF5F8E-->  <NAME><![CDATA[isBOM]]></NAME>
+<!--24824516BC4A40CB8E81F52301EF5F8E-->  <CODE><![CDATA[@SQL=SELECT isBOM FROM M_PRODUCT WHERE M_PRODUCT_ID = @M_PRODUCT_ID@]]></CODE>
+<!--24824516BC4A40CB8E81F52301EF5F8E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--24824516BC4A40CB8E81F52301EF5F8E--></AD_AUXILIARINPUT>
+
 <!--2527595792D6435A991BD8C9B841C3AC--><AD_AUXILIARINPUT>
 <!--2527595792D6435A991BD8C9B841C3AC-->  <AD_AUXILIARINPUT_ID><![CDATA[2527595792D6435A991BD8C9B841C3AC]]></AD_AUXILIARINPUT_ID>
 <!--2527595792D6435A991BD8C9B841C3AC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1414,6 +1458,17 @@
 <!--3E769128EA274A8480EBB341E05468AF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--3E769128EA274A8480EBB341E05468AF--></AD_AUXILIARINPUT>
 
+<!--3EE2062DF62F4E948FD9786D21AF2D0C--><AD_AUXILIARINPUT>
+<!--3EE2062DF62F4E948FD9786D21AF2D0C-->  <AD_AUXILIARINPUT_ID><![CDATA[3EE2062DF62F4E948FD9786D21AF2D0C]]></AD_AUXILIARINPUT_ID>
+<!--3EE2062DF62F4E948FD9786D21AF2D0C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3EE2062DF62F4E948FD9786D21AF2D0C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3EE2062DF62F4E948FD9786D21AF2D0C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3EE2062DF62F4E948FD9786D21AF2D0C-->  <AD_TAB_ID><![CDATA[270]]></AD_TAB_ID>
+<!--3EE2062DF62F4E948FD9786D21AF2D0C-->  <NAME><![CDATA[isBOM]]></NAME>
+<!--3EE2062DF62F4E948FD9786D21AF2D0C-->  <CODE><![CDATA[@SQL=SELECT isBOM FROM M_PRODUCT WHERE M_PRODUCT_ID = @M_PRODUCT_ID@]]></CODE>
+<!--3EE2062DF62F4E948FD9786D21AF2D0C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--3EE2062DF62F4E948FD9786D21AF2D0C--></AD_AUXILIARINPUT>
+
 <!--40289C202E523822012E525106E70036--><AD_AUXILIARINPUT>
 <!--40289C202E523822012E525106E70036-->  <AD_AUXILIARINPUT_ID><![CDATA[40289C202E523822012E525106E70036]]></AD_AUXILIARINPUT_ID>
 <!--40289C202E523822012E525106E70036-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1484,6 +1539,17 @@
 <!--44C89F429E0E42F7961A634D61F34E0A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--44C89F429E0E42F7961A634D61F34E0A--></AD_AUXILIARINPUT>
 
+<!--467629226B744AD5A9D5CEBD284C29E4--><AD_AUXILIARINPUT>
+<!--467629226B744AD5A9D5CEBD284C29E4-->  <AD_AUXILIARINPUT_ID><![CDATA[467629226B744AD5A9D5CEBD284C29E4]]></AD_AUXILIARINPUT_ID>
+<!--467629226B744AD5A9D5CEBD284C29E4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--467629226B744AD5A9D5CEBD284C29E4-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--467629226B744AD5A9D5CEBD284C29E4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--467629226B744AD5A9D5CEBD284C29E4-->  <AD_TAB_ID><![CDATA[270]]></AD_TAB_ID>
+<!--467629226B744AD5A9D5CEBD284C29E4-->  <NAME><![CDATA[IsStocked]]></NAME>
+<!--467629226B744AD5A9D5CEBD284C29E4-->  <CODE><![CDATA[@SQL=SELECT IsStocked FROM M_PRODUCT WHERE M_PRODUCT_ID = @M_PRODUCT_ID@]]></CODE>
+<!--467629226B744AD5A9D5CEBD284C29E4-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--467629226B744AD5A9D5CEBD284C29E4--></AD_AUXILIARINPUT>
+
 <!--47CF833F91C94EF983142C6B2C4C77A1--><AD_AUXILIARINPUT>
 <!--47CF833F91C94EF983142C6B2C4C77A1-->  <AD_AUXILIARINPUT_ID><![CDATA[47CF833F91C94EF983142C6B2C4C77A1]]></AD_AUXILIARINPUT_ID>
 <!--47CF833F91C94EF983142C6B2C4C77A1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1639,6 +1705,17 @@
 <!--5382BB67A2974EDFB18C96575CE6E64F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--5382BB67A2974EDFB18C96575CE6E64F--></AD_AUXILIARINPUT>
 
+<!--54B597A45774438696EC38DB00010B67--><AD_AUXILIARINPUT>
+<!--54B597A45774438696EC38DB00010B67-->  <AD_AUXILIARINPUT_ID><![CDATA[54B597A45774438696EC38DB00010B67]]></AD_AUXILIARINPUT_ID>
+<!--54B597A45774438696EC38DB00010B67-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--54B597A45774438696EC38DB00010B67-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--54B597A45774438696EC38DB00010B67-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--54B597A45774438696EC38DB00010B67-->  <AD_TAB_ID><![CDATA[293]]></AD_TAB_ID>
+<!--54B597A45774438696EC38DB00010B67-->  <NAME><![CDATA[isBOM]]></NAME>
+<!--54B597A45774438696EC38DB00010B67-->  <CODE><![CDATA[@SQL=SELECT isBOM FROM M_PRODUCT WHERE M_PRODUCT_ID = @M_PRODUCT_ID@]]></CODE>
+<!--54B597A45774438696EC38DB00010B67-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--54B597A45774438696EC38DB00010B67--></AD_AUXILIARINPUT>
+
 <!--55C64821BB34410DBB653100E922895D--><AD_AUXILIARINPUT>
 <!--55C64821BB34410DBB653100E922895D-->  <AD_AUXILIARINPUT_ID><![CDATA[55C64821BB34410DBB653100E922895D]]></AD_AUXILIARINPUT_ID>
 <!--55C64821BB34410DBB653100E922895D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -2195,6 +2272,17 @@
 <!--8EE1AE595E1E462BBFE568C0C27BEAC0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--8EE1AE595E1E462BBFE568C0C27BEAC0--></AD_AUXILIARINPUT>
 
+<!--9039E3F1B99F4D76855A89FA73B4F05F--><AD_AUXILIARINPUT>
+<!--9039E3F1B99F4D76855A89FA73B4F05F-->  <AD_AUXILIARINPUT_ID><![CDATA[9039E3F1B99F4D76855A89FA73B4F05F]]></AD_AUXILIARINPUT_ID>
+<!--9039E3F1B99F4D76855A89FA73B4F05F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9039E3F1B99F4D76855A89FA73B4F05F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9039E3F1B99F4D76855A89FA73B4F05F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9039E3F1B99F4D76855A89FA73B4F05F-->  <AD_TAB_ID><![CDATA[293]]></AD_TAB_ID>
+<!--9039E3F1B99F4D76855A89FA73B4F05F-->  <NAME><![CDATA[IsStocked]]></NAME>
+<!--9039E3F1B99F4D76855A89FA73B4F05F-->  <CODE><![CDATA[@SQL=SELECT IsStocked FROM M_PRODUCT WHERE M_PRODUCT_ID = @M_PRODUCT_ID@]]></CODE>
+<!--9039E3F1B99F4D76855A89FA73B4F05F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9039E3F1B99F4D76855A89FA73B4F05F--></AD_AUXILIARINPUT>
+
 <!--9078FCC35AE5454DB6818D2BB6602E0B--><AD_AUXILIARINPUT>
 <!--9078FCC35AE5454DB6818D2BB6602E0B-->  <AD_AUXILIARINPUT_ID><![CDATA[9078FCC35AE5454DB6818D2BB6602E0B]]></AD_AUXILIARINPUT_ID>
 <!--9078FCC35AE5454DB6818D2BB6602E0B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -2432,6 +2520,17 @@
 <!--A9B8EA3C15E14EFB901131BF4DFFF687-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--A9B8EA3C15E14EFB901131BF4DFFF687--></AD_AUXILIARINPUT>
 
+<!--AA79289FD0CB4B69BFB31FC8A8C076EB--><AD_AUXILIARINPUT>
+<!--AA79289FD0CB4B69BFB31FC8A8C076EB-->  <AD_AUXILIARINPUT_ID><![CDATA[AA79289FD0CB4B69BFB31FC8A8C076EB]]></AD_AUXILIARINPUT_ID>
+<!--AA79289FD0CB4B69BFB31FC8A8C076EB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AA79289FD0CB4B69BFB31FC8A8C076EB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AA79289FD0CB4B69BFB31FC8A8C076EB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AA79289FD0CB4B69BFB31FC8A8C076EB-->  <AD_TAB_ID><![CDATA[258]]></AD_TAB_ID>
+<!--AA79289FD0CB4B69BFB31FC8A8C076EB-->  <NAME><![CDATA[isBOM]]></NAME>
+<!--AA79289FD0CB4B69BFB31FC8A8C076EB-->  <CODE><![CDATA[@SQL=SELECT isBOM FROM M_PRODUCT WHERE M_PRODUCT_ID = @M_PRODUCT_ID@]]></CODE>
+<!--AA79289FD0CB4B69BFB31FC8A8C076EB-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--AA79289FD0CB4B69BFB31FC8A8C076EB--></AD_AUXILIARINPUT>
+
 <!--ABF388A018954C4BAF851DCA371167E5--><AD_AUXILIARINPUT>
 <!--ABF388A018954C4BAF851DCA371167E5-->  <AD_AUXILIARINPUT_ID><![CDATA[ABF388A018954C4BAF851DCA371167E5]]></AD_AUXILIARINPUT_ID>
 <!--ABF388A018954C4BAF851DCA371167E5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -2624,6 +2723,17 @@
 <!--BB7571E667114EB3A5FCB3425B6007F4-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--BB7571E667114EB3A5FCB3425B6007F4--></AD_AUXILIARINPUT>
 
+<!--BBFAC7EEB599451388E60BA877C89809--><AD_AUXILIARINPUT>
+<!--BBFAC7EEB599451388E60BA877C89809-->  <AD_AUXILIARINPUT_ID><![CDATA[BBFAC7EEB599451388E60BA877C89809]]></AD_AUXILIARINPUT_ID>
+<!--BBFAC7EEB599451388E60BA877C89809-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BBFAC7EEB599451388E60BA877C89809-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BBFAC7EEB599451388E60BA877C89809-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BBFAC7EEB599451388E60BA877C89809-->  <AD_TAB_ID><![CDATA[187]]></AD_TAB_ID>
+<!--BBFAC7EEB599451388E60BA877C89809-->  <NAME><![CDATA[isBOM]]></NAME>
+<!--BBFAC7EEB599451388E60BA877C89809-->  <CODE><![CDATA[@SQL=SELECT isBOM FROM M_PRODUCT WHERE M_PRODUCT_ID = @M_PRODUCT_ID@]]></CODE>
+<!--BBFAC7EEB599451388E60BA877C89809-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--BBFAC7EEB599451388E60BA877C89809--></AD_AUXILIARINPUT>
+
 <!--BD5BE8557B94430A93CF1C6D56C2C8AB--><AD_AUXILIARINPUT>
 <!--BD5BE8557B94430A93CF1C6D56C2C8AB-->  <AD_AUXILIARINPUT_ID><![CDATA[BD5BE8557B94430A93CF1C6D56C2C8AB]]></AD_AUXILIARINPUT_ID>
 <!--BD5BE8557B94430A93CF1C6D56C2C8AB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -2769,6 +2879,17 @@
 <!--CDA655BBB96A4C4C8BC12AF53DA3E50B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--CDA655BBB96A4C4C8BC12AF53DA3E50B--></AD_AUXILIARINPUT>
 
+<!--CDD35787A8094C5180971D4F8EB83DDC--><AD_AUXILIARINPUT>
+<!--CDD35787A8094C5180971D4F8EB83DDC-->  <AD_AUXILIARINPUT_ID><![CDATA[CDD35787A8094C5180971D4F8EB83DDC]]></AD_AUXILIARINPUT_ID>
+<!--CDD35787A8094C5180971D4F8EB83DDC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CDD35787A8094C5180971D4F8EB83DDC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CDD35787A8094C5180971D4F8EB83DDC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CDD35787A8094C5180971D4F8EB83DDC-->  <AD_TAB_ID><![CDATA[291]]></AD_TAB_ID>
+<!--CDD35787A8094C5180971D4F8EB83DDC-->  <NAME><![CDATA[IsStocked]]></NAME>
+<!--CDD35787A8094C5180971D4F8EB83DDC-->  <CODE><![CDATA[@SQL=SELECT IsStocked FROM M_PRODUCT WHERE M_PRODUCT_ID = @M_PRODUCT_ID@]]></CODE>
+<!--CDD35787A8094C5180971D4F8EB83DDC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--CDD35787A8094C5180971D4F8EB83DDC--></AD_AUXILIARINPUT>
+
 <!--CDE4158CB7924DA18367CE021C812C60--><AD_AUXILIARINPUT>
 <!--CDE4158CB7924DA18367CE021C812C60-->  <AD_AUXILIARINPUT_ID><![CDATA[CDE4158CB7924DA18367CE021C812C60]]></AD_AUXILIARINPUT_ID>
 <!--CDE4158CB7924DA18367CE021C812C60-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -2791,6 +2912,17 @@
 <!--CEFA857994F14AD4878E490EB46349C6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--CEFA857994F14AD4878E490EB46349C6--></AD_AUXILIARINPUT>
 
+<!--CF00CC6BA5F747CBB77CA682833A22FE--><AD_AUXILIARINPUT>
+<!--CF00CC6BA5F747CBB77CA682833A22FE-->  <AD_AUXILIARINPUT_ID><![CDATA[CF00CC6BA5F747CBB77CA682833A22FE]]></AD_AUXILIARINPUT_ID>
+<!--CF00CC6BA5F747CBB77CA682833A22FE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CF00CC6BA5F747CBB77CA682833A22FE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CF00CC6BA5F747CBB77CA682833A22FE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CF00CC6BA5F747CBB77CA682833A22FE-->  <AD_TAB_ID><![CDATA[187]]></AD_TAB_ID>
+<!--CF00CC6BA5F747CBB77CA682833A22FE-->  <NAME><![CDATA[IsStocked]]></NAME>
+<!--CF00CC6BA5F747CBB77CA682833A22FE-->  <CODE><![CDATA[@SQL=SELECT IsStocked FROM M_PRODUCT WHERE M_PRODUCT_ID = @M_PRODUCT_ID@]]></CODE>
+<!--CF00CC6BA5F747CBB77CA682833A22FE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--CF00CC6BA5F747CBB77CA682833A22FE--></AD_AUXILIARINPUT>
+
 <!--D030CCF0F7514C898D981791049FB0DF--><AD_AUXILIARINPUT>
 <!--D030CCF0F7514C898D981791049FB0DF-->  <AD_AUXILIARINPUT_ID><![CDATA[D030CCF0F7514C898D981791049FB0DF]]></AD_AUXILIARINPUT_ID>
 <!--D030CCF0F7514C898D981791049FB0DF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -224756,7 +224756,7 @@
 <!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--1DAE90C2D10B465D895F57B0E82C5E02-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--1DAE90C2D10B465D895F57B0E82C5E02-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <POSITION><![CDATA[46]]></POSITION>
+<!--1DAE90C2D10B465D895F57B0E82C5E02-->  <POSITION><![CDATA[49]]></POSITION>
 <!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--1DAE90C2D10B465D895F57B0E82C5E02-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--1DAE90C2D10B465D895F57B0E82C5E02-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -227499,7 +227499,7 @@
 <!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <POSITION><![CDATA[43]]></POSITION>
+<!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <POSITION><![CDATA[45]]></POSITION>
 <!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--2B1857B270ED4D5A9AC956BB6AA78F24-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -230264,7 +230264,7 @@
 <!--3BC8041C5D9244729D0742298A6C074F-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--3BC8041C5D9244729D0742298A6C074F-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--3BC8041C5D9244729D0742298A6C074F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--3BC8041C5D9244729D0742298A6C074F-->  <POSITION><![CDATA[25]]></POSITION>
+<!--3BC8041C5D9244729D0742298A6C074F-->  <POSITION><![CDATA[26]]></POSITION>
 <!--3BC8041C5D9244729D0742298A6C074F-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--3BC8041C5D9244729D0742298A6C074F-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--3BC8041C5D9244729D0742298A6C074F-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -230408,7 +230408,7 @@
 <!--3C96A94065F14A29B64ACA59226F7AC8-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--3C96A94065F14A29B64ACA59226F7AC8-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--3C96A94065F14A29B64ACA59226F7AC8-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--3C96A94065F14A29B64ACA59226F7AC8-->  <POSITION><![CDATA[45]]></POSITION>
+<!--3C96A94065F14A29B64ACA59226F7AC8-->  <POSITION><![CDATA[51]]></POSITION>
 <!--3C96A94065F14A29B64ACA59226F7AC8-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--3C96A94065F14A29B64ACA59226F7AC8-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--3C96A94065F14A29B64ACA59226F7AC8-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -233036,7 +233036,7 @@
 <!--4B606E722A74490BADA80E742D344926-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--4B606E722A74490BADA80E742D344926-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--4B606E722A74490BADA80E742D344926-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--4B606E722A74490BADA80E742D344926-->  <POSITION><![CDATA[44]]></POSITION>
+<!--4B606E722A74490BADA80E742D344926-->  <POSITION><![CDATA[46]]></POSITION>
 <!--4B606E722A74490BADA80E742D344926-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--4B606E722A74490BADA80E742D344926-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--4B606E722A74490BADA80E742D344926-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -233464,7 +233464,7 @@
 <!--4F226108AD734B6EA311D2090E732F8B-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--4F226108AD734B6EA311D2090E732F8B-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--4F226108AD734B6EA311D2090E732F8B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--4F226108AD734B6EA311D2090E732F8B-->  <POSITION><![CDATA[41]]></POSITION>
+<!--4F226108AD734B6EA311D2090E732F8B-->  <POSITION><![CDATA[42]]></POSITION>
 <!--4F226108AD734B6EA311D2090E732F8B-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--4F226108AD734B6EA311D2090E732F8B-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--4F226108AD734B6EA311D2090E732F8B-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -233573,7 +233573,7 @@
 <!--505825A28B744B71A0E2FE85C814F3A5-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--505825A28B744B71A0E2FE85C814F3A5-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--505825A28B744B71A0E2FE85C814F3A5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--505825A28B744B71A0E2FE85C814F3A5-->  <POSITION><![CDATA[28]]></POSITION>
+<!--505825A28B744B71A0E2FE85C814F3A5-->  <POSITION><![CDATA[29]]></POSITION>
 <!--505825A28B744B71A0E2FE85C814F3A5-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--505825A28B744B71A0E2FE85C814F3A5-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--505825A28B744B71A0E2FE85C814F3A5-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -237411,7 +237411,7 @@
 <!--569D91AEB07C42C69831058080FEE7F6-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--569D91AEB07C42C69831058080FEE7F6-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--569D91AEB07C42C69831058080FEE7F6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--569D91AEB07C42C69831058080FEE7F6-->  <POSITION><![CDATA[46]]></POSITION>
+<!--569D91AEB07C42C69831058080FEE7F6-->  <POSITION><![CDATA[52]]></POSITION>
 <!--569D91AEB07C42C69831058080FEE7F6-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--569D91AEB07C42C69831058080FEE7F6-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--569D91AEB07C42C69831058080FEE7F6-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -254908,7 +254908,7 @@
 <!--69EFBAC452404EDCA43212FA04D9464D-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--69EFBAC452404EDCA43212FA04D9464D-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--69EFBAC452404EDCA43212FA04D9464D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--69EFBAC452404EDCA43212FA04D9464D-->  <POSITION><![CDATA[57]]></POSITION>
+<!--69EFBAC452404EDCA43212FA04D9464D-->  <POSITION><![CDATA[60]]></POSITION>
 <!--69EFBAC452404EDCA43212FA04D9464D-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--69EFBAC452404EDCA43212FA04D9464D-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--69EFBAC452404EDCA43212FA04D9464D-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -255153,7 +255153,7 @@
 <!--6B6445E10CA84681A0C1B25C299F9CBA-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--6B6445E10CA84681A0C1B25C299F9CBA-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--6B6445E10CA84681A0C1B25C299F9CBA-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--6B6445E10CA84681A0C1B25C299F9CBA-->  <POSITION><![CDATA[55]]></POSITION>
+<!--6B6445E10CA84681A0C1B25C299F9CBA-->  <POSITION><![CDATA[56]]></POSITION>
 <!--6B6445E10CA84681A0C1B25C299F9CBA-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--6B6445E10CA84681A0C1B25C299F9CBA-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--6B6445E10CA84681A0C1B25C299F9CBA-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -259629,6 +259629,40 @@
 <!--77C2EFEE52794BBE82FD666BDB3790AC-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--77C2EFEE52794BBE82FD666BDB3790AC--></AD_COLUMN>
 
+<!--78205B696A7A45A4BAA6E2169000E6BF--><AD_COLUMN>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <AD_COLUMN_ID><![CDATA[78205B696A7A45A4BAA6E2169000E6BF]]></AD_COLUMN_ID>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <NAME><![CDATA[Explode]]></NAME>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <COLUMNNAME><![CDATA[Explode]]></COLUMNNAME>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <AD_TABLE_ID><![CDATA[320]]></AD_TABLE_ID>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <SEQNO><![CDATA[94]]></SEQNO>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <AD_PROCESS_ID><![CDATA[DAE719940FE9463F8A3E3C401BBAFC53]]></AD_PROCESS_ID>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <POSITION><![CDATA[33]]></POSITION>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--78205B696A7A45A4BAA6E2169000E6BF-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--78205B696A7A45A4BAA6E2169000E6BF--></AD_COLUMN>
+
 <!--783E40BE7A564FC19E7870D873CD2B71--><AD_COLUMN>
 <!--783E40BE7A564FC19E7870D873CD2B71-->  <AD_COLUMN_ID><![CDATA[783E40BE7A564FC19E7870D873CD2B71]]></AD_COLUMN_ID>
 <!--783E40BE7A564FC19E7870D873CD2B71-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -276065,7 +276099,7 @@
 <!--86486D2A475A452DB3A739D1FA2F5F4E-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--86486D2A475A452DB3A739D1FA2F5F4E-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--86486D2A475A452DB3A739D1FA2F5F4E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--86486D2A475A452DB3A739D1FA2F5F4E-->  <POSITION><![CDATA[42]]></POSITION>
+<!--86486D2A475A452DB3A739D1FA2F5F4E-->  <POSITION><![CDATA[44]]></POSITION>
 <!--86486D2A475A452DB3A739D1FA2F5F4E-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--86486D2A475A452DB3A739D1FA2F5F4E-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--86486D2A475A452DB3A739D1FA2F5F4E-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -280012,7 +280046,7 @@
 <!--8AD755FCF7244B36B2B20B201EA52CDB-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--8AD755FCF7244B36B2B20B201EA52CDB-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--8AD755FCF7244B36B2B20B201EA52CDB-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--8AD755FCF7244B36B2B20B201EA52CDB-->  <POSITION><![CDATA[42]]></POSITION>
+<!--8AD755FCF7244B36B2B20B201EA52CDB-->  <POSITION><![CDATA[43]]></POSITION>
 <!--8AD755FCF7244B36B2B20B201EA52CDB-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--8AD755FCF7244B36B2B20B201EA52CDB-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--8AD755FCF7244B36B2B20B201EA52CDB-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -280676,7 +280710,7 @@
 <!--8CAD7261EEDA4B9399990094D1D285FB-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--8CAD7261EEDA4B9399990094D1D285FB-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--8CAD7261EEDA4B9399990094D1D285FB-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--8CAD7261EEDA4B9399990094D1D285FB-->  <POSITION><![CDATA[56]]></POSITION>
+<!--8CAD7261EEDA4B9399990094D1D285FB-->  <POSITION><![CDATA[58]]></POSITION>
 <!--8CAD7261EEDA4B9399990094D1D285FB-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--8CAD7261EEDA4B9399990094D1D285FB-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--8CAD7261EEDA4B9399990094D1D285FB-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -287345,6 +287379,40 @@
 <!--9E346850D2CA4A2EACB36F70D85E00FF-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--9E346850D2CA4A2EACB36F70D85E00FF--></AD_COLUMN>
 
+<!--9E6D689864154F91B98ACB746EB9C507--><AD_COLUMN>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <AD_COLUMN_ID><![CDATA[9E6D689864154F91B98ACB746EB9C507]]></AD_COLUMN_ID>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <NAME><![CDATA[BOM_Parent_ID]]></NAME>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <COLUMNNAME><![CDATA[BOM_Parent_ID]]></COLUMNNAME>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <AD_TABLE_ID><![CDATA[260]]></AD_TABLE_ID>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <AD_REFERENCE_VALUE_ID><![CDATA[800063]]></AD_REFERENCE_VALUE_ID>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <SEQNO><![CDATA[204]]></SEQNO>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <AD_ELEMENT_ID><![CDATA[D523A78BC3797401E040007F010045B1]]></AD_ELEMENT_ID>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <POSITION><![CDATA[67]]></POSITION>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--9E6D689864154F91B98ACB746EB9C507-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--9E6D689864154F91B98ACB746EB9C507--></AD_COLUMN>
+
 <!--9E7E0CF74B80471094024EE8181BD14B--><AD_COLUMN>
 <!--9E7E0CF74B80471094024EE8181BD14B-->  <AD_COLUMN_ID><![CDATA[9E7E0CF74B80471094024EE8181BD14B]]></AD_COLUMN_ID>
 <!--9E7E0CF74B80471094024EE8181BD14B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -287371,7 +287439,7 @@
 <!--9E7E0CF74B80471094024EE8181BD14B-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--9E7E0CF74B80471094024EE8181BD14B-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--9E7E0CF74B80471094024EE8181BD14B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--9E7E0CF74B80471094024EE8181BD14B-->  <POSITION><![CDATA[54]]></POSITION>
+<!--9E7E0CF74B80471094024EE8181BD14B-->  <POSITION><![CDATA[55]]></POSITION>
 <!--9E7E0CF74B80471094024EE8181BD14B-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--9E7E0CF74B80471094024EE8181BD14B-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--9E7E0CF74B80471094024EE8181BD14B-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -288196,7 +288264,7 @@
 <!--A0D07DC8AC204F4FB743ED217BFDBB81-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--A0D07DC8AC204F4FB743ED217BFDBB81-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--A0D07DC8AC204F4FB743ED217BFDBB81-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--A0D07DC8AC204F4FB743ED217BFDBB81-->  <POSITION><![CDATA[26]]></POSITION>
+<!--A0D07DC8AC204F4FB743ED217BFDBB81-->  <POSITION><![CDATA[27]]></POSITION>
 <!--A0D07DC8AC204F4FB743ED217BFDBB81-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--A0D07DC8AC204F4FB743ED217BFDBB81-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--A0D07DC8AC204F4FB743ED217BFDBB81-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -288375,7 +288443,7 @@
 <!--A23525C4A1644A889E0CB9B552F1C9EF-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--A23525C4A1644A889E0CB9B552F1C9EF-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--A23525C4A1644A889E0CB9B552F1C9EF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--A23525C4A1644A889E0CB9B552F1C9EF-->  <POSITION><![CDATA[45]]></POSITION>
+<!--A23525C4A1644A889E0CB9B552F1C9EF-->  <POSITION><![CDATA[48]]></POSITION>
 <!--A23525C4A1644A889E0CB9B552F1C9EF-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--A23525C4A1644A889E0CB9B552F1C9EF-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--A23525C4A1644A889E0CB9B552F1C9EF-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -290357,6 +290425,41 @@
 <!--A8D2EB858D4B4BF6A2067093B37FAFE2-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--A8D2EB858D4B4BF6A2067093B37FAFE2--></AD_COLUMN>
 
+<!--A8DDAF547BE745EEAB8967F47308486B--><AD_COLUMN>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <AD_COLUMN_ID><![CDATA[A8DDAF547BE745EEAB8967F47308486B]]></AD_COLUMN_ID>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <NAME><![CDATA[Explode]]></NAME>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <HELP><![CDATA[Explode the BOM product]]></HELP>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <COLUMNNAME><![CDATA[Explode]]></COLUMNNAME>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <AD_TABLE_ID><![CDATA[260]]></AD_TABLE_ID>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <SEQNO><![CDATA[194]]></SEQNO>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <AD_ELEMENT_ID><![CDATA[042A6ABD945A48A587CF3C14FEAE9CCC]]></AD_ELEMENT_ID>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <AD_PROCESS_ID><![CDATA[DFC78024B1F54CBB95DC73425BA6687F]]></AD_PROCESS_ID>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <POSITION><![CDATA[66]]></POSITION>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--A8DDAF547BE745EEAB8967F47308486B-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--A8DDAF547BE745EEAB8967F47308486B--></AD_COLUMN>
+
 <!--A908EA6CF218F9C9E040007F01011582--><AD_COLUMN>
 <!--A908EA6CF218F9C9E040007F01011582-->  <AD_COLUMN_ID><![CDATA[A908EA6CF218F9C9E040007F01011582]]></AD_COLUMN_ID>
 <!--A908EA6CF218F9C9E040007F01011582-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -295423,7 +295526,7 @@
 <!--B2023461A08649D58E5D144D4FC2C507-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--B2023461A08649D58E5D144D4FC2C507-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--B2023461A08649D58E5D144D4FC2C507-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--B2023461A08649D58E5D144D4FC2C507-->  <POSITION><![CDATA[58]]></POSITION>
+<!--B2023461A08649D58E5D144D4FC2C507-->  <POSITION><![CDATA[62]]></POSITION>
 <!--B2023461A08649D58E5D144D4FC2C507-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--B2023461A08649D58E5D144D4FC2C507-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--B2023461A08649D58E5D144D4FC2C507-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -299961,7 +300064,7 @@
 <!--BD1602011B5E4AD1B5DD85E8E9017B11-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--BD1602011B5E4AD1B5DD85E8E9017B11-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--BD1602011B5E4AD1B5DD85E8E9017B11-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--BD1602011B5E4AD1B5DD85E8E9017B11-->  <POSITION><![CDATA[29]]></POSITION>
+<!--BD1602011B5E4AD1B5DD85E8E9017B11-->  <POSITION><![CDATA[30]]></POSITION>
 <!--BD1602011B5E4AD1B5DD85E8E9017B11-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--BD1602011B5E4AD1B5DD85E8E9017B11-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--BD1602011B5E4AD1B5DD85E8E9017B11-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -304766,7 +304869,7 @@
 <!--CB9E308EE8DFDCBAE040007F010001E7-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--CB9E308EE8DFDCBAE040007F010001E7-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--CB9E308EE8DFDCBAE040007F010001E7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--CB9E308EE8DFDCBAE040007F010001E7-->  <POSITION><![CDATA[54]]></POSITION>
+<!--CB9E308EE8DFDCBAE040007F010001E7-->  <POSITION><![CDATA[57]]></POSITION>
 <!--CB9E308EE8DFDCBAE040007F010001E7-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--CB9E308EE8DFDCBAE040007F010001E7-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--CB9E308EE8DFDCBAE040007F010001E7-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -305186,7 +305289,7 @@
 <!--CCCD60BB98EDDFF7E040007F01006A5A-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--CCCD60BB98EDDFF7E040007F01006A5A-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--CCCD60BB98EDDFF7E040007F01006A5A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--CCCD60BB98EDDFF7E040007F01006A5A-->  <POSITION><![CDATA[55]]></POSITION>
+<!--CCCD60BB98EDDFF7E040007F01006A5A-->  <POSITION><![CDATA[61]]></POSITION>
 <!--CCCD60BB98EDDFF7E040007F01006A5A-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--CCCD60BB98EDDFF7E040007F01006A5A-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--CCCD60BB98EDDFF7E040007F01006A5A-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -306160,7 +306263,7 @@
 <!--CE4DBA92A2E80C3CE040007F0100316C-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--CE4DBA92A2E80C3CE040007F0100316C-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--CE4DBA92A2E80C3CE040007F0100316C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--CE4DBA92A2E80C3CE040007F0100316C-->  <POSITION><![CDATA[56]]></POSITION>
+<!--CE4DBA92A2E80C3CE040007F0100316C-->  <POSITION><![CDATA[63]]></POSITION>
 <!--CE4DBA92A2E80C3CE040007F0100316C-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--CE4DBA92A2E80C3CE040007F0100316C-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--CE4DBA92A2E80C3CE040007F0100316C-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -306228,7 +306331,7 @@
 <!--CE612A71B701D54AE040007F01001500-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--CE612A71B701D54AE040007F01001500-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--CE612A71B701D54AE040007F01001500-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--CE612A71B701D54AE040007F01001500-->  <POSITION><![CDATA[57]]></POSITION>
+<!--CE612A71B701D54AE040007F01001500-->  <POSITION><![CDATA[64]]></POSITION>
 <!--CE612A71B701D54AE040007F01001500-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--CE612A71B701D54AE040007F01001500-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--CE612A71B701D54AE040007F01001500-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -306329,7 +306432,7 @@
 <!--CE87A0172A66C01CE040007F01003234-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--CE87A0172A66C01CE040007F01003234-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--CE87A0172A66C01CE040007F01003234-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--CE87A0172A66C01CE040007F01003234-->  <POSITION><![CDATA[58]]></POSITION>
+<!--CE87A0172A66C01CE040007F01003234-->  <POSITION><![CDATA[65]]></POSITION>
 <!--CE87A0172A66C01CE040007F01003234-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--CE87A0172A66C01CE040007F01003234-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--CE87A0172A66C01CE040007F01003234-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -307162,7 +307265,7 @@
 <!--CE9968CA4B29F709E040007F01001BE1-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--CE9968CA4B29F709E040007F01001BE1-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--CE9968CA4B29F709E040007F01001BE1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--CE9968CA4B29F709E040007F01001BE1-->  <POSITION><![CDATA[24]]></POSITION>
+<!--CE9968CA4B29F709E040007F01001BE1-->  <POSITION><![CDATA[25]]></POSITION>
 <!--CE9968CA4B29F709E040007F01001BE1-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--CE9968CA4B29F709E040007F01001BE1-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--CE9968CA4B29F709E040007F01001BE1-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -308648,6 +308751,75 @@
 <!--D5B23458ED9A4ABA826ADF0D0BEA05A0-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--D5B23458ED9A4ABA826ADF0D0BEA05A0--></AD_COLUMN>
 
+<!--D5C2FA0A590EDE66E040007F01004011--><AD_COLUMN>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <AD_COLUMN_ID><![CDATA[D5C2FA0A590EDE66E040007F01004011]]></AD_COLUMN_ID>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <NAME><![CDATA[Explode]]></NAME>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <HELP><![CDATA[Explode the BOM product]]></HELP>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <COLUMNNAME><![CDATA[Explode]]></COLUMNNAME>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <AD_TABLE_ID><![CDATA[333]]></AD_TABLE_ID>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <SEQNO><![CDATA[173]]></SEQNO>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <AD_ELEMENT_ID><![CDATA[042A6ABD945A48A587CF3C14FEAE9CCC]]></AD_ELEMENT_ID>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <AD_PROCESS_ID><![CDATA[6E1ADD5C8B6B4ACB82237DAA8114451E]]></AD_PROCESS_ID>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <POSITION><![CDATA[53]]></POSITION>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--D5C2FA0A590EDE66E040007F01004011-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--D5C2FA0A590EDE66E040007F01004011--></AD_COLUMN>
+
+<!--D5C2FA0A590FDE66E040007F01004011--><AD_COLUMN>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <AD_COLUMN_ID><![CDATA[D5C2FA0A590FDE66E040007F01004011]]></AD_COLUMN_ID>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <NAME><![CDATA[BOM_Parent_ID]]></NAME>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <COLUMNNAME><![CDATA[BOM_Parent_ID]]></COLUMNNAME>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <AD_TABLE_ID><![CDATA[333]]></AD_TABLE_ID>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <AD_REFERENCE_VALUE_ID><![CDATA[800096]]></AD_REFERENCE_VALUE_ID>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <SEQNO><![CDATA[183]]></SEQNO>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <AD_ELEMENT_ID><![CDATA[D523A78BC3797401E040007F010045B1]]></AD_ELEMENT_ID>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <POSITION><![CDATA[54]]></POSITION>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--D5C2FA0A590FDE66E040007F01004011-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--D5C2FA0A590FDE66E040007F01004011--></AD_COLUMN>
+
 <!--D61411AE7BB049FC9456BC9F1169B67F--><AD_COLUMN>
 <!--D61411AE7BB049FC9456BC9F1169B67F-->  <AD_COLUMN_ID><![CDATA[D61411AE7BB049FC9456BC9F1169B67F]]></AD_COLUMN_ID>
 <!--D61411AE7BB049FC9456BC9F1169B67F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -311338,7 +311510,7 @@
 <!--E9065F7B304E419787AD6EB080A54143-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--E9065F7B304E419787AD6EB080A54143-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--E9065F7B304E419787AD6EB080A54143-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--E9065F7B304E419787AD6EB080A54143-->  <POSITION><![CDATA[43]]></POSITION>
+<!--E9065F7B304E419787AD6EB080A54143-->  <POSITION><![CDATA[47]]></POSITION>
 <!--E9065F7B304E419787AD6EB080A54143-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--E9065F7B304E419787AD6EB080A54143-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--E9065F7B304E419787AD6EB080A54143-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -311407,7 +311579,7 @@
 <!--E9612846B6F5472A8F64CF729E0B25AE-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--E9612846B6F5472A8F64CF729E0B25AE-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--E9612846B6F5472A8F64CF729E0B25AE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--E9612846B6F5472A8F64CF729E0B25AE-->  <POSITION><![CDATA[55]]></POSITION>
+<!--E9612846B6F5472A8F64CF729E0B25AE-->  <POSITION><![CDATA[59]]></POSITION>
 <!--E9612846B6F5472A8F64CF729E0B25AE-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--E9612846B6F5472A8F64CF729E0B25AE-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--E9612846B6F5472A8F64CF729E0B25AE-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -312277,6 +312449,39 @@
 <!--EE5656508FCB4E63A1495AA85F993105-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--EE5656508FCB4E63A1495AA85F993105--></AD_COLUMN>
 
+<!--EE8A77D46BED44A29CE8A3584B7924AF--><AD_COLUMN>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <AD_COLUMN_ID><![CDATA[EE8A77D46BED44A29CE8A3584B7924AF]]></AD_COLUMN_ID>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <NAME><![CDATA[BOM_Parent_ID]]></NAME>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <COLUMNNAME><![CDATA[BOM_Parent_ID]]></COLUMNNAME>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <AD_TABLE_ID><![CDATA[320]]></AD_TABLE_ID>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <AD_REFERENCE_VALUE_ID><![CDATA[800064]]></AD_REFERENCE_VALUE_ID>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <SEQNO><![CDATA[104]]></SEQNO>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <POSITION><![CDATA[34]]></POSITION>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--EE8A77D46BED44A29CE8A3584B7924AF-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--EE8A77D46BED44A29CE8A3584B7924AF--></AD_COLUMN>
+
 <!--EF00CB8D2A6C4724AD902C18A5964BDE--><AD_COLUMN>
 <!--EF00CB8D2A6C4724AD902C18A5964BDE-->  <AD_COLUMN_ID><![CDATA[EF00CB8D2A6C4724AD902C18A5964BDE]]></AD_COLUMN_ID>
 <!--EF00CB8D2A6C4724AD902C18A5964BDE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -312658,7 +312863,7 @@
 <!--F12044E4570546E18AF6834B00961F8E-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--F12044E4570546E18AF6834B00961F8E-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--F12044E4570546E18AF6834B00961F8E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--F12044E4570546E18AF6834B00961F8E-->  <POSITION><![CDATA[27]]></POSITION>
+<!--F12044E4570546E18AF6834B00961F8E-->  <POSITION><![CDATA[28]]></POSITION>
 <!--F12044E4570546E18AF6834B00961F8E-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--F12044E4570546E18AF6834B00961F8E-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--F12044E4570546E18AF6834B00961F8E-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -313310,7 +313515,7 @@
 <!--F64D9A10ECE54F0E8720E5A1BF3FCFBE-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--F64D9A10ECE54F0E8720E5A1BF3FCFBE-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--F64D9A10ECE54F0E8720E5A1BF3FCFBE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--F64D9A10ECE54F0E8720E5A1BF3FCFBE-->  <POSITION><![CDATA[44]]></POSITION>
+<!--F64D9A10ECE54F0E8720E5A1BF3FCFBE-->  <POSITION><![CDATA[50]]></POSITION>
 <!--F64D9A10ECE54F0E8720E5A1BF3FCFBE-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--F64D9A10ECE54F0E8720E5A1BF3FCFBE-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--F64D9A10ECE54F0E8720E5A1BF3FCFBE-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -20655,6 +20655,22 @@
 <!--03A29E24DCBB40E3B24F54F45762E2B5-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--03A29E24DCBB40E3B24F54F45762E2B5--></AD_ELEMENT>
 
+<!--042A6ABD945A48A587CF3C14FEAE9CCC--><AD_ELEMENT>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <AD_ELEMENT_ID><![CDATA[042A6ABD945A48A587CF3C14FEAE9CCC]]></AD_ELEMENT_ID>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <COLUMNNAME><![CDATA[Explode]]></COLUMNNAME>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <NAME><![CDATA[Explode]]></NAME>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <PRINTNAME><![CDATA[Explode]]></PRINTNAME>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <HELP><![CDATA[Explode the BOM product]]></HELP>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <PO_NAME><![CDATA[Explode]]></PO_NAME>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <PO_PRINTNAME><![CDATA[Explode]]></PO_PRINTNAME>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <PO_HELP><![CDATA[Explode the BOM product]]></PO_HELP>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--042A6ABD945A48A587CF3C14FEAE9CCC--></AD_ELEMENT>
+
 <!--05C19A393B104A858FCB3E1C3B731617--><AD_ELEMENT>
 <!--05C19A393B104A858FCB3E1C3B731617-->  <AD_ELEMENT_ID><![CDATA[05C19A393B104A858FCB3E1C3B731617]]></AD_ELEMENT_ID>
 <!--05C19A393B104A858FCB3E1C3B731617-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -30506,6 +30522,18 @@
 <!--D50985CA0CA5436ABFD922D3D68D1F59-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--D50985CA0CA5436ABFD922D3D68D1F59--></AD_ELEMENT>
 
+<!--D523A78BC3797401E040007F010045B1--><AD_ELEMENT>
+<!--D523A78BC3797401E040007F010045B1-->  <AD_ELEMENT_ID><![CDATA[D523A78BC3797401E040007F010045B1]]></AD_ELEMENT_ID>
+<!--D523A78BC3797401E040007F010045B1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D523A78BC3797401E040007F010045B1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D523A78BC3797401E040007F010045B1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D523A78BC3797401E040007F010045B1-->  <COLUMNNAME><![CDATA[BOM_Parent_ID]]></COLUMNNAME>
+<!--D523A78BC3797401E040007F010045B1-->  <NAME><![CDATA[BOM_Parent_ID]]></NAME>
+<!--D523A78BC3797401E040007F010045B1-->  <PRINTNAME><![CDATA[BOM_Parent_ID]]></PRINTNAME>
+<!--D523A78BC3797401E040007F010045B1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D523A78BC3797401E040007F010045B1-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--D523A78BC3797401E040007F010045B1--></AD_ELEMENT>
+
 <!--D5391AB03C6A4BA486D10813E944E490--><AD_ELEMENT>
 <!--D5391AB03C6A4BA486D10813E944E490-->  <AD_ELEMENT_ID><![CDATA[D5391AB03C6A4BA486D10813E944E490]]></AD_ELEMENT_ID>
 <!--D5391AB03C6A4BA486D10813E944E490-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -176432,6 +176432,33 @@
 <!--07BA019E35BC4495AD040F8338740D95-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--07BA019E35BC4495AD040F8338740D95--></AD_FIELD>
 
+<!--07BB0AEC45AD406690A36869064CBFAC--><AD_FIELD>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <AD_FIELD_ID><![CDATA[07BB0AEC45AD406690A36869064CBFAC]]></AD_FIELD_ID>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <NAME><![CDATA[BOM_Parent_ID]]></NAME>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <AD_TAB_ID><![CDATA[297]]></AD_TAB_ID>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <AD_COLUMN_ID><![CDATA[EE8A77D46BED44A29CE8A3584B7924AF]]></AD_COLUMN_ID>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <SEQNO><![CDATA[2090]]></SEQNO>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--07BB0AEC45AD406690A36869064CBFAC-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--07BB0AEC45AD406690A36869064CBFAC--></AD_FIELD>
+
 <!--07C14F7112E34EA8B4EB6C2B720A7CB6--><AD_FIELD>
 <!--07C14F7112E34EA8B4EB6C2B720A7CB6-->  <AD_FIELD_ID><![CDATA[07C14F7112E34EA8B4EB6C2B720A7CB6]]></AD_FIELD_ID>
 <!--07C14F7112E34EA8B4EB6C2B720A7CB6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -196462,6 +196489,34 @@
 <!--513E28B717504D7496724ADC3F8A32FA-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--513E28B717504D7496724ADC3F8A32FA--></AD_FIELD>
 
+<!--515C368DC0E049E6B66878FC064D561B--><AD_FIELD>
+<!--515C368DC0E049E6B66878FC064D561B-->  <AD_FIELD_ID><![CDATA[515C368DC0E049E6B66878FC064D561B]]></AD_FIELD_ID>
+<!--515C368DC0E049E6B66878FC064D561B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--515C368DC0E049E6B66878FC064D561B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--515C368DC0E049E6B66878FC064D561B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--515C368DC0E049E6B66878FC064D561B-->  <NAME><![CDATA[Explode]]></NAME>
+<!--515C368DC0E049E6B66878FC064D561B-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--515C368DC0E049E6B66878FC064D561B-->  <AD_TAB_ID><![CDATA[258]]></AD_TAB_ID>
+<!--515C368DC0E049E6B66878FC064D561B-->  <AD_COLUMN_ID><![CDATA[78205B696A7A45A4BAA6E2169000E6BF]]></AD_COLUMN_ID>
+<!--515C368DC0E049E6B66878FC064D561B-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--515C368DC0E049E6B66878FC064D561B-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--515C368DC0E049E6B66878FC064D561B-->  <DISPLAYLOGIC><![CDATA[@IsStocked@='N' & @isBOM@='Y' & @explode@!'Y' & @Processed@='N']]></DISPLAYLOGIC>
+<!--515C368DC0E049E6B66878FC064D561B-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--515C368DC0E049E6B66878FC064D561B-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--515C368DC0E049E6B66878FC064D561B-->  <SEQNO><![CDATA[2050]]></SEQNO>
+<!--515C368DC0E049E6B66878FC064D561B-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--515C368DC0E049E6B66878FC064D561B-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--515C368DC0E049E6B66878FC064D561B-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--515C368DC0E049E6B66878FC064D561B-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--515C368DC0E049E6B66878FC064D561B-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--515C368DC0E049E6B66878FC064D561B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--515C368DC0E049E6B66878FC064D561B-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--515C368DC0E049E6B66878FC064D561B-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--515C368DC0E049E6B66878FC064D561B-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--515C368DC0E049E6B66878FC064D561B-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--515C368DC0E049E6B66878FC064D561B-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--515C368DC0E049E6B66878FC064D561B--></AD_FIELD>
+
 <!--518DD951BF174A1385FED69F2428AC82--><AD_FIELD>
 <!--518DD951BF174A1385FED69F2428AC82-->  <AD_FIELD_ID><![CDATA[518DD951BF174A1385FED69F2428AC82]]></AD_FIELD_ID>
 <!--518DD951BF174A1385FED69F2428AC82-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -231102,6 +231157,35 @@
 <!--8CF8F448556E43CE9CB65E63959891E9-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--8CF8F448556E43CE9CB65E63959891E9--></AD_FIELD>
 
+<!--8CF90D88C5F445C59FF111C9FCEBF413--><AD_FIELD>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <AD_FIELD_ID><![CDATA[8CF90D88C5F445C59FF111C9FCEBF413]]></AD_FIELD_ID>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <NAME><![CDATA[Explode]]></NAME>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <HELP><![CDATA[This process will explode the product of the selected line.]]></HELP>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <AD_TAB_ID><![CDATA[187]]></AD_TAB_ID>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <AD_COLUMN_ID><![CDATA[A8DDAF547BE745EEAB8967F47308486B]]></AD_COLUMN_ID>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <DISPLAYLOGIC><![CDATA[@IsStocked@='N' & @isBOM@='Y' & @explode@!'Y' & @Processed@='N']]></DISPLAYLOGIC>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <SEQNO><![CDATA[2050]]></SEQNO>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--8CF90D88C5F445C59FF111C9FCEBF413-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--8CF90D88C5F445C59FF111C9FCEBF413--></AD_FIELD>
+
 <!--8D0DCC6EB1FA7905E040007F0101256E--><AD_FIELD>
 <!--8D0DCC6EB1FA7905E040007F0101256E-->  <AD_FIELD_ID><![CDATA[8D0DCC6EB1FA7905E040007F0101256E]]></AD_FIELD_ID>
 <!--8D0DCC6EB1FA7905E040007F0101256E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -233676,6 +233760,34 @@
 <!--921CE08F5F3A44EFAAA49F3D15F685F7-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--921CE08F5F3A44EFAAA49F3D15F685F7--></AD_FIELD>
 
+<!--921EFC904DE34843B12D25A65B87274C--><AD_FIELD>
+<!--921EFC904DE34843B12D25A65B87274C-->  <AD_FIELD_ID><![CDATA[921EFC904DE34843B12D25A65B87274C]]></AD_FIELD_ID>
+<!--921EFC904DE34843B12D25A65B87274C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--921EFC904DE34843B12D25A65B87274C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--921EFC904DE34843B12D25A65B87274C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--921EFC904DE34843B12D25A65B87274C-->  <NAME><![CDATA[Explode]]></NAME>
+<!--921EFC904DE34843B12D25A65B87274C-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--921EFC904DE34843B12D25A65B87274C-->  <AD_TAB_ID><![CDATA[297]]></AD_TAB_ID>
+<!--921EFC904DE34843B12D25A65B87274C-->  <AD_COLUMN_ID><![CDATA[78205B696A7A45A4BAA6E2169000E6BF]]></AD_COLUMN_ID>
+<!--921EFC904DE34843B12D25A65B87274C-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--921EFC904DE34843B12D25A65B87274C-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--921EFC904DE34843B12D25A65B87274C-->  <DISPLAYLOGIC><![CDATA[@IsStocked@='N' & @isBOM@='Y' & @explode@!'Y' & @Processed@='N']]></DISPLAYLOGIC>
+<!--921EFC904DE34843B12D25A65B87274C-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--921EFC904DE34843B12D25A65B87274C-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--921EFC904DE34843B12D25A65B87274C-->  <SEQNO><![CDATA[2080]]></SEQNO>
+<!--921EFC904DE34843B12D25A65B87274C-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--921EFC904DE34843B12D25A65B87274C-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--921EFC904DE34843B12D25A65B87274C-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--921EFC904DE34843B12D25A65B87274C-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--921EFC904DE34843B12D25A65B87274C-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--921EFC904DE34843B12D25A65B87274C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--921EFC904DE34843B12D25A65B87274C-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--921EFC904DE34843B12D25A65B87274C-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--921EFC904DE34843B12D25A65B87274C-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--921EFC904DE34843B12D25A65B87274C-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--921EFC904DE34843B12D25A65B87274C-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--921EFC904DE34843B12D25A65B87274C--></AD_FIELD>
+
 <!--9251087BCEC34A5EA1622E67701963EE--><AD_FIELD>
 <!--9251087BCEC34A5EA1622E67701963EE-->  <AD_FIELD_ID><![CDATA[9251087BCEC34A5EA1622E67701963EE]]></AD_FIELD_ID>
 <!--9251087BCEC34A5EA1622E67701963EE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -233965,6 +234077,33 @@
 <!--92FC7D0E63E80A15E040007F0100490C-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--92FC7D0E63E80A15E040007F0100490C--></AD_FIELD>
 
+<!--9306A8CBC95647EEA876DC5DC44BA6AA--><AD_FIELD>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <AD_FIELD_ID><![CDATA[9306A8CBC95647EEA876DC5DC44BA6AA]]></AD_FIELD_ID>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <NAME><![CDATA[BOM_Parent_ID]]></NAME>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <AD_TAB_ID><![CDATA[187]]></AD_TAB_ID>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <AD_COLUMN_ID><![CDATA[9E6D689864154F91B98ACB746EB9C507]]></AD_COLUMN_ID>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <SEQNO><![CDATA[2060]]></SEQNO>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--9306A8CBC95647EEA876DC5DC44BA6AA--></AD_FIELD>
+
 <!--93092ACE16BA46B8B0C7AA66DCAF80BE--><AD_FIELD>
 <!--93092ACE16BA46B8B0C7AA66DCAF80BE-->  <AD_FIELD_ID><![CDATA[93092ACE16BA46B8B0C7AA66DCAF80BE]]></AD_FIELD_ID>
 <!--93092ACE16BA46B8B0C7AA66DCAF80BE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -237436,6 +237575,33 @@
 <!--9F27E6BAB3E741419F843618210618A8-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--9F27E6BAB3E741419F843618210618A8--></AD_FIELD>
 
+<!--9F344552910344288AE70AB109B673A0--><AD_FIELD>
+<!--9F344552910344288AE70AB109B673A0-->  <AD_FIELD_ID><![CDATA[9F344552910344288AE70AB109B673A0]]></AD_FIELD_ID>
+<!--9F344552910344288AE70AB109B673A0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9F344552910344288AE70AB109B673A0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9F344552910344288AE70AB109B673A0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9F344552910344288AE70AB109B673A0-->  <NAME><![CDATA[BOM_Parent_ID]]></NAME>
+<!--9F344552910344288AE70AB109B673A0-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--9F344552910344288AE70AB109B673A0-->  <AD_TAB_ID><![CDATA[258]]></AD_TAB_ID>
+<!--9F344552910344288AE70AB109B673A0-->  <AD_COLUMN_ID><![CDATA[EE8A77D46BED44A29CE8A3584B7924AF]]></AD_COLUMN_ID>
+<!--9F344552910344288AE70AB109B673A0-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--9F344552910344288AE70AB109B673A0-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--9F344552910344288AE70AB109B673A0-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--9F344552910344288AE70AB109B673A0-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--9F344552910344288AE70AB109B673A0-->  <SEQNO><![CDATA[2060]]></SEQNO>
+<!--9F344552910344288AE70AB109B673A0-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--9F344552910344288AE70AB109B673A0-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--9F344552910344288AE70AB109B673A0-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9F344552910344288AE70AB109B673A0-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--9F344552910344288AE70AB109B673A0-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--9F344552910344288AE70AB109B673A0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9F344552910344288AE70AB109B673A0-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--9F344552910344288AE70AB109B673A0-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--9F344552910344288AE70AB109B673A0-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--9F344552910344288AE70AB109B673A0-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--9F344552910344288AE70AB109B673A0-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--9F344552910344288AE70AB109B673A0--></AD_FIELD>
+
 <!--9F3A201539BA457B9D574B18FAB26078--><AD_FIELD>
 <!--9F3A201539BA457B9D574B18FAB26078-->  <AD_FIELD_ID><![CDATA[9F3A201539BA457B9D574B18FAB26078]]></AD_FIELD_ID>
 <!--9F3A201539BA457B9D574B18FAB26078-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -264258,6 +264424,62 @@
 <!--D52270BB77254EB997BBF874D68EEC6C-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--D52270BB77254EB997BBF874D68EEC6C--></AD_FIELD>
 
+<!--D523D045C0050880E040007F0100468E--><AD_FIELD>
+<!--D523D045C0050880E040007F0100468E-->  <AD_FIELD_ID><![CDATA[D523D045C0050880E040007F0100468E]]></AD_FIELD_ID>
+<!--D523D045C0050880E040007F0100468E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D523D045C0050880E040007F0100468E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D523D045C0050880E040007F0100468E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D523D045C0050880E040007F0100468E-->  <NAME><![CDATA[Explode]]></NAME>
+<!--D523D045C0050880E040007F0100468E-->  <HELP><![CDATA[This process will explode the product of the selected line.]]></HELP>
+<!--D523D045C0050880E040007F0100468E-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--D523D045C0050880E040007F0100468E-->  <AD_TAB_ID><![CDATA[293]]></AD_TAB_ID>
+<!--D523D045C0050880E040007F0100468E-->  <AD_COLUMN_ID><![CDATA[A8DDAF547BE745EEAB8967F47308486B]]></AD_COLUMN_ID>
+<!--D523D045C0050880E040007F0100468E-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--D523D045C0050880E040007F0100468E-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--D523D045C0050880E040007F0100468E-->  <DISPLAYLOGIC><![CDATA[@IsStocked@='N' & @isBOM@='Y' & @explode@!'Y' & @Processed@='N']]></DISPLAYLOGIC>
+<!--D523D045C0050880E040007F0100468E-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--D523D045C0050880E040007F0100468E-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--D523D045C0050880E040007F0100468E-->  <SEQNO><![CDATA[2050]]></SEQNO>
+<!--D523D045C0050880E040007F0100468E-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--D523D045C0050880E040007F0100468E-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--D523D045C0050880E040007F0100468E-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D523D045C0050880E040007F0100468E-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--D523D045C0050880E040007F0100468E-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--D523D045C0050880E040007F0100468E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D523D045C0050880E040007F0100468E-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--D523D045C0050880E040007F0100468E-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--D523D045C0050880E040007F0100468E-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--D523D045C0050880E040007F0100468E-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--D523D045C0050880E040007F0100468E-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--D523D045C0050880E040007F0100468E--></AD_FIELD>
+
+<!--D523D045C0060880E040007F0100468E--><AD_FIELD>
+<!--D523D045C0060880E040007F0100468E-->  <AD_FIELD_ID><![CDATA[D523D045C0060880E040007F0100468E]]></AD_FIELD_ID>
+<!--D523D045C0060880E040007F0100468E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D523D045C0060880E040007F0100468E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D523D045C0060880E040007F0100468E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D523D045C0060880E040007F0100468E-->  <NAME><![CDATA[BOM_Parent_ID]]></NAME>
+<!--D523D045C0060880E040007F0100468E-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--D523D045C0060880E040007F0100468E-->  <AD_TAB_ID><![CDATA[293]]></AD_TAB_ID>
+<!--D523D045C0060880E040007F0100468E-->  <AD_COLUMN_ID><![CDATA[9E6D689864154F91B98ACB746EB9C507]]></AD_COLUMN_ID>
+<!--D523D045C0060880E040007F0100468E-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--D523D045C0060880E040007F0100468E-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--D523D045C0060880E040007F0100468E-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--D523D045C0060880E040007F0100468E-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--D523D045C0060880E040007F0100468E-->  <SEQNO><![CDATA[2060]]></SEQNO>
+<!--D523D045C0060880E040007F0100468E-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--D523D045C0060880E040007F0100468E-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--D523D045C0060880E040007F0100468E-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D523D045C0060880E040007F0100468E-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--D523D045C0060880E040007F0100468E-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--D523D045C0060880E040007F0100468E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D523D045C0060880E040007F0100468E-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--D523D045C0060880E040007F0100468E-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--D523D045C0060880E040007F0100468E-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--D523D045C0060880E040007F0100468E-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--D523D045C0060880E040007F0100468E-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--D523D045C0060880E040007F0100468E--></AD_FIELD>
+
 <!--D52AE609DAAA497EA62527427E53D9B2--><AD_FIELD>
 <!--D52AE609DAAA497EA62527427E53D9B2-->  <AD_FIELD_ID><![CDATA[D52AE609DAAA497EA62527427E53D9B2]]></AD_FIELD_ID>
 <!--D52AE609DAAA497EA62527427E53D9B2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -264488,6 +264710,118 @@
 <!--D5BA78CABC7346BEB0C64EE971084AC5-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--D5BA78CABC7346BEB0C64EE971084AC5--></AD_FIELD>
 
+<!--D5C2F8F063FAD47CE040007F01004029--><AD_FIELD>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <AD_FIELD_ID><![CDATA[D5C2F8F063FAD47CE040007F01004029]]></AD_FIELD_ID>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <NAME><![CDATA[Explode]]></NAME>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <HELP><![CDATA[This process will explode the product of the selected line.]]></HELP>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <AD_TAB_ID><![CDATA[270]]></AD_TAB_ID>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <AD_COLUMN_ID><![CDATA[D5C2FA0A590EDE66E040007F01004011]]></AD_COLUMN_ID>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <DISPLAYLOGIC><![CDATA[@IsStocked@='N' & @isBOM@='Y' & @explode@!'Y' & @Processed@='N']]></DISPLAYLOGIC>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <SEQNO><![CDATA[2050]]></SEQNO>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--D5C2F8F063FAD47CE040007F01004029-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--D5C2F8F063FAD47CE040007F01004029--></AD_FIELD>
+
+<!--D5C2F8F063FBD47CE040007F01004029--><AD_FIELD>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <AD_FIELD_ID><![CDATA[D5C2F8F063FBD47CE040007F01004029]]></AD_FIELD_ID>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <NAME><![CDATA[BOM_Parent_ID]]></NAME>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <AD_TAB_ID><![CDATA[270]]></AD_TAB_ID>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <AD_COLUMN_ID><![CDATA[D5C2FA0A590FDE66E040007F01004011]]></AD_COLUMN_ID>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <SEQNO><![CDATA[2060]]></SEQNO>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--D5C2F8F063FBD47CE040007F01004029-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--D5C2F8F063FBD47CE040007F01004029--></AD_FIELD>
+
+<!--D5C2F8F063FCD47CE040007F01004029--><AD_FIELD>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <AD_FIELD_ID><![CDATA[D5C2F8F063FCD47CE040007F01004029]]></AD_FIELD_ID>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <NAME><![CDATA[Explode]]></NAME>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <HELP><![CDATA[This process will explode the product of the selected line.]]></HELP>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <AD_TAB_ID><![CDATA[291]]></AD_TAB_ID>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <AD_COLUMN_ID><![CDATA[D5C2FA0A590EDE66E040007F01004011]]></AD_COLUMN_ID>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <DISPLAYLOGIC><![CDATA[@IsStocked@='N' & @isBOM@='Y' & @explode@!'Y' & @Processed@='N']]></DISPLAYLOGIC>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <SEQNO><![CDATA[2060]]></SEQNO>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--D5C2F8F063FCD47CE040007F01004029-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--D5C2F8F063FCD47CE040007F01004029--></AD_FIELD>
+
+<!--D5C2F8F063FDD47CE040007F01004029--><AD_FIELD>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <AD_FIELD_ID><![CDATA[D5C2F8F063FDD47CE040007F01004029]]></AD_FIELD_ID>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <NAME><![CDATA[BOM_Parent_ID]]></NAME>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <AD_TAB_ID><![CDATA[291]]></AD_TAB_ID>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <AD_COLUMN_ID><![CDATA[D5C2FA0A590FDE66E040007F01004011]]></AD_COLUMN_ID>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <SEQNO><![CDATA[2070]]></SEQNO>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--D5C2F8F063FDD47CE040007F01004029-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--D5C2F8F063FDD47CE040007F01004029--></AD_FIELD>
+
 <!--D5CAB62F6D99404EADBC2A5917BE10B6--><AD_FIELD>
 <!--D5CAB62F6D99404EADBC2A5917BE10B6-->  <AD_FIELD_ID><![CDATA[D5CAB62F6D99404EADBC2A5917BE10B6]]></AD_FIELD_ID>
 <!--D5CAB62F6D99404EADBC2A5917BE10B6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -18104,6 +18104,17 @@
 <!--73F57932E5184CF8B919FDB42A89BDCD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--73F57932E5184CF8B919FDB42A89BDCD--></AD_MESSAGE>
 
+<!--744A4881B5A949748CC72C5E40FBAD59--><AD_MESSAGE>
+<!--744A4881B5A949748CC72C5E40FBAD59-->  <AD_MESSAGE_ID><![CDATA[744A4881B5A949748CC72C5E40FBAD59]]></AD_MESSAGE_ID>
+<!--744A4881B5A949748CC72C5E40FBAD59-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--744A4881B5A949748CC72C5E40FBAD59-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--744A4881B5A949748CC72C5E40FBAD59-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--744A4881B5A949748CC72C5E40FBAD59-->  <VALUE><![CDATA[ProdExploded]]></VALUE>
+<!--744A4881B5A949748CC72C5E40FBAD59-->  <MSGTEXT><![CDATA[The product is already exploded]]></MSGTEXT>
+<!--744A4881B5A949748CC72C5E40FBAD59-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--744A4881B5A949748CC72C5E40FBAD59-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--744A4881B5A949748CC72C5E40FBAD59--></AD_MESSAGE>
+
 <!--74560B0C1A2C42DABDEFE33B6AEB3B86--><AD_MESSAGE>
 <!--74560B0C1A2C42DABDEFE33B6AEB3B86-->  <AD_MESSAGE_ID><![CDATA[74560B0C1A2C42DABDEFE33B6AEB3B86]]></AD_MESSAGE_ID>
 <!--74560B0C1A2C42DABDEFE33B6AEB3B86-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -18923,6 +18934,17 @@
 <!--8EB1FC8AD95146EC885D2E0D4D92F43A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--8EB1FC8AD95146EC885D2E0D4D92F43A--></AD_MESSAGE>
 
+<!--8F3E26D7655C42718BD12468136EA296--><AD_MESSAGE>
+<!--8F3E26D7655C42718BD12468136EA296-->  <AD_MESSAGE_ID><![CDATA[8F3E26D7655C42718BD12468136EA296]]></AD_MESSAGE_ID>
+<!--8F3E26D7655C42718BD12468136EA296-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8F3E26D7655C42718BD12468136EA296-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8F3E26D7655C42718BD12468136EA296-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8F3E26D7655C42718BD12468136EA296-->  <VALUE><![CDATA[InoutLineNotExploded]]></VALUE>
+<!--8F3E26D7655C42718BD12468136EA296-->  <MSGTEXT><![CDATA[A BOM non-stocked is not exploded. Please, explode it manually.]]></MSGTEXT>
+<!--8F3E26D7655C42718BD12468136EA296-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--8F3E26D7655C42718BD12468136EA296-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--8F3E26D7655C42718BD12468136EA296--></AD_MESSAGE>
+
 <!--90227390063C4D1BA7187A2F12C6A55A--><AD_MESSAGE>
 <!--90227390063C4D1BA7187A2F12C6A55A-->  <AD_MESSAGE_ID><![CDATA[90227390063C4D1BA7187A2F12C6A55A]]></AD_MESSAGE_ID>
 <!--90227390063C4D1BA7187A2F12C6A55A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_PROCESS.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/sourcedata/AD_PROCESS.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -5952,6 +5952,28 @@
 <!--6D3B1C36BF594A51878281B505F6CECF-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--6D3B1C36BF594A51878281B505F6CECF--></AD_PROCESS>
 
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E--><AD_PROCESS>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <AD_PROCESS_ID><![CDATA[6E1ADD5C8B6B4ACB82237DAA8114451E]]></AD_PROCESS_ID>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <VALUE><![CDATA[ExplodeBOMInv]]></VALUE>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <NAME><![CDATA[Explode]]></NAME>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <HELP><![CDATA[This process will explode the product of the selected line.]]></HELP>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <PROCEDURENAME><![CDATA[M_INVEXPLODEBOMNOTSTOCK]]></PROCEDURENAME>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <ISREPORT><![CDATA[N]]></ISREPORT>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <UIPATTERN><![CDATA[S]]></UIPATTERN>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
+<!--6E1ADD5C8B6B4ACB82237DAA8114451E--></AD_PROCESS>
+
 <!--6FBD65B0FDB74D1AB07F0EADF18D48AE--><AD_PROCESS>
 <!--6FBD65B0FDB74D1AB07F0EADF18D48AE-->  <AD_PROCESS_ID><![CDATA[6FBD65B0FDB74D1AB07F0EADF18D48AE]]></AD_PROCESS_ID>
 <!--6FBD65B0FDB74D1AB07F0EADF18D48AE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -6358,6 +6380,50 @@
 <!--D85D5B5E368A49B1A6293BA4AE15F0F9-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--D85D5B5E368A49B1A6293BA4AE15F0F9--></AD_PROCESS>
 
+<!--DAE719940FE9463F8A3E3C401BBAFC53--><AD_PROCESS>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <AD_PROCESS_ID><![CDATA[DAE719940FE9463F8A3E3C401BBAFC53]]></AD_PROCESS_ID>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <VALUE><![CDATA[ExplodeBOMInOut]]></VALUE>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <NAME><![CDATA[Explode]]></NAME>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <HELP><![CDATA[This process will explode the product of the selected line.]]></HELP>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <PROCEDURENAME><![CDATA[M_INOUTEXPLODEBOMNOTSTOCK]]></PROCEDURENAME>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <ISREPORT><![CDATA[N]]></ISREPORT>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <UIPATTERN><![CDATA[S]]></UIPATTERN>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--DAE719940FE9463F8A3E3C401BBAFC53-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
+<!--DAE719940FE9463F8A3E3C401BBAFC53--></AD_PROCESS>
+
+<!--DFC78024B1F54CBB95DC73425BA6687F--><AD_PROCESS>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <AD_PROCESS_ID><![CDATA[DFC78024B1F54CBB95DC73425BA6687F]]></AD_PROCESS_ID>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <VALUE><![CDATA[ExplodeBOM]]></VALUE>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <NAME><![CDATA[Explode]]></NAME>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <HELP><![CDATA[This process will explode the product of the selected line.]]></HELP>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <ISUSERSTARTABLE><![CDATA[N]]></ISUSERSTARTABLE>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <PROCEDURENAME><![CDATA[M_EXPLODEBOMNOTSTOCK]]></PROCEDURENAME>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <ISREPORT><![CDATA[N]]></ISREPORT>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <ISDIRECTPRINT><![CDATA[N]]></ISDIRECTPRINT>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <ISJASPER><![CDATA[N]]></ISJASPER>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <ISEXTERNALSERVICE><![CDATA[N]]></ISEXTERNALSERVICE>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <UIPATTERN><![CDATA[S]]></UIPATTERN>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--DFC78024B1F54CBB95DC73425BA6687F-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
+<!--DFC78024B1F54CBB95DC73425BA6687F--></AD_PROCESS>
+
 <!--E5BE98DCF4514A18B571F21183B397DD--><AD_PROCESS>
 <!--E5BE98DCF4514A18B571F21183B397DD-->  <AD_PROCESS_ID><![CDATA[E5BE98DCF4514A18B571F21183B397DD]]></AD_PROCESS_ID>
 <!--E5BE98DCF4514A18B571F21183B397DD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TAB.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src-db/database/sourcedata/AD_TAB.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -3803,6 +3803,7 @@
 <!--317-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--317-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
 <!--317-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
+<!--317-->  <DISPLAYLOGIC><![CDATA[@IsBOM@='Y']]></DISPLAYLOGIC>
 <!--317-->  <EM_OBUIAPP_CAN_ADD><![CDATA[N]]></EM_OBUIAPP_CAN_ADD>
 <!--317-->  <EM_OBUIAPP_CAN_DELETE><![CDATA[N]]></EM_OBUIAPP_CAN_DELETE>
 <!--317-->  <EM_OBUIAPP_SHOW_SELECT><![CDATA[Y]]></EM_OBUIAPP_SHOW_SELECT>
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java	Thu Feb 28 20:24:19 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java	Wed Feb 27 17:16:35 2013 +0100
@@ -1613,7 +1613,8 @@
                   priceStd, lineNetAmt.toString(), priceGross, grossAmt.toString(),
                   priceListGross.toString(), priceStdGross.toString(), isDeferred, planType,
                   periodNumber, startingPeriodId, data[i].aAssetId, data[i].cProjectId,
-                  data[i].cCostcenterId, data[i].user1Id, data[i].user2Id);
+                  data[i].cCostcenterId, data[i].user1Id, data[i].user2Id, data[i].explode,
+                  data[i].isorder);
 
               if (!data[i].mInoutlineId.isEmpty() && strType.equals("SHIPMENT")) {
                 CreateFromInvoiceData.insertShipmentAcctDimension(conn, this, strSequence,
@@ -1815,7 +1816,8 @@
                       CreateFromShipmentData.isInvoiced(conn, this, data[i].cInvoicelineId),
                       (qtyIsNegative ? "-" + total : total), data[i].mProductUomId,
                       strmAttributesetinstanceId, data[i].aAssetId, data[i].cProjectId,
-                      data[i].cCostcenterId, data[i].user1Id, data[i].user2Id, data[i].cBpartnerId);
+                      data[i].cCostcenterId, data[i].user1Id, data[i].user2Id, data[i].cBpartnerId,
+                      data[i].explode, data[i].isorder);
 
                   if (strType.equals("INVOICE") && !data[i].cInvoicelineId.isEmpty()) {
                     CreateFromShipmentData.insertInvoiceAcctDimension(conn, this, strSequence,
@@ -1846,7 +1848,7 @@
                     CreateFromShipmentData.isInvoiced(conn, this, data[i].cInvoicelineId),
                     strQuantityorder, strProductUomId, strmAttributesetinstanceId,
                     data[i].aAssetId, data[i].cProjectId, data[i].cCostcenterId, data[i].user1Id,
-                    data[i].user2Id, data[i].cBpartnerId);
+                    data[i].user2Id, data[i].cBpartnerId, data[i].explode, data[i].isorder);
 
                 if (strType.equals("INVOICE") && !data[i].cInvoicelineId.isEmpty()) {
                   CreateFromShipmentData.insertInvoiceAcctDimension(conn, this, strSequence,
@@ -1858,10 +1860,11 @@
                 if (!strInvoice.equals("")) {
                   String strInOutLineId = CreateFromShipmentData.selectInvoiceInOut(conn, this,
                       data[i].cInvoicelineId);
-                  if (strInOutLineId.isEmpty())
+                  if (strInOutLineId.isEmpty()) {
                     CreateFromShipmentData.updateInvoice(conn, this, strSequence,
                         data[i].cInvoicelineId);
-                  else {
+                    CreateFromShipmentData.updateBOMStructure(conn, this, strKey, strSequence);
+                  } else {
                     CreateFromShipmentData.insertMatchInv(conn, this, vars.getUser(),
                         data[i].cInvoicelineId, strSequence, data[i].cInvoiceId);
                   }
@@ -2020,7 +2023,8 @@
                       CreateFromShipmentData.isInvoiced(conn, this, data[i].cInvoicelineId),
                       (qtyIsNegative ? "-" + total : total), data[i].mProductUomId,
                       data[i].mAttributesetinstanceId, data[i].aAssetId, data[i].cProjectId,
-                      data[i].cCostcenterId, data[i].user1Id, data[i].user2Id, data[i].cBpartnerId);
+                      data[i].cCostcenterId, data[i].user1Id, data[i].user2Id, data[i].cBpartnerId,
+                      data[i].explode, data[i].isorder);
 
                   if (strType.equals("INVOICE") && !data[i].cInvoicelineId.isEmpty()) {
                     CreateFromShipmentData.insertInvoiceAcctDimension(conn, this, strSequence,
@@ -2052,7 +2056,7 @@
                     CreateFromShipmentData.isInvoiced(conn, this, data[i].cInvoicelineId),
                     data[i].quantityorder, data[i].mProductUomId, data[i].mAttributesetinstanceId,
                     data[i].aAssetId, data[i].cProjectId, data[i].cCostcenterId, data[i].user1Id,
-                    data[i].user2Id, data[i].cBpartnerId);
+                    data[i].user2Id, data[i].cBpartnerId, data[i].explode, data[i].isorder);
 
                 if (strType.equals("INVOICE") && !data[i].cInvoicelineId.isEmpty()) {
                   CreateFromShipmentData.insertInvoiceAcctDimension(conn, this, strSequence,
@@ -2062,10 +2066,11 @@
                       vars.getClient(), data[i].adOrgId, vars.getUser(), data[i].cOrderlineId);
                 }
 
-                if (!strInvoice.equals(""))
+                if (!strInvoice.equals("")) {
                   CreateFromShipmentData.updateInvoice(conn, this, strSequence,
                       data[i].cInvoicelineId);
-                else
+                  CreateFromShipmentData.updateBOMStructure(conn, this, strKey, strSequence);
+                } else
                   CreateFromShipmentData.updateInvoiceOrder(conn, this, strSequence,
                       data[i].cOrderlineId);
               } catch (final ServletException ex) {
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice.html	Thu Feb 28 20:24:19 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice.html	Wed Feb 27 17:16:35 2013 +0100
@@ -47,6 +47,11 @@
 
     function submitThisPage(strCommand) {
       if (validate(strCommand)) {
+          var inp= document.frmMain.inpcOrderId;
+          var total = document.frmMain.inpcOrderId.length;
+          for (var i=0;i<total;i++) {
+              inp[i].removeAttribute("disabled");
+          }
         submitCommandForm(strCommand, false, null, null);
         return true;
       }
@@ -133,6 +138,22 @@
     function onResizeDo(){
      resizeAreaCreateFrom();
     }
+    
+    function checkchilds(inp, bolMark) {
+      if (bolMark==null) bolMark = false;
+      if (!inp) return false;
+      else if (!inp.length) {
+        document.getElementById('CheckNum' + inp.value).checked = bolMark;
+      }  
+      else {
+        var total = inp.length;
+        for (var i=0;i<total;i++) {
+          document.getElementById('CheckNum' +inp[i].value).checked = bolMark;
+        }
+      }
+      return true;
+     }
+
   </script>
 </head>
 <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="onLoadDo();" onresize="onResizeDo();">
@@ -419,7 +440,7 @@
                     <div id="sectionDetail">
                       <tr class="DataGrid_Body_Row DataGrid_Body_Row_yy" onclick="selectActual(this); return true;" ondblclick="checkActual(this); return true;" id="funcEvenOddRowxx"> 
                         <td class="DataGrid_Body_LineNoCell DataGrid_Body_Cell_CheckBox">
-                          <span class="Checkbox_container_NOT_Focused"><input type="checkbox"  name="inpcOrderId" value="" id="CheckNumxx"></input></span>
+                          <span class="Checkbox_container_NOT_Focused"><input type="checkbox"  name="inpcOrderId" value="" id="CheckNumxx" onclick="checkchilds(document.frmMain['inpBomParent'+this.value], this.checked)"></input><input type="hidden" id="fieldBomParent" name="inpBomParentxx" value=""></input></span>
                         </td>
                         <td class="DataGrid_Body_Cell" onmouseover="HoverCell(this);" onmouseout="unHoverCell(this);" id="fieldQuantity">xxQuantity</td>
                         <td class="DataGrid_Body_Cell" onmouseover="HoverCell(this);" onmouseout="unHoverCell(this);" id="fieldCuomid">xx</td>
@@ -522,4 +543,4 @@
   </table>
 </form>
 </body>
-</html>
+</html>
\ No newline at end of file
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -18,53 +18,58 @@
  ************************************************************************
 -->
 <REPORT>
-	<template file="CreateFrom_Invoice.html"/>
-	<PARAMETER id="paramLanguage" name="language" default=""/>
-	<PARAMETER id="paramDirectory" name="directory" default=""/>
-	<PARAMETER id="paramCSS" name="theme" attribute="href" replace="Default"/>
+    <template file="CreateFrom_Invoice.html"/>
+    <PARAMETER id="paramLanguage" name="language" default=""/>
+    <PARAMETER id="paramDirectory" name="directory" default=""/>
+    <PARAMETER id="paramCSS" name="theme" attribute="href" replace="Default"/>
 
-	<PARAMETER id="paramKey" name="key" attribute="value"/>
-	<PARAMETER id="paramTableId" name="tableId" attribute="value"/>
-	<PARAMETER id="paramProcessId" name="processId" attribute="value"/>
-	<PARAMETER id="paramDateInvoiced" name="dateInvoiced" attribute="value"/>
-	<PARAMETER id="paramBPartnerLocation" name="bpartnerLocation" attribute="value"/>
-	<PARAMETER id="paramPriceList" name="pricelist" attribute="value"/>
-	<PARAMETER id="paramPath" name="path" attribute="value"/>
-	<PARAMETER id="paramWindowId" name="windowId" attribute="value"/>
-	<PARAMETER id="paramTabName" name="tabName" attribute="value"/>
-	<PARAMETER id="paramBPartnerId" name="cBpartnerId" attribute="value"/>
+    <PARAMETER id="paramKey" name="key" attribute="value"/>
+    <PARAMETER id="paramTableId" name="tableId" attribute="value"/>
+    <PARAMETER id="paramProcessId" name="processId" attribute="value"/>
+    <PARAMETER id="paramDateInvoiced" name="dateInvoiced" attribute="value"/>
+    <PARAMETER id="paramBPartnerLocation" name="bpartnerLocation" attribute="value"/>
+    <PARAMETER id="paramPriceList" name="pricelist" attribute="value"/>
+    <PARAMETER id="paramPath" name="path" attribute="value"/>
+    <PARAMETER id="paramWindowId" name="windowId" attribute="value"/>
+    <PARAMETER id="paramTabName" name="tabName" attribute="value"/>
+    <PARAMETER id="paramBPartnerId" name="cBpartnerId" attribute="value"/>
   <PARAMETER id="keyMap" name="keyMap"/>
   <PARAMETER id="messageBoxID" name="messageType" attribute="class" replace="yy" default="HIDDEN"/>
   <PARAMETER id="messageBoxIDTitle" name="messageTitle" default=""/>
   <PARAMETER id="messageBoxIDMessage" name="messageMessage" default=""/>
 
 
-	<PARAMETER id="paramBPartnerDescription" name="BPartnerDescription" attribute="value"/>
-	<PARAMETER id="paramPurchaseOrder" name="PurchaseOrder"/>
-	<PARAMETER id="paramShipment" name="Shipment"/>
-	<PARAMETER id="paramType" name="pType" attribute="value"/>
-	<SUBREPORT id="reportPurchaseOrder" name="reportPurchaseOrder" report="org/openbravo/erpCommon/reference/List">
-		<ARGUMENT name="parameterListSelected" withId="paramPurchaseOrder"/>
-	</SUBREPORT>
-	<SUBREPORT id="reportShipmentReciept" name="reportShipmentReciept" report="org/openbravo/erpCommon/reference/List">
-		<ARGUMENT name="parameterListSelected" withId="paramShipment"/>
-	</SUBREPORT>
-	<PARAMETER id="param2" name="param2" default="2"/>
-	<structure name="structure1">
+    <PARAMETER id="paramBPartnerDescription" name="BPartnerDescription" attribute="value"/>
+    <PARAMETER id="paramPurchaseOrder" name="PurchaseOrder"/>
+    <PARAMETER id="paramShipment" name="Shipment"/>
+    <PARAMETER id="paramType" name="pType" attribute="value"/>
+    <SUBREPORT id="reportPurchaseOrder" name="reportPurchaseOrder" report="org/openbravo/erpCommon/reference/List">
+        <ARGUMENT name="parameterListSelected" withId="paramPurchaseOrder"/>
+    </SUBREPORT>
+    <SUBREPORT id="reportShipmentReciept" name="reportShipmentReciept" report="org/openbravo/erpCommon/reference/List">
+        <ARGUMENT name="parameterListSelected" withId="paramShipment"/>
+    </SUBREPORT>
+    <PARAMETER id="param2" name="param2" default="2"/>
+  <PARAMETER id="paramCheck" name="check" default="N"/>
+    <structure name="structure1">
     <FIELD id="fieldRownum1">rownum</FIELD>
     <FUNCTION id="funcEvenOddRowxx" name="MODULE" arg1="fieldRownum1" arg2="param2" format="integerEdition" attribute="class" replace="yy"/>
 
     <FIELD id="funcEvenOddRowxx" attribute="id" replace="xx">rownum</FIELD>
 
-    <FIELD id="CheckNumxx" attribute="id" replace="xx">rownum</FIELD>
+    <FIELD id="CheckNumxx" attribute="id" replace="xx">cOrderlineId</FIELD>
     <FIELD id="CheckNumxx" attribute="value">cOrderlineId</FIELD>
-
-		<FIELD id="fieldQuantity" format="euroRelation">qty</FIELD>
-		<FIELD id="fieldCuomid">uomsymbol</FIELD>
-		<FIELD id="fieldMproductid">relationName</FIELD>
-		<FIELD id="fieldPurchaseorder">line</FIELD>
-		<FIELD id="fieldNameOrder">nameorder</FIELD>
-		<FIELD id="fieldNameShipment">nameshipment</FIELD>
-		<SECTION id="sectionDetail"/>
-	</structure>
-</REPORT>
+    <FIELD id="CheckNumxx" boolean="disabled" withId="paramCheck">isparent</FIELD>
+    <FIELD id="fieldBomParent" attribute="value">cOrderlineId</FIELD>
+    <FIELD id="fieldBomParent" attribute="name" replace="xx">bom_parent_id</FIELD>
+    
+    
+        <FIELD id="fieldQuantity" format="euroRelation">qty</FIELD>
+        <FIELD id="fieldCuomid">uomsymbol</FIELD>
+        <FIELD id="fieldMproductid">relationName</FIELD>
+        <FIELD id="fieldPurchaseorder">line</FIELD>
+        <FIELD id="fieldNameOrder">nameorder</FIELD>
+        <FIELD id="fieldNameShipment">nameshipment</FIELD>
+        <SECTION id="sectionDetail"/>
+    </structure>
+</REPORT>
\ No newline at end of file
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql	Thu Feb 28 20:24:19 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql	Wed Feb 27 17:16:35 2013 +0100
@@ -40,7 +40,7 @@
         l.taxbaseamt, l.CancelPriceAD, '' AS Rate, '' AS gross_unit_price, '' AS grosspricelist, '' AS grosspricestd,
         COALESCE(l.A_Asset_ID, o.A_Asset_ID) AS A_Asset_ID, COALESCE(l.C_Project_ID, o.C_Project_ID) AS C_Project_ID,
         COALESCE(l.C_Costcenter_ID, o.C_Costcenter_ID) AS C_Costcenter_ID,
-        COALESCE(l.User1_ID, o.User1_ID) AS User1_ID, COALESCE(l.User2_ID, o.User2_ID) AS User2_ID
+        COALESCE(l.User1_ID, o.User1_ID) AS User1_ID, COALESCE(l.User2_ID, o.User2_ID) AS User2_ID, l.explode, '' as isOrder, CASE WHEN l.Bom_parent_id is null then 'Y' else 'N' END isparent, l.bom_parent_id
         FROM C_ORDERLINE l left join M_MATCHPO m on  l.C_OrderLine_ID=m.C_OrderLine_ID
                                                  AND m.C_InvoiceLine_ID IS NOT NULL, 
         C_ORDER o, C_UOM uom,  M_PRODUCT p
@@ -61,8 +61,8 @@
         GROUP BY o.C_ORDER_ID, o.DocumentNo, o.DateOrdered, o.GrandTotal, l.QtyOrdered,l.C_UOM_ID,
         uom.UOMSymbol,l.M_Product_ID,p.NAME,l.Line,l.C_OrderLine_ID, l.ad_org_id, l.taxbaseamt,l.CancelPriceAD,
         COALESCE(l.A_Asset_ID, o.A_Asset_ID), COALESCE(l.C_Project_ID, o.C_Project_ID), COALESCE(l.C_Costcenter_ID, o.C_Costcenter_ID),
-        COALESCE(l.User1_ID, o.User1_ID), COALESCE(l.User2_ID, o.User2_ID)
-        HAVING (l.QtyOrdered-SUM(COALESCE(m.Qty,0))) <> 0
+        COALESCE(l.User1_ID, o.User1_ID), COALESCE(l.User2_ID, o.User2_ID), l.explode, l.bom_parent_id 
+        HAVING ( (l.explode='Y') OR ((l.QtyOrdered-SUM(COALESCE(m.Qty,0))) <> 0)) 
         ORDER BY NAME, l.Line
       ]]>
     </Sql>
@@ -111,7 +111,8 @@
 	Ad_Column_Identifier(to_char('M_Product'), to_char(l.m_product_id), to_char(?)) AS RELATION_NAME, 
         l.C_OrderLine_ID,l.Line, l.ad_Org_id, l.taxbaseamt,
         COALESCE(l.A_Asset_ID, o.A_Asset_ID) AS A_Asset_ID, COALESCE(l.C_Project_ID, o.C_Project_ID) AS C_Project_ID, COALESCE(l.C_Costcenter_ID, o.C_Costcenter_ID) AS C_Costcenter_ID,
-        COALESCE(l.User1_ID, o.User1_ID) AS User1_ID, COALESCE(l.User2_ID, o.User2_ID) AS User2_ID
+        COALESCE(l.User1_ID, o.User1_ID) AS User1_ID, COALESCE(l.User2_ID, o.User2_ID) AS User2_ID, l.explode, l.Bom_parent_id, 
+         CASE WHEN l.Bom_parent_id is null then 'Y' else 'N' END isparent
         FROM C_INVOICE_CANDIDATE_V ic, C_UOM uom, C_ORDER o, C_ORDERLINE l, M_PRODUCT p 
         WHERE l.C_UOM_ID=uom.C_UOM_ID
         AND o.C_ORDER_ID = ic.C_ORDER_ID 
@@ -123,7 +124,7 @@
         GROUP BY o.C_ORDER_ID, o.DocumentNo, o.DateOrdered, o.GrandTotal, l.QtyOrdered,
         l.C_UOM_ID,uom.UOMSymbol,l.M_Product_ID,p.NAME,l.Line,l.C_OrderLine_ID, l.QTYINVOICED, l.ad_org_id, l.taxbaseamt,
         COALESCE(l.A_Asset_ID, o.A_Asset_ID), COALESCE(l.C_Project_ID, o.C_Project_ID), COALESCE(l.C_Costcenter_ID, o.C_Costcenter_ID),
-        COALESCE(l.User1_ID, o.User1_ID), COALESCE(l.User2_ID, o.User2_ID)
+        COALESCE(l.User1_ID, o.User1_ID), COALESCE(l.User2_ID, o.User2_ID), l.explode, l.Bom_parent_id
         ORDER BY NAME, l.Line
       ]]>
     </Sql>
@@ -253,10 +254,10 @@
       A.C_OrderLine_ID,A.Line, uom.stdprecision AS stdprecision, cur.priceprecision, 
       B.M_InOutLine_ID, A.Description, (CASE WHEN B.M_InOutLine_ID IS NULL THEN A.quantityOrder ELSE B.quantityOrder END) AS quantityOrder, 
       (CASE WHEN B.M_InOutLine_ID IS NULL THEN A.M_Product_UOM_ID ELSE B.M_Product_UOM_ID END) AS M_Product_UOM_ID, A.M_ATTRIBUTESETINSTANCE_ID, A.ad_org_id,
-      A.taxbaseamt, A.a_asset_id, A.c_project_id, A.c_costcenter_id, A.user1_id, A.user2_id
+      A.taxbaseamt, A.a_asset_id, A.c_project_id, A.c_costcenter_id, A.user1_id, A.user2_id, A.explode, 'Y' as isOrder
       FROM c_currency cur,C_UOM uom, M_PRODUCT p, 
       (SELECT COALESCE(l.A_Asset_ID, o.A_Asset_ID) AS A_Asset_ID, COALESCE(l.C_Project_ID, o.C_Project_ID) AS C_Project_ID, COALESCE(l.C_Costcenter_ID, o.C_Costcenter_ID) AS C_Costcenter_ID,
-       COALESCE(l.User1_ID, o.User1_ID) AS User1_ID, COALESCE(l.User2_ID, o.User2_ID) AS User2_ID, l.ad_org_id,l.C_CURRENCY_ID,l.C_UOM_ID, l.M_Product_ID, l.Line, l.Description, l.C_OrderLine_ID, (l.QtyOrdered-SUM(COALESCE(mp.Qty,0))-
+       COALESCE(l.User1_ID, o.User1_ID) AS User1_ID, COALESCE(l.User2_ID, o.User2_ID) AS User2_ID, l.explode,l.ad_org_id,l.C_CURRENCY_ID,l.C_UOM_ID, l.M_Product_ID, l.Line, l.Description, l.C_OrderLine_ID, (l.QtyOrdered-SUM(COALESCE(mp.Qty,0))-
        COALESCE((SELECT SUM(COALESCE(CI.QtyINVOICED, 0))  
        FROM C_ORDERLINE CO LEFT JOIN C_INVOICELINE CI ON CI.C_ORDERLINE_ID = CO.C_ORDERLINE_ID
        WHERE  CI.C_INVOICE_ID=? AND CO.C_ORDERLINE_ID = l.c_orderline_id
@@ -271,7 +272,7 @@
         LEFT JOIN C_Order o ON l.C_Order_ID = o.C_Order_ID
         GROUP BY l.ad_org_id,l.C_CURRENCY_ID,l.C_UOM_ID, l.M_Product_ID, l.Line, l.Description, l.C_OrderLine_ID, l.QtyOrdered, l.quantityOrder, l.M_Product_UOM_ID,
         l.M_ATTRIBUTESETINSTANCE_ID, l.taxbaseamt, COALESCE(l.A_Asset_ID, o.A_Asset_ID), COALESCE(l.C_Project_ID, o.C_Project_ID), COALESCE(l.C_Costcenter_ID, o.C_Costcenter_ID),
-        COALESCE(l.User1_ID, o.User1_ID), COALESCE(l.User2_ID, o.User2_ID)) A left join 
+        COALESCE(l.User1_ID, o.User1_ID), COALESCE(l.User2_ID, o.User2_ID), l.explode) A left join 
       (SELECT il.M_InOutLine_ID, il.C_OrderLine_ID, (il.MovementQty-SUM(COALESCE(mi.Qty,0))) AS QTY,
       il.quantityOrder*C_DIVIDE((il.MovementQty-SUM(COALESCE(mi.Qty,0))),(il.MovementQty)) as quantityOrder, il.M_Product_UOM_ID
         FROM M_INOUTLINE il left join M_MATCHINV mi on il.M_InOutLine_ID=mi.M_InOutLine_ID,
@@ -302,7 +303,7 @@
         (CASE WHEN il.M_INOUTLINE_ID IS NULL THEN l.quantityOrder*C_DIVIDE((l.QtyOrdered-COALESCE(l.QTYINVOICED ,0)),(l.QtyOrdered)) ELSE il.quantityOrder END) AS quantityOrder, 
         (CASE WHEN il.M_INOUTLINE_ID IS NULL THEN l.M_Product_UOM_ID ELSE il.M_Product_UOM_ID END) AS M_Product_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id,
         l.taxbaseamt, COALESCE(l.A_Asset_ID, o.A_Asset_ID) as A_Asset_ID, COALESCE(l.C_Project_ID, o.C_Project_ID) as C_Project_ID,
-        COALESCE(l.C_Costcenter_ID, o.C_Costcenter_ID) as C_Costcenter_ID, COALESCE(l.User1_ID, o.User1_ID) as User1_ID, COALESCE(l.User2_ID, o.User2_ID) as User2_ID
+        COALESCE(l.C_Costcenter_ID, o.C_Costcenter_ID) as C_Costcenter_ID, COALESCE(l.User1_ID, o.User1_ID) as User1_ID, COALESCE(l.User2_ID, o.User2_ID) as User2_ID, l.explode, 'Y' as isOrder
         FROM C_ORDERLINE l left join (SELECT M_InOutLine.* FROM M_InOutLine, M_InOut
                                       WHERE M_InOut.M_InOut_ID = M_InOutLine.M_InOut_ID
                                       AND M_InOutLine.IsInvoiced = 'N'
@@ -315,8 +316,8 @@
         l.QTYINVOICED, il.M_InOutLine_ID, il.MovementQty, l.Description, l.quantityOrder, il.quantityOrder, 
         l.M_Product_UOM_ID, il.M_Product_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID,l.ad_org_id, cur.priceprecision,
         l.taxbaseamt, COALESCE(l.A_Asset_ID, o.A_Asset_ID), COALESCE(l.C_Project_ID, o.C_Project_ID), COALESCE(l.C_Costcenter_ID, o.C_Costcenter_ID),
-        COALESCE(l.User1_ID, o.User1_ID), COALESCE(l.User2_ID, o.User2_ID)
-        HAVING (l.QtyOrdered-COALESCE(l.QTYINVOICED ,0)) <> 0 
+        COALESCE(l.User1_ID, o.User1_ID), COALESCE(l.User2_ID, o.User2_ID), l.explode
+        HAVING ( (l.explode='Y') OR ((l.QtyOrdered-COALESCE(l.QTYINVOICED ,0)) <> 0)) 
         ORDER BY l.Line
       ]]>
     </Sql>
@@ -334,7 +335,8 @@
         l.M_InOutLine_ID,l.Line, l.M_InOutLine_ID as C_OrderLine_ID,
         COALESCE(l.A_Asset_ID, s.A_Asset_ID) AS A_Asset_ID, COALESCE(l.C_Project_ID, s.C_Project_ID) AS C_Project_ID, 
         COALESCE(l.C_Costcenter_ID, s.C_Costcenter_ID) AS C_Costcenter_ID,
-        COALESCE(l.User1_ID, s.User1_ID) AS User1_ID, COALESCE(l.User2_ID, s.User2_ID) AS User2_ID
+        COALESCE(l.User1_ID, s.User1_ID) AS User1_ID, COALESCE(l.User2_ID, s.User2_ID) AS User2_ID, l.explode, l.Bom_parent_id, 
+        CASE WHEN l.Bom_parent_id is null then 'Y' else 'N' END isparent
         FROM M_INOUTLINE l left join M_ATTRIBUTESETINSTANCE ma on l.M_ATTRIBUTESETINSTANCE_ID = ma.M_ATTRIBUTESETINSTANCE_ID
                            left join M_MATCHINV mi             on l.M_InOutLine_ID=mi.M_InOutLine_ID
                            left join c_orderline ol on l.c_orderline_id = ol.c_orderline_id
@@ -353,8 +355,8 @@
         GROUP BY s.M_InOut_ID, s.DocumentNo, s.MovementDate, l.MovementQty,l.C_UOM_ID,uom.UOMSymbol,
         l.M_Product_ID,ma.serno,p.NAME, l.M_InOutLine_ID,l.Line,l.C_OrderLine_ID,
         COALESCE(l.A_Asset_ID, s.A_Asset_ID), COALESCE(l.C_Project_ID, s.C_Project_ID), COALESCE(l.C_Costcenter_ID, s.C_Costcenter_ID),
-        COALESCE(l.User1_ID, s.User1_ID), COALESCE(l.User2_ID, s.User2_ID)
-        HAVING  (l.MovementQty-SUM(COALESCE(mi.Qty,0))) <> 0
+        COALESCE(l.User1_ID, s.User1_ID), COALESCE(l.User2_ID, s.User2_ID), l.explode, l.bom_parent_id
+        HAVING  (((l.MovementQty-SUM(COALESCE(mi.Qty,0))) <> 0) OR (l.explode='Y'))
         ORDER BY NAME, l.Line
       ]]>
     </Sql>
@@ -409,7 +411,8 @@
         l.M_InOutLine_ID as C_OrderLine_ID,
         COALESCE(l.A_Asset_ID, s.A_Asset_ID) AS A_Asset_ID, COALESCE(l.C_Project_ID, s.C_Project_ID) AS C_Project_ID, 
         COALESCE(l.C_Costcenter_ID, s.C_Costcenter_ID) AS C_Costcenter_ID,
-        COALESCE(l.User1_ID, s.User1_ID) AS User1_ID, COALESCE(l.User2_ID, s.User2_ID) AS User2_ID
+        COALESCE(l.User1_ID, s.User1_ID) AS User1_ID, COALESCE(l.User2_ID, s.User2_ID) AS User2_ID, l.explode, l.Bom_parent_id, 
+        CASE WHEN l.Bom_parent_id is null then 'Y' else 'N' END isparent
         FROM M_INOUTLINE l
                 left join M_ATTRIBUTESETINSTANCE ma on l.M_ATTRIBUTESETINSTANCE_ID = ma.M_ATTRIBUTESETINSTANCE_ID
                 left join c_orderline ol on l.c_orderline_id = ol.c_orderline_id
@@ -430,9 +433,10 @@
         GROUP BY s.M_InOut_ID, s.DocumentNo, s.MovementDate, l.MovementQty,l.C_UOM_ID,uom.UOMSymbol,
         l.M_Product_ID,p.NAME, ma.serno, l.M_InOutLine_ID,l.Line,l.C_OrderLine_ID,
         COALESCE(l.A_Asset_ID, s.A_Asset_ID), COALESCE(l.C_Project_ID, s.C_Project_ID), COALESCE(l.C_Costcenter_ID, s.C_Costcenter_ID),
-        COALESCE(l.User1_ID, s.User1_ID), COALESCE(l.User2_ID, s.User2_ID)
+        COALESCE(l.User1_ID, s.User1_ID), COALESCE(l.User2_ID, s.User2_ID), l.explode, l.Bom_parent_id
         HAVING (l.movementqty >= 0 AND l.movementqty > SUM(COALESCE(CASE WHEN i.docstatus = 'CO' THEN il.qtyinvoiced ELSE 0 END, 0)))
            OR (l.movementqty < 0 AND l.movementqty < SUM(COALESCE(CASE WHEN i.docstatus = 'CO' THEN il.qtyinvoiced ELSE 0 END, 0)))
+           OR (l.explode='Y')
         ORDER BY NAME, l.Line
       ]]>
     </Sql>
@@ -590,7 +594,8 @@
       l.M_Product_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, COALESCE(co.taxbaseamt,0) * C_DIVIDE((l.MovementQty-SUM(COALESCE(mi.Qty,0))),COALESCE(co.qtyordered,1)) as taxbaseamt,
       COALESCE(l.A_Asset_ID, s.A_Asset_ID) AS A_Asset_ID, COALESCE(l.C_Project_ID, s.C_Project_ID) AS C_Project_ID, 
       COALESCE(l.C_Costcenter_ID, s.C_Costcenter_ID) AS C_Costcenter_ID,
-      COALESCE(l.User1_ID, s.User1_ID) AS User1_ID, COALESCE(l.User2_ID, s.User2_ID) AS User2_ID
+      COALESCE(l.User1_ID, s.User1_ID) AS User1_ID, COALESCE(l.User2_ID, s.User2_ID) AS User2_ID,
+      l.explode, 'N' as isOrder
       FROM M_INOUTLINE l left join M_MATCHINV mi on l.M_InOutLine_ID=mi.M_InOutLine_ID
             left join C_ORDERLINE co ON co.C_ORDERLINE_ID=l.C_ORDERLINE_ID,
       C_UOM uom,  M_PRODUCT p, M_InOut s
@@ -599,7 +604,7 @@
       AND l.M_Product_ID=p.M_Product_ID
       GROUP BY l.MovementQty,l.C_UOM_ID,uom.UOMSymbol,l.M_Product_ID,p.NAME, l.M_InOutLine_ID,l.Line,l.C_OrderLine_ID, l.Description,l.quantityOrder, l.M_Product_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, co.taxbaseamt,co.qtyordered,
       COALESCE(l.A_Asset_ID, s.A_Asset_ID), COALESCE(l.C_Project_ID, s.C_Project_ID), COALESCE(l.C_Costcenter_ID, s.C_Costcenter_ID),
-      COALESCE(l.User1_ID, s.User1_ID), COALESCE(l.User2_ID, s.User2_ID)
+      COALESCE(l.User1_ID, s.User1_ID), COALESCE(l.User2_ID, s.User2_ID),l.explode
       ORDER BY l.Line
       ]]>
     </Sql>
@@ -616,7 +621,8 @@
         l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id,
         COALESCE(l.A_Asset_ID, s.A_Asset_ID) AS A_Asset_ID, COALESCE(l.C_Project_ID, s.C_Project_ID) AS C_Project_ID, 
         COALESCE(l.C_Costcenter_ID, s.C_Costcenter_ID) AS C_Costcenter_ID,
-        COALESCE(l.User1_ID, s.User1_ID) AS User1_ID, COALESCE(l.User2_ID, s.User2_ID) AS User2_ID
+        COALESCE(l.User1_ID, s.User1_ID) AS User1_ID, COALESCE(l.User2_ID, s.User2_ID) AS User2_ID, 
+        l.explode, 'N' as isOrder
         FROM C_UOM uom, M_INOUTLINE l
           left join c_invoiceline il on l.m_inoutline_id = il.m_inoutline_id
           left join c_invoice i on il.c_invoice_id = i.c_invoice_id 
@@ -626,9 +632,10 @@
         AND l.M_Product_ID=p.M_Product_ID 
         GROUP BY l.MovementQty,l.C_UOM_ID,uom.UOMSymbol,l.M_Product_ID,p.NAME, l.M_InOutLine_ID,l.Line,l.C_OrderLine_ID, l.Description, l.quantityOrder, l.M_Product_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, l.m_inout_id,
         COALESCE(l.A_Asset_ID, s.A_Asset_ID), COALESCE(l.C_Project_ID, s.C_Project_ID), COALESCE(l.C_Costcenter_ID, s.C_Costcenter_ID),
-        COALESCE(l.User1_ID, s.User1_ID), COALESCE(l.User2_ID, s.User2_ID)
+        COALESCE(l.User1_ID, s.User1_ID), COALESCE(l.User2_ID, s.User2_ID), l.explode
         HAVING (l.movementqty >= 0 AND l.movementqty > SUM(COALESCE(CASE WHEN i.docstatus = 'CO' THEN il.qtyinvoiced ELSE 0 END, 0)))
           OR (l.movementqty < 0 AND l.movementqty < SUM(COALESCE(CASE WHEN i.docstatus = 'CO' THEN il.qtyinvoiced ELSE 0 END, 0)))
+          OR(l.explode='Y') 
         ORDER BY l.Line
       ]]>
     </Sql>
@@ -704,7 +711,8 @@
         M_Attributesetinstance_ID, PriceStd, taxbaseamt, excludeforwithholding,
         gross_unit_price, line_gross_amount, grosspricelist, grosspricestd,
         isdeferred, defplantype, periodnumber, c_period_id,
-        a_asset_id, c_project_id, c_costcenter_id, user1_id, user2_id
+        a_asset_id, c_project_id, c_costcenter_id, user1_id, user2_id, explode, 
+        BOM_Parent_id
         )
       VALUES 
         (?, ?, ?, ?, 'Y', 
@@ -716,8 +724,21 @@
          ?, TO_NUMBER(?), TO_NUMBER(?), 'N',
          TO_NUMBER(?), TO_NUMBER(?), TO_NUMBER(?), TO_NUMBER(?),
          ?, ?, TO_NUMBER(?), ?,
-         ?, ?, ?, ?, ?
+         ?, ?, ?, ?, ?, ?,
+         (CASE to_char(?) WHEN 'Y' THEN (SELECT c_invoiceline_id 
+                                FROM c_invoiceline 
+                                WHERE c_invoice_id=? 
+                                   and c_orderline_id = (SELECT BOM_parent_id 
+                                                         FROM c_orderline 
+                                                         WHERE c_orderline_id = ?))
+          ELSE (SELECT c_invoiceline_id 
+                FROM c_invoiceline 
+                WHERE c_invoice_id=? 
+                and m_inoutline_id = (SELECT BOM_parent_id 
+                                      FROM m_inoutline 
+                                      WHERE m_inoutline_id = ?)) END
          )
+        )
     </Sql>
     <Parameter name="cInvoicelineId"/>
     <Parameter name="cInvoiceId"/>
@@ -756,6 +777,12 @@
     <Parameter name="cCostcenterId"/>
     <Parameter name="user1Id"/>
     <Parameter name="user2Id"/>
+    <Parameter name="explode"/>
+    <Parameter name="isOrder"/>
+    <Parameter name="cInvoiceId"/>
+    <Parameter name="cOrderlineId"/>
+    <Parameter name="cInvoiceId"/>
+    <Parameter name="mInoutlineId"/>
   </SqlMethod>
   <SqlMethod name="insertAcctDimension" type="preparedStatement" connection="true" return="rowCount">
     <SqlMethodComment>Copies the order line accounting dimensions to invoice lines</SqlMethodComment>
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment.html	Thu Feb 28 20:24:19 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment.html	Wed Feb 27 17:16:35 2013 +0100
@@ -45,6 +45,11 @@
 
     function submitThisPage(strCommand) {
       if (validate(strCommand)) {
+        var inp= document.frmMain.inpId;
+        var total = document.frmMain.inpId.length;
+        for (var i=0;i<total;i++) {
+            inp[i].removeAttribute("disabled");
+        }       
         submitCommandForm(strCommand, false, null, null);
         return true;
       }
@@ -60,7 +65,7 @@
 
     function validate(action) {
       var frm=document.frmMain;
-      if (radioValue(frm.inpId)==null) {
+      if (radioValue(frm.inpId)==null) { 
         showJSMessage(1);
         setTimeout('resizeAreaCreateFrom()',100);
         return false;
@@ -82,6 +87,7 @@
 
     function onloadFunctions() {
     }
+    
 
     function enableLocalShortcuts(){
         keyArray[keyArray.length] = new keyArrayItem("ENTER", "openSearch(null, null, '../info/BusinessPartner.html', 'SELECTOR_BUSINESS', true, 'frmMain', 'inpcBpartnerId', 'inpBpartnerId_DES', document.frmMain.inpBpartnerId_DES.value, 'Command', 'KEY');", "inpBpartnerId_DES", "null");
@@ -102,7 +108,6 @@
 
     function checkActual(obj) {
       selectedCheck = selectedRow.id.toString().replace('funcEvenOddRow', 'CheckNum');
-      document.getElementById(selectedCheck).checked = !document.getElementById(selectedCheck).checked;
     }
 
     function HoverCell(cell) {
@@ -135,7 +140,25 @@
 
     function onResizeDo(){
       resizeAreaCreateFrom();
-    }
+    } 
+    
+    function checkchilds(inp, bolMark) {
+      
+      if (bolMark==null) bolMark = false;
+      if (!inp) return false;
+      else if (!inp.length) {
+        document.getElementById('inpfieldID' + inp.value).checked = bolMark;
+      }  
+      else {
+        var total = inp.length;
+        for (var i=0;i<total;i++) {
+          document.getElementById('inpfieldID' +inp[i].value).checked = bolMark;
+        }
+      }
+      return true;
+     }
+     
+
   </script>
 </head>
 <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="onLoadDo();" onresize="onResizeDo();">
@@ -425,13 +448,13 @@
             </tr>
             <div id="sectionDetail">
               <tr class="DataGrid_Body_Row DataGrid_Body_Row_yy" onclick="selectActual(this); return true;" ondblclick="checkActual(this); return true;" id="funcEvenOddRowxx"> 
-                <td class="DataGrid_Body_LineNoCell DataGrid_Body_Cell_CheckBox"> <span class="Checkbox_container_NOT_Focused"><input type="checkbox" id="fieldID" name="inpId" value=""></input></span></td>
+                <td class="DataGrid_Body_LineNoCell DataGrid_Body_Cell_CheckBox"> <span class="Checkbox_container_NOT_Focused"><input type="checkbox" disabled="disabled" id="inpfieldIDxx" name="inpId" value="" onclick="checkchilds(document.frmMain['inpBomParent'+this.value], this.checked)"></input><input type="hidden" id="fieldBomParent" name="inpBomParentxx" value=""></input></span></td>
                 <td class="DataGrid_Body_Cell" onmouseover="HoverCell(this);" onmouseout="unHoverCell(this);" id="fieldQuantity">xxQuantity</td>
                 <td class="DataGrid_Body_Cell" onmouseover="HoverCell(this);" onmouseout="unHoverCell(this);" id="fieldCuomid">xxUOM</td>
                 <td class="DataGrid_Body_Cell" onmouseover="HoverCell(this);" onmouseout="unHoverCell(this);" id="fieldMproductid">xxProduct</td>
                 <td class="DataGrid_Body_Cell" onmouseover="HoverCell(this);" onmouseout="unHoverCell(this);" id="fieldPurchaseorder">xxPurchase Order</td>
                 <td class="DataGrid_Body_Cell"></td>
-                <td class="DataGrid_Body_Cell"></td>
+                <td class="DataGrid_Body_Cell"></td>      
               </tr>
             </div>
           </table>
@@ -514,3 +537,4 @@
   </table>
 </body>
 </html>
+
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -18,35 +18,35 @@
  ************************************************************************
 -->
 <REPORT>
-	<template file="CreateFrom_Shipment.html"/>
-	<PARAMETER id="paramLanguage" name="language" default=""/>
-	<PARAMETER id="paramDirectory" name="directory" default=""/>
-	<PARAMETER id="paramCSS" name="theme" attribute="href" replace="Default"/>
-	<PARAMETER id="paramKey" name="key" attribute="value"/>
-	<PARAMETER id="paramTableId" name="tableId" attribute="value"/>
-	<PARAMETER id="paramProcessId" name="processId" attribute="value"/>
-	<PARAMETER id="paramPath" name="path" attribute="value"/>
-	<PARAMETER id="paramWindowId" name="windowId" attribute="value"/>
-	<PARAMETER id="paramTabName" name="tabName" attribute="value"/>
-	<PARAMETER id="paramBPartnerId" name="cBpartnerId" attribute="value"/>
-	<PARAMETER id="paramBPartnerDescription" name="BPartnerDescription" attribute="value"/>
-	<PARAMETER id="paramM_Locator_ID_DES" name="M_Locator_ID_DES" attribute="value"/>
-	<PARAMETER id="paramM_Locator_ID" name="M_Locator_ID" attribute="value"/>
-	<PARAMETER id="paramPurchaseOrder" name="PurchaseOrder"/>
-	<PARAMETER id="paramInvoice" name="Invoice"/>
-	<PARAMETER id="paramType" name="pType" attribute="value"/>
-	<PARAMETER id="processing" name="processing" default="" attribute="value"/>
-	<PARAMETER id="linkButtonOk" name="processId" default="" attribute="onclick" replace="xx"/>
-	<PARAMETER id="linkButtonOk" name="ok" default="" attribute="onmouseover" replace="xx"/>
-	<PARAMETER id="linkButtonCancel" name="cancel" default="" attribute="onmouseover" replace="xx"/>
+    <template file="CreateFrom_Shipment.html"/>
+    <PARAMETER id="paramLanguage" name="language" default=""/>
+    <PARAMETER id="paramDirectory" name="directory" default=""/>
+    <PARAMETER id="paramCSS" name="theme" attribute="href" replace="Default"/>
+    <PARAMETER id="paramKey" name="key" attribute="value"/>
+    <PARAMETER id="paramTableId" name="tableId" attribute="value"/>
+    <PARAMETER id="paramProcessId" name="processId" attribute="value"/>
+    <PARAMETER id="paramPath" name="path" attribute="value"/>
+    <PARAMETER id="paramWindowId" name="windowId" attribute="value"/>
+    <PARAMETER id="paramTabName" name="tabName" attribute="value"/>
+    <PARAMETER id="paramBPartnerId" name="cBpartnerId" attribute="value"/>
+    <PARAMETER id="paramBPartnerDescription" name="BPartnerDescription" attribute="value"/>
+    <PARAMETER id="paramM_Locator_ID_DES" name="M_Locator_ID_DES" attribute="value"/>
+    <PARAMETER id="paramM_Locator_ID" name="M_Locator_ID" attribute="value"/>
+    <PARAMETER id="paramPurchaseOrder" name="PurchaseOrder"/>
+    <PARAMETER id="paramInvoice" name="Invoice"/>
+    <PARAMETER id="paramType" name="pType" attribute="value"/>
+    <PARAMETER id="processing" name="processing" default="" attribute="value"/>
+    <PARAMETER id="linkButtonOk" name="processId" default="" attribute="onclick" replace="xx"/>
+    <PARAMETER id="linkButtonOk" name="ok" default="" attribute="onmouseover" replace="xx"/>
+    <PARAMETER id="linkButtonCancel" name="cancel" default="" attribute="onmouseover" replace="xx"/>
   <PARAMETER id="buttonOk" name="ok" default="" attribute="title" replace="xx"/>
-	<PARAMETER id="buttonCancel" name="cancel" default="" attribute="title" replace="xx"/>
-	<SUBREPORT id="reportPurchaseOrder" name="reportPurchaseOrder" report="org/openbravo/erpCommon/reference/List">
-		<ARGUMENT name="parameterListSelected" withId="paramPurchaseOrder"/>
-	</SUBREPORT>
-	<SUBREPORT id="reportInvoice" name="reportInvoice" report="org/openbravo/erpCommon/reference/List">
-		<ARGUMENT name="parameterListSelected" withId="paramInvoice"/>
-	</SUBREPORT>
+    <PARAMETER id="buttonCancel" name="cancel" default="" attribute="title" replace="xx"/>
+    <SUBREPORT id="reportPurchaseOrder" name="reportPurchaseOrder" report="org/openbravo/erpCommon/reference/List">
+        <ARGUMENT name="parameterListSelected" withId="paramPurchaseOrder"/>
+    </SUBREPORT>
+    <SUBREPORT id="reportInvoice" name="reportInvoice" report="org/openbravo/erpCommon/reference/List">
+        <ARGUMENT name="parameterListSelected" withId="paramInvoice"/>
+    </SUBREPORT>
 
   <PARAMETER id="keyMap" name="keyMap"/>
 
@@ -54,17 +54,22 @@
   <PARAMETER id="messageBoxIDTitle" name="messageTitle" default=""/>
   <PARAMETER id="messageBoxIDMessage" name="messageMessage" default=""/>
 
-	<PARAMETER id="param2" name="param2" default="2"/>
-	<structure name="structure1">
+    <PARAMETER id="param2" name="param2" default="2"/>
+    <PARAMETER id="paramCheck" name="check" default="N"/> 
+    <structure name="structure1">
     <FIELD id="fieldRownum1">rownum</FIELD>
     <FUNCTION id="funcEvenOddRowxx" name="MODULE" arg1="fieldRownum1" arg2="param2" format="integerEdition" attribute="class" replace="yy"/>
     <FIELD id="funcEvenOddRowxx" attribute="id" replace="xx">rownum</FIELD>
 
-		<FIELD id="fieldID" attribute="value">id</FIELD>
-		<FIELD id="fieldQuantity" format="euroRelation">qty</FIELD>
-		<FIELD id="fieldCuomid">uomsymbol</FIELD>
-		<FIELD id="fieldMproductid">relationName</FIELD>
-		<FIELD id="fieldPurchaseorder">line</FIELD>
-		<SECTION id="sectionDetail"/>
-	</structure>
-</REPORT>
+        <FIELD id="inpfieldIDxx" attribute="value">id</FIELD>
+        <FIELD id="inpfieldIDxx" boolean="disabled" withId="paramCheck">isparent</FIELD>
+        <FIELD id="inpfieldIDxx" attribute="id" replace="xx">id</FIELD>
+        <FIELD id="fieldBomParent" attribute="value">id</FIELD>
+        <FIELD id="fieldBomParent" attribute="name" replace="xx">bom_parent_id</FIELD>
+        <FIELD id="fieldQuantity" format="euroRelation">qty</FIELD>
+        <FIELD id="fieldCuomid">uomsymbol</FIELD>
+        <FIELD id="fieldMproductid">relationName</FIELD>
+        <FIELD id="fieldPurchaseorder">line</FIELD>
+        <SECTION id="sectionDetail"/>  
+    </structure>
+</REPORT>
\ No newline at end of file
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO.html	Thu Feb 28 20:24:19 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO.html	Wed Feb 27 17:16:35 2013 +0100
@@ -45,6 +45,12 @@
 
     function submitThisPage(strCommand) {
       if (validate(strCommand)) {
+        var inp= document.frmMain.inpId; 
+        var total = document.frmMain.inpId.length;
+        for (var i=0;i<total;i++) {
+            inp[i].removeAttribute("disabled");
+            document.frmMain['inpmovementqty' + inp[i].value].removeAttribute("disabled");
+        }
         submitCommandForm(strCommand, false, null, '../ad_actionButton/CreateFrom.html', '_self');
         return true;
       }
@@ -95,12 +101,12 @@
 }
 
 function updateData(clave, marcar) {
-	if (marcar==null) marcar=false;
-	var frm = document.frmMain;
-	frm.elements["inpmovementqty" + clave].disabled=!marcar; 
-	frm.elements["inpquantityorder" + clave].disabled=!marcar;
-	frm.elements["inpmProductUomId" + clave].disabled=!marcar;
-	return true;
+    if (marcar==null) marcar=false;
+    var frm = document.frmMain;
+    frm.elements["inpmovementqty" + clave].disabled=!marcar; 
+    frm.elements["inpquantityorder" + clave].disabled=!marcar;
+    frm.elements["inpmProductUomId" + clave].disabled=!marcar;
+    return true;
 }
 
 function checkAllCreateLines(chk, bolCheck)
@@ -108,20 +114,20 @@
   if (bolCheck==null) bolCheck = false;
   if (!chk) return false;
   else if (!chk.length){
-	  chk.checked = bolCheck;
-	  var frm = document.frmMain;
-	  frm.elements["inpmovementqty" + chk.value].disabled=!bolCheck; 
-	  frm.elements["inpquantityorder" + chk.value].disabled=!bolCheck;
-	  frm.elements["inpmProductUomId" + chk.value].disabled=!bolCheck;
+      chk.checked = bolCheck;
+      var frm = document.frmMain;
+      frm.elements["inpmovementqty" + chk.value].disabled=!bolCheck; 
+      frm.elements["inpquantityorder" + chk.value].disabled=!bolCheck;
+      frm.elements["inpmProductUomId" + chk.value].disabled=!bolCheck;
   }
   else {
     var total = chk.length;
     for (var i=0;i<total;i++) {
     chk[i].checked = bolCheck;
-	var frm = document.frmMain;
-	frm.elements["inpmovementqty" + chk[i].value].disabled=!bolCheck; 
-	frm.elements["inpquantityorder" + chk[i].value].disabled=!bolCheck;
-	frm.elements["inpmProductUomId" + chk[i].value].disabled=!bolCheck;
+    var frm = document.frmMain;
+    frm.elements["inpmovementqty" + chk[i].value].disabled=!bolCheck; 
+    frm.elements["inpquantityorder" + chk[i].value].disabled=!bolCheck;
+    frm.elements["inpmProductUomId" + chk[i].value].disabled=!bolCheck;
     }
   }
   return true;
@@ -178,6 +184,21 @@
     function onResizeDo(){
       resizeAreaCreateFrom();
     }
+    
+    function checkchilds(inp, bolMark) {
+        if (bolMark==null) bolMark = false;
+         if (!inp) return false;
+         else if (!inp.length) {
+             document.getElementById('inpfieldID' + inp.value).checked = bolMark;
+         }
+         else {
+             var total = inp.length;
+             for (var i=0;i<total;i++) {
+                 document.getElementById('inpfieldID' +inp[i].value).checked = bolMark; 
+             }
+         }
+         return true;
+    }
   </script>
 </head>
 <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="onLoadDo();" onresize="onResizeDo();">
@@ -458,109 +479,109 @@
 
             <tr class="Popup_Client_Selector_DataGrid_HeaderRow"> 
                       <th width="29" class="DataGrid_Header_LineNoCell DataGrid_Body_Cell_CheckBox"> <span class="Checkbox_container_NOT_Focused"><input type="checkbox" name="inpTodos" onclick="checkAllCreateLines(document.frmMain.inpId, this.checked);return true;"></input></span></th>
-					  <th width="70" class="DataGrid_Header_Cell">Quantity</th>
+                      <th width="70" class="DataGrid_Header_Cell">Quantity</th>
                       <th width="70" class="DataGrid_Header_Cell">Unit</th>
-					  <th width="71" class="DataGrid_Header_Cell">Secondary Quantity</th>
-					  <th width="71" class="DataGrid_Header_Cell">Secondary Unit</th>
+                      <th width="71" class="DataGrid_Header_Cell">Secondary Quantity</th>
+                      <th width="71" class="DataGrid_Header_Cell">Secondary Unit</th>
                       <th width="129" class="DataGrid_Header_Cell">Product</th>
                       <th width="127" class="DataGrid_Header_Cell">Line</th>
-					  <th width="124" class="DataGrid_Header_Cell">Storage Bin</th>
-					  <th width="124" class="DataGrid_Header_Cell">Attribute</th>
+                      <th width="124" class="DataGrid_Header_Cell">Storage Bin</th>
+                      <th width="124" class="DataGrid_Header_Cell">Attribute</th>
                     </tr>
                     <div id="sectionDetail">
                       <tr class="DataGrid_Body_Row DataGrid_Body_Row_yy" onclick="selectActual(this); return true;" ondblclick="checkActual(this); return true;" id="funcEvenOddRowxx">
-						<td class="DataGrid_Body_LineNoCell DataGrid_Body_Cell_CheckBox"> <span class="Checkbox_container_NOT_Focused"><input type="checkbox" id="fieldID" name="inpId" onclick="updateData(this.value, this.checked);return true;" value=""></input></span></td>
-						<td class="DataGrid_Body_Cell">
-						<input  type="text" id="fieldQuantity" class="dojoValidateValid TextBox_btn_OneCell_width number" required="false" value="" maxlength="10" name="inpmovementqtyxx" disabled="true" onkeyup="" onkeypress="changeToEditingMode();"></input>
-						</td>
-						<td class="DataGrid_Body_Cell" onmouseover="HoverCell(this);" onmouseout="unHoverCell(this);" id="fieldCuomName" value="">xxUOM</td>
-						<input type="hidden" id="fieldCuomId" name="inpcUomIdxx" value="0"></input>
-						<td class="DataGrid_Body_Cell">
-						<input type="zzz" id="fieldSecQuantity" class="dojoValidateValid TextBox_btn_OneCell_width number" required="false" value="" maxlength="10" name="inpquantityorderxx" disabled="true" onkeyup="" onkeypress="changeToEditingMode();" onchange="logChanges(this);calloutSL_CreateLines_Conversion_UOM('ff');return true;"></input>
-						</td>
-						<td  class="DataGrid_Body_Cell">
-						<select class="DataGrid_Body_Cell" style="display:yyy;" name="inpmProductUomIdxx" id="fieldSecUom" disabled="true" onchange="logChanges(this);calloutSL_CreateLines_Conversion_UOM('ff');return true;"><div id="reportM_Product_Uom_To_ID"></div></select>
-						</td>
+                        <td class="DataGrid_Body_LineNoCell DataGrid_Body_Cell_CheckBox"> <span class="Checkbox_container_NOT_Focused"><input type="checkbox" id="inpfieldIDxx" name="inpId" onclick="updateData(this.value, this.checked);checkchilds(document.frmMain['inpBomParent'+this.value], this.checked)" value=""></input><input type="hidden" id="fieldBomParent" name="inpBomParentxx" value=""></input></span></td>
+                        <td class="DataGrid_Body_Cell">
+                        <input  type="text" id="fieldQuantity" class="dojoValidateValid TextBox_btn_OneCell_width number" required="false" value="" maxlength="10" name="inpmovementqtyxx" disabled="true" onkeyup="" onkeypress="changeToEditingMode();"></input>
+                        </td>
+                        <td class="DataGrid_Body_Cell" onmouseover="HoverCell(this);" onmouseout="unHoverCell(this);" id="fieldCuomName" value="">xxUOM</td>
+                        <input type="hidden" id="fieldCuomId" name="inpcUomIdxx" value="0"></input>
+                        <td class="DataGrid_Body_Cell">
+                        <input type="zzz" id="fieldSecQuantity" class="dojoValidateValid TextBox_btn_OneCell_width number" required="false" value="" maxlength="10" name="inpquantityorderxx" disabled="true" onkeyup="" onkeypress="changeToEditingMode();" onchange="logChanges(this);calloutSL_CreateLines_Conversion_UOM('ff');return true;"></input>
+                        </td>
+                        <td  class="DataGrid_Body_Cell">
+                        <select class="DataGrid_Body_Cell" style="display:yyy;" name="inpmProductUomIdxx" id="fieldSecUom" disabled="true" onchange="logChanges(this);calloutSL_CreateLines_Conversion_UOM('ff');return true;"><div id="reportM_Product_Uom_To_ID"></div></select>
+                        </td>
                         <td class="DataGrid_Body_Cell" onmouseover="HoverCell(this);" onmouseout="unHoverCell(this);" id="fieldMproductid">xxProduct</td>
                         <td class="DataGrid_Body_Cell" onmouseover="HoverCell(this);" onmouseout="unHoverCell(this);" id="fieldPurchaseorder">xxPurchase Order</td>
-						<td class="DataGrid_Body_Cell"> 
-						<table>
-						<td>
-						<input type="text" onfocus="enableLocatorShortcut('xx');" class="dojoValidateValid TextBox_btn_TwoCells_width" required="false" maxlength="22" name="inpmLocatorId_DESxx" id="fieldM_Locator_ID_DES"></input>
-						</td>
-						<td>
-						<a id="fieldLocatorDES" class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Locator'; return true;" onblur=" window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;"  onclick="openSearch(null, null, '../info/Locator.html', null, false, 'frmMain', 'inpmLocatorIdyyy', 'inpmLocatorId_DESvvv', document.frmMain.inpmLocatorId_DESxxx.value, 'WindowID', document.frmMain.inpWindowId.value);return false;" >
+                        <td class="DataGrid_Body_Cell"> 
+                        <table>
+                        <td>
+                        <input type="text" onfocus="enableLocatorShortcut('xx');" class="dojoValidateValid TextBox_btn_TwoCells_width" required="false" maxlength="22" name="inpmLocatorId_DESxx" id="fieldM_Locator_ID_DES"></input>
+                        </td>
+                        <td>
+                        <a id="fieldLocatorDES" class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Locator'; return true;" onblur=" window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;"  onclick="openSearch(null, null, '../info/Locator.html', null, false, 'frmMain', 'inpmLocatorIdyyy', 'inpmLocatorId_DESvvv', document.frmMain.inpmLocatorId_DESxxx.value, 'WindowID', document.frmMain.inpWindowId.value);return false;" >
                         <table class="FieldButton"onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Locator';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
                             <td class="FieldButton_bg">
                               <img alt="Locator" class="FieldButton_Icon FieldButton_Icon_Locator" title="Locator" src="../../../../../web/images/blank.gif" border="0" id="buttonLocator"></img>
                             </td>
                           
                         </table>
-						</a>
-						</td>
-						<input type="hidden" name="inpmLocatorIdxx" id="fieldM_Locator_ID" value="">
-						</table>
-						</td>
-						<input style="display:none;" type="text" name="inpmProductIdxxxx_LOC" id="M_Product_ID_LOC" value=""></input>
-						<input type="text" style="display:none;" name="inpmProductIdyyyy_ATR" id="M_Product_ID_ATR" value=""></input>
-						<input type="text" style="display:none;" name="inpmProductIdzzzz" id="M_Product_ID" value=""></input>
-						<td class="TextBox_btn_ContentCell" id="M_AttributeSetInstance_ID_inp_td">
-						  <input type="hidden" name="inpmAttributesetinstanceIdxxx" id="M_AttributeSetInstance_ID" value="" onchange="logChanges(this);return true;"></input>
-						  <table border="0" cellspacing="0" cellpadding="0" summary="" class="">
-							<tr>
-							  <td class="TextBox_ContentCell">
-							  <table style="border:0px;border-collapse:collapse;">
-								<tr>
-								  <td style="padding-top: 0px;">
-									
-									<input type="text" class="dojoValidateValid readonly TextBox_btn_OneCell_width" tabindex="1" maxlength="22"  name="inpmAttributesetinstanceId_Rxxx" id="M_AttributeSetInstance_ID_R" value="" required="false" onkeypress="changeToEditingMode();" onchange="validateTextBox(this.id);" readonly=true></input>
-								  </td>
-								</tr>
-							  </table>
-						  <span class="TextBox_MsgContainer_span" style="display: none;" id="M_AttributeSetInstance_ID_RinvalidSpan">
-							<table class="TextBox_MsgContainer_table">
-							  <tr class="TextBox_MsgContainer_tr">
-								<td class="TextBox_MsgContainer_td"><div class="TextBox_MsgContainer_div"></div></td><td></td>
-							  </tr>
-							  <tr>
-								<td colspan="2" class="invalid"><div class="TextBox_MsgContainer_div2" id="M_AttributeSetInstance_ID_RinvalidSpanText">* The value entered is not valid.</div></td>
-							  </tr>
-							</table>
-						  </span>
-						  <span class="TextBox_MsgContainer_span" style="display: none;" id="M_AttributeSetInstance_ID_RmissingSpan">
-							<table class="TextBox_MsgContainer_table">
-							  <tr class="TextBox_MsgContainer_tr">
-								<td class="TextBox_MsgContainer_td"><div class="TextBox_MsgContainer_div"></div></td><td></td>
-							  </tr>
-							  <tr>
-								<td colspan="2" class="missing"><div class="TextBox_MsgContainer_div2" id="M_AttributeSetInstance_ID_RmissingSpanText">* This value is required.</div></td>
-							  </tr>
-							</table>
-						  </span>
-						  <span class="TextBox_MsgContainer_span" style="display: none;" id="M_AttributeSetInstance_ID_RrangeSpan">
-							<table class="TextBox_MsgContainer_table">
-							  <tr class="TextBox_MsgContainer_tr">
-								<td class="TextBox_MsgContainer_td"><div class="TextBox_MsgContainer_div"></div></td><td></td>
-							  </tr>
-							  <tr>
-								<td colspan="2" class="range"><div class="TextBox_MsgContainer_div2" id="M_AttributeSetInstance_ID_RrangeSpanText">* This value is out of range.</div></td>
-							  </tr>
-							</table>
-						  </span>
-							  </td>
-							  <td class="FieldButton_ContentCell"><a id="fieldAttributeseinstance" class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Attribute Set Value'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;" 
-							  onclick="openPAttribute(null, null, '../info/AttributeSetInstance.html', null, false, 'frmMain', 'inpmAttributesetinstanceIdxxx', 'inpmAttributesetinstanceId_Ryyy', inputValue(document.frmMain.inpmAttributesetinstanceId_Rvvv), 'inpIDValue', inputValue(document.frmMain.inpmAttributesetinstanceIdwww), 'WindowID', inputValue(document.frmMain.inpwindowId), 'inpKeyValue', inputValue(document.frmMain.inpmAttributesetinstanceIduuu), 'inpwindowId', inputValue(document.frmMain.inpwindowId), 'inpProduct', inputValue(document.frmMain.inpmProductIdzzz));return false;">
-						  <table class="FieldButton" onmousedown="this.className='FieldButton_active'; return true;" onmouseup="this.className='FieldButton'; return true;" onmouseover="this.className='FieldButton_hover'; window.status='Attribute Set Value'; return true;" onmouseout="this.className='FieldButton'; window.status=''; return true;" id="M_AttributeSetInstance_IDlinkAttributeSetInstance">
-							<tr>
-							  <td class="FieldButton_bg">
-								<img alt="Attribute Set Value" class="FieldButton_Icon FieldButton_Icon_AttributeSetInstance" title="Attribute Set Value" src="../../../../../web/images/blank.gif" border="0" id="buttonAttributeSetInstance"></img>
-							  </td>
-							</tr>
-						  </table>
-						</a>
-						</td>
-							</tr>
-						  </table>
+                        </a>
+                        </td>
+                        <input type="hidden" name="inpmLocatorIdxx" id="fieldM_Locator_ID" value="">
+                        </table>
+                        </td>
+                        <input style="display:none;" type="text" name="inpmProductIdxxxx_LOC" id="M_Product_ID_LOC" value=""></input>
+                        <input type="text" style="display:none;" name="inpmProductIdyyyy_ATR" id="M_Product_ID_ATR" value=""></input>
+                        <input type="text" style="display:none;" name="inpmProductIdzzzz" id="M_Product_ID" value=""></input>
+                        <td class="TextBox_btn_ContentCell" id="M_AttributeSetInstance_ID_inp_td">
+                          <input type="hidden" name="inpmAttributesetinstanceIdxxx" id="M_AttributeSetInstance_ID" value="" onchange="logChanges(this);return true;"></input>
+                          <table border="0" cellspacing="0" cellpadding="0" summary="" class="">
+                            <tr>
+                              <td class="TextBox_ContentCell">
+                              <table style="border:0px;border-collapse:collapse;">
+                                <tr>
+                                  <td style="padding-top: 0px;">
+                                    
+                                    <input type="text" class="dojoValidateValid readonly TextBox_btn_OneCell_width" tabindex="1" maxlength="22"  name="inpmAttributesetinstanceId_Rxxx" id="M_AttributeSetInstance_ID_R" value="" required="false" onkeypress="changeToEditingMode();" onchange="validateTextBox(this.id);" readonly=true></input>
+                                  </td>
+                                </tr>
+                              </table>
+                          <span class="TextBox_MsgContainer_span" style="display: none;" id="M_AttributeSetInstance_ID_RinvalidSpan">
+                            <table class="TextBox_MsgContainer_table">
+                              <tr class="TextBox_MsgContainer_tr">
+                                <td class="TextBox_MsgContainer_td"><div class="TextBox_MsgContainer_div"></div></td><td></td>
+                              </tr>
+                              <tr>
+                                <td colspan="2" class="invalid"><div class="TextBox_MsgContainer_div2" id="M_AttributeSetInstance_ID_RinvalidSpanText">* The value entered is not valid.</div></td>
+                              </tr>
+                            </table>
+                          </span>
+                          <span class="TextBox_MsgContainer_span" style="display: none;" id="M_AttributeSetInstance_ID_RmissingSpan">
+                            <table class="TextBox_MsgContainer_table">
+                              <tr class="TextBox_MsgContainer_tr">
+                                <td class="TextBox_MsgContainer_td"><div class="TextBox_MsgContainer_div"></div></td><td></td>
+                              </tr>
+                              <tr>
+                                <td colspan="2" class="missing"><div class="TextBox_MsgContainer_div2" id="M_AttributeSetInstance_ID_RmissingSpanText">* This value is required.</div></td>
+                              </tr>
+                            </table>
+                          </span>
+                          <span class="TextBox_MsgContainer_span" style="display: none;" id="M_AttributeSetInstance_ID_RrangeSpan">
+                            <table class="TextBox_MsgContainer_table">
+                              <tr class="TextBox_MsgContainer_tr">
+                                <td class="TextBox_MsgContainer_td"><div class="TextBox_MsgContainer_div"></div></td><td></td>
+                              </tr>
+                              <tr>
+                                <td colspan="2" class="range"><div class="TextBox_MsgContainer_div2" id="M_AttributeSetInstance_ID_RrangeSpanText">* This value is out of range.</div></td>
+                              </tr>
+                            </table>
+                          </span>
+                              </td>
+                              <td class="FieldButton_ContentCell"><a id="fieldAttributeseinstance" class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Attribute Set Value'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;" 
+                              onclick="openPAttribute(null, null, '../info/AttributeSetInstance.html', null, false, 'frmMain', 'inpmAttributesetinstanceIdxxx', 'inpmAttributesetinstanceId_Ryyy', inputValue(document.frmMain.inpmAttributesetinstanceId_Rvvv), 'inpIDValue', inputValue(document.frmMain.inpmAttributesetinstanceIdwww), 'WindowID', inputValue(document.frmMain.inpwindowId), 'inpKeyValue', inputValue(document.frmMain.inpmAttributesetinstanceIduuu), 'inpwindowId', inputValue(document.frmMain.inpwindowId), 'inpProduct', inputValue(document.frmMain.inpmProductIdzzz));return false;">
+                          <table class="FieldButton" onmousedown="this.className='FieldButton_active'; return true;" onmouseup="this.className='FieldButton'; return true;" onmouseover="this.className='FieldButton_hover'; window.status='Attribute Set Value'; return true;" onmouseout="this.className='FieldButton'; window.status=''; return true;" id="M_AttributeSetInstance_IDlinkAttributeSetInstance">
+                            <tr>
+                              <td class="FieldButton_bg">
+                                <img alt="Attribute Set Value" class="FieldButton_Icon FieldButton_Icon_AttributeSetInstance" title="Attribute Set Value" src="../../../../../web/images/blank.gif" border="0" id="buttonAttributeSetInstance"></img>
+                              </td>
+                            </tr>
+                          </table>
+                        </a>
+                        </td>
+                            </tr>
+                          </table>
               </tr>
             </div>
           </table>
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO.xml	Thu Feb 28 20:24:19 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_ShipmentPO.xml	Wed Feb 27 17:16:35 2013 +0100
@@ -18,35 +18,35 @@
  ************************************************************************
 -->
 <REPORT>
-	<template file="CreateFrom_ShipmentPO.html"/>
-	<PARAMETER id="paramLanguage" name="language" default=""/>
-	<PARAMETER id="paramDirectory" name="directory" default=""/>
-	<PARAMETER id="paramCSS" name="theme" attribute="href" replace="Default"/>
-	<PARAMETER id="paramKey" name="key" attribute="value"/>
-	<PARAMETER id="paramTableId" name="tableId" attribute="value"/>
-	<PARAMETER id="paramProcessId" name="processId" attribute="value"/>
-	<PARAMETER id="paramPath" name="path" attribute="value"/>
-	<PARAMETER id="paramWindowId" name="windowId" attribute="value"/>
-	<PARAMETER id="paramTabName" name="tabName" attribute="value"/>
-	<PARAMETER id="paramBPartnerId" name="cBpartnerId" attribute="value"/>
-	<PARAMETER id="paramBPartnerDescription" name="BPartnerDescription" attribute="value"/>
-	<PARAMETER id="paramM_Locator_ID_DES" name="M_Locator_ID_DES" attribute="value"/>
-	<PARAMETER id="paramM_Locator_ID" name="M_Locator_ID" attribute="value"/>
-	<PARAMETER id="paramPurchaseOrder" name="PurchaseOrder"/>
-	<PARAMETER id="paramInvoice" name="Invoice"/>
-	<PARAMETER id="paramType" name="pType" attribute="value"/>
-	<PARAMETER id="processing" name="processing" default="" attribute="value"/>
-	<PARAMETER id="linkButtonOk" name="processId" default="" attribute="onclick" replace="xx"/>
-	<PARAMETER id="linkButtonOk" name="ok" default="" attribute="onmouseover" replace="xx"/>
-	<PARAMETER id="linkButtonCancel" name="cancel" default="" attribute="onmouseover" replace="xx"/>
+    <template file="CreateFrom_ShipmentPO.html"/>
+    <PARAMETER id="paramLanguage" name="language" default=""/>
+    <PARAMETER id="paramDirectory" name="directory" default=""/>
+    <PARAMETER id="paramCSS" name="theme" attribute="href" replace="Default"/>
+    <PARAMETER id="paramKey" name="key" attribute="value"/>
+    <PARAMETER id="paramTableId" name="tableId" attribute="value"/>
+    <PARAMETER id="paramProcessId" name="processId" attribute="value"/>
+    <PARAMETER id="paramPath" name="path" attribute="value"/>
+    <PARAMETER id="paramWindowId" name="windowId" attribute="value"/>
+    <PARAMETER id="paramTabName" name="tabName" attribute="value"/>
+    <PARAMETER id="paramBPartnerId" name="cBpartnerId" attribute="value"/>
+    <PARAMETER id="paramBPartnerDescription" name="BPartnerDescription" attribute="value"/>
+    <PARAMETER id="paramM_Locator_ID_DES" name="M_Locator_ID_DES" attribute="value"/>
+    <PARAMETER id="paramM_Locator_ID" name="M_Locator_ID" attribute="value"/>
+    <PARAMETER id="paramPurchaseOrder" name="PurchaseOrder"/>
+    <PARAMETER id="paramInvoice" name="Invoice"/>
+    <PARAMETER id="paramType" name="pType" attribute="value"/>
+    <PARAMETER id="processing" name="processing" default="" attribute="value"/>
+    <PARAMETER id="linkButtonOk" name="processId" default="" attribute="onclick" replace="xx"/>
+    <PARAMETER id="linkButtonOk" name="ok" default="" attribute="onmouseover" replace="xx"/>
+    <PARAMETER id="linkButtonCancel" name="cancel" default="" attribute="onmouseover" replace="xx"/>
   <PARAMETER id="buttonOk" name="ok" default="" attribute="title" replace="xx"/>
-	<PARAMETER id="buttonCancel" name="cancel" default="" attribute="title" replace="xx"/>
-	<SUBREPORT id="reportPurchaseOrder" name="reportPurchaseOrder" report="org/openbravo/erpCommon/reference/List">
-		<ARGUMENT name="parameterListSelected" withId="paramPurchaseOrder"/>
-	</SUBREPORT>
-	<SUBREPORT id="reportInvoice" name="reportInvoice" report="org/openbravo/erpCommon/reference/List">
-		<ARGUMENT name="parameterListSelected" withId="paramInvoice"/>
-	</SUBREPORT>
+    <PARAMETER id="buttonCancel" name="cancel" default="" attribute="title" replace="xx"/>
+    <SUBREPORT id="reportPurchaseOrder" name="reportPurchaseOrder" report="org/openbravo/erpCommon/reference/List">
+        <ARGUMENT name="parameterListSelected" withId="paramPurchaseOrder"/>
+    </SUBREPORT>
+    <SUBREPORT id="reportInvoice" name="reportInvoice" report="org/openbravo/erpCommon/reference/List">
+        <ARGUMENT name="parameterListSelected" withId="paramInvoice"/>
+    </SUBREPORT>
 
   <PARAMETER id="keyMap" name="keyMap"/>
 
@@ -54,51 +54,57 @@
   <PARAMETER id="messageBoxIDTitle" name="messageTitle" default=""/>
   <PARAMETER id="messageBoxIDMessage" name="messageMessage" default=""/>
 
-	<PARAMETER id="param2" name="param2" default="2"/>
-	<structure name="structure1">
+    <PARAMETER id="param2" name="param2" default="2"/>
+    <PARAMETER id="paramCheck" name="check" default="N"/>
+    <structure name="structure1">
     <FIELD id="fieldRownum1">rownum</FIELD>
     <FUNCTION id="funcEvenOddRowxx" name="MODULE" arg1="fieldRownum1" arg2="param2" format="integerEdition" attribute="class" replace="yy"/>
     <FIELD id="funcEvenOddRowxx" attribute="id" replace="xx">rownum</FIELD>
 
-		<FIELD id="fieldID" attribute="value">id</FIELD>
-		<FIELD id="fieldQuantity" attribute="value" format="qtyEdition">qty</FIELD>
-		<FIELD id="fieldQuantity" attribute="name" replace="xx">id</FIELD>
-		<FIELD id="fieldSecQuantity" attribute="value" format="qtyEdition">secqty</FIELD>
-		<FIELD id="fieldSecQuantity" attribute="name" replace="xx">id</FIELD>
-		<FIELD id="fieldSecQuantity" attribute="type" replace="zzz">havesec</FIELD>
-		<FIELD id="fieldSecQuantity" attribute="onchange" replace="ff">id</FIELD>
-		<FIELD id="fieldCuomName">uomsymbol</FIELD>
-		<FIELD id="fieldCuomId" attribute="name" replace="xx">id</FIELD>
-		<FIELD id="fieldCuomId" attribute="value">cUomId</FIELD>
-		<FIELD id="fieldMproductid">relationName</FIELD>
-		<FIELD id="fieldPurchaseorder">line</FIELD>
-		<FIELD id="fieldSecUom" attribute="name" replace="xx">id</FIELD>
-		<FIELD id="fieldSecUom" attribute="onchange" replace="ff">id</FIELD>
-		<FIELD id="fieldSecUom" attribute="style" replace="yyy">havesecuom</FIELD>
-		<FIELD id="fieldM_Locator_ID_DES" attribute="name" replace="xx">id</FIELD>
+        <!--<FIELD id="fieldID" attribute="value">id</FIELD>  -->
+        <FIELD id="inpfieldIDxx" attribute="value">id</FIELD>
+        <FIELD id="inpfieldIDxx" boolean="disabled" withId="paramCheck">isparent</FIELD>
+        <FIELD id="inpfieldIDxx" attribute="id" replace="xx">id</FIELD>
+        <FIELD id="fieldBomParent" attribute="value">id</FIELD>
+        <FIELD id="fieldBomParent" attribute="name" replace="xx">bom_parent_id</FIELD>
+        <FIELD id="fieldQuantity" attribute="value" format="qtyEdition">qty</FIELD>
+        <FIELD id="fieldQuantity" attribute="name" replace="xx">id</FIELD>
+        <FIELD id="fieldSecQuantity" attribute="value" format="qtyEdition">secqty</FIELD>
+        <FIELD id="fieldSecQuantity" attribute="name" replace="xx">id</FIELD>
+        <FIELD id="fieldSecQuantity" attribute="type" replace="zzz">havesec</FIELD>
+        <FIELD id="fieldSecQuantity" attribute="onchange" replace="ff">id</FIELD>
+        <FIELD id="fieldCuomName">uomsymbol</FIELD>
+        <FIELD id="fieldCuomId" attribute="name" replace="xx">id</FIELD>
+        <FIELD id="fieldCuomId" attribute="value">cUomId</FIELD>
+        <FIELD id="fieldMproductid">relationName</FIELD>
+        <FIELD id="fieldPurchaseorder">line</FIELD>
+        <FIELD id="fieldSecUom" attribute="name" replace="xx">id</FIELD>
+        <FIELD id="fieldSecUom" attribute="onchange" replace="ff">id</FIELD>
+        <FIELD id="fieldSecUom" attribute="style" replace="yyy">havesecuom</FIELD>
+        <FIELD id="fieldM_Locator_ID_DES" attribute="name" replace="xx">id</FIELD>
         <FIELD id="fieldM_Locator_ID_DES" attribute="onfocus" replace="xx">id</FIELD>
-		<FIELD id="fieldM_Locator_ID" attribute="name" replace="xx">id</FIELD>
-		<FIELD id="fieldLocatorDES" attribute="onclick" replace="xxx">id</FIELD>
-		<FIELD id="fieldLocatorDES" attribute="onclick" replace="yyy">id</FIELD>
-		<FIELD id="fieldLocatorDES" attribute="onclick" replace="vvv">id</FIELD>
-		<FIELD id="M_Product_ID_LOC" attribute="name" replace="xxxx">id</FIELD>
-		<FIELD id="M_Product_ID_ATR" attribute="name" replace="yyyy">id</FIELD>
-		<FIELD id="M_AttributeSetInstance_ID" attribute="name" replace="xxx">id</FIELD>
+        <FIELD id="fieldM_Locator_ID" attribute="name" replace="xx">id</FIELD>
+        <FIELD id="fieldLocatorDES" attribute="onclick" replace="xxx">id</FIELD>
+        <FIELD id="fieldLocatorDES" attribute="onclick" replace="yyy">id</FIELD>
+        <FIELD id="fieldLocatorDES" attribute="onclick" replace="vvv">id</FIELD>
+        <FIELD id="M_Product_ID_LOC" attribute="name" replace="xxxx">id</FIELD>
+        <FIELD id="M_Product_ID_ATR" attribute="name" replace="yyyy">id</FIELD>
+        <FIELD id="M_AttributeSetInstance_ID" attribute="name" replace="xxx">id</FIELD>
         <FIELD id="M_AttributeSetInstance_ID" attribute="value">mAttributesetinstanceId</FIELD>
-		<FIELD id="M_AttributeSetInstance_ID_R" attribute="name" replace="xxx">id</FIELD>
+        <FIELD id="M_AttributeSetInstance_ID_R" attribute="name" replace="xxx">id</FIELD>
         <FIELD id="M_AttributeSetInstance_ID_R" attribute="value">ATTRIBUTESETINSTANCENAME</FIELD>
-		<FIELD id="M_Product_ID" attribute="name" replace="zzzz">id</FIELD>
-		<FIELD id="M_Product_ID" attribute="value" >mProductId</FIELD>
-		<FIELD id="fieldAttributeseinstance" attribute="onclick" replace="uuu">id</FIELD>
+        <FIELD id="M_Product_ID" attribute="name" replace="zzzz">id</FIELD>
+        <FIELD id="M_Product_ID" attribute="value" >mProductId</FIELD>
+        <FIELD id="fieldAttributeseinstance" attribute="onclick" replace="uuu">id</FIELD>
         <FIELD id="fieldAttributeseinstance" attribute="onclick" replace="vvv">id</FIELD>
         <FIELD id="fieldAttributeseinstance" attribute="onclick" replace="xxx">id</FIELD>
         <FIELD id="fieldAttributeseinstance" attribute="onclick" replace="yyy">id</FIELD>
         <FIELD id="fieldAttributeseinstance" attribute="onclick" replace="zzz">id</FIELD>
         <FIELD id="fieldAttributeseinstance" attribute="onclick" replace="www">id</FIELD>
-		<FIELD id="fieldsecProductUomId">secProductUomId</FIELD>
-		<SUBREPORT id="reportM_Product_Uom_To_ID" name="reportM_Product_Uom_To_ID" report="org/openbravo/erpCommon/reference/List">
-		<ARGUMENT name="parameterListSelected"  withId="fieldsecProductUomId"/>
-		</SUBREPORT>
-		<SECTION id="sectionDetail"/>
-	</structure>
-</REPORT>
+        <FIELD id="fieldsecProductUomId">secProductUomId</FIELD>
+        <SUBREPORT id="reportM_Product_Uom_To_ID" name="reportM_Product_Uom_To_ID" report="org/openbravo/erpCommon/reference/List">
+        <ARGUMENT name="parameterListSelected"  withId="fieldsecProductUomId"/>
+        </SUBREPORT>
+        <SECTION id="sectionDetail"/>
+    </structure>
+</REPORT>
\ No newline at end of file
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql	Thu Feb 28 20:24:19 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Shipment_data.xsql	Wed Feb 27 17:16:35 2013 +0100
@@ -42,7 +42,8 @@
         coalesce(l.a_asset_id,o.a_asset_id) as a_asset_id, coalesce(l.c_project_id,o.c_project_id) as c_project_id, 
         coalesce(l.c_costcenter_id, o.c_costcenter_id) as c_costcenter_id,
         coalesce(l.user1_id,o.user1_id) as user1_id, coalesce(l.user2_id,o.user2_id) as user2_id, 
-        coalesce (l.c_bpartner_id,o.c_bpartner_id) as c_bpartner_id
+        coalesce (l.c_bpartner_id,o.c_bpartner_id) as c_bpartner_id, l.explode, l.bom_parent_id, CASE WHEN l.Bom_parent_id is null then 'Y' else 'N' END isparent, 
+        '' as isorder
         FROM C_ORDERLINE l left join  M_MATCHPO m on l.C_OrderLine_ID=m.C_OrderLine_ID
                                                  and m.M_InOutLine_ID IS NOT NULL
                            LEFT JOIN M_Product_UOM mpu on mpu.M_PRODUCT_UOM_ID =l.M_PRODUCT_UOM_ID,  
@@ -60,8 +61,8 @@
         GROUP BY o.C_ORDER_ID, o.DocumentNo, o.DateOrdered, o.GrandTotal, l.QtyOrdered,l.qtydelivered, 
         l.C_UOM_ID,uom.UOMSymbol,l.M_Product_ID,p.NAME,l.Line,l.C_OrderLine_ID, l.ad_org_id, l.DESCRIPTION, l.QUANTITYORDER, 
         l.M_PRODUCT_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID, coalesce(l.a_asset_id,o.a_asset_id), coalesce(l.c_project_id,o.c_project_id), coalesce(l.c_costcenter_id, o.c_costcenter_id),
-        coalesce(l.user1_id,o.user1_id), coalesce(l.user2_id,o.user2_id), coalesce (l.c_bpartner_id,o.c_bpartner_id) ,mpu.C_UOM_ID
-        HAVING (l.QtyOrdered-SUM(COALESCE(m.Qty,0))) <> 0
+        coalesce(l.user1_id,o.user1_id), coalesce(l.user2_id,o.user2_id), coalesce (l.c_bpartner_id,o.c_bpartner_id) ,mpu.C_UOM_ID, l.explode, l.bom_parent_id
+        HAVING ((l.explode='Y')  OR ((l.QtyOrdered-SUM(COALESCE(m.Qty,0)))<>0)) 
         ORDER BY NAME, l.Line
       ]]>
     </Sql>
@@ -109,7 +110,7 @@
         coalesce(l.a_asset_id,o.a_asset_id) as a_asset_id, coalesce(l.c_project_id,o.c_project_id) as c_project_id, 
 		coalesce(l.c_costcenter_id,o.c_costcenter_id) as c_costcenter_id, 
 		coalesce(l.user1_id,o.user1_id) as user1_id ,coalesce( l.user2_id ,o.user2_id) as user2_id, 
-		coalesce (l.c_bpartner_id,o.c_bpartner_id) as c_bpartner_id
+		coalesce (l.c_bpartner_id,o.c_bpartner_id) as c_bpartner_id, l.Bom_parent_id, CASE WHEN l.Bom_parent_id is null then 'Y' else 'N' END isparent
         FROM M_INOUT_CANDIDATE_V ic, C_ORDER o, C_UOM uom, C_ORDERLINE l, M_PRODUCT p 
         WHERE o.C_ORDER_ID = l.C_ORDER_ID
         AND o.C_ORDER_ID = ic.C_ORDER_ID 
@@ -118,11 +119,12 @@
         AND l.C_UOM_ID = uom.C_UOM_ID
         AND l.M_Product_ID=p.M_Product_ID 
         AND ic.C_Order_ID = ?
-        AND l.QtyOrdered <> COALESCE(l.qtydelivered,0)
+        AND ((l.explode <>'Y' AND l.QtyOrdered <> COALESCE(l.qtydelivered,0)) OR (l.explode ='Y')) 
         GROUP BY o.C_ORDER_ID, o.DocumentNo, o.DateOrdered, o.GrandTotal, l.QtyOrdered,l.qtydelivered, 
         l.C_UOM_ID,uom.UOMSymbol,l.M_Product_ID,p.NAME,l.Line,l.C_OrderLine_ID, l.ad_org_id, l.DESCRIPTION,
        	coalesce(l.a_asset_id,o.a_asset_id) , coalesce( l.c_project_id,o.c_project_id),coalesce(l.c_costcenter_id,o.c_costcenter_id), 
-		coalesce(l.user1_id,o.user1_id), coalesce(l.user2_id,o.user2_id), coalesce (l.c_bpartner_id,o.c_bpartner_id) 
+		coalesce(l.user1_id,o.user1_id), coalesce(l.user2_id,o.user2_id), coalesce (l.c_bpartner_id,o.c_bpartner_id),
+		l.Bom_parent_id
         ORDER BY NAME, l.Line
       ]]>
     </Sql>
@@ -241,7 +243,7 @@
       coalesce(l.a_asset_id,o.a_asset_id) as a_asset_id, coalesce(l.c_project_id, o.c_project_id) as c_project_id , 
    	  coalesce(l.c_costcenter_id,o.c_costcenter_id) as c_costcenter_id,
       coalesce(l.user1_id,o.user1_id) as user1_id,coalesce( l.user2_id,o.user2_id) as user2_id , 
-      coalesce (l.c_bpartner_id,o.c_bpartner_id) as c_bpartner_id
+      coalesce (l.c_bpartner_id,o.c_bpartner_id) as c_bpartner_id, l.explode, 'Y' as isorder
       FROM C_ORDERLINE l left join M_MATCHPO m on l.C_OrderLine_ID=m.C_OrderLine_ID
                                               and  m.M_InOutLine_ID IS NOT NULL 
                          left join M_Product_UOM mu on l.M_Product_UOM_ID = mu.M_Product_UOM_ID
@@ -253,7 +255,7 @@
       GROUP BY l.QtyOrdered,l.qtydelivered,l.C_UOM_ID,uom.UOMSymbol,l.M_Product_ID,p.NAME,l.Line,l.C_OrderLine_ID, 
       uom1.BREAKDOWN, l.QUANTITYORDER, l.M_Product_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, l.DESCRIPTION,
       coalesce(l.a_asset_id,o.a_asset_id), coalesce(l.c_project_id, o.c_project_id), coalesce(l.c_costcenter_id,o.c_costcenter_id) ,
-      coalesce(l.user1_id,o.user1_id) ,coalesce( l.user2_id,o.user2_id) , coalesce (l.c_bpartner_id,o.c_bpartner_id) 
+      coalesce(l.user1_id,o.user1_id) ,coalesce( l.user2_id,o.user2_id) , coalesce (l.c_bpartner_id,o.c_bpartner_id), l.explode 
       ORDER BY l.Line
       ]]>
     </Sql>
@@ -273,7 +275,7 @@
       coalesce(l.a_asset_id,o.a_asset_id) as a_asset_id, coalesce(l.c_project_id, o.c_project_id) as c_project_id , 
    	  coalesce(l.c_costcenter_id,o.c_costcenter_id) as c_costcenter_id,
       coalesce(l.user1_id,o.user1_id) as user1_id,coalesce( l.user2_id,o.user2_id) as user2_id , 
-      l.c_bpartner_id
+      l.c_bpartner_id, l.explode, 'Y' as isorder
       FROM C_ORDERLINE l left join M_Product_UOM mu on l.M_Product_UOM_ID = mu.M_Product_UOM_ID
                          left join C_UOM uom1 on mu.C_UOM_ID = uom1.C_UOM_ID ,
       C_UOM uom,  M_PRODUCT p, C_ORDER o
@@ -283,8 +285,8 @@
       GROUP BY l.QtyOrdered,l.qtydelivered,l.C_UOM_ID,uom.UOMSymbol,l.M_Product_ID,p.NAME,l.Line,l.C_OrderLine_ID, 
       uom1.BREAKDOWN, l.QUANTITYORDER, l.M_Product_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, l.DESCRIPTION,
       coalesce(l.a_asset_id,o.a_asset_id), coalesce(l.c_project_id, o.c_project_id), coalesce(l.c_costcenter_id,o.c_costcenter_id),
-   	  coalesce(l.user1_id,o.user1_id),coalesce( l.user2_id,o.user2_id), l.c_bpartner_id
-      HAVING l.QtyOrdered - COALESCE(l.QTYDELIVERED,0)<>0
+   	  coalesce(l.user1_id,o.user1_id),coalesce( l.user2_id,o.user2_id), l.c_bpartner_id, l.explode
+      HAVING ((l.explode='Y')  OR (l.QtyOrdered - COALESCE(l.QTYDELIVERED,0)<>0)) 
       ORDER BY l.Line
       ]]>
     </Sql>
@@ -311,7 +313,8 @@
         as SECQTY, l.M_PRODUCT_UOM_ID as SEC_PRODUCT_UOM_ID,
         (SELECT C_UOM.NAME FROM M_PRODUCT_UOM, C_UOM WHERE M_PRODUCT_UOM_ID = l.M_PRODUCT_UOM_ID AND M_PRODUCT_UOM.C_UOM_ID = C_UOM.C_UOM_ID) as SECUOMSYMBOL,
         COALESCE(l.M_PRODUCT_UOM_ID,null,'0') as HAVESEC,'' as HAVESECUOM,'' AS LOCATOR,l.M_ATTRIBUTESETINSTANCE_ID AS M_ATTRIBUTESETINSTANCE_ID,
-        (SELECT M_ATTRIBUTESETINSTANCE.DESCRIPTION FROM M_ATTRIBUTESETINSTANCE WHERE l.M_ATTRIBUTESETINSTANCE_ID = M_ATTRIBUTESETINSTANCE.M_ATTRIBUTESETINSTANCE_ID) as ATTRIBUTESETINSTANCENAME
+        (SELECT M_ATTRIBUTESETINSTANCE.DESCRIPTION FROM M_ATTRIBUTESETINSTANCE WHERE l.M_ATTRIBUTESETINSTANCE_ID = M_ATTRIBUTESETINSTANCE.M_ATTRIBUTESETINSTANCE_ID) as ATTRIBUTESETINSTANCENAME, l.explode, l.Bom_parent_id, 
+        CASE WHEN l.Bom_parent_id is null then 'Y' else 'N' END isparent
         FROM C_INVOICELINE l left join  M_MATCHINV mi  on l.C_InvoiceLine_ID=mi.C_InvoiceLine_ID,
         C_INVOICE i, C_UOM uom,  M_PRODUCT p
         WHERE i.C_INVOICE_ID = l.C_INVOICE_ID 
@@ -326,8 +329,8 @@
         l.C_UOM_ID,uom.UOMSymbol,l.M_Product_ID,p.NAME, l.C_InvoiceLine_ID,l.Line,l.C_OrderLine_ID, l.DESCRIPTION,l.QUANTITYORDER,
         l.M_PRODUCT_UOM_ID,l.M_ATTRIBUTESETINSTANCE_ID,  coalesce(l.a_asset_id,i.a_asset_id), coalesce(l.c_project_id,i.c_project_id), 
         coalesce(l.c_costcenter_id,i.c_costcenter_id) , 
-        coalesce(l.user1_id,i.user1_id) , coalesce(l.user2_id, i.user2_id), l.c_bpartner_id 
-        HAVING (l.QtyInvoiced-SUM(COALESCE(mi.Qty,0))) <> 0 
+        coalesce(l.user1_id,i.user1_id) , coalesce(l.user2_id, i.user2_id), l.c_bpartner_id, l.explode, l.bom_parent_id
+        HAVING ((l.explode='Y')  OR (l.QtyInvoiced-SUM(COALESCE(mi.Qty,0))<>0))   
         ORDER BY NAME, l.Line
       ]]>
     </Sql>
@@ -348,7 +351,8 @@
 	    l.C_InvoiceLine_ID,l.Line, l.C_OrderLine_ID, l.C_InvoiceLine_ID AS ID, 
         l.DESCRIPTION AS DESCRIPTION,
         coalesce(l.a_asset_id,i.a_asset_id) as a_asset_id, coalesce(l.c_project_id,i.c_project_id) as c_project_id,coalesce(l.c_costcenter_id,i.c_costcenter_id)
-        as c_costcenter_id, coalesce(l.user1_id,i.user1_id) as user1_id , coalesce(l.user2_id,i.user2_id) as user2_id , l.c_bpartner_id 
+        as c_costcenter_id, coalesce(l.user1_id,i.user1_id) as user1_id , coalesce(l.user2_id,i.user2_id) as user2_id , l.c_bpartner_id, l.explode, l.Bom_parent_id,
+        CASE  WHEN l.Bom_parent_id is null then 'Y' else 'N' END isparent
         FROM C_INVOICELINE l left join M_INOUTLINE mi on l.M_INOUTLINE_ID = mi.M_INOUTLINE_ID,
         C_INVOICE i, C_UOM uom,  M_PRODUCT p
         WHERE i.C_INVOICE_ID = l.C_INVOICE_ID 
@@ -361,8 +365,8 @@
         GROUP BY i.C_Invoice_ID, i.DocumentNo, DateInvoiced, GrandTotal, l.QtyInvoiced, 
         l.C_UOM_ID,uom.UOMSymbol,l.M_Product_ID,p.NAME, l.C_InvoiceLine_ID,l.Line,l.C_OrderLine_ID, l.DESCRIPTION,
         coalesce(l.a_asset_id,i.a_asset_id), coalesce(l.c_project_id,i.c_project_id),coalesce(l.c_costcenter_id,i.c_costcenter_id), 
-		coalesce(l.user1_id,i.user1_id), coalesce(l.user2_id,i.user2_id) , l.c_bpartner_id 
-        HAVING (l.QtyInvoiced-SUM(COALESCE(mi.MOVEMENTQTY,0))) <> 0 
+		coalesce(l.user1_id,i.user1_id), coalesce(l.user2_id,i.user2_id) , l.c_bpartner_id, l.explode, l.Bom_parent_id
+        HAVING ((l.explode='Y')  OR ((l.QtyInvoiced-SUM(COALESCE(mi.MOVEMENTQTY,0))) <> 0))  
         ORDER BY NAME, l.Line
       ]]>
     </Sql>
@@ -481,7 +485,8 @@
       l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, l.DESCRIPTION AS DESCRIPTION, l.C_INVOICE_ID,
       coalesce(l.a_asset_id,i.a_asset_id) as a_asset_id, coalesce(l.c_project_id, i.c_project_id) as c_project_id, 
       coalesce(l.c_costcenter_id,i.c_costcenter_id) as c_costcenter_id , 
-      coalesce(l.user1_id,i.user1_id ) as user1_id , coalesce(l.user2_id , i.user2_id) as user2_id, l.c_bpartner_id
+      coalesce(l.user1_id,i.user1_id ) as user1_id , coalesce(l.user2_id , i.user2_id) as user2_id, l.c_bpartner_id, l.explode, 
+      'N' as isorder
       FROM C_INVOICELINE l left join  M_Product_UOM mu on l.M_Product_UOM_ID = mu.M_Product_UOM_ID 
                            left join C_UOM uom1 on mu.C_UOM_ID = uom1.C_UOM_ID 
                            left join M_MATCHINV mi on l.C_InvoiceLine_ID=mi.C_InvoiceLine_ID,
@@ -493,8 +498,8 @@
       l.C_UOM_ID,uom.UOMSymbol,l.M_Product_ID,p.NAME, l.C_InvoiceLine_ID,l.Line,l.C_OrderLine_ID, 
       uom1.BREAKDOWN, l.QUANTITYORDER, l.M_Product_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, l.DESCRIPTION, l.C_INVOICE_ID,
       coalesce(l.a_asset_id,i.a_asset_id), coalesce(l.c_project_id, i.c_project_id), coalesce(l.c_costcenter_id,i.c_costcenter_id), 
-      coalesce(l.user1_id,i.user1_id ), coalesce(l.user2_id , i.user2_id),l.c_bpartner_id
-      HAVING l.QtyInvoiced-SUM(COALESCE(mi.Qty,0))<>0
+      coalesce(l.user1_id,i.user1_id ), coalesce(l.user2_id , i.user2_id),l.c_bpartner_id, l.explode
+      HAVING ((l.explode='Y')  OR (l.QtyInvoiced-SUM(COALESCE(mi.Qty,0))<>0))   
       ORDER BY l.Line
       ]]>
     </Sql>
@@ -512,7 +517,8 @@
       l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, l.DESCRIPTION AS DESCRIPTION,
       coalesce(l.a_asset_id,i.a_asset_id) as a_asset_id , coalesce(l.c_project_id,i.c_project_id) as c_project_id, 
       coalesce(l.c_costcenter_id,i.c_costcenter_id) as c_costcenter_id,
-      coalesce( l.user1_id,i.user1_id) as user1_id , coalesce(l.user2_id ,i.user2_id) as  user2_id ,  l.c_bpartner_id
+      coalesce( l.user1_id,i.user1_id) as user1_id , coalesce(l.user2_id ,i.user2_id) as  user2_id ,  l.c_bpartner_id, l.explode,
+      'N' as isorder
       FROM C_INVOICELINE l left join  M_Product_UOM mu on l.M_Product_UOM_ID = mu.M_Product_UOM_ID 
                            left join C_UOM uom1 on mu.C_UOM_ID = uom1.C_UOM_ID 
                            left join M_INOUTLINE mi on l.M_INOUTLINE_ID=mi.M_INOUTLINE_ID,
@@ -525,8 +531,8 @@
       l.C_UOM_ID,uom.UOMSymbol,l.M_Product_ID,p.NAME, l.C_InvoiceLine_ID,l.Line,l.C_OrderLine_ID, 
       uom1.BREAKDOWN, l.QUANTITYORDER, l.M_Product_UOM_ID, l.M_ATTRIBUTESETINSTANCE_ID, l.ad_org_id, l.DESCRIPTION,
       coalesce(l.a_asset_id,i.a_asset_id), coalesce(l.c_project_id,i.c_project_id), coalesce(l.c_costcenter_id,i.c_costcenter_id),
-      coalesce( l.user1_id,i.user1_id), coalesce(l.user2_id ,i.user2_id) ,  l.c_bpartner_id
-      HAVING l.QtyInvoiced-SUM(COALESCE(mi.MOVEMENTQTY,0))<>0
+      coalesce( l.user1_id,i.user1_id), coalesce(l.user2_id ,i.user2_id) ,  l.c_bpartner_id, l.explode
+      HAVING ((l.explode='Y')  OR (l.QtyInvoiced-SUM(COALESCE(mi.MOVEMENTQTY,0))<>0))  
       ORDER BY l.Line
       ]]>
     </Sql>
@@ -570,7 +576,7 @@
          M_Locator_ID,IsInvoiced, QUANTITYORDER, 
       M_PRODUCT_UOM_ID, M_ATTRIBUTESETINSTANCE_ID,
       A_ASSET_ID, C_PROJECT_ID, C_COSTCENTER_ID,
-      USER1_ID, USER2_ID, C_BPARTNER_ID)
+      USER1_ID, USER2_ID, C_BPARTNER_ID, explode, BOM_Parent_id)
       VALUES 
         (?, ?, ?, ?, 
          'Y', now(), ?, now(), ?, 
@@ -579,7 +585,16 @@
          ?, ?, TO_NUMBER(?), 
          ?, ?,
          ?, ?, ?,
-         ?, ?,?)
+         ?, ?,?, ?,
+         (CASE to_char(?) WHEN 'Y' THEN (SELECT m_inoutline_id 
+                                        FROM m_inoutline 
+                                        WHERE m_inout_id=? 
+                                         and c_orderline_id = (SELECT BOM_parent_id 
+                                                               FROM c_orderline 
+                                                               WHERE c_orderline_id = ?)) 
+          ELSE null END                        
+         )
+        )
     </Sql>
     <Parameter name="mInoutlineId"/>
     <Parameter name="mInoutId"/>
@@ -604,6 +619,11 @@
     <Parameter name="user1Id"/>
     <Parameter name="user2Id"/>
     <Parameter name="cBpartnerId"/>
+    <Parameter name="explode"/>
+    <Parameter name="isOrder"/>
+    <Parameter name="mInoutId"/>
+    <Parameter name="cOrderlineId"/>
+
   </SqlMethod>
   <SqlMethod name="insertAcctDimension" type="preparedStatement" connection="true" return="rowCount">
     <SqlMethodComment>Copies the order line accounting dimensions to In/Out lines</SqlMethodComment>
@@ -703,6 +723,25 @@
     <Parameter name="mInoutlineId"/>
     <Parameter name="cInvoicelineId"/>
   </SqlMethod>
+  <SqlMethod name="updateBOMStructure" type="preparedStatement" connection="true" return="rowCount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      UPDATE M_Inoutline 
+      SET Bom_parent_id = (SELECT m_inoutline.m_inoutline_id 
+                           FROM m_inoutline inner join c_invoiceline on m_inoutline.m_inoutline_id = c_invoiceline.m_inoutline_id
+                           WHERE m_inout_id=? 
+                             and c_invoiceline_id = (SELECT BOM_parent_id 
+                                                     FROM c_invoiceline 
+                                                     WHERE c_invoiceline_id = (select c_invoiceline_id 
+                                                    from c_invoiceline 
+                                                    where m_inoutline_id = ?)))
+      WHERE m_inoutLine_ID= ? 
+    </Sql>
+    <Parameter name="mInoutId"/>
+    <Parameter name="mInoutlineId"/>
+    <Parameter name="mInoutlineId"/>
+  </SqlMethod>
+  
   <SqlMethod name="updateInvoiceOrder" type="preparedStatement" connection="true" return="rowCount">
     <SqlMethodComment></SqlMethodComment>
     <Sql>