[Home] [Help]
1747: -1); --CMRO
1748:
1749:
1750: FORALL i IN 1..l_identifier_tab.COUNT
1751: UPDATE msc_alloc_supplies
1752: SET old_allocated_quantity = allocated_quantity,
1753: old_supply_date = supply_date,
1754: allocated_quantity = 0,
1755: old_refresh_number = refresh_number, -- For summary enhancement
1887: l_refresh_number_tab,
1888: l_qty_tab,
1889: l_old_demand_date,
1890: l_demand_class_tab
1891: FROM msc_alloc_supplies
1892: WHERE sr_instance_id = p_instance_id
1893: AND plan_id = p_plan_id
1894: AND stealing_flag = 1
1895: AND allocated_quantity <> 0
1923: msc_sch_wb.atp_debug('Delete_Row: l_identifier_tab.COUNT ' || l_identifier_tab.COUNT);
1924: END IF;
1925:
1926: FORALL i IN 1..l_identifier_tab.COUNT
1927: UPDATE msc_alloc_supplies
1928: SET old_allocated_quantity = allocated_quantity,
1929: old_supply_date = supply_date,
1930: allocated_quantity = 0,
1931: old_refresh_number = refresh_number, -- For summary enhancement
2213: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
2214:
2215: IF PG_DEBUG in ('Y', 'C') THEN
2216: msc_sch_wb.atp_debug('Remove_Invalid_SD_Rec: before delete of ' ||
2217: ' msc_alloc_supplies');
2218: END IF;
2219:
2220: DELETE FROM MSC_ALLOC_SUPPLIES
2221: WHERE parent_transaction_id = c1.identifier3
2216: msc_sch_wb.atp_debug('Remove_Invalid_SD_Rec: before delete of ' ||
2217: ' msc_alloc_supplies');
2218: END IF;
2219:
2220: DELETE FROM MSC_ALLOC_SUPPLIES
2221: WHERE parent_transaction_id = c1.identifier3
2222: AND plan_id = c1.identifier2;
2223:
2224: IF PG_DEBUG in ('Y', 'C') THEN
2221: WHERE parent_transaction_id = c1.identifier3
2222: AND plan_id = c1.identifier2;
2223:
2224: IF PG_DEBUG in ('Y', 'C') THEN
2225: msc_sch_wb.atp_debug('Remove_Invalid_SD_Rec: ' || 'No. of supply deleted from msc_alloc_supplies = '|| SQL%ROWCOUNT);
2226: END IF;
2227: END IF;
2228: -- Allocated ATP Based on Planning Details -- Agilent changes End
2229:
2838: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
2839:
2840: IF PG_DEBUG in ('Y', 'C') THEN
2841: msc_sch_wb.atp_debug('Update_Planned_Order: before update of' ||
2842: ' msc_alloc_supplies');
2843: END IF;
2844:
2845: UPDATE msc_alloc_supplies
2846: SET old_supply_date = supply_date,
2841: msc_sch_wb.atp_debug('Update_Planned_Order: before update of' ||
2842: ' msc_alloc_supplies');
2843: END IF;
2844:
2845: UPDATE msc_alloc_supplies
2846: SET old_supply_date = supply_date,
2847: old_allocated_quantity = allocated_quantity,
2848: supply_date = NVL(p_date, supply_date),
2849: allocated_quantity = NVL(p_quantity, allocated_quantity),
3927: */
3928:
3929: IF PG_DEBUG in ('Y', 'C') THEN
3930: msc_sch_wb.atp_debug('Undo_Delete_Row: before update of ' ||
3931: ' msc_alloc_supplies');
3932: END IF;
3933:
3934: FORALL m IN 1..p_del_demand_ids.COUNT
3935: UPDATE msc_alloc_supplies
3931: ' msc_alloc_supplies');
3932: END IF;
3933:
3934: FORALL m IN 1..p_del_demand_ids.COUNT
3935: UPDATE msc_alloc_supplies
3936: SET allocated_quantity = old_allocated_quantity ,
3937: supply_date = old_supply_date ,
3938: old_allocated_quantity = null,
3939: old_supply_date = null,
4383:
4384: SELECT msc_supplies_s.nextval into p_transaction_id from dual;
4385:
4386: IF PG_DEBUG in ('Y', 'C') THEN
4387: msc_sch_wb.atp_debug('Add_Stealing_Supply_Details: ' || 'before insert into msc_alloc_supplies-Stealing Info');
4388: END IF;
4389:
4390: --ssurendr 25-NOV-2002: From_Demand_Class added in both the insert statements for alloc w/b drill down
4391: INSERT INTO MSC_ALLOC_SUPPLIES
4387: msc_sch_wb.atp_debug('Add_Stealing_Supply_Details: ' || 'before insert into msc_alloc_supplies-Stealing Info');
4388: END IF;
4389:
4390: --ssurendr 25-NOV-2002: From_Demand_Class added in both the insert statements for alloc w/b drill down
4391: INSERT INTO MSC_ALLOC_SUPPLIES
4392: (plan_id, inventory_item_id, organization_id, sr_instance_id,
4393: demand_class, supply_date, parent_transaction_id,
4394: allocated_quantity, order_type, sales_order_line_id,demand_source_type, stealing_flag, --cmro
4395: created_by, creation_date, last_updated_by, last_update_date, from_demand_class,
4410:
4411: -- Next add the Stolen Data.
4412:
4413: IF PG_DEBUG in ('Y', 'C') THEN
4414: msc_sch_wb.atp_debug('Add_Stealing_Supply_Details: ' || 'before insert into msc_alloc_supplies-Stolen Info');
4415: END IF;
4416:
4417: INSERT INTO MSC_ALLOC_SUPPLIES
4418: (plan_id, inventory_item_id, organization_id, sr_instance_id,
4413: IF PG_DEBUG in ('Y', 'C') THEN
4414: msc_sch_wb.atp_debug('Add_Stealing_Supply_Details: ' || 'before insert into msc_alloc_supplies-Stolen Info');
4415: END IF;
4416:
4417: INSERT INTO MSC_ALLOC_SUPPLIES
4418: (plan_id, inventory_item_id, organization_id, sr_instance_id,
4419: demand_class, supply_date, parent_transaction_id,
4420: allocated_quantity, order_type, sales_order_line_id,demand_source_type, stealing_flag, --cmro
4421: created_by, creation_date, last_updated_by, last_update_date, from_demand_class,
4481: END IF;
4482:
4483: MSC_ATP_DB_UTILS.Delete_Pegging(c1.pegging_id);
4484:
4485: DELETE MSC_ALLOC_SUPPLIES
4486: WHERE parent_transaction_id = c1.identifier3
4487: AND plan_id = c1.identifier2
4488: AND sr_instance_id = c1.identifier1;
4489:
4487: AND plan_id = c1.identifier2
4488: AND sr_instance_id = c1.identifier1;
4489:
4490: IF PG_DEBUG in ('Y', 'C') THEN
4491: msc_sch_wb.atp_debug('Remove_Invalid_Future_SD: ' || 'Records deleted from msc_alloc_supplies = '|| SQL%ROWCOUNT);
4492: END IF;
4493:
4494: END LOOP;
4495: CLOSE pegging;
4974: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
4975:
4976: IF PG_DEBUG in ('Y', 'C') THEN
4977: msc_sch_wb.atp_debug('Add_Supplies: ' || ' before insert into' ||
4978: ' msc_alloc_supplies');
4979: END IF;
4980:
4981: INSERT INTO MSC_ALLOC_SUPPLIES(
4982: PLAN_ID,
4977: msc_sch_wb.atp_debug('Add_Supplies: ' || ' before insert into' ||
4978: ' msc_alloc_supplies');
4979: END IF;
4980:
4981: INSERT INTO MSC_ALLOC_SUPPLIES(
4982: PLAN_ID,
4983: INVENTORY_ITEM_ID,
4984: ORGANIZATION_ID,
4985: SR_INSTANCE_ID,