DBA Data[Home] [Help]

APPS.GME_UPDATE_STEP_QTY_PVT dependencies on GME_COMMON_PVT

Line 93: IF (x_batch_step_rec.step_status = gme_common_pvt.g_step_cancelled) THEN

89: RAISE batch_step_fetch_error;
90: END IF;
91:
92: /* The current Step Status must allow editing of step qty */
93: IF (x_batch_step_rec.step_status = gme_common_pvt.g_step_cancelled) THEN
94: RAISE invalid_step_status;
95: END IF;
96:
97: l_batch_header.batch_id := x_batch_step_rec.batch_id;

Line 119: IF (l_batch_header.batch_status = gme_common_pvt.g_batch_cancelled) THEN

115: END IF;
116: l_rec := 0;
117:
118: /* The Batch must not be in Cancelled state to edit the step qty. */
119: IF (l_batch_header.batch_status = gme_common_pvt.g_batch_cancelled) THEN
120: RAISE invalid_batch_status;
121: END IF;
122:
123: /* If automatic step qty calculation is set for the batch then */

Line 133: (gme_common_pvt.g_step_pending

129: /* passed in WIP we have to calculate for the whole batch as this procedure */
130: /* might be called from uncertify batch wherein we have to decrease the */
131: /* succeeding step quantities. */
132: IF x_batch_step_rec.step_status IN
133: (gme_common_pvt.g_step_pending
134: ,gme_common_pvt.g_step_wip
135: ,gme_common_pvt.g_step_completed) THEN
136: gmd_auto_step_calc.calc_step_qty
137: (p_parent_id => l_batch_header.batch_id

Line 134: ,gme_common_pvt.g_step_wip

130: /* might be called from uncertify batch wherein we have to decrease the */
131: /* succeeding step quantities. */
132: IF x_batch_step_rec.step_status IN
133: (gme_common_pvt.g_step_pending
134: ,gme_common_pvt.g_step_wip
135: ,gme_common_pvt.g_step_completed) THEN
136: gmd_auto_step_calc.calc_step_qty
137: (p_parent_id => l_batch_header.batch_id
138: ,p_step_tbl => l_step_tbl

Line 135: ,gme_common_pvt.g_step_completed) THEN

131: /* succeeding step quantities. */
132: IF x_batch_step_rec.step_status IN
133: (gme_common_pvt.g_step_pending
134: ,gme_common_pvt.g_step_wip
135: ,gme_common_pvt.g_step_completed) THEN
136: gmd_auto_step_calc.calc_step_qty
137: (p_parent_id => l_batch_header.batch_id
138: ,p_step_tbl => l_step_tbl
139: ,p_msg_count => x_message_count

Line 171: IF x_batch_step_rec.step_status > gme_common_pvt.g_step_pending THEN

167: ,l_step_tbl);
168:
169: /* If step status is not in pending then actual quantities have to */
170: /* be updated */
171: IF x_batch_step_rec.step_status > gme_common_pvt.g_step_pending THEN
172: x_batch_step_rec.actual_step_qty := l_step_tbl (l_rec).step_qty;
173: x_batch_step_rec.actual_mass_qty :=
174: l_step_tbl (l_rec).step_mass_qty;
175: x_batch_step_rec.actual_volume_qty :=

Line 186: IF x_batch_step_rec.step_status > gme_common_pvt.g_step_wip THEN

182: l_step_tbl (l_rec).step_vol_qty;
183: END IF;
184: /* If automatic step quantity calculation is not set for the current batch */
185: ELSE
186: IF x_batch_step_rec.step_status > gme_common_pvt.g_step_wip THEN
187: IF x_batch_step_rec.actual_step_qty IS NULL THEN
188: x_batch_step_rec.actual_step_qty :=
189: x_batch_step_rec.plan_step_qty;
190: x_batch_step_rec.actual_mass_qty :=

Line 200: ELSIF x_batch_step_rec.step_status = gme_common_pvt.g_step_wip

196: ELSE
197: calculate_mass_vol_qty (x_batch_step_rec);
198: END IF;
199: /* Bug 3545726 backflush actual qty based on factor */
200: ELSIF x_batch_step_rec.step_status = gme_common_pvt.g_step_wip
201: AND gme_common_pvt.g_backflush_rsrc_usg_ind = 1
202: AND p_backflush_factor IS NOT NULL THEN
203: x_batch_step_rec.actual_step_qty :=
204: NVL (x_batch_step_rec.actual_step_qty, 0)

Line 201: AND gme_common_pvt.g_backflush_rsrc_usg_ind = 1

197: calculate_mass_vol_qty (x_batch_step_rec);
198: END IF;
199: /* Bug 3545726 backflush actual qty based on factor */
200: ELSIF x_batch_step_rec.step_status = gme_common_pvt.g_step_wip
201: AND gme_common_pvt.g_backflush_rsrc_usg_ind = 1
202: AND p_backflush_factor IS NOT NULL THEN
203: x_batch_step_rec.actual_step_qty :=
204: NVL (x_batch_step_rec.actual_step_qty, 0)
205: + (x_batch_step_rec.plan_step_qty * p_backflush_factor);

Line 220: IF x_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN

216: END IF; /* IF x_batch_step_rec.step_status > 1 */
217: END IF; /* IF l_batch_header.automatic_step_calculation = 1 */
218:
219: /* If the step status is pending the null the actual quantities */
220: IF x_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN
221: x_batch_step_rec.actual_step_qty := NULL;
222: x_batch_step_rec.actual_mass_qty := NULL;
223: x_batch_step_rec.actual_volume_qty := NULL;
224: END IF;

Line 241: (gme_common_pvt.g_step_pending

237: IF l_batch_header.automatic_step_calculation = 1 THEN
238: /* If the step status is certified or WIP then the transafer quantities */
239: /* would affect the succeeding steps. */
240: IF x_batch_step_rec.step_status IN
241: (gme_common_pvt.g_step_pending
242: ,gme_common_pvt.g_step_wip
243: ,gme_common_pvt.g_step_completed) THEN
244: /* We have to invoke the calculate quantities routine for all the */
245: /* succeeding steps. */

Line 242: ,gme_common_pvt.g_step_wip

238: /* If the step status is certified or WIP then the transafer quantities */
239: /* would affect the succeeding steps. */
240: IF x_batch_step_rec.step_status IN
241: (gme_common_pvt.g_step_pending
242: ,gme_common_pvt.g_step_wip
243: ,gme_common_pvt.g_step_completed) THEN
244: /* We have to invoke the calculate quantities routine for all the */
245: /* succeeding steps. */
246: FOR dep_steps IN dependent_steps (l_batch_header.batch_id

Line 243: ,gme_common_pvt.g_step_completed) THEN

239: /* would affect the succeeding steps. */
240: IF x_batch_step_rec.step_status IN
241: (gme_common_pvt.g_step_pending
242: ,gme_common_pvt.g_step_wip
243: ,gme_common_pvt.g_step_completed) THEN
244: /* We have to invoke the calculate quantities routine for all the */
245: /* succeeding steps. */
246: FOR dep_steps IN dependent_steps (l_batch_header.batch_id
247: ,l_batch_step.batchstep_id) LOOP

Line 260: gme_common_pvt.g_step_pending)

256:
257: /* We need to apply the transfer quantities if only the step status is in */
258: /* confirm with the dependent step status */
259: IF ( (x_batch_step_rec.step_status >
260: gme_common_pvt.g_step_pending)
261: AND (l_batch_step.step_status >
262: gme_common_pvt.g_step_pending) )
263: OR ( (x_batch_step_rec.step_status =
264: gme_common_pvt.g_step_pending)

Line 262: gme_common_pvt.g_step_pending) )

258: /* confirm with the dependent step status */
259: IF ( (x_batch_step_rec.step_status >
260: gme_common_pvt.g_step_pending)
261: AND (l_batch_step.step_status >
262: gme_common_pvt.g_step_pending) )
263: OR ( (x_batch_step_rec.step_status =
264: gme_common_pvt.g_step_pending)
265: AND (l_batch_step.step_status =
266: gme_common_pvt.g_step_pending) ) THEN

Line 264: gme_common_pvt.g_step_pending)

260: gme_common_pvt.g_step_pending)
261: AND (l_batch_step.step_status >
262: gme_common_pvt.g_step_pending) )
263: OR ( (x_batch_step_rec.step_status =
264: gme_common_pvt.g_step_pending)
265: AND (l_batch_step.step_status =
266: gme_common_pvt.g_step_pending) ) THEN
267: /* Get the record number for the current step in the step table */
268: l_rec :=

Line 266: gme_common_pvt.g_step_pending) ) THEN

262: gme_common_pvt.g_step_pending) )
263: OR ( (x_batch_step_rec.step_status =
264: gme_common_pvt.g_step_pending)
265: AND (l_batch_step.step_status =
266: gme_common_pvt.g_step_pending) ) THEN
267: /* Get the record number for the current step in the step table */
268: l_rec :=
269: gmd_auto_step_calc.get_step_rec
270: (l_batch_step.batchstep_no

Line 275: IF l_batch_step.step_status > gme_common_pvt.g_step_pending THEN

271: ,l_step_tbl);
272:
273: /* If step status is not in pending then actual quantities have to */
274: /* be updated */
275: IF l_batch_step.step_status > gme_common_pvt.g_step_pending THEN
276: l_batch_step.actual_step_qty :=
277: l_step_tbl (l_rec).step_qty;
278: l_batch_step.actual_mass_qty :=
279: l_step_tbl (l_rec).step_mass_qty;

Line 317: gme_common_pvt.log_message ('GME_API_INV_STAT_STEP_EDIT');

313: ,p_data => x_message_list);
314: WHEN invalid_step_status THEN
315: ROLLBACK TO SAVEPOINT update_step_qty;
316: x_return_status := fnd_api.g_ret_sts_error;
317: gme_common_pvt.log_message ('GME_API_INV_STAT_STEP_EDIT');
318: fnd_msg_pub.count_and_get (p_count => x_message_count
319: ,p_data => x_message_list);
320: WHEN batch_header_fetch_error THEN
321: ROLLBACK TO SAVEPOINT update_step_qty;

Line 328: gme_common_pvt.log_message ('GME_API_INV_BATCH_EDIT_STEP');

324: ,p_data => x_message_list);
325: WHEN invalid_batch_status THEN
326: ROLLBACK TO SAVEPOINT update_step_qty;
327: x_return_status := fnd_api.g_ret_sts_error;
328: gme_common_pvt.log_message ('GME_API_INV_BATCH_EDIT_STEP');
329: fnd_msg_pub.count_and_get (p_count => x_message_count
330: ,p_data => x_message_list);
331: WHEN auto_step_calc_error THEN
332: ROLLBACK TO SAVEPOINT update_step_qty;

Line 395: IF l_um_type = gme_common_pvt.g_mass_um_type THEN

391: INTO l_um_type, l_std_factor;
392:
393: CLOSE cur_get_uom;
394:
395: IF l_um_type = gme_common_pvt.g_mass_um_type THEN
396: /* If step status is not in pending then actual quantities have to */
397: /* be updated */
398: IF p_batch_step_rec.step_status > gme_common_pvt.g_step_pending THEN
399: p_batch_step_rec.actual_mass_qty :=

Line 398: IF p_batch_step_rec.step_status > gme_common_pvt.g_step_pending THEN

394:
395: IF l_um_type = gme_common_pvt.g_mass_um_type THEN
396: /* If step status is not in pending then actual quantities have to */
397: /* be updated */
398: IF p_batch_step_rec.step_status > gme_common_pvt.g_step_pending THEN
399: p_batch_step_rec.actual_mass_qty :=
400: NVL (p_batch_step_rec.actual_step_qty * l_std_factor, 0);
401: ELSE
402: p_batch_step_rec.plan_mass_qty :=

Line 405: ELSIF l_um_type = gme_common_pvt.g_volume_um_type THEN

401: ELSE
402: p_batch_step_rec.plan_mass_qty :=
403: NVL (p_batch_step_rec.plan_step_qty * l_std_factor, 0);
404: END IF; /* IF p_batch_step_rec.step_status > 1 */
405: ELSIF l_um_type = gme_common_pvt.g_volume_um_type THEN
406: /* If step status is not in pending then actual quantities have to */
407: /* be updated */
408: IF p_batch_step_rec.step_status > gme_common_pvt.g_step_pending THEN
409: p_batch_step_rec.actual_volume_qty :=

Line 408: IF p_batch_step_rec.step_status > gme_common_pvt.g_step_pending THEN

404: END IF; /* IF p_batch_step_rec.step_status > 1 */
405: ELSIF l_um_type = gme_common_pvt.g_volume_um_type THEN
406: /* If step status is not in pending then actual quantities have to */
407: /* be updated */
408: IF p_batch_step_rec.step_status > gme_common_pvt.g_step_pending THEN
409: p_batch_step_rec.actual_volume_qty :=
410: NVL (p_batch_step_rec.actual_step_qty * l_std_factor, 0);
411: ELSE
412: p_batch_step_rec.plan_volume_qty :=

Line 415: END IF; /* IF l_um_type = gme_common_pvt.g_mass_um_type */

411: ELSE
412: p_batch_step_rec.plan_volume_qty :=
413: NVL (p_batch_step_rec.plan_step_qty * l_std_factor, 0);
414: END IF; /* IF p_batch_step_rec.step_status > 1 */
415: END IF; /* IF l_um_type = gme_common_pvt.g_mass_um_type */
416:
417: IF g_debug <= gme_debug.g_log_procedure THEN
418: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
419: END IF;

Line 476: IF p_batch_step_rec.step_status > gme_common_pvt.g_step_pending THEN

472: x_return_status := fnd_api.g_ret_sts_success;
473: /* Bug 3545726 store original charges */
474: l_orig_charges := NVL (p_batch_step_rec.actual_charges, 0);
475:
476: IF p_batch_step_rec.step_status > gme_common_pvt.g_step_pending THEN
477: calc_charge (p_step_id => p_batch_step_rec.batchstep_id
478: ,p_mass_qty => p_batch_step_rec.actual_mass_qty
479: ,p_vol_qty => p_batch_step_rec.actual_volume_qty
480: ,x_charge => l_charges

Line 488: ELSIF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN

484: RAISE error_calc_charge;
485: ELSE
486: p_batch_step_rec.actual_charges := l_charges;
487: END IF;
488: ELSIF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN
489: calc_charge (p_step_id => p_batch_step_rec.batchstep_id
490: ,p_mass_qty => p_batch_step_rec.plan_mass_qty
491: ,p_vol_qty => p_batch_step_rec.plan_volume_qty
492: ,x_charge => l_charges

Line 728: IF x_um_type = gme_common_pvt.g_mass_um_type THEN

724:
725: x_stdum_tolerance := (x_tolerance * x_std_capacity) / 100;
726:
727: -- Capacity will be in either mass or volume...
728: IF x_um_type = gme_common_pvt.g_mass_um_type THEN
729: IF (p_mass_qty IS NULL) THEN
730: RAISE error_calc_charge_conv;
731: END IF;
732:

Line 740: ELSIF x_um_type = gme_common_pvt.g_volume_um_type THEN

736: ELSE
737: x_charge := TRUNC (p_mass_qty / x_std_capacity);
738: END IF;
739:
740: ELSIF x_um_type = gme_common_pvt.g_volume_um_type THEN
741: IF (p_vol_qty IS NULL) THEN
742: RAISE error_calc_charge_conv;
743: END IF;
744:

Line 756: ,PRECISION => gme_common_pvt.g_precision

752: ELSE
753: x_temp_qty :=
754: inv_convert.inv_um_convert
755: (item_id => 0
756: ,PRECISION => gme_common_pvt.g_precision
757: ,from_quantity => x_step_qty
758: ,from_unit => x_step_qty_uom
759: ,to_unit => x_max_cap_uom
760: ,from_name => NULL

Line 850: gme_common_pvt.log_message ('GME_BATCH_STEP_NOT_FOUND'

846: END IF;
847: EXCEPTION
848: WHEN error_step_not_found THEN
849: x_return_status := fnd_api.g_ret_sts_error;
850: gme_common_pvt.log_message ('GME_BATCH_STEP_NOT_FOUND'
851: ,'STEP_ID'
852: ,p_step_id);
853: WHEN error_calc_charge_conv THEN
854: -- x_return_status := FND_API.G_RET_STS_ERROR;

Line 855: gme_common_pvt.log_message ('GME_CALC_CHARGE_CONV_ERROR'

851: ,'STEP_ID'
852: ,p_step_id);
853: WHEN error_calc_charge_conv THEN
854: -- x_return_status := FND_API.G_RET_STS_ERROR;
855: gme_common_pvt.log_message ('GME_CALC_CHARGE_CONV_ERROR'
856: ,'STEP_NO'
857: ,x_step_no);
858: WHEN error_max_cap_not_mass_vol THEN
859: gme_common_pvt.log_message

Line 859: gme_common_pvt.log_message

855: gme_common_pvt.log_message ('GME_CALC_CHARGE_CONV_ERROR'
856: ,'STEP_NO'
857: ,x_step_no);
858: WHEN error_max_cap_not_mass_vol THEN
859: gme_common_pvt.log_message
860: ('GME_MAX_CAP_NOT_MASS_VOL_ERR'
861: ,'STEP_NO'
862: ,x_step_no
863: ,'MASS'

Line 864: ,gme_common_pvt.g_mass_um_type

860: ('GME_MAX_CAP_NOT_MASS_VOL_ERR'
861: ,'STEP_NO'
862: ,x_step_no
863: ,'MASS'
864: ,gme_common_pvt.g_mass_um_type
865: ,'VOLUME'
866: ,gme_common_pvt.g_volume_um_type);
867: WHEN error_charge_insert THEN
868: gme_common_pvt.log_message ('GME_INSERT_CHARGE_ERROR'

Line 866: ,gme_common_pvt.g_volume_um_type);

862: ,x_step_no
863: ,'MASS'
864: ,gme_common_pvt.g_mass_um_type
865: ,'VOLUME'
866: ,gme_common_pvt.g_volume_um_type);
867: WHEN error_charge_insert THEN
868: gme_common_pvt.log_message ('GME_INSERT_CHARGE_ERROR'
869: ,'STEP_NO'
870: ,x_step_no);

Line 868: gme_common_pvt.log_message ('GME_INSERT_CHARGE_ERROR'

864: ,gme_common_pvt.g_mass_um_type
865: ,'VOLUME'
866: ,gme_common_pvt.g_volume_um_type);
867: WHEN error_charge_insert THEN
868: gme_common_pvt.log_message ('GME_INSERT_CHARGE_ERROR'
869: ,'STEP_NO'
870: ,x_step_no);
871: WHEN OTHERS THEN
872: IF g_debug <= gme_debug.g_log_unexpected THEN

Line 909: l_batchstep_activity_ids gme_common_pvt.number_tab;

905: ,p_dependency_type IN NUMBER DEFAULT NULL)
906: IS
907: l_api_name CONSTANT VARCHAR2 (30) := 'update_activities';
908: /* Collections for details etc */
909: l_batchstep_activity_ids gme_common_pvt.number_tab;
910: l_gme_batchstep_activities gme_batch_step_activities%ROWTYPE;
911: l_gme_calc_int_rsrc_usage_char VARCHAR2 (10);
912: l_user_profile_option_name VARCHAR2 (100);
913: /* Local variables */

Line 964: gme_common_pvt.g_calc_interim_rsrc_usg_ind;

960: IF p_batch_hdr_rec.automatic_step_calculation = 1 THEN
961: IF (p_gme_calc_int_rsrc_usage IS NULL) THEN
962: l_gme_calc_int_rsrc_usage_char := NULL;
963: l_gme_calc_int_rsrc_usage_char :=
964: gme_common_pvt.g_calc_interim_rsrc_usg_ind;
965: p_gme_calc_int_rsrc_usage := l_gme_calc_int_rsrc_usage_char;
966: l_gme_calc_int_rsrc_usage_char := NULL;
967: END IF;
968: ELSE

Line 973: gme_common_pvt.g_step_wip)

969: p_gme_calc_int_rsrc_usage := NULL;
970: END IF;
971:
972: IF ( ( ( (p_batch_step_rec.step_status =
973: gme_common_pvt.g_step_wip)
974: AND (NVL (p_gme_calc_int_rsrc_usage, 0) = 1)
975: OR NVL (gme_common_pvt.g_backflush_rsrc_usg_ind, 0) =
976: 1)
977: OR (p_batch_step_rec.step_status >

Line 975: OR NVL (gme_common_pvt.g_backflush_rsrc_usg_ind, 0) =

971:
972: IF ( ( ( (p_batch_step_rec.step_status =
973: gme_common_pvt.g_step_wip)
974: AND (NVL (p_gme_calc_int_rsrc_usage, 0) = 1)
975: OR NVL (gme_common_pvt.g_backflush_rsrc_usg_ind, 0) =
976: 1)
977: OR (p_batch_step_rec.step_status >
978: gme_common_pvt.g_step_wip) )
979: AND (NVL (l_gme_batchstep_activities.actual_activity_factor, 0) =

Line 978: gme_common_pvt.g_step_wip) )

974: AND (NVL (p_gme_calc_int_rsrc_usage, 0) = 1)
975: OR NVL (gme_common_pvt.g_backflush_rsrc_usg_ind, 0) =
976: 1)
977: OR (p_batch_step_rec.step_status >
978: gme_common_pvt.g_step_wip) )
979: AND (NVL (l_gme_batchstep_activities.actual_activity_factor, 0) =
980: 0) ) THEN
981: l_gme_batchstep_activities.actual_activity_factor :=
982: l_gme_batchstep_activities.plan_activity_factor;

Line 983: ELSIF (p_batch_step_rec.step_status = gme_common_pvt.g_step_pending) THEN

979: AND (NVL (l_gme_batchstep_activities.actual_activity_factor, 0) =
980: 0) ) THEN
981: l_gme_batchstep_activities.actual_activity_factor :=
982: l_gme_batchstep_activities.plan_activity_factor;
983: ELSIF (p_batch_step_rec.step_status = gme_common_pvt.g_step_pending) THEN
984: l_gme_batchstep_activities.actual_activity_factor := NULL;
985: END IF;
986:
987: /* Let us update all the resources attached to the activity */

Line 1023: l_user_profile_option_name := gme_common_pvt.g_calc_interim_rsrc_usg_ind;

1019: WHEN VALUE_ERROR THEN
1020: x_return_status := fnd_api.g_ret_sts_error;
1021:
1022: IF l_gme_calc_int_rsrc_usage_char IS NOT NULL THEN
1023: l_user_profile_option_name := gme_common_pvt.g_calc_interim_rsrc_usg_ind;
1024: /* SELECT user_profile_option_name
1025: INTO l_user_profile_option_name
1026: FROM fnd_profile_options_vl
1027: WHERE application_id = 553

Line 1030: gme_common_pvt.log_message ('GME_INVALID_VALUE_PROFILE'

1026: FROM fnd_profile_options_vl
1027: WHERE application_id = 553
1028: AND profile_option_name = 'GME_CALC_INT_RSRC_USAGE';*/
1029:
1030: gme_common_pvt.log_message ('GME_INVALID_VALUE_PROFILE'
1031: ,'VALUE'
1032: ,l_gme_calc_int_rsrc_usage_char
1033: ,'PROFILE'
1034: ,l_user_profile_option_name);

Line 1080: l_batchstep_resource_ids gme_common_pvt.number_tab;

1076: ,p_dependency_type IN NUMBER DEFAULT NULL)
1077: IS
1078: l_api_name CONSTANT VARCHAR2 (30) := 'update_resources';
1079: /* Collections for details etc */
1080: l_batchstep_resource_ids gme_common_pvt.number_tab;
1081: l_gme_batchstep_resources gme_batch_step_resources%ROWTYPE;
1082: l_resource_txns gme_resource_txns_gtmp%ROWTYPE;
1083: l_resource_tab gme_common_pvt.resource_transactions_tab;
1084: /* Local variables */

Line 1083: l_resource_tab gme_common_pvt.resource_transactions_tab;

1079: /* Collections for details etc */
1080: l_batchstep_resource_ids gme_common_pvt.number_tab;
1081: l_gme_batchstep_resources gme_batch_step_resources%ROWTYPE;
1082: l_resource_txns gme_resource_txns_gtmp%ROWTYPE;
1083: l_resource_tab gme_common_pvt.resource_transactions_tab;
1084: /* Local variables */
1085: l_sum_comp_usage NUMBER;
1086: l_override_usage NUMBER;
1087: l_actual_usage NUMBER;

Line 1157: NVL (gme_common_pvt.g_allow_qty_below_min_ind, 1);

1153: l_doc_type := 'FPO';
1154: END IF;
1155:
1156: l_allow_qty_below_cap :=
1157: NVL (gme_common_pvt.g_allow_qty_below_min_ind, 1);
1158: l_copy_plan_to_actual :=
1159: NVL (gme_common_pvt.g_def_actual_rsrc_usg_ind, 1);
1160:
1161: /* Fetch all the resources associated with the activity */

Line 1159: NVL (gme_common_pvt.g_def_actual_rsrc_usg_ind, 1);

1155:
1156: l_allow_qty_below_cap :=
1157: NVL (gme_common_pvt.g_allow_qty_below_min_ind, 1);
1158: l_copy_plan_to_actual :=
1159: NVL (gme_common_pvt.g_def_actual_rsrc_usg_ind, 1);
1160:
1161: /* Fetch all the resources associated with the activity */
1162: OPEN cur_step_resource_ids
1163: (p_batchstep_activities_rec.batchstep_activity_id);

Line 1197: gme_common_pvt.g_step_wip)

1193: IF p_batch_hdr_rec.automatic_step_calculation = 1 THEN
1194: /* If the step status is greater than pending then we have to calculate the actual quantities
1195: calculate resource qty and usage for WIP asqc batch if profile is set */
1196: IF ( ( (p_batch_step_rec.step_status =
1197: gme_common_pvt.g_step_wip)
1198: AND (NVL (p_gme_calc_int_rsrc_usage, 0) = 1) )
1199: OR (p_batch_step_rec.step_status > gme_common_pvt.g_step_wip) ) THEN
1200: IF l_process_qty <> 0 THEN
1201: l_gme_batchstep_resources.actual_rsrc_qty :=

Line 1199: OR (p_batch_step_rec.step_status > gme_common_pvt.g_step_wip) ) THEN

1195: calculate resource qty and usage for WIP asqc batch if profile is set */
1196: IF ( ( (p_batch_step_rec.step_status =
1197: gme_common_pvt.g_step_wip)
1198: AND (NVL (p_gme_calc_int_rsrc_usage, 0) = 1) )
1199: OR (p_batch_step_rec.step_status > gme_common_pvt.g_step_wip) ) THEN
1200: IF l_process_qty <> 0 THEN
1201: l_gme_batchstep_resources.actual_rsrc_qty :=
1202: p_batch_step_rec.actual_step_qty
1203: * p_batchstep_activities_rec.actual_activity_factor;

Line 1240: gme_common_pvt.g_step_pending) THEN

1236: /* Count if the Actual Resource Count is zero. */
1237: IF (NVL (l_gme_batchstep_resources.actual_rsrc_count, 0) =
1238: 0)
1239: AND (p_batch_step_rec.step_status >
1240: gme_common_pvt.g_step_pending) THEN
1241: l_gme_batchstep_resources.actual_rsrc_count :=
1242: l_gme_batchstep_resources.plan_rsrc_count;
1243: END IF;
1244:

Line 1245: IF p_batch_step_rec.step_status = gme_common_pvt.g_step_wip THEN

1241: l_gme_batchstep_resources.actual_rsrc_count :=
1242: l_gme_batchstep_resources.plan_rsrc_count;
1243: END IF;
1244:
1245: IF p_batch_step_rec.step_status = gme_common_pvt.g_step_wip THEN
1246: l_gme_batchstep_resources.plan_rsrc_count :=
1247: NVL (l_gme_batchstep_resources.plan_rsrc_count, 1);
1248: l_gme_batchstep_resources.plan_rsrc_usage :=
1249: NVL (l_gme_batchstep_resources.plan_rsrc_usage, 0);

Line 1254: ELSIF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN

1250: l_gme_batchstep_resources.plan_rsrc_qty :=
1251: NVL (l_gme_batchstep_resources.plan_rsrc_qty, 0);
1252: END IF;
1253: /* If the step status is pending then we have to update the plan quantities */
1254: ELSIF p_batch_step_rec.step_status = gme_common_pvt.g_step_pending THEN
1255: l_gme_batchstep_resources.plan_rsrc_qty :=
1256: p_batch_step_rec.plan_step_qty
1257: * p_batchstep_activities_rec.plan_activity_factor;
1258:

Line 1282: ELSIF (p_batch_step_rec.step_status > gme_common_pvt.g_step_wip) THEN

1278: l_gme_batchstep_resources.actual_rsrc_usage := NULL;
1279: l_gme_batchstep_resources.actual_rsrc_qty := NULL;
1280: l_gme_batchstep_resources.actual_rsrc_count := NULL;
1281: END IF; /*IF p_batch_step_rec.step_status > 1*/
1282: ELSIF (p_batch_step_rec.step_status > gme_common_pvt.g_step_wip) THEN
1283: OPEN cur_prev_actv_fact
1284: (p_batchstep_activities_rec.batchstep_activity_id);
1285:
1286: FETCH cur_prev_actv_fact

Line 1402: ELSIF (p_batch_step_rec.step_status = gme_common_pvt.g_step_pending) THEN

1398:
1399: /* (New Fix) if at end of calculation usage is null assign zero */
1400: l_gme_batchstep_resources.actual_rsrc_count :=
1401: NVL (l_gme_batchstep_resources.actual_rsrc_count, 1);
1402: ELSIF (p_batch_step_rec.step_status = gme_common_pvt.g_step_pending) THEN
1403: OPEN cur_prev_actv_fact
1404: (p_batchstep_activities_rec.batchstep_activity_id);
1405:
1406: FETCH cur_prev_actv_fact

Line 1484: ELSIF p_batch_step_rec.step_status = gme_common_pvt.g_step_wip THEN

1480: NVL (l_gme_batchstep_resources.plan_rsrc_qty, 0);
1481: l_gme_batchstep_resources.actual_rsrc_usage := NULL;
1482: l_gme_batchstep_resources.actual_rsrc_qty := NULL;
1483: l_gme_batchstep_resources.actual_rsrc_count := NULL;
1484: ELSIF p_batch_step_rec.step_status = gme_common_pvt.g_step_wip THEN
1485: IF (p_backflush_factor IS NOT NULL) THEN
1486: IF l_gme_batchstep_resources.scale_type = 1 THEN
1487: /* Proportional resource scale type */
1488: IF (p_batchstep_activities_rec.plan_activity_factor > 0) THEN

Line 1646: IF gme_common_pvt.is_qty_below_capacity

1642: || l_allow_qty_below_cap);
1643: END IF;
1644:
1645: IF l_allow_qty_below_cap = 0 THEN
1646: IF gme_common_pvt.is_qty_below_capacity
1647: (p_batch_step_resources_rec => l_gme_batchstep_resources) THEN
1648: RAISE qty_below_cap_error;
1649: END IF;
1650: END IF; /* IF l_allow_qty_below_cap = 0 */

Line 1656: gme_common_pvt.g_step_pending)

1652: /* Only if the update inventory ind is set to 'Y' on the batch header */
1653: /* then only we will have resource transactions */
1654: IF p_batch_hdr_rec.update_inventory_ind = 'Y' THEN
1655: IF (p_batch_step_rec.step_status >
1656: gme_common_pvt.g_step_pending)
1657: AND (NVL (l_gme_batchstep_resources.actual_rsrc_usage, -1) >= 0) THEN
1658: IF p_batch_hdr_rec.automatic_step_calculation = 1 THEN
1659: OPEN cur_sum_override_resource
1660: (l_gme_batchstep_resources.batchstep_resource_id

Line 1694: gme_common_pvt.g_step_pending

1690: RAISE resource_trans_ins_err;
1691: END IF;
1692: /* we have to delete the actual transactions and create pending resource transactions */
1693: ELSIF ( p_batch_step_rec.step_status =
1694: gme_common_pvt.g_step_pending
1695: OR ( p_batch_hdr_rec.automatic_step_calculation = 1
1696: AND p_batch_step_rec.step_status =
1697: gme_common_pvt.g_step_wip) ) THEN
1698: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN

Line 1697: gme_common_pvt.g_step_wip) ) THEN

1693: ELSIF ( p_batch_step_rec.step_status =
1694: gme_common_pvt.g_step_pending
1695: OR ( p_batch_hdr_rec.automatic_step_calculation = 1
1696: AND p_batch_step_rec.step_status =
1697: gme_common_pvt.g_step_wip) ) THEN
1698: IF (NVL (g_debug, -1) = gme_debug.g_log_statement) THEN
1699: gme_debug.put_line (' invoking pending usage');
1700: END IF;
1701:

Line 1744: gme_common_pvt.log_message ('GME_API_RSRC_QTY_BELOW_CAP'

1740: WHEN error_txns_update THEN
1741: x_return_status := fnd_api.g_ret_sts_error;
1742: WHEN qty_below_cap_error THEN
1743: x_return_status := fnd_api.g_ret_sts_error;
1744: gme_common_pvt.log_message ('GME_API_RSRC_QTY_BELOW_CAP'
1745: ,'RESOURCES'
1746: ,l_gme_batchstep_resources.resources);
1747: WHEN OTHERS THEN
1748: IF g_debug <= gme_debug.g_log_unexpected THEN

Line 1840: ,gme_common_pvt.g_timestamp);

1836:
1837: IF p_completed = 1 THEN
1838: l_ins_resource_row.trans_date :=
1839: NVL (p_batchstep_resource.actual_start_date
1840: ,gme_common_pvt.g_timestamp);
1841: l_ins_resource_row.start_date :=
1842: NVL (p_batchstep_resource.actual_start_date
1843: ,gme_common_pvt.g_timestamp);
1844: gme_create_step_pvt.get_usage_in_hours

Line 1843: ,gme_common_pvt.g_timestamp);

1839: NVL (p_batchstep_resource.actual_start_date
1840: ,gme_common_pvt.g_timestamp);
1841: l_ins_resource_row.start_date :=
1842: NVL (p_batchstep_resource.actual_start_date
1843: ,gme_common_pvt.g_timestamp);
1844: gme_create_step_pvt.get_usage_in_hours
1845: (p_usage
1846: ,p_batchstep_resource.usage_um
1847: ,l_usage_hrs

Line 1861: IF (l_ins_resource_row.end_date > gme_common_pvt.g_timestamp) THEN

1857:
1858: l_ins_resource_row.end_date :=
1859: (l_ins_resource_row.start_date + (l_usage_hrs / 24) );
1860:
1861: IF (l_ins_resource_row.end_date > gme_common_pvt.g_timestamp) THEN
1862: l_ins_resource_row.end_date := gme_common_pvt.g_timestamp;
1863: END IF;
1864: ELSE
1865: l_ins_resource_row.end_date :=

Line 1862: l_ins_resource_row.end_date := gme_common_pvt.g_timestamp;

1858: l_ins_resource_row.end_date :=
1859: (l_ins_resource_row.start_date + (l_usage_hrs / 24) );
1860:
1861: IF (l_ins_resource_row.end_date > gme_common_pvt.g_timestamp) THEN
1862: l_ins_resource_row.end_date := gme_common_pvt.g_timestamp;
1863: END IF;
1864: ELSE
1865: l_ins_resource_row.end_date :=
1866: NVL (p_batchstep_resource.actual_cmplt_date

Line 1874: ,gme_common_pvt.g_timestamp);

1870: END IF;
1871: ELSE
1872: l_ins_resource_row.trans_date :=
1873: NVL (p_batchstep_resource.plan_start_date
1874: ,gme_common_pvt.g_timestamp);
1875: l_ins_resource_row.start_date :=
1876: NVL (p_batchstep_resource.plan_start_date
1877: ,gme_common_pvt.g_timestamp);
1878: l_ins_resource_row.end_date :=

Line 1877: ,gme_common_pvt.g_timestamp);

1873: NVL (p_batchstep_resource.plan_start_date
1874: ,gme_common_pvt.g_timestamp);
1875: l_ins_resource_row.start_date :=
1876: NVL (p_batchstep_resource.plan_start_date
1877: ,gme_common_pvt.g_timestamp);
1878: l_ins_resource_row.end_date :=
1879: NVL (p_batchstep_resource.plan_cmplt_date
1880: ,gme_common_pvt.g_timestamp);
1881: END IF;

Line 1880: ,gme_common_pvt.g_timestamp);

1876: NVL (p_batchstep_resource.plan_start_date
1877: ,gme_common_pvt.g_timestamp);
1878: l_ins_resource_row.end_date :=
1879: NVL (p_batchstep_resource.plan_cmplt_date
1880: ,gme_common_pvt.g_timestamp);
1881: END IF;
1882:
1883: l_ins_resource_row.completed_ind := p_completed;
1884: l_ins_resource_row.posted_ind := 0;

Line 2105: l_resource_tab gme_common_pvt.resource_transactions_tab;

2101: AND action_code <> 'DEL';
2102:
2103: /* Collections for details etc */
2104: l_resource_txns gme_resource_txns_gtmp%ROWTYPE;
2105: l_resource_tab gme_common_pvt.resource_transactions_tab;
2106: l_batch_hdr gme_batch_header%ROWTYPE;
2107: /* Local variables */
2108: l_sum_comp_usage NUMBER;
2109: l_cnt_comp_usage NUMBER;

Line 2327: l_resource_tab gme_common_pvt.resource_transactions_tab;

2323: WHERE line_id = v_batchstep_resource_id AND completed_ind = 0;
2324:
2325: /* Collections for details etc */
2326: l_resource_txns gme_resource_txns_gtmp%ROWTYPE;
2327: l_resource_tab gme_common_pvt.resource_transactions_tab;
2328: /* Local variables */
2329: l_alloc_usage NUMBER;
2330: l_usage NUMBER;
2331: l_tot_usage NUMBER;

Line 2384: IF l_step_status = gme_common_pvt.g_step_wip THEN

2380:
2381:
2382: /* If the step is in WIP then we need to adjust the pending transactions */
2383: /* so lets calculate the usage to be adjusted */
2384: IF l_step_status = gme_common_pvt.g_step_wip THEN
2385: /* Lets get the previous actual usage */
2386:
2387: OPEN cur_get_rsrc_dtl
2388: (p_batch_step_resources_rec.batchstep_resource_id);

Line 2423: IF l_step_status = gme_common_pvt.g_step_wip THEN

2419: FOR i IN 1 .. l_resource_tab.COUNT LOOP
2420: IF l_resource_tab (i).completed_ind = 0 THEN
2421: l_resource_txns := l_resource_tab (i);
2422:
2423: IF l_step_status = gme_common_pvt.g_step_wip THEN
2424: l_remaining_tran_count := l_remaining_tran_count - 1;
2425: l_usage := l_resource_txns.resource_usage - l_alloc_usage;
2426:
2427: -- nsinghi bug#5609683

Line 2479: ELSIF l_step_status > gme_common_pvt.g_step_wip THEN

2475:
2476: IF l_return_status <> x_return_status THEN
2477: RAISE fnd_api.g_exc_error;
2478: END IF;
2479: ELSIF l_step_status > gme_common_pvt.g_step_wip THEN
2480: /* If the step is certified then their shouldn't be any further pending transactions */
2481: gme_resource_engine_pvt.delete_resource_trans
2482: (p_tran_rec => l_resource_txns
2483: ,x_return_status => l_return_status);

Line 2564: l_step_resources gme_common_pvt.resources_tab;

2560: l_return_status VARCHAR2(1);
2561: l_calc_step_qty BOOLEAN;
2562: l_uom VARCHAR2(3);
2563: l_gmd_resources gmd_recipe_fetch_pub.oprn_resc_tbl;
2564: l_step_resources gme_common_pvt.resources_tab;
2565:
2566: error_batchstep_id EXCEPTION;
2567: error_in_calc_capacity EXCEPTION;
2568: error_calc_charge EXCEPTION;

Line 2597: IF l_step_rec.step_status > gme_common_pvt.g_step_pending THEN

2593: OPEN c_get_step_qty(p_batchstep_rec.batchstep_id);
2594: FETCH c_get_step_qty INTO l_step_rec;
2595: CLOSE c_get_step_qty;
2596:
2597: IF l_step_rec.step_status > gme_common_pvt.g_step_pending THEN
2598: l_step_qty := l_step_rec.actual_step_qty;
2599: l_in_step_qty := x_batchstep_rec.actual_step_qty;
2600: ELSE
2601: l_step_qty := l_step_rec.plan_step_qty;

Line 2679: IF l_step_rec.step_status > gme_common_pvt.g_step_pending THEN

2675: gme_update_step_qty_pvt.calculate_mass_vol_qty(
2676: p_batch_step_rec => x_batchstep_rec
2677: );
2678:
2679: IF l_step_rec.step_status > gme_common_pvt.g_step_pending THEN
2680: l_mass_qty := x_batchstep_rec.actual_mass_qty;
2681: l_vol_qty := x_batchstep_rec.actual_volume_qty;
2682: ELSE
2683: l_mass_qty := x_batchstep_rec.plan_mass_qty;

Line 2709: IF l_step_rec.step_status > gme_common_pvt.g_step_pending THEN

2705: END IF;
2706: RAISE error_calc_charge;
2707: END IF;
2708:
2709: IF l_step_rec.step_status > gme_common_pvt.g_step_pending THEN
2710: x_batchstep_rec.actual_charges := l_charge;
2711: ELSE
2712: x_batchstep_rec.plan_charges := l_charge;
2713: END IF;