660: safety.period_start_date old_date,
661: sum(safety.safety_stock_quantity) new_quantity,
662: safety.organization_id old_quantity,
663: sum(safety.achieved_days_of_supply) dos,
664: sum(safety.safety_stock_quantity * gpi.standard_cost) cost
665: FROM msc_safety_stocks safety,
666: -- msc_form_query list ,
667: -- msc_system_items item
668: gmp_pdr_items_gtmp gpi
710: safety.period_start_date old_date,
711: sum(safety.TARGET_SAFETY_STOCK) new_quantity,
712: sum(safety.TOTAL_UNPOOLED_SAFETY_STOCK) old_quantity,
713: sum(safety.target_days_of_supply) dos,
714: sum(safety.TARGET_SAFETY_STOCK * gpi.standard_cost) cost
715: FROM msc_safety_stocks safety,
716: -- msc_form_query list ,
717: -- msc_system_items item
718: gmp_pdr_items_gtmp gpi
759: safety.period_start_date old_date,
760: sum(safety.USER_DEFINED_SAFETY_STOCKS) new_quantity,
761: sum(0) old_quantity,
762: sum(safety.user_defined_dos) dos,
763: sum(safety.USER_DEFINED_SAFETY_STOCKS * gpi.standard_cost) cost
764: FROM msc_safety_stocks safety,
765: -- msc_form_query list,
766: -- msc_system_items item
767: gmp_pdr_items_gtmp gpi
1034: */
1035: ORDER BY
1036: 1, 2, 5, 3 ;
1037: /*
1038: cursor standard_cost (p_inventory_item_id number,
1039: p_sr_instance_id number,
1040: p_organization_id number,
1041: p_plan_id number) is
1042: select nvl(standard_cost,0)
1038: cursor standard_cost (p_inventory_item_id number,
1039: p_sr_instance_id number,
1040: p_organization_id number,
1041: p_plan_id number) is
1042: select nvl(standard_cost,0)
1043: from msc_system_items
1044: where inventory_item_id=p_inventory_item_id
1045: and organization_id =p_organization_id
1046: and sr_instance_id =p_sr_instance_id
2704: -- else
2705: -- add_to_plan(bucket_counter -1,
2706: -- uss_off,
2707: -- activity_rec.new_quantity);
2708: -- open standard_cost(
2709: -- last_item_id,
2710: -- last_inst_id,
2711: -- last_org_id,
2712: -- G_plan_id);
2709: -- last_item_id,
2710: -- last_inst_id,
2711: -- last_org_id,
2712: -- G_plan_id);
2713: -- fetch standard_cost into l_standard_cost;
2714: -- close standard_cost;
2715: -- add_to_plan(bucket_counter-1,
2716: -- USS_val_OFF,
2717: -- activity_rec.new_quantity*l_standard_cost);
2710: -- last_inst_id,
2711: -- last_org_id,
2712: -- G_plan_id);
2713: -- fetch standard_cost into l_standard_cost;
2714: -- close standard_cost;
2715: -- add_to_plan(bucket_counter-1,
2716: -- USS_val_OFF,
2717: -- activity_rec.new_quantity*l_standard_cost);
2718: --
2713: -- fetch standard_cost into l_standard_cost;
2714: -- close standard_cost;
2715: -- add_to_plan(bucket_counter-1,
2716: -- USS_val_OFF,
2717: -- activity_rec.new_quantity*l_standard_cost);
2718: --
2719: -- end if;
2720: END IF;
2721: END IF;