[Home] [Help]
1482:
1483:
1484:
1485: --
1486: -- deleting from bom_cto_order_lines and bom_cto_src_orgs
1487: -- for this top ato line id
1488: --
1489:
1490: lStmtNumber := 550;
4137: bug 2706981 was used to provide an alternate logic
4138: */
4139:
4140:
4141: v_program_id bom_cto_order_lines.program_id%type ;
4142: x_return_status varchar2(1);
4143:
4144: lOptionNum number ; -- 2652379 : new variable
4145: v_ato_line_id number ;
4157: /* Added by Sushant for checking preconfigure bom module populated records */
4158: -- bugfix 2267646 Added nvl
4159:
4160: select NVL(program_id,0) , ato_line_id into v_program_id , v_ato_line_id
4161: from bom_cto_order_lines where line_id = pLineId ;
4162:
4163:
4164: /* BUG #1957336 Change for preconfigure bom by Sushant Sawant */
4165: /* Changes for patchset J
5240:
5241: from
5242: mtl_system_items_b m, -- Model
5243: bom_cto_src_orgs bcso,
5244: bom_cto_order_lines bcol
5245: where m.inventory_item_id = pModelId
5246: and bcso.model_item_id = pModelId
5247: and bcso.line_id = pLineId
5248: and bcol.line_id = bcso.line_id
5355:
5356: select i.weight_uom_code, i.volume_uom_code
5357: into o_weight_uom, o_volume_uom
5358: from mtl_system_items i,
5359: bom_cto_order_lines l
5360: where l.line_id = pLineId -- model line id
5361: and l.inventory_item_id = i.inventory_item_id
5362: and i.organization_id = lValidationOrg;
5363:
5381: from mtl_units_of_measure
5382: where uom_class = (select uom1.uom_class
5383: from mtl_units_of_measure uom1,
5384: mtl_system_items i,
5385: bom_cto_order_lines l
5386: where l.parent_ato_line_id = pLineId
5387: -- mbsk: replaced ato_line_id with parent_ato_line_id
5388: and l.item_type_code not in ('INCLUDED', 'CONFIG')
5389: and l.inventory_item_id = i.inventory_item_id
5416: from mtl_units_of_measure
5417: where uom_class = (select uom1.uom_class
5418: from mtl_units_of_measure uom1,
5419: mtl_system_items i,
5420: bom_cto_order_lines l
5421: where l.parent_ato_line_id = pLineId
5422: -- mbsk: replaced ato_line_id with parent_ato_line_id
5423: and l.item_type_code not in ('INCLUDED', 'CONFIG')
5424: and l.inventory_item_id = i.inventory_item_id
5651: END LOOP;
5652:
5653:
5654: --
5655: -- update bom_cto_order_lines with new config item
5656: --
5657:
5658: lStmtNumber := 120;
5659: lStatus := CTO_UTILITY_PK.Update_Order_Lines(
5812: Round( ( l.ordered_quantity / l_model.ordered_quantity), 7) , /* Support Decimal-Qty for Option Items */
5813: l.inventory_item_id) ) weight,
5814: msi.weight_uom_code uom,
5815: msi.inventory_item_id
5816: FROM bom_cto_order_lines l,
5817: bom_cto_order_lines l_model,
5818: mtl_system_items msi
5819: WHERE (l.parent_ato_line_id = x_a_line_id
5820: -- MLMO:replaced ato_line_id with parent_ato_line_id and added OR condn
5813: l.inventory_item_id) ) weight,
5814: msi.weight_uom_code uom,
5815: msi.inventory_item_id
5816: FROM bom_cto_order_lines l,
5817: bom_cto_order_lines l_model,
5818: mtl_system_items msi
5819: WHERE (l.parent_ato_line_id = x_a_line_id
5820: -- MLMO:replaced ato_line_id with parent_ato_line_id and added OR condn
5821: or
5847: Round( ( l.ordered_quantity / l_model.ordered_quantity) , 7) , /* Support Decimal-Qty for Option Items */
5848: l.inventory_item_id) ) volume,
5849: msi.volume_uom_code uom,
5850: msi.inventory_item_id
5851: FROM bom_cto_order_lines l,
5852: bom_cto_order_lines l_model,
5853: mtl_system_items msi
5854: WHERE (l.parent_ato_line_id = x_a_line_id -- MLMO: replaced ato_line_id with parent_ato_line_id
5855: or
5848: l.inventory_item_id) ) volume,
5849: msi.volume_uom_code uom,
5850: msi.inventory_item_id
5851: FROM bom_cto_order_lines l,
5852: bom_cto_order_lines l_model,
5853: mtl_system_items msi
5854: WHERE (l.parent_ato_line_id = x_a_line_id -- MLMO: replaced ato_line_id with parent_ato_line_id
5855: or
5856: l.line_id = x_a_line_id)
6016:
6017: -- x_item_rev_seq number; bugfix 3026929
6018:
6019: multiorg_error exception;
6020: v_program_id bom_cto_order_lines.program_id%type ;
6021:
6022: l_cto_cost_type_id number;
6023:
6024: lCnt number; --Bugfix 6717614
6126:
6127:
6128: /* added by Sushant to check preconfigure bom populated records */
6129: select nvl( program_id , 0 ) into v_program_id
6130: from bom_cto_order_lines
6131: where line_id = pLineId ;
6132:
6133:
6134: lStmtNumber := 200;
7225: -- projects are assigned to different orgs.
7226: --
7227: select ship_from_org_id
7228: into lShipFromOrg
7229: from bom_cto_order_lines bcol
7230: where line_id = pLineID;
7231:
7232: l_cost_group_id := get_cost_group(lShipFromOrg, pLineID);
7233:
9830: --end r12,4574899
9831: from
9832: mtl_system_items_b m, -- Model
9833: mtl_system_items_b config,
9834: bom_cto_order_lines bcol,
9835: bom_cto_src_orgs bcso
9836: where m.inventory_item_id = p_model_id
9837: and bcso.model_item_id = p_model_id
9838: and bcso.line_id = p_line_id