1 PACKAGE CHV_CREATE_BUCKETS AUTHID CURRENT_USER as
2 /* $Header: CHVCBKTS.pls 115.1 2002/11/26 19:51:21 sbull ship $ */
3
4 TYPE bkttable is TABLE OF VARCHAR2(25)
5 INDEX BY BINARY_INTEGER ;
6 x_bucket_table bkttable ;
7 x_bucket_count BINARY_INTEGER := 1 ;
8
9 /*===========================================================================
10 PACKAGE NAME: CHVCBKTS.pls
11
12 DESCRIPTION: This package contains the server side of Supplier Scheduling
13 APIs to create buckets.
14
15 CLIENT/SERVER: Server
16
17 OWNER: Sri Rumalla
18
19 FUNCTION/
20 PROCEDURE: create_bucket_template()
21 load_horizontal_schedules()
22 calculate_bucket_qty()
23
24 =============================================================================*/
25 /*=============================================================================
26 PROCEDURE NAME: create_bucket_template
27
28 DESCRIPTION: This procedure when executed will create horizontal bucketed
29 plan based on the horizon_start_date and applying the bucket
30 pattern. It will create three records(Descriptor, Start Date
31 and End Date) and calls the insert_buckets procedure to do the
32 actual insert. Procedure will then return horizon end date
33 calculated.
34
35 PARAMETERS: p_horizon_start_date in NUMBER,
36 p_include_future_release_flag in VARCHAR2,
37 p_bucket_pattern_id in NUMBER,
38 p_horizon_end_date OUT DATE,
39 p_bucket_descriptor_table OUT BKTTABLE,
40 p_bucket_start_date_table OUT BKTTABLE,
41 p_bucket_end_date_table OUT BKTTABLE
42
43
44 DESIGN REFERENCES:
45
46 ALGORITHM:
47
48 NOTES:
49
50 OPEN ISSUES:
51
52 CLOSED ISSUES:
53
54 CHANGE HISTORY: Created 01-NOV-1995 SRUMALLA
55 Modified to send 20-MAY-1996 SRUMALLA
56 past due in both
57 purchasing and
58 primary uoms.
59 =============================================================================*/
60 PROCEDURE create_bucket_template(
61 p_horizon_start_date in DATE,
62 p_include_future_release_flag in VARCHAR2,
63 p_bucket_pattern_id in NUMBER,
64 p_horizon_end_date out NOCOPY DATE,
65 x_bucket_descriptor_table in out NOCOPY BKTTABLE,
66 x_bucket_start_date_table in out NOCOPY BKTTABLE,
67 x_bucket_end_date_table in out NOCOPY BKTTABLE);
68
69 /*=============================================================================
70 PROCEDURE NAME: load_horizontal_schedules
71
72 DESCRIPTION:
73
74 PARAMETERS: p_schedule_id in NUMBER,
75 p_schedule_item_id in NUMBER,
76 p_row_select_order in NUMBER,
77 p_row_type in VARCHAR2,
78 p_bucket_table in BKTTABLE) ;
79
80 DESIGN REFERENCES:
81
82 ALGORITHM:
83
84 NOTES:
85
86 OPEN ISSUES:
87
88 CLOSED ISSUES:
89
90 CHANGE HISTORY: Created 01-NOV-1995 SRUMALLA
91 =============================================================================*/
92 PROCEDURE load_horizontal_schedules(
93 p_schedule_id in NUMBER,
94 p_schedule_item_id in NUMBER,
95 p_row_select_order in NUMBER,
96 p_row_type in VARCHAR2,
97 p_bucket_table in BKTTABLE) ;
98
99 /*=============================================================================
100 PROCEDURE NAME: calculate_buckets
101
102 DESCRIPTION: This procedure when executed will calculate the buckted
103 quantities by selecting the quantities from
104 CHV_ITEM_ORDERS based on the due date.
105
106 PARAMETERS: p_schedule_id in NUMBER,
107 p_schedule_item_id in NUMBER,
108 p_horizon_start_date in DATE,
109 p_horizon_end_date in DATE,
110 p_cum_enable_flag in VARCHAR2,
111 p_cum_quantity_received in NUMBER,
112 p_bucket_descriptor_table in BKTTABLE,
113 p_bucket_start_date_table in BKTTABLE,
114 p_bucket_end_date_table in BKTTABLE,
115 p_past_due_qty out NUMBER,
116 p_past_due_qty_primary out NUMBER
117
118 DESIGN REFERENCES:
119
120 ALGORITHM:
121
122 NOTES:
123
124 OPEN ISSUES:
125
126 CLOSED ISSUES:
127
128 CHANGE HISTORY: Created 01-NOV-1995 SRUMALLA
129 =============================================================================*/
130 PROCEDURE calculate_buckets(p_schedule_id in NUMBER,
131 p_schedule_item_id in NUMBER,
132 p_horizon_start_date in DATE,
133 p_horizon_end_date in DATE,
134 p_schedule_type in VARCHAR2,
135 p_cum_enable_flag in VARCHAR2,
136 p_cum_quantity_received in NUMBER,
137 p_bucket_descriptor_table in BKTTABLE,
138 p_bucket_start_date_table in BKTTABLE,
139 p_bucket_end_date_table in BKTTABLE,
140 p_past_due_qty out NOCOPY NUMBER,
141 p_past_due_qty_primary out NOCOPY NUMBER
142 ) ;
143
144 END CHV_CREATE_BUCKETS ;