DBA Data[Home] [Help]

APPS.GME_CREATE_STEP_PVT dependencies on GME_BATCH_HEADER

Line 13: ,p_gme_batch_header_rec IN gme_batch_header%ROWTYPE

9: ,p_recipe_rout_resc_tbl IN gmd_recipe_fetch_pub.oprn_resc_tbl
10: ,p_resc_parameters_tbl IN gmd_recipe_fetch_pub.recp_resc_proc_param_tbl
11: ,p_recipe_rout_matl_tbl IN gmd_recipe_fetch_pub.recipe_rout_matl_tbl
12: ,p_routing_depd_tbl IN gmd_recipe_fetch_pub.routing_depd_tbl
13: ,p_gme_batch_header_rec IN gme_batch_header%ROWTYPE
14: ,p_use_workday_cal IN VARCHAR2
15: ,p_contiguity_override IN VARCHAR2
16: ,x_return_status OUT NOCOPY VARCHAR2
17: ,p_ignore_qty_below_cap IN VARCHAR2

Line 49: l_batch_id gme_batch_header.batch_id%TYPE;

45: INDEX BY BINARY_INTEGER;
46:
47: i PLS_INTEGER;
48: j PLS_INTEGER;
49: l_batch_id gme_batch_header.batch_id%TYPE;
50: l_step_tbl gmd_auto_step_calc.step_rec_tbl;
51: l_batchstep_id gme_batch_steps.batchstep_id%TYPE;
52: l_last_batchstep_id gme_batch_steps.batchstep_id%TYPE;
53: l_qty gme_batch_steps.plan_step_qty%TYPE;

Line 99: l_gme_batch_header gme_batch_header%ROWTYPE;

95: l_step_plan_start_date DATE;
96: l_step_plan_cmplt_date DATE;
97: l_rsrc_start_date DATE;
98: l_rsrc_cmplt_date DATE;
99: l_gme_batch_header gme_batch_header%ROWTYPE;
100:
101: CURSOR cur_get_batch_steps (v_batch_id NUMBER, v_count NUMBER DEFAULT 0)
102: IS
103: SELECT batchstep_id, plan_step_qty, plan_charges

Line 139: v_batch_id gme_batch_header.batch_id%TYPE

135: FROM gmd_recipe_validity_rules
136: WHERE recipe_validity_rule_id = v_recipe_validity_rule_id;
137:
138: CURSOR cur_step_dates (
139: v_batch_id gme_batch_header.batch_id%TYPE
140: ,v_batchstep_id gme_batch_steps.batchstep_id%TYPE)
141: IS
142: SELECT plan_start_date, plan_cmplt_date
143: FROM gme_batch_steps

Line 147: v_batch_id gme_batch_header.batch_id%TYPE

143: FROM gme_batch_steps
144: WHERE batch_id = v_batch_id AND batchstep_id = v_batchstep_id;
145:
146: CURSOR cur_step_plan_cmplt_date (
147: v_batch_id gme_batch_header.batch_id%TYPE
148: ,v_batchstep_id gme_batch_steps.batchstep_id%TYPE)
149: IS
150: SELECT plan_cmplt_date
151: FROM gme_batch_steps

Line 189: l_batch_id := p_gme_batch_header_rec.batch_id;

185: gme_debug.put_line ('BEGIN Create_step');
186: END IF;
187:
188: x_return_status := fnd_api.g_ret_sts_success;
189: l_batch_id := p_gme_batch_header_rec.batch_id;
190:
191: IF (p_gme_batch_header_rec.batch_type = gme_common_pvt.g_doc_type_batch) THEN
192: l_doc_type := 'PROD';
193: ELSE

Line 191: IF (p_gme_batch_header_rec.batch_type = gme_common_pvt.g_doc_type_batch) THEN

187:
188: x_return_status := fnd_api.g_ret_sts_success;
189: l_batch_id := p_gme_batch_header_rec.batch_id;
190:
191: IF (p_gme_batch_header_rec.batch_type = gme_common_pvt.g_doc_type_batch) THEN
192: l_doc_type := 'PROD';
193: ELSE
194: l_doc_type := 'FPO';
195: END IF;

Line 197: OPEN cur_recipe_id (p_gme_batch_header_rec.recipe_validity_rule_id);

193: ELSE
194: l_doc_type := 'FPO';
195: END IF;
196:
197: OPEN cur_recipe_id (p_gme_batch_header_rec.recipe_validity_rule_id);
198:
199: FETCH cur_recipe_id
200: INTO l_recipe_id;
201:

Line 248: IF p_gme_batch_header_rec.enforce_step_dependency = 1 THEN

244: l_gme_batch_steps (j).plan_start_date := gme_common_pvt.g_timestamp;
245: l_gme_batch_steps (j).plan_cmplt_date := gme_common_pvt.g_timestamp;
246: l_gme_batch_steps (j).plan_charges := 0;
247:
248: IF p_gme_batch_header_rec.enforce_step_dependency = 1 THEN
249: l_gme_batch_steps (j).steprelease_type := 1;
250: ELSE
251: l_gme_batch_steps (j).steprelease_type :=
252: p_recipe_rout_step_tbl (i).steprelease_type;

Line 300: gmd_gme_int.check_qc(p_routingid => p_gme_batch_header_rec.routing_id,

296: l_gme_batch_steps (j).text_code := l_gme_text_code;
297: END IF;
298: END IF;
299:
300: gmd_gme_int.check_qc(p_routingid => p_gme_batch_header_rec.routing_id,
301: p_routingstepid => l_gme_batch_steps(j).routingstep_id,
302: p_recipeid => l_recipe_id,
303: p_organization_id => p_gme_batch_header_rec.organization_id,
304: p_resultout => l_qc_status);

Line 303: p_organization_id => p_gme_batch_header_rec.organization_id,

299:
300: gmd_gme_int.check_qc(p_routingid => p_gme_batch_header_rec.routing_id,
301: p_routingstepid => l_gme_batch_steps(j).routingstep_id,
302: p_recipeid => l_recipe_id,
303: p_organization_id => p_gme_batch_header_rec.organization_id,
304: p_resultout => l_qc_status);
305: IF (l_qc_status = 'S') THEN
306: l_gme_batch_steps(j).quality_status := 2;
307: END IF;

Line 489: p_gme_batch_header_rec.organization_id;

485: END IF;
486:
487: l_gme_batch_step_resources (j).batch_id := l_batch_id;
488: l_gme_batch_step_resources (j).organization_id :=
489: p_gme_batch_header_rec.organization_id;
490: l_gme_batch_step_resources (j).resources :=
491: p_recipe_rout_resc_tbl (i).resources;
492: l_gme_batch_step_resources (j).cost_analysis_code :=
493: p_recipe_rout_resc_tbl (i).cost_analysis_code;

Line 897: IF (p_gme_batch_header_rec.automatic_step_calculation = 1) THEN

893: -- ALSO, don't need to call auto_step_calc, because there are no dependencies tied in with this step... and there
894: -- are no item_step_associations either... so do nothing...
895: NULL;
896: ELSE
897: IF (p_gme_batch_header_rec.automatic_step_calculation = 1) THEN
898: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
899: gme_debug.put_line ('auto step calc...');
900: END IF;
901:

Line 909: ,p_organization_id => p_gme_batch_header_rec.organization_id);

905: ,p_msg_count => l_msg_count
906: ,p_msg_stack => l_msg_stack
907: ,p_return_status => l_return_status
908: ,p_called_from_batch => 1
909: ,p_organization_id => p_gme_batch_header_rec.organization_id);
910: ELSE
911: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
912: gme_debug.put_line ('NO auto step calc...');
913: END IF;

Line 1104: IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN

1100: ,plan_rsrc_qty =
1101: ROUND (plan_rsrc_qty * l_activity_factor, 32)
1102: WHERE batchstep_activity_id = l_batchstep_activity_id;
1103:
1104: IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN
1105: FOR l_rec IN cur_get_resources (l_batchstep_activity_id) LOOP
1106: UPDATE gme_resource_txns
1107: SET resource_usage =
1108: ROUND ( l_rec.plan_rsrc_usage

Line 1116: /* IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN */

1112: AND doc_type = l_doc_type
1113: AND line_id = l_rec.batchstep_resource_id;
1114: END LOOP; /* FOR resources */
1115: END IF;
1116: /* IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN */
1117:
1118: FETCH cur_get_step_activities
1119: INTO l_batchstep_activity_id, l_activity_factor;
1120: END LOOP; /* WHILE cur_get_step_activities%FOUND */

Line 1189: IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN

1185: ,plan_rsrc_qty =
1186: ROUND (plan_rsrc_qty * l_activity_factor, 32)
1187: WHERE batchstep_activity_id = l_batchstep_activity_id;
1188:
1189: IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN
1190: FOR l_rec IN cur_get_resources (l_batchstep_activity_id) LOOP
1191: UPDATE gme_resource_txns
1192: SET resource_usage =
1193: ROUND ( l_rec.plan_rsrc_usage

Line 1201: /* IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN */

1197: AND doc_type = l_doc_type
1198: AND line_id = l_rec.batchstep_resource_id;
1199: END LOOP; /* FOR resources */
1200: END IF;
1201: /* IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN */
1202:
1203: FETCH cur_get_activities
1204: INTO l_batchstep_activity_id, l_activity_factor;
1205: END LOOP; /* WHILE cur_get_activities%FOUND */

Line 1236: (p_gme_batch_header_rec => p_gme_batch_header_rec

1232:
1233: IF ( p_recipe_rout_step_tbl.COUNT = 1
1234: AND p_recipe_rout_step_tbl (1).routingstep_id IS NULL) THEN
1235: gme_create_step_pvt.calc_dates
1236: (p_gme_batch_header_rec => p_gme_batch_header_rec
1237: ,p_use_workday_cal => p_use_workday_cal
1238: ,p_contiguity_override => p_contiguity_override
1239: ,p_return_status => l_return_status
1240: ,p_step_id => l_last_batchstep_id

Line 1249: (p_gme_batch_header_rec => p_gme_batch_header_rec

1245: RAISE error_calc_dates;
1246: END IF;
1247: ELSE
1248: gme_create_step_pvt.calc_dates
1249: (p_gme_batch_header_rec => p_gme_batch_header_rec
1250: ,p_use_workday_cal => p_use_workday_cal
1251: ,p_contiguity_override => p_contiguity_override
1252: ,p_return_status => l_return_status);
1253: END IF;

Line 1261: OPEN cur_step_dates (p_gme_batch_header_rec.batch_id

1257: END IF;
1258:
1259: IF ( p_recipe_rout_step_tbl.COUNT = 1
1260: AND p_recipe_rout_step_tbl (1).routingstep_id IS NULL) THEN
1261: OPEN cur_step_dates (p_gme_batch_header_rec.batch_id
1262: ,l_last_batchstep_id);
1263:
1264: FETCH cur_step_dates
1265: INTO l_step_plan_start_date, l_step_plan_cmplt_date;

Line 1286: || TO_CHAR (p_gme_batch_header_rec.plan_start_date

1282: || TO_CHAR (p_step_cmplt_date
1283: ,'DD-MON-YYYY HH24:MI:SS') );
1284: gme_debug.put_line
1285: ( 'start,cmplt dates for batch are'
1286: || TO_CHAR (p_gme_batch_header_rec.plan_start_date
1287: ,'DD-MON-YYYY HH24:MI:SS')
1288: || TO_CHAR (p_gme_batch_header_rec.plan_cmplt_date
1289: ,'DD-MON-YYYY HH24:MI:SS') );
1290: END IF;

Line 1288: || TO_CHAR (p_gme_batch_header_rec.plan_cmplt_date

1284: gme_debug.put_line
1285: ( 'start,cmplt dates for batch are'
1286: || TO_CHAR (p_gme_batch_header_rec.plan_start_date
1287: ,'DD-MON-YYYY HH24:MI:SS')
1288: || TO_CHAR (p_gme_batch_header_rec.plan_cmplt_date
1289: ,'DD-MON-YYYY HH24:MI:SS') );
1290: END IF;
1291:
1292: IF (p_step_cmplt_date IS NOT NULL)

Line 1305: WHERE batch_id = p_gme_batch_header_rec.batch_id

1301: SET plan_cmplt_date = p_step_cmplt_date
1302: ,last_updated_by = gme_common_pvt.g_user_ident
1303: ,last_update_date = gme_common_pvt.g_timestamp
1304: ,last_update_login = gme_common_pvt.g_login_id
1305: WHERE batch_id = p_gme_batch_header_rec.batch_id
1306: AND batchstep_id = l_last_batchstep_id;
1307: ELSIF (p_step_cmplt_date < l_step_plan_cmplt_date) THEN
1308: l_gme_batch_header.batch_id := p_gme_batch_header_rec.batch_id;
1309: l_gme_batch_header.batch_type :=

Line 1308: l_gme_batch_header.batch_id := p_gme_batch_header_rec.batch_id;

1304: ,last_update_login = gme_common_pvt.g_login_id
1305: WHERE batch_id = p_gme_batch_header_rec.batch_id
1306: AND batchstep_id = l_last_batchstep_id;
1307: ELSIF (p_step_cmplt_date < l_step_plan_cmplt_date) THEN
1308: l_gme_batch_header.batch_id := p_gme_batch_header_rec.batch_id;
1309: l_gme_batch_header.batch_type :=
1310: p_gme_batch_header_rec.batch_type;
1311: l_gme_batch_header.plan_cmplt_date := p_step_cmplt_date;
1312: gme_reschedule_batch_pvt.truncate_date

Line 1309: l_gme_batch_header.batch_type :=

1305: WHERE batch_id = p_gme_batch_header_rec.batch_id
1306: AND batchstep_id = l_last_batchstep_id;
1307: ELSIF (p_step_cmplt_date < l_step_plan_cmplt_date) THEN
1308: l_gme_batch_header.batch_id := p_gme_batch_header_rec.batch_id;
1309: l_gme_batch_header.batch_type :=
1310: p_gme_batch_header_rec.batch_type;
1311: l_gme_batch_header.plan_cmplt_date := p_step_cmplt_date;
1312: gme_reschedule_batch_pvt.truncate_date
1313: (p_batch_header_rec => l_gme_batch_header

Line 1310: p_gme_batch_header_rec.batch_type;

1306: AND batchstep_id = l_last_batchstep_id;
1307: ELSIF (p_step_cmplt_date < l_step_plan_cmplt_date) THEN
1308: l_gme_batch_header.batch_id := p_gme_batch_header_rec.batch_id;
1309: l_gme_batch_header.batch_type :=
1310: p_gme_batch_header_rec.batch_type;
1311: l_gme_batch_header.plan_cmplt_date := p_step_cmplt_date;
1312: gme_reschedule_batch_pvt.truncate_date
1313: (p_batch_header_rec => l_gme_batch_header
1314: ,p_date => 1

Line 1311: l_gme_batch_header.plan_cmplt_date := p_step_cmplt_date;

1307: ELSIF (p_step_cmplt_date < l_step_plan_cmplt_date) THEN
1308: l_gme_batch_header.batch_id := p_gme_batch_header_rec.batch_id;
1309: l_gme_batch_header.batch_type :=
1310: p_gme_batch_header_rec.batch_type;
1311: l_gme_batch_header.plan_cmplt_date := p_step_cmplt_date;
1312: gme_reschedule_batch_pvt.truncate_date
1313: (p_batch_header_rec => l_gme_batch_header
1314: ,p_date => 1
1315: ,p_batchstep_id => l_last_batchstep_id

Line 1313: (p_batch_header_rec => l_gme_batch_header

1309: l_gme_batch_header.batch_type :=
1310: p_gme_batch_header_rec.batch_type;
1311: l_gme_batch_header.plan_cmplt_date := p_step_cmplt_date;
1312: gme_reschedule_batch_pvt.truncate_date
1313: (p_batch_header_rec => l_gme_batch_header
1314: ,p_date => 1
1315: ,p_batchstep_id => l_last_batchstep_id
1316: ,x_return_status => l_return_status);
1317:

Line 1336: IF (l_step_plan_start_date < p_gme_batch_header_rec.plan_start_date) THEN

1332: || TO_CHAR (l_step_plan_cmplt_date, 'DD-MON-YYYY HH24:MI:SS') );
1333: END IF;
1334:
1335: --checking against the batch dates
1336: IF (l_step_plan_start_date < p_gme_batch_header_rec.plan_start_date) THEN
1337: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1338: gme_debug.put_line
1339: ('l_step_plan_start_date diff from batch start date');
1340: END IF;

Line 1343: (p_batch_header_rec => p_gme_batch_header_rec

1339: ('l_step_plan_start_date diff from batch start date');
1340: END IF;
1341:
1342: gme_reschedule_batch_pvt.truncate_date
1343: (p_batch_header_rec => p_gme_batch_header_rec
1344: ,p_date => 0
1345: ,p_batchstep_id => l_last_batchstep_id
1346: ,x_return_status => l_return_status);
1347:

Line 1352: /* (l_step_plan_start_date < p_gme_batch_header_rec.plan_start_date) */

1348: IF l_return_status <> x_return_status THEN
1349: RAISE error_truncate_date;
1350: END IF;
1351: END IF;
1352: /* (l_step_plan_start_date < p_gme_batch_header_rec.plan_start_date) */
1353:
1354: IF (l_step_plan_cmplt_date > p_gme_batch_header_rec.plan_cmplt_date) THEN
1355: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1356: gme_debug.put_line

Line 1354: IF (l_step_plan_cmplt_date > p_gme_batch_header_rec.plan_cmplt_date) THEN

1350: END IF;
1351: END IF;
1352: /* (l_step_plan_start_date < p_gme_batch_header_rec.plan_start_date) */
1353:
1354: IF (l_step_plan_cmplt_date > p_gme_batch_header_rec.plan_cmplt_date) THEN
1355: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1356: gme_debug.put_line
1357: ('l_step_plan_cmplt_date diff from batch cmplt date');
1358: END IF;

Line 1361: (p_batch_header_rec => p_gme_batch_header_rec

1357: ('l_step_plan_cmplt_date diff from batch cmplt date');
1358: END IF;
1359:
1360: gme_reschedule_batch_pvt.truncate_date
1361: (p_batch_header_rec => p_gme_batch_header_rec
1362: ,p_date => 1
1363: ,p_batchstep_id => l_last_batchstep_id
1364: ,x_return_status => l_return_status);
1365:

Line 1370: /* (l_step_plan_cmplt_date > p_gme_batch_header_rec.plan_cmplt_date) */

1366: IF l_return_status <> x_return_status THEN
1367: RAISE error_truncate_date;
1368: END IF;
1369: END IF;
1370: /* (l_step_plan_cmplt_date > p_gme_batch_header_rec.plan_cmplt_date) */
1371: END IF; /* IF (p_recipe_rout_step_tbl.COUNT = 1 AND */
1372:
1373: OPEN cur_get_batchstep_ids (p_gme_batch_header_rec.batch_id);
1374:

Line 1373: OPEN cur_get_batchstep_ids (p_gme_batch_header_rec.batch_id);

1369: END IF;
1370: /* (l_step_plan_cmplt_date > p_gme_batch_header_rec.plan_cmplt_date) */
1371: END IF; /* IF (p_recipe_rout_step_tbl.COUNT = 1 AND */
1372:
1373: OPEN cur_get_batchstep_ids (p_gme_batch_header_rec.batch_id);
1374:
1375: FETCH cur_get_batchstep_ids
1376: BULK COLLECT INTO l_batchstep_ids_tab;
1377:

Line 1383: || p_gme_batch_header_rec.batch_id

1379:
1380: FOR i IN 1 .. l_batchstep_ids_tab.COUNT LOOP
1381: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1382: gme_debug.put_line ( 'batch,step ids are'
1383: || p_gme_batch_header_rec.batch_id
1384: || l_batchstep_ids_tab (i) );
1385: END IF;
1386:
1387: OPEN cur_is_charge_associated (p_gme_batch_header_rec.batch_id

Line 1387: OPEN cur_is_charge_associated (p_gme_batch_header_rec.batch_id

1383: || p_gme_batch_header_rec.batch_id
1384: || l_batchstep_ids_tab (i) );
1385: END IF;
1386:
1387: OPEN cur_is_charge_associated (p_gme_batch_header_rec.batch_id
1388: ,l_batchstep_ids_tab (i) );
1389:
1390: FETCH cur_is_charge_associated
1391: INTO l_resources;

Line 1397: ,p_gme_batch_header_rec.batch_id

1393: IF cur_is_charge_associated%FOUND THEN
1394: CLOSE cur_is_charge_associated;
1395:
1396: OPEN cur_get_resource_dates (l_resources
1397: ,p_gme_batch_header_rec.batch_id
1398: ,l_batchstep_ids_tab (i) );
1399:
1400: FETCH cur_get_resource_dates
1401: INTO l_rsrc_start_date, l_rsrc_cmplt_date;

Line 1417: WHERE batch_id = p_gme_batch_header_rec.batch_id

1413:
1414: UPDATE gme_batch_step_charges
1415: SET plan_start_date = l_rsrc_start_date
1416: ,plan_cmplt_date = l_rsrc_cmplt_date
1417: WHERE batch_id = p_gme_batch_header_rec.batch_id
1418: AND batchstep_id = l_batchstep_ids_tab (i);
1419: ELSE
1420: CLOSE cur_is_charge_associated;
1421: END IF;

Line 1654: -- p_gme_batch_header_rec non null value.

1650: -- This PL/SQL function is responsible for calculating max step
1651: -- dates based on shop calendar or otherwise
1652: --
1653: -- REQUIREMENTS
1654: -- p_gme_batch_header_rec non null value.
1655: -- SYNOPSIS:
1656: --
1657: --===================================================================== */
1658: FUNCTION get_max_step_date (

Line 1927: -- p_gme_batch_header_rec non null value.

1923: -- DESCRIPTION:
1924: -- This PL/SQL procedure is responsible for calculating dates for the batch
1925: --
1926: -- REQUIREMENTS
1927: -- p_gme_batch_header_rec non null value.
1928: -- SYNOPSIS:
1929: -- calc_dates (p_gme_batch_header_rec,p_use_workday_cal, X_return_status);
1930: -- -- Pawan Kumar bug 823188 added for shop calendar
1931: -- Added additional parameters for the shop calendar implementation.

Line 1929: -- calc_dates (p_gme_batch_header_rec,p_use_workday_cal, X_return_status);

1925: --
1926: -- REQUIREMENTS
1927: -- p_gme_batch_header_rec non null value.
1928: -- SYNOPSIS:
1929: -- calc_dates (p_gme_batch_header_rec,p_use_workday_cal, X_return_status);
1930: -- -- Pawan Kumar bug 823188 added for shop calendar
1931: -- Added additional parameters for the shop calendar implementation.
1932: --===================================================================== */
1933: PROCEDURE calc_dates (

Line 1934: p_gme_batch_header_rec IN gme_batch_header%ROWTYPE

1930: -- -- Pawan Kumar bug 823188 added for shop calendar
1931: -- Added additional parameters for the shop calendar implementation.
1932: --===================================================================== */
1933: PROCEDURE calc_dates (
1934: p_gme_batch_header_rec IN gme_batch_header%ROWTYPE
1935: ,p_use_workday_cal IN VARCHAR2
1936: ,p_contiguity_override IN VARCHAR2
1937: ,p_return_status OUT NOCOPY VARCHAR2
1938: ,p_step_id IN gme_batch_steps.batchstep_id%TYPE

Line 1955: x_routing_id gme_batch_header.routing_id%TYPE;

1951: x_step_row gme_batch_steps%ROWTYPE;
1952: x_max_act_date DATE;
1953: x_max_rsrc_date DATE;
1954: l_return_status VARCHAR2 (1);
1955: x_routing_id gme_batch_header.routing_id%TYPE;
1956: x_gmd_step_tbl gmd_auto_step_calc.step_rec_tbl;
1957: l_batch_id gme_batch_header.batch_id%TYPE;
1958: x_batch_duration NUMBER;
1959: x_batch_start_date DATE;

Line 1957: l_batch_id gme_batch_header.batch_id%TYPE;

1953: x_max_rsrc_date DATE;
1954: l_return_status VARCHAR2 (1);
1955: x_routing_id gme_batch_header.routing_id%TYPE;
1956: x_gmd_step_tbl gmd_auto_step_calc.step_rec_tbl;
1957: l_batch_id gme_batch_header.batch_id%TYPE;
1958: x_batch_duration NUMBER;
1959: x_batch_start_date DATE;
1960: x_step_start_date DATE;
1961: x_step_no gme_batch_steps.batchstep_no%TYPE;

Line 2004: p_recipe_validity_rule_id gme_batch_header.recipe_validity_rule_id%TYPE)

2000: FROM gme_batch_step_activities
2001: WHERE batchstep_activity_id = v_batchstep_activity_id;
2002:
2003: CURSOR cur_recipe_validity_rule (
2004: p_recipe_validity_rule_id gme_batch_header.recipe_validity_rule_id%TYPE)
2005: IS
2006: SELECT inventory_item_id
2007: FROM gmd_recipe_validity_rules
2008: WHERE recipe_validity_rule_id = p_recipe_validity_rule_id;

Line 2032: l_batch_id := p_gme_batch_header_rec.batch_id;

2028: gme_debug.put_line ('start calc_dates');
2029: END IF;
2030:
2031: p_return_status := fnd_api.g_ret_sts_success;
2032: l_batch_id := p_gme_batch_header_rec.batch_id;
2033:
2034: IF (p_gme_batch_header_rec.batch_type = 0) THEN
2035: l_doc_type := 'PROD';
2036: ELSE

Line 2034: IF (p_gme_batch_header_rec.batch_type = 0) THEN

2030:
2031: p_return_status := fnd_api.g_ret_sts_success;
2032: l_batch_id := p_gme_batch_header_rec.batch_id;
2033:
2034: IF (p_gme_batch_header_rec.batch_type = 0) THEN
2035: l_doc_type := 'PROD';
2036: ELSE
2037: l_doc_type := 'FPO';
2038: END IF;

Line 2052: (p_gme_batch_header_rec.recipe_validity_rule_id);

2048: IF l_calendar_code IS NULL THEN
2049: l_use_workday_cal := fnd_api.g_false;
2050: ELSE
2051: OPEN cur_recipe_validity_rule
2052: (p_gme_batch_header_rec.recipe_validity_rule_id);
2053:
2054: FETCH cur_recipe_validity_rule
2055: INTO l_item_id;
2056:

Line 2114: x_batch_start_date := p_gme_batch_header_rec.plan_start_date;

2110: (x_gmd_step_tbl (i).step_no) );
2111: END IF;
2112: END LOOP;
2113:
2114: x_batch_start_date := p_gme_batch_header_rec.plan_start_date;
2115: x_step_start_date := p_plan_start_date;
2116:
2117: IF (p_step_id IS NOT NULL) THEN
2118: -- This is a step insert... calc the start date with the cmplt date and duration...

Line 2172: IF (p_gme_batch_header_rec.plan_start_date IS NOT NULL) THEN

2168: ,'DD-MON-YYYY HH24:MI:SS') );
2169: END IF;
2170: END IF;
2171: ELSE
2172: IF (p_gme_batch_header_rec.plan_start_date IS NOT NULL) THEN
2173: calc_longest_time (l_batch_id
2174: ,l_step_duration_tab
2175: ,x_batch_duration
2176: ,l_return_status);

Line 2183: (p_gme_batch_header_rec.plan_cmplt_date

2179: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
2180: gme_debug.put_line
2181: ( 'start date is not null'
2182: || TO_CHAR
2183: (p_gme_batch_header_rec.plan_cmplt_date
2184: ,'DD-MON-YYYY HH24:MI:SS') );
2185: END IF;
2186:
2187: gmp_calendar_api.get_contiguous_periods

Line 2190: ,p_start_date => p_gme_batch_header_rec.plan_start_date

2186:
2187: gmp_calendar_api.get_contiguous_periods
2188: (p_api_version => 1
2189: ,p_init_msg_list => TRUE
2190: ,p_start_date => p_gme_batch_header_rec.plan_start_date
2191: ,p_end_date => NULL
2192: ,p_calendar_code => l_calendar_code
2193: ,p_duration => x_batch_duration
2194: ,p_output_tbl => l_contig_period_tbl

Line 2210: x_batch_start_date := p_gme_batch_header_rec.plan_start_date;

2206: END IF;
2207: END IF;
2208: END IF;
2209:
2210: x_batch_start_date := p_gme_batch_header_rec.plan_start_date;
2211: ELSIF (p_gme_batch_header_rec.plan_start_date IS NULL)
2212: AND (p_gme_batch_header_rec.plan_cmplt_date IS NOT NULL) THEN
2213: -- calc longest time for the entire batch if we're only given cmplt date...
2214: calc_longest_time (l_batch_id

Line 2211: ELSIF (p_gme_batch_header_rec.plan_start_date IS NULL)

2207: END IF;
2208: END IF;
2209:
2210: x_batch_start_date := p_gme_batch_header_rec.plan_start_date;
2211: ELSIF (p_gme_batch_header_rec.plan_start_date IS NULL)
2212: AND (p_gme_batch_header_rec.plan_cmplt_date IS NOT NULL) THEN
2213: -- calc longest time for the entire batch if we're only given cmplt date...
2214: calc_longest_time (l_batch_id
2215: ,l_step_duration_tab

Line 2212: AND (p_gme_batch_header_rec.plan_cmplt_date IS NOT NULL) THEN

2208: END IF;
2209:
2210: x_batch_start_date := p_gme_batch_header_rec.plan_start_date;
2211: ELSIF (p_gme_batch_header_rec.plan_start_date IS NULL)
2212: AND (p_gme_batch_header_rec.plan_cmplt_date IS NOT NULL) THEN
2213: -- calc longest time for the entire batch if we're only given cmplt date...
2214: calc_longest_time (l_batch_id
2215: ,l_step_duration_tab
2216: ,x_batch_duration

Line 2224: (p_gme_batch_header_rec.plan_cmplt_date

2220: gme_debug.put_line ('duration of batch is ' || x_batch_duration);
2221: gme_debug.put_line
2222: ( 'batch completion date is '
2223: || TO_CHAR
2224: (p_gme_batch_header_rec.plan_cmplt_date
2225: ,'DD-MON-YYYY HH24:MI:SS') );
2226: END IF;
2227:
2228: IF l_use_workday_cal = fnd_api.g_true THEN

Line 2234: (p_gme_batch_header_rec.plan_cmplt_date

2230: gme_debug.put_line ('end date null ' || l_use_workday_cal);
2231: gme_debug.put_line
2232: ( 'batch completion date is '
2233: || TO_CHAR
2234: (p_gme_batch_header_rec.plan_cmplt_date
2235: ,'DD-MON-YYYY HH24:MI:SS') );
2236: END IF;
2237:
2238: gmp_calendar_api.get_contiguous_periods

Line 2242: ,p_end_date => p_gme_batch_header_rec.plan_cmplt_date

2238: gmp_calendar_api.get_contiguous_periods
2239: (p_api_version => 1
2240: ,p_init_msg_list => TRUE
2241: ,p_start_date => NULL
2242: ,p_end_date => p_gme_batch_header_rec.plan_cmplt_date
2243: ,p_calendar_code => l_calendar_code
2244: ,p_duration => x_batch_duration
2245: ,p_output_tbl => l_contig_period_tbl
2246: ,x_return_status => l_return_status);

Line 2264: p_gme_batch_header_rec.plan_cmplt_date

2260: x_batch_start_date :=
2261: l_contig_period_tbl (l_cal_count).start_date;
2262: ELSE
2263: x_batch_start_date :=
2264: p_gme_batch_header_rec.plan_cmplt_date
2265: - x_batch_duration / 24;
2266: END IF;
2267:
2268: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN

Line 2273: ELSIF (p_gme_batch_header_rec.plan_start_date IS NULL)

2269: gme_debug.put_line ( 'calculated batch start date is '
2270: || TO_CHAR (x_batch_start_date
2271: ,'DD-MON-YYYY HH24:MI:SS') );
2272: END IF;
2273: ELSIF (p_gme_batch_header_rec.plan_start_date IS NULL)
2274: AND (p_gme_batch_header_rec.plan_cmplt_date IS NULL) THEN
2275: calc_longest_time (l_batch_id
2276: ,l_step_duration_tab
2277: ,x_batch_duration

Line 2274: AND (p_gme_batch_header_rec.plan_cmplt_date IS NULL) THEN

2270: || TO_CHAR (x_batch_start_date
2271: ,'DD-MON-YYYY HH24:MI:SS') );
2272: END IF;
2273: ELSIF (p_gme_batch_header_rec.plan_start_date IS NULL)
2274: AND (p_gme_batch_header_rec.plan_cmplt_date IS NULL) THEN
2275: calc_longest_time (l_batch_id
2276: ,l_step_duration_tab
2277: ,x_batch_duration
2278: ,l_return_status);

Line 2287: (p_gme_batch_header_rec.plan_cmplt_date

2283: || p_contiguity_override);
2284: gme_debug.put_line
2285: ( 'batch completion date is '
2286: || TO_CHAR
2287: (p_gme_batch_header_rec.plan_cmplt_date
2288: ,'DD-MON-YYYY HH24:MI:SS') );
2289: END IF;
2290:
2291: gmp_calendar_api.get_contiguous_periods

Line 2424: IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN

2420: l_batchstep_activity_id := x_act_tab (j).batchstep_activity_id;
2421: RAISE no_resources;
2422: END IF;
2423:
2424: IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN
2425: x_rsrc_txns_tab.DELETE;
2426: x_cur_row := 0;
2427: END IF;
2428: /* IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN */

Line 2428: /* IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN */

2424: IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN
2425: x_rsrc_txns_tab.DELETE;
2426: x_cur_row := 0;
2427: END IF;
2428: /* IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN */
2429:
2430: FOR k IN x_rsrc_tab.FIRST .. x_rsrc_tab.LAST LOOP
2431: IF l_use_workday_cal = fnd_api.g_true THEN
2432: x_rsrc_tab (k).plan_start_date :=

Line 2487: IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN

2483: l_cal_count := l_contig_period_tbl.COUNT;
2484: x_rsrc_tab (k).plan_cmplt_date :=
2485: l_contig_period_tbl (l_cal_count).end_date;
2486:
2487: IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN
2488: FOR m IN 1 .. l_cal_count LOOP
2489: x_rsrc_tab (k).plan_start_date :=
2490: l_contig_period_tbl (m).start_date;
2491: x_rsrc_tab (k).plan_cmplt_date :=

Line 2493: insert_resource_txns (p_gme_batch_header_rec

2489: x_rsrc_tab (k).plan_start_date :=
2490: l_contig_period_tbl (m).start_date;
2491: x_rsrc_tab (k).plan_cmplt_date :=
2492: l_contig_period_tbl (m).end_date;
2493: insert_resource_txns (p_gme_batch_header_rec
2494: ,l_doc_type
2495: ,x_rsrc_tab (k)
2496: ,l_return_status);
2497:

Line 2507: /* IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN */

2503: x_rsrc_tab (k).plan_start_date :=
2504: l_contig_period_tbl (1).start_date;
2505: END IF;
2506:
2507: /* IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN */
2508: IF k = x_rsrc_tab.FIRST
2509: OR x_rsrc_tab (k).plan_cmplt_date > x_max_rsrc_date THEN
2510: x_max_rsrc_date := x_rsrc_tab (k).plan_cmplt_date;
2511: END IF;

Line 2575: IF p_gme_batch_header_rec.batch_status = 2 THEN

2571: INTO min_start_date
2572: FROM gme_batch_steps
2573: WHERE batch_id = l_batch_id;
2574:
2575: IF p_gme_batch_header_rec.batch_status = 2 THEN
2576: -- Pawan Kumar made following changes for bug 5015873
2577: -- min_start_date := p_gme_batch_header_rec.plan_start_date;
2578: UPDATE gme_batch_header
2579: SET plan_cmplt_date = max_cmplt_date

Line 2577: -- min_start_date := p_gme_batch_header_rec.plan_start_date;

2573: WHERE batch_id = l_batch_id;
2574:
2575: IF p_gme_batch_header_rec.batch_status = 2 THEN
2576: -- Pawan Kumar made following changes for bug 5015873
2577: -- min_start_date := p_gme_batch_header_rec.plan_start_date;
2578: UPDATE gme_batch_header
2579: SET plan_cmplt_date = max_cmplt_date
2580: ,last_updated_by = gme_common_pvt.g_user_ident
2581: ,last_update_date = gme_common_pvt.g_timestamp

Line 2578: UPDATE gme_batch_header

2574:
2575: IF p_gme_batch_header_rec.batch_status = 2 THEN
2576: -- Pawan Kumar made following changes for bug 5015873
2577: -- min_start_date := p_gme_batch_header_rec.plan_start_date;
2578: UPDATE gme_batch_header
2579: SET plan_cmplt_date = max_cmplt_date
2580: ,last_updated_by = gme_common_pvt.g_user_ident
2581: ,last_update_date = gme_common_pvt.g_timestamp
2582: ,last_update_login = gme_common_pvt.g_login_id

Line 2585: UPDATE gme_batch_header

2581: ,last_update_date = gme_common_pvt.g_timestamp
2582: ,last_update_login = gme_common_pvt.g_login_id
2583: WHERE batch_id = l_batch_id;
2584: ELSE
2585: UPDATE gme_batch_header
2586: SET plan_start_date = min_start_date
2587: ,plan_cmplt_date = max_cmplt_date
2588: ,last_updated_by = gme_common_pvt.g_user_ident
2589: ,last_update_date = gme_common_pvt.g_timestamp

Line 2594: /* UPDATE gme_batch_header

2590: ,last_update_login = gme_common_pvt.g_login_id
2591: WHERE batch_id = l_batch_id;
2592: END IF;
2593:
2594: /* UPDATE gme_batch_header
2595: SET plan_start_date = min_start_date
2596: ,plan_cmplt_date = max_cmplt_date
2597: ,last_updated_by = gme_common_pvt.g_user_ident
2598: ,last_update_date = gme_common_pvt.g_timestamp

Line 2602: UPDATE gme_batch_header

2598: ,last_update_date = gme_common_pvt.g_timestamp
2599: ,last_update_login = gme_common_pvt.g_login_id
2600: WHERE batch_id = l_batch_id;*/
2601:
2602: UPDATE gme_batch_header
2603: SET due_date = max_cmplt_date
2604: ,last_updated_by = gme_common_pvt.g_user_ident
2605: ,last_update_date = gme_common_pvt.g_timestamp
2606: ,last_update_login = gme_common_pvt.g_login_id

Line 2690: PROCEDURE calc_longest_time(l_batch_id IN gme_batch_header.batch_id%TYPE,

2686: -- l_step_duration_tab non null value.
2687: -- HISTORY
2688: -- Chandrashekar Tiruvidula 20-Dec-2006 Rewrote procedure Bug 5716727
2689: --================================================================================= */
2690: PROCEDURE calc_longest_time(l_batch_id IN gme_batch_header.batch_id%TYPE,
2691: l_step_duration_tab IN step_duration_tab,
2692: x_batch_duration OUT NOCOPY NUMBER,
2693: x_return_status OUT NOCOPY VARCHAR2) IS
2694:

Line 2847: x_routing_id gme_batch_header.routing_id%TYPE;

2843: ,p_return_status OUT NOCOPY VARCHAR2
2844: ,p_called_from_batch IN NUMBER DEFAULT 1)
2845: IS
2846: x_step_rows NUMBER;
2847: x_routing_id gme_batch_header.routing_id%TYPE;
2848: x_step_qty NUMBER;
2849: x_new_factor NUMBER;
2850: x_uom_class mtl_units_of_measure.uom_class%TYPE;
2851: x_scale_factor NUMBER;

Line 3289: p_gme_batch_header_rec IN gme_batch_header%ROWTYPE

3285: RETURN 0;
3286: END get_max_duration;
3287:
3288: PROCEDURE insert_resource_txns (
3289: p_gme_batch_header_rec IN gme_batch_header%ROWTYPE
3290: ,p_doc_type IN VARCHAR2
3291: ,p_batch_step_resources_rec IN gme_batch_step_resources%ROWTYPE
3292: ,x_return_status OUT NOCOPY VARCHAR2)
3293: IS

Line 3331: IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN

3327: p_batch_step_resources_rec.plan_rsrc_usage
3328: / p_batch_step_resources_rec.plan_rsrc_count;
3329: END IF;
3330:
3331: IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN
3332: l_gme_resource_txns.doc_id := p_batch_step_resources_rec.batch_id;
3333: l_gme_resource_txns.doc_type := p_doc_type;
3334: l_gme_resource_txns.organization_id :=
3335: p_gme_batch_header_rec.organization_id;

Line 3335: p_gme_batch_header_rec.organization_id;

3331: IF p_gme_batch_header_rec.update_inventory_ind = 'Y' THEN
3332: l_gme_resource_txns.doc_id := p_batch_step_resources_rec.batch_id;
3333: l_gme_resource_txns.doc_type := p_doc_type;
3334: l_gme_resource_txns.organization_id :=
3335: p_gme_batch_header_rec.organization_id;
3336: l_gme_resource_txns.line_type := 0;
3337: l_gme_resource_txns.line_id :=
3338: p_batch_step_resources_rec.batchstep_resource_id;
3339: l_gme_resource_txns.resources :=