55: l_message_list VARCHAR2(2000);
56: l_tmp VARCHAR2(2000);
57:
58: BEGIN
59: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
60: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
61: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batch_id='||p_batch_header_rec.batch_id);
62: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_phantom_product_id='||p_phantom_product_id);
63: IF p_yield IS NOT NULL AND p_yield THEN
56: l_tmp VARCHAR2(2000);
57:
58: BEGIN
59: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
60: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
61: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batch_id='||p_batch_header_rec.batch_id);
62: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_phantom_product_id='||p_phantom_product_id);
63: IF p_yield IS NOT NULL AND p_yield THEN
64: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield=TRUE');
57:
58: BEGIN
59: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
60: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
61: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batch_id='||p_batch_header_rec.batch_id);
62: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_phantom_product_id='||p_phantom_product_id);
63: IF p_yield IS NOT NULL AND p_yield THEN
64: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield=TRUE');
65: ELSIF p_yield IS NOT NULL THEN
58: BEGIN
59: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
60: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
61: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batch_id='||p_batch_header_rec.batch_id);
62: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_phantom_product_id='||p_phantom_product_id);
63: IF p_yield IS NOT NULL AND p_yield THEN
64: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield=TRUE');
65: ELSIF p_yield IS NOT NULL THEN
66: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield=FALSE');
60: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
61: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batch_id='||p_batch_header_rec.batch_id);
62: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_phantom_product_id='||p_phantom_product_id);
63: IF p_yield IS NOT NULL AND p_yield THEN
64: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield=TRUE');
65: ELSIF p_yield IS NOT NULL THEN
66: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield=FALSE');
67: ELSE
68: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield is NULL');
62: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_phantom_product_id='||p_phantom_product_id);
63: IF p_yield IS NOT NULL AND p_yield THEN
64: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield=TRUE');
65: ELSIF p_yield IS NOT NULL THEN
66: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield=FALSE');
67: ELSE
68: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield is NULL');
69: END IF;
70: END IF;
64: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield=TRUE');
65: ELSIF p_yield IS NOT NULL THEN
66: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield=FALSE');
67: ELSE
68: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_yield is NULL');
69: END IF;
70: END IF;
71:
72: /* Set the return status to success initially */
147:
148: -- Yield the phantom product for this batch... that will also take care of the phantom ingredient
149: IF p_phantom_product_id IS NOT NULL THEN
150: IF NVL(p_yield, TRUE) THEN
151: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
152: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' yielding phantom product');
153: END IF;
154: l_matl_dtl_rec.material_detail_id := p_phantom_product_id;
155: IF NOT gme_material_details_dbl.fetch_row(l_matl_dtl_rec, l_matl_dtl_rec) THEN
148: -- Yield the phantom product for this batch... that will also take care of the phantom ingredient
149: IF p_phantom_product_id IS NOT NULL THEN
150: IF NVL(p_yield, TRUE) THEN
151: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
152: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' yielding phantom product');
153: END IF;
154: l_matl_dtl_rec.material_detail_id := p_phantom_product_id;
155: IF NOT gme_material_details_dbl.fetch_row(l_matl_dtl_rec, l_matl_dtl_rec) THEN
156: RAISE error_fetch_material;
170: END IF;
171:
172: IF p_batch_header_rec.update_inventory_ind = 'Y' AND
173: l_item_rec.mtl_transactions_enabled_flag = 'Y' THEN
174: IF g_debug <= gme_debug.g_log_procedure THEN
175: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' processing phantom product material_detail_id='||l_matl_dtl_rec.material_detail_id);
176: END IF;
177:
178: gme_complete_batch_pvt.yield_material
171:
172: IF p_batch_header_rec.update_inventory_ind = 'Y' AND
173: l_item_rec.mtl_transactions_enabled_flag = 'Y' THEN
174: IF g_debug <= gme_debug.g_log_procedure THEN
175: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' processing phantom product material_detail_id='||l_matl_dtl_rec.material_detail_id);
176: END IF;
177:
178: gme_complete_batch_pvt.yield_material
179: (p_material_dtl_rec => l_matl_dtl_rec
198: ELSE
199: l_matl_dtl_rec.actual_qty := l_matl_dtl_rec.plan_qty;
200: END IF;
201: ELSE
202: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
203: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' NOT yielding phantom product; set actual to 0');
204: END IF;
205: l_matl_dtl_rec.actual_qty := 0;
206: END IF;
199: l_matl_dtl_rec.actual_qty := l_matl_dtl_rec.plan_qty;
200: END IF;
201: ELSE
202: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
203: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' NOT yielding phantom product; set actual to 0');
204: END IF;
205: l_matl_dtl_rec.actual_qty := 0;
206: END IF;
207:
236: IF NOT gme_common_pvt.create_history
237: (p_batch_header_rec => x_batch_header_rec
238: ,p_original_status => gme_common_pvt.g_batch_pending
239: ,p_event_id => NVL(gme_common_pvt.g_transaction_header_id,-9999)) THEN
240: IF g_debug <= gme_debug.g_log_procedure THEN
241: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' create history returned error');
242: END IF;
243: END IF;
244:
237: (p_batch_header_rec => x_batch_header_rec
238: ,p_original_status => gme_common_pvt.g_batch_pending
239: ,p_event_id => NVL(gme_common_pvt.g_transaction_header_id,-9999)) THEN
240: IF g_debug <= gme_debug.g_log_procedure THEN
241: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' create history returned error');
242: END IF;
243: END IF;
244:
245:
262: END IF;
263: -- End Bug 5903208
264: END IF;
265:
266: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
267: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name||' for batch_id= '||x_batch_header_rec.batch_id||' and x_return_status= '||l_return_status);
268: END IF;
269:
270: EXCEPTION
263: -- End Bug 5903208
264: END IF;
265:
266: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
267: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name||' for batch_id= '||x_batch_header_rec.batch_id||' and x_return_status= '||l_return_status);
268: END IF;
269:
270: EXCEPTION
271: WHEN gmf_cost_failure THEN
282: gme_common_pvt.log_message ('PM_UNEXPLODED_PHANTOMS');
283: x_return_status := FND_API.G_RET_STS_ERROR;
284: WHEN OTHERS THEN
285: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
286: IF g_debug <= gme_debug.g_log_procedure THEN
287: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
288: END IF;
289: x_return_status := FND_API.g_ret_sts_unexp_error;
290: END release_batch;
283: x_return_status := FND_API.G_RET_STS_ERROR;
284: WHEN OTHERS THEN
285: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
286: IF g_debug <= gme_debug.g_log_procedure THEN
287: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
288: END IF;
289: x_return_status := FND_API.g_ret_sts_unexp_error;
290: END release_batch;
291:
315: error_get_item EXCEPTION;
316: error_dispense_non_reserve EXCEPTION;
317: BEGIN
318:
319: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
320: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
321: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_detail_rec.material_detail_id);
322: END IF;
323:
316: error_dispense_non_reserve EXCEPTION;
317: BEGIN
318:
319: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
320: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
321: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_detail_rec.material_detail_id);
322: END IF;
323:
324: /* Set the return status to success initially */
317: BEGIN
318:
319: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
320: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
321: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_detail_rec.material_detail_id);
322: END IF;
323:
324: /* Set the return status to success initially */
325: x_return_status := FND_API.G_RET_STS_SUCCESS;
342: IF NOT gme_batch_header_dbl.fetch_row(l_phantom_batch_rec, l_phantom_batch_rec) THEN
343: RAISE error_fetch_batch;
344: END IF;
345:
346: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
347: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' found phantom ingredient material_detail_id='||l_matl_dtl_rec.material_detail_id||' and phantom batch_id= '||l_phantom_batch_rec.batch_id);
348: END IF;
349: -- pass in the phantom line id so that release batch will know to yield that product
350: l_in_phantom_batch_rec := l_phantom_batch_rec;
343: RAISE error_fetch_batch;
344: END IF;
345:
346: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
347: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' found phantom ingredient material_detail_id='||l_matl_dtl_rec.material_detail_id||' and phantom batch_id= '||l_phantom_batch_rec.batch_id);
348: END IF;
349: -- pass in the phantom line id so that release batch will know to yield that product
350: l_in_phantom_batch_rec := l_phantom_batch_rec;
351: l_in_phantom_batch_rec.actual_start_date := p_trans_date;
367: END IF;
368:
369: l_update_matl := FALSE;
370:
371: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
372: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' after release_batch for phantom batch; it returned x_return_status='||x_return_status);
373: END IF;
374: ELSIF p_consume THEN
375: gme_material_detail_pvt.get_item_rec
368:
369: l_update_matl := FALSE;
370:
371: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
372: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' after release_batch for phantom batch; it returned x_return_status='||x_return_status);
373: END IF;
374: ELSIF p_consume THEN
375: gme_material_detail_pvt.get_item_rec
376: (p_org_id => l_matl_dtl_rec.organization_id
386: IF p_update_inv_ind = 'Y' AND
387: l_item_rec.mtl_transactions_enabled_flag = 'Y' THEN
388: --Pawan Kumar bug 4742244 --
389: -- check for item which dispensable but non-reservable
390: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
391: gme_debug.put_line(g_pkg_name||'.'||l_api_name||'disp ind'||l_matl_dtl_rec.dispense_ind);
392: gme_debug.put_line(g_pkg_name||'.'||l_api_name||'reservable_type'||l_item_rec.reservable_type);
393: END IF;
394: IF nvl(l_matl_dtl_rec.dispense_ind, 'N' ) = 'Y' AND
387: l_item_rec.mtl_transactions_enabled_flag = 'Y' THEN
388: --Pawan Kumar bug 4742244 --
389: -- check for item which dispensable but non-reservable
390: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
391: gme_debug.put_line(g_pkg_name||'.'||l_api_name||'disp ind'||l_matl_dtl_rec.dispense_ind);
392: gme_debug.put_line(g_pkg_name||'.'||l_api_name||'reservable_type'||l_item_rec.reservable_type);
393: END IF;
394: IF nvl(l_matl_dtl_rec.dispense_ind, 'N' ) = 'Y' AND
395: l_item_rec.reservable_type <> 1 THEN
388: --Pawan Kumar bug 4742244 --
389: -- check for item which dispensable but non-reservable
390: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
391: gme_debug.put_line(g_pkg_name||'.'||l_api_name||'disp ind'||l_matl_dtl_rec.dispense_ind);
392: gme_debug.put_line(g_pkg_name||'.'||l_api_name||'reservable_type'||l_item_rec.reservable_type);
393: END IF;
394: IF nvl(l_matl_dtl_rec.dispense_ind, 'N' ) = 'Y' AND
395: l_item_rec.reservable_type <> 1 THEN
396: RAISE error_dispense_non_reserve;
404: ,x_return_status => l_return_status);
405:
406: l_matl_dtl_rec.actual_qty := l_actual_qty;
407:
408: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
409: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' after consume_material; it returned actual_qty='||l_actual_qty);
410: END IF;
411:
412: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
405:
406: l_matl_dtl_rec.actual_qty := l_actual_qty;
407:
408: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
409: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' after consume_material; it returned actual_qty='||l_actual_qty);
410: END IF;
411:
412: IF l_return_status NOT IN (FND_API.G_RET_STS_SUCCESS, gme_common_pvt.g_exceptions_err) THEN
413: x_return_status := l_return_status;
433: IF l_update_matl and NVL( l_matl_dtl_rec.wip_plan_qty, 0) = 0 THEN
434: -- set WIP plan qty
435: l_matl_dtl_rec.wip_plan_qty := l_matl_dtl_rec.plan_qty;
436:
437: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
438: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' before update_row; actual_qty='||l_matl_dtl_rec.actual_qty);
439: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' before update_row; wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
440: END IF;
441:
434: -- set WIP plan qty
435: l_matl_dtl_rec.wip_plan_qty := l_matl_dtl_rec.plan_qty;
436:
437: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
438: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' before update_row; actual_qty='||l_matl_dtl_rec.actual_qty);
439: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' before update_row; wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
440: END IF;
441:
442: IF NOT gme_material_details_dbl.update_row (l_matl_dtl_rec) THEN
435: l_matl_dtl_rec.wip_plan_qty := l_matl_dtl_rec.plan_qty;
436:
437: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
438: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' before update_row; actual_qty='||l_matl_dtl_rec.actual_qty);
439: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' before update_row; wip_plan_qty='||l_matl_dtl_rec.wip_plan_qty);
440: END IF;
441:
442: IF NOT gme_material_details_dbl.update_row (l_matl_dtl_rec) THEN
443: RAISE error_update_row;
443: RAISE error_update_row;
444: END IF;
445: END IF;
446:
447: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
448: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name||' with x_return_status= '||x_return_status);
449: END IF;
450:
451: EXCEPTION
444: END IF;
445: END IF;
446:
447: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
448: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name||' with x_return_status= '||x_return_status);
449: END IF;
450:
451: EXCEPTION
452: WHEN error_update_row OR error_fetch_batch THEN
458: gme_common_pvt.log_message ('GME_DISPENSE_NON_RESERVE');
459: x_return_status := fnd_api.g_ret_sts_error;
460: WHEN OTHERS THEN
461: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
462: IF g_debug <= gme_debug.g_log_procedure THEN
463: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
464: END IF;
465: x_return_status := FND_API.g_ret_sts_unexp_error;
466: END process_ingredient;
459: x_return_status := fnd_api.g_ret_sts_error;
460: WHEN OTHERS THEN
461: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
462: IF g_debug <= gme_debug.g_log_procedure THEN
463: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
464: END IF;
465: x_return_status := FND_API.g_ret_sts_unexp_error;
466: END process_ingredient;
467:
534: no_consume_required EXCEPTION;
535:
536: BEGIN
537:
538: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
539: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
540: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
541: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' dispense_ind='||p_material_dtl_rec.dispense_ind);
542: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
535:
536: BEGIN
537:
538: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
539: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
540: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
541: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' dispense_ind='||p_material_dtl_rec.dispense_ind);
542: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
543: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
536: BEGIN
537:
538: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
539: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
540: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
541: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' dispense_ind='||p_material_dtl_rec.dispense_ind);
542: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
543: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
544: ,'YYYY-MON-DD HH24:MI:SS'));
537:
538: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
539: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
540: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
541: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' dispense_ind='||p_material_dtl_rec.dispense_ind);
542: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
543: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
544: ,'YYYY-MON-DD HH24:MI:SS'));
545: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
538: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
539: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
540: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
541: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' dispense_ind='||p_material_dtl_rec.dispense_ind);
542: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
543: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
544: ,'YYYY-MON-DD HH24:MI:SS'));
545: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
546: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
539: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
540: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
541: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' dispense_ind='||p_material_dtl_rec.dispense_ind);
542: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
543: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
544: ,'YYYY-MON-DD HH24:MI:SS'));
545: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
546: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
547: END IF;
541: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' dispense_ind='||p_material_dtl_rec.dispense_ind);
542: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
543: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
544: ,'YYYY-MON-DD HH24:MI:SS'));
545: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
546: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
547: END IF;
548: /* Set the return status to success initially */
549: x_return_status := FND_API.G_RET_STS_SUCCESS;
542: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
543: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
544: ,'YYYY-MON-DD HH24:MI:SS'));
545: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
546: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
547: END IF;
548: /* Set the return status to success initially */
549: x_return_status := FND_API.G_RET_STS_SUCCESS;
550:
565:
566: IF gme_common_pvt.g_auto_consume_supply_sub_only = 1 THEN
567: IF p_material_dtl_rec.subinventory IS NULL THEN
568: l_pending_mo_ind := FALSE; -- can't have move order if sub is NULL
569: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
570: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' auto consume from supply sub is ON and subinv on material is NULL; cant consume anything; get exceptions');
571: END IF;
572:
573: RAISE error_get_exception;
566: IF gme_common_pvt.g_auto_consume_supply_sub_only = 1 THEN
567: IF p_material_dtl_rec.subinventory IS NULL THEN
568: l_pending_mo_ind := FALSE; -- can't have move order if sub is NULL
569: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
570: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' auto consume from supply sub is ON and subinv on material is NULL; cant consume anything; get exceptions');
571: END IF;
572:
573: RAISE error_get_exception;
574: END IF;
576:
577: l_subinv := p_material_dtl_rec.subinventory;
578: l_locator_id := p_material_dtl_rec.locator_id;
579:
580: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
581: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_subinv='||l_subinv);
582: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_locator_id='||l_locator_id);
583: END IF;
584:
577: l_subinv := p_material_dtl_rec.subinventory;
578: l_locator_id := p_material_dtl_rec.locator_id;
579:
580: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
581: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_subinv='||l_subinv);
582: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_locator_id='||l_locator_id);
583: END IF;
584:
585: -- channges for GMO
578: l_locator_id := p_material_dtl_rec.locator_id;
579:
580: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
581: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_subinv='||l_subinv);
582: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_locator_id='||l_locator_id);
583: END IF;
584:
585: -- channges for GMO
586: gme_reservations_pvt.get_material_reservations
605: END IF;
606:
607: l_trans_date := NVL(p_trans_date, gme_common_pvt.g_timestamp);
608:
609: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
610: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_consume_qty='||l_consume_qty);
611: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(p_trans_date
612: ,'YYYY-MON-DD HH24:MI:SS'));
613: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
606:
607: l_trans_date := NVL(p_trans_date, gme_common_pvt.g_timestamp);
608:
609: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
610: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_consume_qty='||l_consume_qty);
611: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(p_trans_date
612: ,'YYYY-MON-DD HH24:MI:SS'));
613: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
614: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' number of reservations='||l_reservation_tab.COUNT);
607: l_trans_date := NVL(p_trans_date, gme_common_pvt.g_timestamp);
608:
609: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
610: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_consume_qty='||l_consume_qty);
611: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(p_trans_date
612: ,'YYYY-MON-DD HH24:MI:SS'));
613: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
614: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' number of reservations='||l_reservation_tab.COUNT);
615: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' auto consume from supply sub='||gme_common_pvt.g_auto_consume_supply_sub_only);
609: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
610: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_consume_qty='||l_consume_qty);
611: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(p_trans_date
612: ,'YYYY-MON-DD HH24:MI:SS'));
613: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
614: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' number of reservations='||l_reservation_tab.COUNT);
615: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' auto consume from supply sub='||gme_common_pvt.g_auto_consume_supply_sub_only);
616: END IF;
617:
610: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_consume_qty='||l_consume_qty);
611: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(p_trans_date
612: ,'YYYY-MON-DD HH24:MI:SS'));
613: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
614: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' number of reservations='||l_reservation_tab.COUNT);
615: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' auto consume from supply sub='||gme_common_pvt.g_auto_consume_supply_sub_only);
616: END IF;
617:
618: i := 1;
611: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_trans_date='||to_char(p_trans_date
612: ,'YYYY-MON-DD HH24:MI:SS'));
613: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
614: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' number of reservations='||l_reservation_tab.COUNT);
615: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' auto consume from supply sub='||gme_common_pvt.g_auto_consume_supply_sub_only);
616: END IF;
617:
618: i := 1;
619: j := 1;
620:
621: WHILE l_consume_qty > x_actual_qty AND i <= l_reservation_tab.COUNT LOOP
622: -- Consume all fully specified reservations and mark the Partial ones
623: l_reservation_rec := l_reservation_tab(i);
624: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
625: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' in reservation loop: reservation_id='||l_reservation_rec.reservation_id);
626: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' in reservation loop: reservation subinventory='||l_reservation_rec.subinventory_code);
627: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' in reservation loop: reservation external_source_line_id='||l_reservation_rec.external_source_line_id);
628: END IF;
621: WHILE l_consume_qty > x_actual_qty AND i <= l_reservation_tab.COUNT LOOP
622: -- Consume all fully specified reservations and mark the Partial ones
623: l_reservation_rec := l_reservation_tab(i);
624: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
625: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' in reservation loop: reservation_id='||l_reservation_rec.reservation_id);
626: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' in reservation loop: reservation subinventory='||l_reservation_rec.subinventory_code);
627: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' in reservation loop: reservation external_source_line_id='||l_reservation_rec.external_source_line_id);
628: END IF;
629: /* Bug 5441643 Added NVL condition for location control code*/
622: -- Consume all fully specified reservations and mark the Partial ones
623: l_reservation_rec := l_reservation_tab(i);
624: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
625: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' in reservation loop: reservation_id='||l_reservation_rec.reservation_id);
626: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' in reservation loop: reservation subinventory='||l_reservation_rec.subinventory_code);
627: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' in reservation loop: reservation external_source_line_id='||l_reservation_rec.external_source_line_id);
628: END IF;
629: /* Bug 5441643 Added NVL condition for location control code*/
630: l_rsrv_type := gme_reservations_pvt.reservation_fully_specified
623: l_reservation_rec := l_reservation_tab(i);
624: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
625: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' in reservation loop: reservation_id='||l_reservation_rec.reservation_id);
626: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' in reservation loop: reservation subinventory='||l_reservation_rec.subinventory_code);
627: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' in reservation loop: reservation external_source_line_id='||l_reservation_rec.external_source_line_id);
628: END IF;
629: /* Bug 5441643 Added NVL condition for location control code*/
630: l_rsrv_type := gme_reservations_pvt.reservation_fully_specified
631: (p_reservation_rec => l_reservation_rec
631: (p_reservation_rec => l_reservation_rec
632: ,p_item_location_control => NVL(p_item_rec.location_control_code,1)
633: ,p_item_restrict_locators => p_item_rec.restrict_locators_code);
634:
635: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
636: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' after call to gme_reservations_pvt.reservation_fully_specified: l_rsrv_type='||l_rsrv_type);
637: END IF;
638:
639: IF l_rsrv_type = -1 THEN
632: ,p_item_location_control => NVL(p_item_rec.location_control_code,1)
633: ,p_item_restrict_locators => p_item_rec.restrict_locators_code);
634:
635: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
636: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' after call to gme_reservations_pvt.reservation_fully_specified: l_rsrv_type='||l_rsrv_type);
637: END IF;
638:
639: IF l_rsrv_type = -1 THEN
640: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
636: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' after call to gme_reservations_pvt.reservation_fully_specified: l_rsrv_type='||l_rsrv_type);
637: END IF;
638:
639: IF l_rsrv_type = -1 THEN
640: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
641: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_rsrv_type passed back as -1 from gme_reservations_pvt.reservation_fully_specified');
642: RAISE error_unexpected;
643: ENd IF;
644: END IF;
637: END IF;
638:
639: IF l_rsrv_type = -1 THEN
640: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
641: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_rsrv_type passed back as -1 from gme_reservations_pvt.reservation_fully_specified');
642: RAISE error_unexpected;
643: ENd IF;
644: END IF;
645:
708: i := i + 1; -- move on to the next reservation
709: END LOOP;
710:
711: IF x_actual_qty >= l_consume_qty THEN
712: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
713: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' consumption complete: x_actual_qty='||x_actual_qty||' and l_consume_qty='||l_consume_qty);
714: END IF;
715: -- done!
716: RAISE consume_done;
709: END LOOP;
710:
711: IF x_actual_qty >= l_consume_qty THEN
712: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
713: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' consumption complete: x_actual_qty='||x_actual_qty||' and l_consume_qty='||l_consume_qty);
714: END IF;
715: -- done!
716: RAISE consume_done;
717: END IF;
716: RAISE consume_done;
717: END IF;
718:
719: IF (gme_common_pvt.g_auto_consume_supply_sub_only = 0 AND l_subinv IS NULL) THEN
720: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
721: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' exception; qty not met; consume from supply sub is FALSE and material subinv is NULL');
722: END IF;
723: RAISE error_get_exception;
724: END IF;
717: END IF;
718:
719: IF (gme_common_pvt.g_auto_consume_supply_sub_only = 0 AND l_subinv IS NULL) THEN
720: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
721: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' exception; qty not met; consume from supply sub is FALSE and material subinv is NULL');
722: END IF;
723: RAISE error_get_exception;
724: END IF;
725:
726: -- Changes for GMO
727: IF NVL(p_material_dtl_rec.dispense_ind, 'N') = 'Y' THEN
728: -- if you get to this point, raise exception; can't process PLR/HLR for dispensed records; nor
729: -- can you get available inventory; record must be dispensed to process it
730: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
731: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' dispensed item; get exceptions: x_actual_qty='||x_actual_qty||' and l_consume_qty='||l_consume_qty);
732: END IF;
733: RAISE error_get_exception;
734: END IF;
727: IF NVL(p_material_dtl_rec.dispense_ind, 'N') = 'Y' THEN
728: -- if you get to this point, raise exception; can't process PLR/HLR for dispensed records; nor
729: -- can you get available inventory; record must be dispensed to process it
730: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
731: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' dispensed item; get exceptions: x_actual_qty='||x_actual_qty||' and l_consume_qty='||l_consume_qty);
732: END IF;
733: RAISE error_get_exception;
734: END IF;
735:
741: IF p_item_rec.lot_control_code = 2 THEN -- lot control
742: IF gme_common_pvt.g_auto_consume_supply_sub_only = 1 THEN -- auto consume -> Yes
743: IF l_pending_mo_ind THEN
744: l_try_PLR := FALSE;
745: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
746: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' consume from supply sub ON; pending MO TRUE: l_try_PLR := FALSE; get batch exception');
747: END IF;
748: ELSE
749: l_try_PLR := TRUE;
742: IF gme_common_pvt.g_auto_consume_supply_sub_only = 1 THEN -- auto consume -> Yes
743: IF l_pending_mo_ind THEN
744: l_try_PLR := FALSE;
745: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
746: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' consume from supply sub ON; pending MO TRUE: l_try_PLR := FALSE; get batch exception');
747: END IF;
748: ELSE
749: l_try_PLR := TRUE;
750: END IF;
752: l_try_PLR := TRUE;
753: END IF;
754:
755: IF NOT l_try_PLR THEN
756: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
757: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' lot control item; get exceptions: x_actual_qty='||x_actual_qty||' and l_consume_qty='||l_consume_qty);
758: END IF;
759: RAISE error_get_exception;
760: END IF;
753: END IF;
754:
755: IF NOT l_try_PLR THEN
756: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
757: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' lot control item; get exceptions: x_actual_qty='||x_actual_qty||' and l_consume_qty='||l_consume_qty);
758: END IF;
759: RAISE error_get_exception;
760: END IF;
761: END IF;
775: ,p_item_rec => p_item_rec
776: ,x_reservation_rec => l_reservation_rec
777: ,x_return_status => l_return_status);
778: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
779: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
780: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' could not convert partial to dlr for reservation id='||l_partial_rec.reservation_id||'; moving to next partial');
781: END IF;
782: ELSE
783: -- Bug 8277090 - Initialize locator_id properly if required.
776: ,x_reservation_rec => l_reservation_rec
777: ,x_return_status => l_return_status);
778: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
779: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
780: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' could not convert partial to dlr for reservation id='||l_partial_rec.reservation_id||'; moving to next partial');
781: END IF;
782: ELSE
783: -- Bug 8277090 - Initialize locator_id properly if required.
784: IF l_reservation_rec.locator_id IS NULL AND
785: p_material_dtl_rec.locator_id IS NOT NULL THEN
786: l_reservation_rec.locator_id := p_material_dtl_rec.locator_id;
787: END IF;
788:
789: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
790: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'Calling query quantities for plr');
791: gme_debug.put_line ('inventory_item_id is '||p_material_dtl_rec.inventory_item_id);
792: gme_debug.put_line ('material_detail_id is '||p_material_dtl_rec.material_detail_id);
793: END IF;
786: l_reservation_rec.locator_id := p_material_dtl_rec.locator_id;
787: END IF;
788:
789: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
790: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'Calling query quantities for plr');
791: gme_debug.put_line ('inventory_item_id is '||p_material_dtl_rec.inventory_item_id);
792: gme_debug.put_line ('material_detail_id is '||p_material_dtl_rec.material_detail_id);
793: END IF;
794:
787: END IF;
788:
789: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
790: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'Calling query quantities for plr');
791: gme_debug.put_line ('inventory_item_id is '||p_material_dtl_rec.inventory_item_id);
792: gme_debug.put_line ('material_detail_id is '||p_material_dtl_rec.material_detail_id);
793: END IF;
794:
795: -- Bug 13949475 - Let's see if there is enough inventory.
788:
789: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
790: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'Calling query quantities for plr');
791: gme_debug.put_line ('inventory_item_id is '||p_material_dtl_rec.inventory_item_id);
792: gme_debug.put_line ('material_detail_id is '||p_material_dtl_rec.material_detail_id);
793: END IF;
794:
795: -- Bug 13949475 - Let's see if there is enough inventory.
796: gme_transactions_pvt.query_quantities
832: ,p_lpn_id => NULL
833: ,p_transfer_locator_id => NULL
834: );
835:
836: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities return status='||l_return_status);
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
839: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
840: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
833: ,p_transfer_locator_id => NULL
834: );
835:
836: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities return status='||l_return_status);
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
839: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
840: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
841: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
834: );
835:
836: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities return status='||l_return_status);
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
839: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
840: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
841: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
842: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities loc='||l_reservation_rec.locator_id);
835:
836: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities return status='||l_return_status);
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
839: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
840: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
841: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
842: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities loc='||l_reservation_rec.locator_id);
843: END IF;
836: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities return status='||l_return_status);
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
839: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
840: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
841: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
842: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities loc='||l_reservation_rec.locator_id);
843: END IF;
844:
837: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities return status='||l_return_status);
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
839: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
840: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
841: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
842: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities loc='||l_reservation_rec.locator_id);
843: END IF;
844:
845: -- Internal note - down the road this may need to be reconstructed like 7709971 below to consider allow neg inv.
838: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
839: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
840: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
841: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
842: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities loc='||l_reservation_rec.locator_id);
843: END IF;
844:
845: -- Internal note - down the road this may need to be reconstructed like 7709971 below to consider allow neg inv.
846: IF l_return_status = FND_API.G_RET_STS_SUCCESS AND l_att > 0 THEN
854: ,p_secondary_uom_code => p_item_rec.secondary_uom_code
855: ,x_actual_qty => x_actual_qty
856: ,x_return_status => l_return_status);
857:
858: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
859: gme_debug.put_line ('after build and create');
860: END IF;
861:
862: IF l_return_status NOT IN (gme_common_pvt.g_not_transactable, FND_API.G_RET_STS_SUCCESS) THEN
855: ,x_actual_qty => x_actual_qty
856: ,x_return_status => l_return_status);
857:
858: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
859: gme_debug.put_line ('after build and create');
860: END IF;
861:
862: IF l_return_status NOT IN (gme_common_pvt.g_not_transactable, FND_API.G_RET_STS_SUCCESS) THEN
863: x_return_status := l_return_status;
863: x_return_status := l_return_status;
864: RAISE error_build_trxn;
865: END IF;
866:
867: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
868: gme_debug.put_line ('after build and create build is successful');
869: END IF;
870:
871: END IF; -- IF l_return_status <> FND_API.G_RET_STS_SUCCESS AND l_att
864: RAISE error_build_trxn;
865: END IF;
866:
867: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
868: gme_debug.put_line ('after build and create build is successful');
869: END IF;
870:
871: END IF; -- IF l_return_status <> FND_API.G_RET_STS_SUCCESS AND l_att
872: END IF; -- IF l_return_status <> FND_API.G_RET_STS_SUCCESS for gme_reservations_pvt.convert_partial_to_dlr
875: END LOOP;
876:
877: -- Bug 8277090 - See if we have satisfied consumption qty..
878: IF x_actual_qty >= l_consume_qty THEN
879: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
880: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' consumption complete: x_actual_qty='||x_actual_qty||' and l_consume_qty='||l_consume_qty);
881: END IF;
882: -- done!
883: RAISE consume_done;
876:
877: -- Bug 8277090 - See if we have satisfied consumption qty..
878: IF x_actual_qty >= l_consume_qty THEN
879: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
880: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' consumption complete: x_actual_qty='||x_actual_qty||' and l_consume_qty='||l_consume_qty);
881: END IF;
882: -- done!
883: RAISE consume_done;
884: END IF;
884: END IF;
885:
886: -- If it's lot control and the qty is still not satisfied, get exceptions;
887: IF p_item_rec.lot_control_code = 2 THEN -- lot control
888: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
889: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' lot control; DLR and PLR have been exhausted; get exception');
890: END IF;
891: RAISE error_get_exception;
892: END IF;
885:
886: -- If it's lot control and the qty is still not satisfied, get exceptions;
887: IF p_item_rec.lot_control_code = 2 THEN -- lot control
888: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
889: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' lot control; DLR and PLR have been exhausted; get exception');
890: END IF;
891: RAISE error_get_exception;
892: END IF;
893:
908: CLOSE cur_get_item_revision;
909: END IF;
910: END IF; -- IF p_revision_qty_control_code = 2
911:
912: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
913: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_revision='||l_revision);
914: END IF;
915:
916: IF l_locator_id IS NULL THEN
909: END IF;
910: END IF; -- IF p_revision_qty_control_code = 2
911:
912: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
913: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_revision='||l_revision);
914: END IF;
915:
916: IF l_locator_id IS NULL THEN
917: -- check if it's locator control, we need a locator...
923: ,p_subinventory => p_material_dtl_rec.subinventory
924: ,p_item_control => NVL(p_item_rec.location_control_code,1)
925: ,p_item_loc_restrict => p_item_rec.restrict_locators_code
926: ,p_action => gme_common_pvt.g_ing_issue_txn_action);
927: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
928: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
929: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
930: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
931: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
924: ,p_item_control => NVL(p_item_rec.location_control_code,1)
925: ,p_item_loc_restrict => p_item_rec.restrict_locators_code
926: ,p_action => gme_common_pvt.g_ing_issue_txn_action);
927: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
928: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
929: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
930: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
931: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
932: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
925: ,p_item_loc_restrict => p_item_rec.restrict_locators_code
926: ,p_action => gme_common_pvt.g_ing_issue_txn_action);
927: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
928: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
929: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
930: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
931: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
932: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
933: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
926: ,p_action => gme_common_pvt.g_ing_issue_txn_action);
927: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
928: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
929: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
930: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
931: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
932: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
933: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
934: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
927: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
928: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
929: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
930: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
931: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
932: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
933: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
934: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
935: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_ing_issue_txn_action);
928: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' l_eff_locator_control='||l_eff_locator_control);
929: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
930: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
931: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
932: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
933: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
934: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
935: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_ing_issue_txn_action);
936: END IF;
929: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' organization_id='||p_material_dtl_rec.organization_id);
930: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
931: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
932: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
933: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
934: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
935: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_ing_issue_txn_action);
936: END IF;
937: IF l_eff_locator_control <> 1 THEN
930: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' g_org_locator_control='||gme_common_pvt.g_org_locator_control);
931: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
932: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
933: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
934: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
935: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_ing_issue_txn_action);
936: END IF;
937: IF l_eff_locator_control <> 1 THEN
938: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
931: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' subinventory='||p_material_dtl_rec.subinventory);
932: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' inventory_item_id='||p_item_rec.inventory_item_id);
933: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' location_control_code='||p_item_rec.location_control_code);
934: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
935: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_ing_issue_txn_action);
936: END IF;
937: IF l_eff_locator_control <> 1 THEN
938: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
939: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' locator on material is NULL and material is eff locator control; cant get quantities from inventory; get exceptions');
934: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' restrict_locators_code='||p_item_rec.restrict_locators_code);
935: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_ing_issue_txn_action);
936: END IF;
937: IF l_eff_locator_control <> 1 THEN
938: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
939: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' locator on material is NULL and material is eff locator control; cant get quantities from inventory; get exceptions');
940: END IF;
941: RAISE error_get_exception;
942: END IF;
935: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_action='||gme_common_pvt.g_ing_issue_txn_action);
936: END IF;
937: IF l_eff_locator_control <> 1 THEN
938: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
939: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' locator on material is NULL and material is eff locator control; cant get quantities from inventory; get exceptions');
940: END IF;
941: RAISE error_get_exception;
942: END IF;
943: END IF;
981: ,p_lpn_id => NULL
982: ,p_transfer_locator_id => NULL
983: );
984:
985: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
986: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities return status='||l_return_status);
987: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
988: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
989: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
982: ,p_transfer_locator_id => NULL
983: );
984:
985: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
986: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities return status='||l_return_status);
987: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
988: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
989: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
990: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
983: );
984:
985: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
986: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities return status='||l_return_status);
987: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
988: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
989: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
990: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
991: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities loc='||l_locator_id);
984:
985: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
986: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities return status='||l_return_status);
987: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
988: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
989: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
990: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
991: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities loc='||l_locator_id);
992: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities rev='||l_revision);
985: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
986: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities return status='||l_return_status);
987: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
988: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
989: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
990: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
991: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities loc='||l_locator_id);
992: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities rev='||l_revision);
993: END IF;
986: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities return status='||l_return_status);
987: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
988: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
989: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
990: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
991: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities loc='||l_locator_id);
992: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities rev='||l_revision);
993: END IF;
994:
987: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities att='||l_att);
988: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
989: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
990: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
991: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities loc='||l_locator_id);
992: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities rev='||l_revision);
993: END IF;
994:
995: -- Bug 7709971 - Restructure this condition to handle orgs that allow negative inventory.
988: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities qoh='||l_qoh);
989: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities item_id='||p_material_dtl_rec.inventory_item_id);
990: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities sub='||l_subinv);
991: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities loc='||l_locator_id);
992: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after query quantities rev='||l_revision);
993: END IF;
994:
995: -- Bug 7709971 - Restructure this condition to handle orgs that allow negative inventory.
996: -- g_allow_neg_inv: 2 means do not allow neg inv whereas 1 means allow it.
1055: IF x_actual_qty < l_consume_qty THEN
1056: RAISE error_get_exception;
1057: END IF;
1058:
1059: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1060: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1061: END IF;
1062:
1063: EXCEPTION
1056: RAISE error_get_exception;
1057: END IF;
1058:
1059: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1060: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1061: END IF;
1062:
1063: EXCEPTION
1064: WHEN error_build_trxn OR error_get_item OR error_convert_partial OR consume_done OR
1064: WHEN error_build_trxn OR error_get_item OR error_convert_partial OR consume_done OR
1065: error_get_reservations OR no_consume_required THEN
1066: NULL;
1067: WHEN error_get_exception THEN
1068: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1069: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
1070: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1071: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
1072: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_consume_qty='||l_consume_qty);
1065: error_get_reservations OR no_consume_required THEN
1066: NULL;
1067: WHEN error_get_exception THEN
1068: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1069: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
1070: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1071: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
1072: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_consume_qty='||l_consume_qty);
1073: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_exception_qty='||(l_consume_qty - x_actual_qty));
1066: NULL;
1067: WHEN error_get_exception THEN
1068: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1069: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
1070: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1071: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
1072: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_consume_qty='||l_consume_qty);
1073: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_exception_qty='||(l_consume_qty - x_actual_qty));
1074: END IF;
1067: WHEN error_get_exception THEN
1068: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1069: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
1070: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1071: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
1072: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_consume_qty='||l_consume_qty);
1073: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_exception_qty='||(l_consume_qty - x_actual_qty));
1074: END IF;
1075:
1068: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1069: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
1070: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1071: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
1072: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_consume_qty='||l_consume_qty);
1073: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_exception_qty='||(l_consume_qty - x_actual_qty));
1074: END IF;
1075:
1076: create_batch_exception
1069: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception block for get exceptions:');
1070: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1071: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_start_actual_qty='||l_start_actual_qty);
1072: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_consume_qty='||l_consume_qty);
1073: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_exception_qty='||(l_consume_qty - x_actual_qty));
1074: END IF;
1075:
1076: create_batch_exception
1077: (p_material_dtl_rec => p_material_dtl_rec
1087: WHEN error_unexpected THEN
1088: x_return_status := FND_API.g_ret_sts_unexp_error;
1089: WHEN OTHERS THEN
1090: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1091: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
1092: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
1093: END IF;
1094: x_return_status := FND_API.g_ret_sts_unexp_error;
1095: END consume_material;
1088: x_return_status := FND_API.g_ret_sts_unexp_error;
1089: WHEN OTHERS THEN
1090: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1091: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
1092: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
1093: END IF;
1094: x_return_status := FND_API.g_ret_sts_unexp_error;
1095: END consume_material;
1096:
1146: error_relieve_rsrv EXCEPTION;
1147: um_convert_error EXCEPTION;
1148: dispense_error EXCEPTION;
1149: BEGIN
1150: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1151: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1152: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.reservation_id='||p_rsrv_rec.reservation_id);
1153: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.lot_number='||p_rsrv_rec.lot_number);
1154: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_lot_divisible_flag='||p_lot_divisible_flag);
1147: um_convert_error EXCEPTION;
1148: dispense_error EXCEPTION;
1149: BEGIN
1150: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1151: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1152: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.reservation_id='||p_rsrv_rec.reservation_id);
1153: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.lot_number='||p_rsrv_rec.lot_number);
1154: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_lot_divisible_flag='||p_lot_divisible_flag);
1155: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1148: dispense_error EXCEPTION;
1149: BEGIN
1150: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1151: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1152: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.reservation_id='||p_rsrv_rec.reservation_id);
1153: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.lot_number='||p_rsrv_rec.lot_number);
1154: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_lot_divisible_flag='||p_lot_divisible_flag);
1155: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1156: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1149: BEGIN
1150: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1151: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1152: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.reservation_id='||p_rsrv_rec.reservation_id);
1153: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.lot_number='||p_rsrv_rec.lot_number);
1154: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_lot_divisible_flag='||p_lot_divisible_flag);
1155: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1156: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1157: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_att='||p_att);
1150: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1151: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1152: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.reservation_id='||p_rsrv_rec.reservation_id);
1153: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.lot_number='||p_rsrv_rec.lot_number);
1154: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_lot_divisible_flag='||p_lot_divisible_flag);
1155: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1156: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1157: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_att='||p_att);
1158: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_satt='||p_satt);
1151: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1152: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.reservation_id='||p_rsrv_rec.reservation_id);
1153: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.lot_number='||p_rsrv_rec.lot_number);
1154: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_lot_divisible_flag='||p_lot_divisible_flag);
1155: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1156: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1157: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_att='||p_att);
1158: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_satt='||p_satt);
1159: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_primary_uom_code='||p_primary_uom_code);
1152: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.reservation_id='||p_rsrv_rec.reservation_id);
1153: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.lot_number='||p_rsrv_rec.lot_number);
1154: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_lot_divisible_flag='||p_lot_divisible_flag);
1155: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1156: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1157: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_att='||p_att);
1158: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_satt='||p_satt);
1159: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_primary_uom_code='||p_primary_uom_code);
1160: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1153: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_rsrv_rec.lot_number='||p_rsrv_rec.lot_number);
1154: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_lot_divisible_flag='||p_lot_divisible_flag);
1155: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1156: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1157: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_att='||p_att);
1158: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_satt='||p_satt);
1159: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_primary_uom_code='||p_primary_uom_code);
1160: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1161: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.dtl_um='||p_mtl_dtl_rec.dtl_um);
1154: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_lot_divisible_flag='||p_lot_divisible_flag);
1155: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1156: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1157: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_att='||p_att);
1158: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_satt='||p_satt);
1159: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_primary_uom_code='||p_primary_uom_code);
1160: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1161: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.dtl_um='||p_mtl_dtl_rec.dtl_um);
1162: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
1155: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1156: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1157: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_att='||p_att);
1158: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_satt='||p_satt);
1159: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_primary_uom_code='||p_primary_uom_code);
1160: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1161: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.dtl_um='||p_mtl_dtl_rec.dtl_um);
1162: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
1163: ,'YYYY-MON-DD HH24:MI:SS'));
1156: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1157: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_att='||p_att);
1158: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_satt='||p_satt);
1159: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_primary_uom_code='||p_primary_uom_code);
1160: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1161: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.dtl_um='||p_mtl_dtl_rec.dtl_um);
1162: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
1163: ,'YYYY-MON-DD HH24:MI:SS'));
1164: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
1157: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_att='||p_att);
1158: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_satt='||p_satt);
1159: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_primary_uom_code='||p_primary_uom_code);
1160: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1161: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.dtl_um='||p_mtl_dtl_rec.dtl_um);
1162: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
1163: ,'YYYY-MON-DD HH24:MI:SS'));
1164: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
1165: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
1158: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_satt='||p_satt);
1159: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_primary_uom_code='||p_primary_uom_code);
1160: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1161: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.dtl_um='||p_mtl_dtl_rec.dtl_um);
1162: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
1163: ,'YYYY-MON-DD HH24:MI:SS'));
1164: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
1165: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
1166: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_secondary_uom_code='||p_secondary_uom_code);
1160: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1161: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.dtl_um='||p_mtl_dtl_rec.dtl_um);
1162: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
1163: ,'YYYY-MON-DD HH24:MI:SS'));
1164: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
1165: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
1166: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_secondary_uom_code='||p_secondary_uom_code);
1167: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1168: END IF;
1161: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_mtl_dtl_rec.dtl_um='||p_mtl_dtl_rec.dtl_um);
1162: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
1163: ,'YYYY-MON-DD HH24:MI:SS'));
1164: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
1165: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
1166: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_secondary_uom_code='||p_secondary_uom_code);
1167: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1168: END IF;
1169:
1162: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_trans_date='||to_char(p_trans_date
1163: ,'YYYY-MON-DD HH24:MI:SS'));
1164: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
1165: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
1166: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_secondary_uom_code='||p_secondary_uom_code);
1167: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1168: END IF;
1169:
1170: /* Set the return status to success initially */
1163: ,'YYYY-MON-DD HH24:MI:SS'));
1164: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_consume_qty='||p_consume_qty);
1165: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_revision='||p_revision);
1166: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' p_secondary_uom_code='||p_secondary_uom_code);
1167: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1168: END IF;
1169:
1170: /* Set the return status to success initially */
1171: x_return_status := FND_API.G_RET_STS_SUCCESS;
1187: -- If the revision is null which would be becasue the Reservations on the
1188: -- GME batch form dont have the revision information, then set the revision
1189: -- passed
1190: --
1191: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti_from_reservation revision='||l_transaction_rec.revision);
1192: IF (l_transaction_rec.revision IS NULL) THEN
1193: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti_from_reservation revision is NULL so setting '||p_revision);
1194: l_transaction_rec.revision := p_revision;
1195: END IF;
1189: -- passed
1190: --
1191: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti_from_reservation revision='||l_transaction_rec.revision);
1192: IF (l_transaction_rec.revision IS NULL) THEN
1193: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after constr_mmti_from_reservation revision is NULL so setting '||p_revision);
1194: l_transaction_rec.revision := p_revision;
1195: END IF;
1196: ELSE
1197: constr_mmti_from_qty_tree
1217: ,x_qty => l_dtl_qty
1218: ,x_return_status => x_return_status);
1219:
1220: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1221: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1222: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' gme_reservations_pvt.get_reservation_dtl_qty returned error');
1223: END IF;
1224:
1225: RAISE error_get_dtl_qty;
1218: ,x_return_status => x_return_status);
1219:
1220: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1221: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1222: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' gme_reservations_pvt.get_reservation_dtl_qty returned error');
1223: END IF;
1224:
1225: RAISE error_get_dtl_qty;
1226: END IF;
1224:
1225: RAISE error_get_dtl_qty;
1226: END IF;
1227:
1228: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1229: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' get_reservation_dtl_qty returned l_dtl_qty='||l_dtl_qty);
1230: END IF;
1231: ELSE
1232: l_prim_qty := p_att;
1225: RAISE error_get_dtl_qty;
1226: END IF;
1227:
1228: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1229: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' get_reservation_dtl_qty returned l_dtl_qty='||l_dtl_qty);
1230: END IF;
1231: ELSE
1232: l_prim_qty := p_att;
1233: l_sec_qty := p_satt;
1263: ,to_name => NULL);
1264:
1265: -- Let's see if conversion went wrong.
1266: IF (NVL(l_sec_qty, 0) = -99999) THEN
1267: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1268: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' REL2 - PRIM TO SEC - inv_convert.inv_um_convert returned error');
1269: END IF;
1270: RAISE um_convert_error;
1271: END IF;
1264:
1265: -- Let's see if conversion went wrong.
1266: IF (NVL(l_sec_qty, 0) = -99999) THEN
1267: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1268: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' REL2 - PRIM TO SEC - inv_convert.inv_um_convert returned error');
1269: END IF;
1270: RAISE um_convert_error;
1271: END IF;
1272: ELSE
1285: ,to_name => NULL);
1286:
1287: -- Let's see if conversion went wrong.
1288: IF (l_dtl_qty = -99999) THEN
1289: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1290: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' REL2 - SEC TO PRIM - inv_convert.inv_um_convert returned error');
1291: END IF;
1292: RAISE um_convert_error;
1293: END IF;
1286:
1287: -- Let's see if conversion went wrong.
1288: IF (l_dtl_qty = -99999) THEN
1289: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1290: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' REL2 - SEC TO PRIM - inv_convert.inv_um_convert returned error');
1291: END IF;
1292: RAISE um_convert_error;
1293: END IF;
1294: END IF;
1293: END IF;
1294: END IF;
1295: END IF;
1296:
1297: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1298: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after call to inv_convert.inv_um_convert');
1299: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_dtl_qty= '||to_char(l_dtl_qty));
1300: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_sec_qty= '||to_char(l_sec_qty));
1301: END IF;
1294: END IF;
1295: END IF;
1296:
1297: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1298: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after call to inv_convert.inv_um_convert');
1299: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_dtl_qty= '||to_char(l_dtl_qty));
1300: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_sec_qty= '||to_char(l_sec_qty));
1301: END IF;
1302: -- We now have in hand both the dtl and secondary qty in the correct UOM.
1295: END IF;
1296:
1297: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1298: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after call to inv_convert.inv_um_convert');
1299: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_dtl_qty= '||to_char(l_dtl_qty));
1300: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_sec_qty= '||to_char(l_sec_qty));
1301: END IF;
1302: -- We now have in hand both the dtl and secondary qty in the correct UOM.
1303:
1296:
1297: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1298: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after call to inv_convert.inv_um_convert');
1299: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_dtl_qty= '||to_char(l_dtl_qty));
1300: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_sec_qty= '||to_char(l_sec_qty));
1301: END IF;
1302: -- We now have in hand both the dtl and secondary qty in the correct UOM.
1303:
1304: l_prim_qty := l_dtl_qty;
1333: ,from_name => NULL
1334: ,to_name => NULL);
1335:
1336: IF l_prim_qty = -99999 THEN
1337: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1338: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' DTL TO PRIM - inv_convert.inv_um_convert returned error');
1339: END IF;
1340: RAISE um_convert_error;
1341: END IF;
1334: ,to_name => NULL);
1335:
1336: IF l_prim_qty = -99999 THEN
1337: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1338: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' DTL TO PRIM - inv_convert.inv_um_convert returned error');
1339: END IF;
1340: RAISE um_convert_error;
1341: END IF;
1342:
1339: END IF;
1340: RAISE um_convert_error;
1341: END IF;
1342:
1343: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1344: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' DTL TO PRIM - after call to inv_convert.inv_um_convert');
1345: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_prim_qty= '||to_char(l_prim_qty));
1346: END IF;
1347: END IF;
1340: RAISE um_convert_error;
1341: END IF;
1342:
1343: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1344: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' DTL TO PRIM - after call to inv_convert.inv_um_convert');
1345: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_prim_qty= '||to_char(l_prim_qty));
1346: END IF;
1347: END IF;
1348: END IF;
1341: END IF;
1342:
1343: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1344: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' DTL TO PRIM - after call to inv_convert.inv_um_convert');
1345: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_prim_qty= '||to_char(l_prim_qty));
1346: END IF;
1347: END IF;
1348: END IF;
1349:
1366: ,from_name => NULL
1367: ,to_name => NULL);
1368:
1369: IF l_dtl_qty = -99999 THEN
1370: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1371: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' PRIM TO DTL - inv_convert.inv_um_convert returned error');
1372: END IF;
1373: RAISE um_convert_error;
1374: END IF;
1367: ,to_name => NULL);
1368:
1369: IF l_dtl_qty = -99999 THEN
1370: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1371: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' PRIM TO DTL - inv_convert.inv_um_convert returned error');
1372: END IF;
1373: RAISE um_convert_error;
1374: END IF;
1375:
1372: END IF;
1373: RAISE um_convert_error;
1374: END IF;
1375:
1376: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1377: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after call to inv_convert.inv_um_convert');
1378: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_dtl_qty= '||to_char(l_dtl_qty));
1379: END IF;
1380: END IF;
1373: RAISE um_convert_error;
1374: END IF;
1375:
1376: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1377: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after call to inv_convert.inv_um_convert');
1378: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_dtl_qty= '||to_char(l_dtl_qty));
1379: END IF;
1380: END IF;
1381: END IF;
1374: END IF;
1375:
1376: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1377: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' after call to inv_convert.inv_um_convert');
1378: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_dtl_qty= '||to_char(l_dtl_qty));
1379: END IF;
1380: END IF;
1381: END IF;
1382: END IF;
1383:
1384: IF p_rsrv_rec.lot_number IS NOT NULL AND
1385: NVL(p_lot_divisible_flag,'Y') = 'N' THEN
1386: l_whole_qty := TRUE;
1387: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1388: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_whole_qty = TRUE because lot indivisible item');
1389: END IF;
1390: ELSE
1391: l_whole_qty := FALSE;
1384: IF p_rsrv_rec.lot_number IS NOT NULL AND
1385: NVL(p_lot_divisible_flag,'Y') = 'N' THEN
1386: l_whole_qty := TRUE;
1387: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1388: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_whole_qty = TRUE because lot indivisible item');
1389: END IF;
1390: ELSE
1391: l_whole_qty := FALSE;
1392: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1388: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_whole_qty = TRUE because lot indivisible item');
1389: END IF;
1390: ELSE
1391: l_whole_qty := FALSE;
1392: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1393: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_whole_qty = FALSE');
1394: END IF;
1395: END IF;
1396:
1389: END IF;
1390: ELSE
1391: l_whole_qty := FALSE;
1392: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1393: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_whole_qty = FALSE');
1394: END IF;
1395: END IF;
1396:
1397: -- test again for dispensed items
1397: -- test again for dispensed items
1398: IF NOT l_whole_qty THEN
1399: IF NVL(p_dispense_ind,'N') = 'Y' THEN
1400: l_whole_qty := TRUE;
1401: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1402: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_whole_qty = TRUE because dispensed item');
1403: END IF;
1404: END IF;
1405: END IF;
1398: IF NOT l_whole_qty THEN
1399: IF NVL(p_dispense_ind,'N') = 'Y' THEN
1400: l_whole_qty := TRUE;
1401: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1402: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_whole_qty = TRUE because dispensed item');
1403: END IF;
1404: END IF;
1405: END IF;
1406:
1405: END IF;
1406:
1407: /* Original code
1408: IF l_dtl_qty <= p_consume_qty - x_actual_qty OR l_whole_qty THEN
1409: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1410: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := l_dtl_qty');
1411: END IF;
1412: l_trxn_qty := l_dtl_qty;
1413: ELSE
1406:
1407: /* Original code
1408: IF l_dtl_qty <= p_consume_qty - x_actual_qty OR l_whole_qty THEN
1409: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1410: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := l_dtl_qty');
1411: END IF;
1412: l_trxn_qty := l_dtl_qty;
1413: ELSE
1414: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1410: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := l_dtl_qty');
1411: END IF;
1412: l_trxn_qty := l_dtl_qty;
1413: ELSE
1414: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1415: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := p_consume_qty - x_actual_qty');
1416: END IF;
1417: l_trxn_qty := p_consume_qty - x_actual_qty;
1418: l_prim_qty := NULL;
1411: END IF;
1412: l_trxn_qty := l_dtl_qty;
1413: ELSE
1414: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1415: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := p_consume_qty - x_actual_qty');
1416: END IF;
1417: l_trxn_qty := p_consume_qty - x_actual_qty;
1418: l_prim_qty := NULL;
1419: l_sec_qty := NULL;
1432: END IF;
1433:
1434: -- If the resrvation qty (l_dtl_qty) hass less than what is being requested consume all of it.
1435: IF l_dtl_qty <= l_trxn_qty OR l_whole_qty THEN
1436: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1437: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := l_dtl_qty');
1438: END IF;
1439: l_trxn_qty := l_dtl_qty;
1440: ELSE
1433:
1434: -- If the resrvation qty (l_dtl_qty) hass less than what is being requested consume all of it.
1435: IF l_dtl_qty <= l_trxn_qty OR l_whole_qty THEN
1436: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1437: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := l_dtl_qty');
1438: END IF;
1439: l_trxn_qty := l_dtl_qty;
1440: ELSE
1441: -- Transaction qty is set above. Just set other two variables.
1438: END IF;
1439: l_trxn_qty := l_dtl_qty;
1440: ELSE
1441: -- Transaction qty is set above. Just set other two variables.
1442: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1443: IF (p_called_by = 'CVT') THEN
1444: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := p_consume_qty');
1445: ELSE
1446: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := p_consume_qty - x_actual_qty');
1440: ELSE
1441: -- Transaction qty is set above. Just set other two variables.
1442: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1443: IF (p_called_by = 'CVT') THEN
1444: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := p_consume_qty');
1445: ELSE
1446: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := p_consume_qty - x_actual_qty');
1447: END IF;
1448: END IF;
1442: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1443: IF (p_called_by = 'CVT') THEN
1444: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := p_consume_qty');
1445: ELSE
1446: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' l_trxn_qty := p_consume_qty - x_actual_qty');
1447: END IF;
1448: END IF;
1449: l_prim_qty := NULL;
1450: l_sec_qty := NULL;
1454: l_transaction_rec.transaction_date := p_trans_date;
1455: l_transaction_rec.transaction_quantity := l_trxn_qty;
1456: l_transaction_rec.secondary_uom_code := p_secondary_uom_code;
1457:
1458: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1459: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_date='||to_char(l_transaction_rec.transaction_date
1460: ,'YYYY-MON-DD HH24:MI:SS'));
1461: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_qty='||l_transaction_rec.transaction_quantity);
1462: END IF;
1455: l_transaction_rec.transaction_quantity := l_trxn_qty;
1456: l_transaction_rec.secondary_uom_code := p_secondary_uom_code;
1457:
1458: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1459: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_date='||to_char(l_transaction_rec.transaction_date
1460: ,'YYYY-MON-DD HH24:MI:SS'));
1461: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_qty='||l_transaction_rec.transaction_quantity);
1462: END IF;
1463:
1457:
1458: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1459: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_date='||to_char(l_transaction_rec.transaction_date
1460: ,'YYYY-MON-DD HH24:MI:SS'));
1461: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' transaction_qty='||l_transaction_rec.transaction_quantity);
1462: END IF;
1463:
1464: IF l_prim_qty IS NOT NULL THEN
1465: l_transaction_rec.primary_quantity := l_prim_qty;
1462: END IF;
1463:
1464: IF l_prim_qty IS NOT NULL THEN
1465: l_transaction_rec.primary_quantity := l_prim_qty;
1466: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1467: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' primary_qty is known:'||l_transaction_rec.primary_quantity);
1468: END IF;
1469: END IF;
1470: IF l_sec_qty IS NOT NULL THEN
1463:
1464: IF l_prim_qty IS NOT NULL THEN
1465: l_transaction_rec.primary_quantity := l_prim_qty;
1466: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1467: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' primary_qty is known:'||l_transaction_rec.primary_quantity);
1468: END IF;
1469: END IF;
1470: IF l_sec_qty IS NOT NULL THEN
1471: l_transaction_rec.secondary_transaction_quantity := l_sec_qty;
1468: END IF;
1469: END IF;
1470: IF l_sec_qty IS NOT NULL THEN
1471: l_transaction_rec.secondary_transaction_quantity := l_sec_qty;
1472: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1473: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' secondary_transaction_quantity is known:'||l_transaction_rec.secondary_transaction_quantity);
1474: END IF;
1475: END IF;
1476:
1469: END IF;
1470: IF l_sec_qty IS NOT NULL THEN
1471: l_transaction_rec.secondary_transaction_quantity := l_sec_qty;
1472: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1473: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' secondary_transaction_quantity is known:'||l_transaction_rec.secondary_transaction_quantity);
1474: END IF;
1475: END IF;
1476:
1477: l_transaction_rec.transaction_uom := p_mtl_dtl_rec.dtl_um;
1496: ,p_mmli_tbl => l_lot_rec
1497: ,x_return_status => x_return_status);
1498:
1499: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1500: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1501: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' gme_transactions_pvt.create_transaction returned '||x_return_status);
1502: END IF;
1503: RAISE error_create_trxn;
1504: END IF;
1497: ,x_return_status => x_return_status);
1498:
1499: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1500: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1501: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' gme_transactions_pvt.create_transaction returned '||x_return_status);
1502: END IF;
1503: RAISE error_create_trxn;
1504: END IF;
1505:
1504: END IF;
1505:
1506: x_actual_qty := x_actual_qty + l_trxn_qty;
1507:
1508: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1509: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1510: END IF;
1511:
1512: IF l_rsrv_mode THEN
1505:
1506: x_actual_qty := x_actual_qty + l_trxn_qty;
1507:
1508: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1509: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' x_actual_qty='||x_actual_qty);
1510: END IF;
1511:
1512: IF l_rsrv_mode THEN
1513: IF l_prim_qty IS NULL THEN
1522: ,to_unit => l_to_um
1523: ,from_name => NULL
1524: ,to_name => NULL);
1525: IF l_prim_qty = -99999 THEN
1526: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1527: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' rsrv_mode - DTL to PRIM - inv_convert.inv_um_convert returned error');
1528: END IF;
1529: RAISE um_convert_error;
1530: END IF;
1523: ,from_name => NULL
1524: ,to_name => NULL);
1525: IF l_prim_qty = -99999 THEN
1526: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1527: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' rsrv_mode - DTL to PRIM - inv_convert.inv_um_convert returned error');
1528: END IF;
1529: RAISE um_convert_error;
1530: END IF;
1531: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1527: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' rsrv_mode - DTL to PRIM - inv_convert.inv_um_convert returned error');
1528: END IF;
1529: RAISE um_convert_error;
1530: END IF;
1531: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1532: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated prim qty for call to gme_reservations_pvt.relieve_reservation: l_prim_qty= '||to_char(l_prim_qty));
1533: END IF;
1534: END IF;
1535: gme_reservations_pvt.relieve_reservation
1528: END IF;
1529: RAISE um_convert_error;
1530: END IF;
1531: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1532: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' calculated prim qty for call to gme_reservations_pvt.relieve_reservation: l_prim_qty= '||to_char(l_prim_qty));
1533: END IF;
1534: END IF;
1535: gme_reservations_pvt.relieve_reservation
1536: (p_reservation_id => p_rsrv_rec.reservation_id
1541: RAISE error_relieve_rsrv;
1542: END IF;
1543:
1544: -- Bug 4899399 - after relieving the reservation, informing the GMO about the transaction.
1545: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1546: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'dispense_ind'||p_mtl_dtl_rec.dispense_ind);
1547: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'trans type_id'||l_transaction_rec.transaction_type_id);
1548: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'ext sour line_id'||p_rsrv_rec.external_source_line_id);
1549:
1542: END IF;
1543:
1544: -- Bug 4899399 - after relieving the reservation, informing the GMO about the transaction.
1545: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1546: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'dispense_ind'||p_mtl_dtl_rec.dispense_ind);
1547: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'trans type_id'||l_transaction_rec.transaction_type_id);
1548: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'ext sour line_id'||p_rsrv_rec.external_source_line_id);
1549:
1550: END IF;
1543:
1544: -- Bug 4899399 - after relieving the reservation, informing the GMO about the transaction.
1545: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1546: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'dispense_ind'||p_mtl_dtl_rec.dispense_ind);
1547: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'trans type_id'||l_transaction_rec.transaction_type_id);
1548: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'ext sour line_id'||p_rsrv_rec.external_source_line_id);
1549:
1550: END IF;
1551: IF NVL(p_dispense_ind,'N') = 'Y' THEN
1544: -- Bug 4899399 - after relieving the reservation, informing the GMO about the transaction.
1545: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1546: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'dispense_ind'||p_mtl_dtl_rec.dispense_ind);
1547: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'trans type_id'||l_transaction_rec.transaction_type_id);
1548: gme_debug.put_line (g_pkg_name||'.'||l_api_name||'ext sour line_id'||p_rsrv_rec.external_source_line_id);
1549:
1550: END IF;
1551: IF NVL(p_dispense_ind,'N') = 'Y' THEN
1552: IF l_transaction_rec.transaction_type_id = gme_common_pvt.g_ing_issue THEN
1568: END IF;
1569: END IF;
1570: END IF;
1571:
1572: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1573: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1574: END IF;
1575:
1576:
1569: END IF;
1570: END IF;
1571:
1572: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1573: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1574: END IF;
1575:
1576:
1577: EXCEPTION
1591: WHEN dispense_error THEN
1592: x_return_status := fnd_api.g_ret_sts_error;
1593: WHEN OTHERS THEN
1594: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1595: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
1596: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
1597: END IF;
1598: x_return_status := FND_API.g_ret_sts_unexp_error;
1599: END build_and_create_transaction;
1592: x_return_status := fnd_api.g_ret_sts_error;
1593: WHEN OTHERS THEN
1594: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1595: IF (NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT) THEN
1596: gme_debug.put_line ('Unexpected error: '||g_pkg_name||'.'||l_api_name||': '||SQLERRM);
1597: END IF;
1598: x_return_status := FND_API.g_ret_sts_unexp_error;
1599: END build_and_create_transaction;
1600:
1608:
1609: l_api_name CONSTANT VARCHAR2 (30) := 'CONSTR_MMTI_FROM_RESERVATION';
1610: BEGIN
1611:
1612: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1613: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1614: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' reservation_id='||p_rsrv_rec.reservation_id);
1615: END IF;
1616:
1609: l_api_name CONSTANT VARCHAR2 (30) := 'CONSTR_MMTI_FROM_RESERVATION';
1610: BEGIN
1611:
1612: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1613: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1614: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' reservation_id='||p_rsrv_rec.reservation_id);
1615: END IF;
1616:
1617: /* Initially let us assign the return status to success */
1610: BEGIN
1611:
1612: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1613: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1614: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' reservation_id='||p_rsrv_rec.reservation_id);
1615: END IF;
1616:
1617: /* Initially let us assign the return status to success */
1618: x_return_status := FND_API.g_ret_sts_success;
1637: -- Bug 6437252 LPN Support
1638: IF p_rsrv_rec.lpn_id IS NOT NULL THEN
1639: x_mmti_rec.lpn_id := p_rsrv_rec.lpn_id;
1640: END IF;
1641: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1642: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1643: END IF;
1644:
1645:
1638: IF p_rsrv_rec.lpn_id IS NOT NULL THEN
1639: x_mmti_rec.lpn_id := p_rsrv_rec.lpn_id;
1640: END IF;
1641: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1642: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1643: END IF;
1644:
1645:
1646: EXCEPTION
1665:
1666: l_api_name CONSTANT VARCHAR2 (30) := 'CONSTR_MMTI_FROM_QTY_TREE';
1667: BEGIN
1668:
1669: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1670: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1671: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1672: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1673: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1666: l_api_name CONSTANT VARCHAR2 (30) := 'CONSTR_MMTI_FROM_QTY_TREE';
1667: BEGIN
1668:
1669: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1670: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1671: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1672: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1673: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1674: END IF;
1667: BEGIN
1668:
1669: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1670: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1671: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1672: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1673: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1674: END IF;
1675:
1668:
1669: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1670: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1671: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1672: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1673: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1674: END IF;
1675:
1676: /* Initially let us assign the return status to success */
1669: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1670: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1671: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_mtl_dtl_rec.material_detail_id);
1672: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_subinv='||p_subinv);
1673: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_locator_id='||p_locator_id);
1674: END IF;
1675:
1676: /* Initially let us assign the return status to success */
1677: x_return_status := FND_API.g_ret_sts_success;
1683: x_mmti_rec.organization_id := p_mtl_dtl_rec.organization_id;
1684: x_mmti_rec.subinventory_code := p_subinv;
1685: x_mmti_rec.locator_id := p_locator_id;
1686:
1687: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1688: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1689: END IF;
1690:
1691: EXCEPTION
1684: x_mmti_rec.subinventory_code := p_subinv;
1685: x_mmti_rec.locator_id := p_locator_id;
1686:
1687: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1688: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1689: END IF;
1690:
1691: EXCEPTION
1692: WHEN FND_API.G_EXC_ERROR THEN
1722:
1723: error_insert_exceptions EXCEPTION;
1724: error_no_exception EXCEPTION;
1725: BEGIN
1726: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1727: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
1729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
1730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
1723: error_insert_exceptions EXCEPTION;
1724: error_no_exception EXCEPTION;
1725: BEGIN
1726: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1727: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
1729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
1730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
1731: IF p_material_dtl_rec.phantom_line_id IS NOT NULL THEN
1724: error_no_exception EXCEPTION;
1725: BEGIN
1726: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1727: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
1729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
1730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
1731: IF p_material_dtl_rec.phantom_line_id IS NOT NULL THEN
1732: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' this is a PHANTOM');
1725: BEGIN
1726: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1727: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
1729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
1730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
1731: IF p_material_dtl_rec.phantom_line_id IS NOT NULL THEN
1732: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' this is a PHANTOM');
1733: END IF;
1726: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1727: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
1729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
1730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
1731: IF p_material_dtl_rec.phantom_line_id IS NOT NULL THEN
1732: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' this is a PHANTOM');
1733: END IF;
1734:
1728: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' material_detail_id='||p_material_dtl_rec.material_detail_id);
1729: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_no='||p_material_dtl_rec.line_no);
1730: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' line_type='||p_material_dtl_rec.line_type);
1731: IF p_material_dtl_rec.phantom_line_id IS NOT NULL THEN
1732: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' this is a PHANTOM');
1733: END IF;
1734:
1735: IF p_pending_move_order_ind IS NULL THEN
1736: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_move_order_ind IS NULL');
1732: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' this is a PHANTOM');
1733: END IF;
1734:
1735: IF p_pending_move_order_ind IS NULL THEN
1736: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_move_order_ind IS NULL');
1737: ELSIF p_pending_move_order_ind THEN
1738: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_move_order_ind = TRUE');
1739: ELSE
1740: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_move_order_ind = FALSE');
1734:
1735: IF p_pending_move_order_ind IS NULL THEN
1736: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_move_order_ind IS NULL');
1737: ELSIF p_pending_move_order_ind THEN
1738: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_move_order_ind = TRUE');
1739: ELSE
1740: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_move_order_ind = FALSE');
1741: END IF;
1742:
1736: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_move_order_ind IS NULL');
1737: ELSIF p_pending_move_order_ind THEN
1738: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_move_order_ind = TRUE');
1739: ELSE
1740: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_move_order_ind = FALSE');
1741: END IF;
1742:
1743: IF p_pending_rsrv_ind IS NULL THEN
1744: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_rsrv_ind IS NULL');
1740: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_move_order_ind = FALSE');
1741: END IF;
1742:
1743: IF p_pending_rsrv_ind IS NULL THEN
1744: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_rsrv_ind IS NULL');
1745: ELSIF p_pending_rsrv_ind THEN
1746: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_rsrv_ind = TRUE');
1747: ELSE
1748: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_rsrv_ind = FALSE');
1742:
1743: IF p_pending_rsrv_ind IS NULL THEN
1744: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_rsrv_ind IS NULL');
1745: ELSIF p_pending_rsrv_ind THEN
1746: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_rsrv_ind = TRUE');
1747: ELSE
1748: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_rsrv_ind = FALSE');
1749: END IF;
1750:
1744: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_rsrv_ind IS NULL');
1745: ELSIF p_pending_rsrv_ind THEN
1746: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_rsrv_ind = TRUE');
1747: ELSE
1748: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_rsrv_ind = FALSE');
1749: END IF;
1750:
1751: IF p_transacted_qty IS NULL THEN
1752: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_transacted_qty IS NULL');
1748: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_pending_rsrv_ind = FALSE');
1749: END IF;
1750:
1751: IF p_transacted_qty IS NULL THEN
1752: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_transacted_qty IS NULL');
1753: ELSE
1754: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_transacted_qty = '||p_transacted_qty);
1755: END IF;
1756:
1750:
1751: IF p_transacted_qty IS NULL THEN
1752: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_transacted_qty IS NULL');
1753: ELSE
1754: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_transacted_qty = '||p_transacted_qty);
1755: END IF;
1756:
1757: IF p_exception_qty IS NULL THEN
1758: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_exception_qty IS NULL');
1754: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_transacted_qty = '||p_transacted_qty);
1755: END IF;
1756:
1757: IF p_exception_qty IS NULL THEN
1758: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_exception_qty IS NULL');
1759: ELSE
1760: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_exception_qty = '||p_exception_qty);
1761: END IF;
1762:
1756:
1757: IF p_exception_qty IS NULL THEN
1758: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_exception_qty IS NULL');
1759: ELSE
1760: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' p_exception_qty = '||p_exception_qty);
1761: END IF;
1762:
1763: END IF;
1764:
1775: END IF;
1776:
1777: IF p_material_dtl_rec.line_type = gme_common_pvt.g_line_type_ing AND p_material_dtl_rec.phantom_line_id IS NOT NULL THEN
1778: -- don't report the phantom ingredients; just return; phantom products will be reported
1779: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1780: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' called for phantom ingredient... returning, only report for phantom product');
1781: END IF;
1782: RAISE error_no_exception;
1783: END IF;
1776:
1777: IF p_material_dtl_rec.line_type = gme_common_pvt.g_line_type_ing AND p_material_dtl_rec.phantom_line_id IS NOT NULL THEN
1778: -- don't report the phantom ingredients; just return; phantom products will be reported
1779: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1780: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' called for phantom ingredient... returning, only report for phantom product');
1781: END IF;
1782: RAISE error_no_exception;
1783: END IF;
1784:
1838: END IF;
1839:
1840: x_return_status := gme_common_pvt.g_exceptions_err;
1841: ELSE
1842: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1843: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception not found');
1844: END IF;
1845: END IF;
1846:
1839:
1840: x_return_status := gme_common_pvt.g_exceptions_err;
1841: ELSE
1842: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1843: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception not found');
1844: END IF;
1845: END IF;
1846:
1847: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1843: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' exception not found');
1844: END IF;
1845: END IF;
1846:
1847: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1848: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name||' with return status= '||x_return_status);
1849: END IF;
1850: EXCEPTION
1851: WHEN error_insert_exceptions THEN
1844: END IF;
1845: END IF;
1846:
1847: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1848: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name||' with return status= '||x_return_status);
1849: END IF;
1850: EXCEPTION
1851: WHEN error_insert_exceptions THEN
1852: x_return_status := FND_API.G_RET_STS_ERROR;
1852: x_return_status := FND_API.G_RET_STS_ERROR;
1853: WHEN error_no_exception THEN
1854: NULL;
1855: WHEN OTHERS THEN
1856: IF nvl(g_debug, gme_debug.g_log_unexpected + 1) <= gme_debug.g_log_unexpected THEN
1857: gme_debug.put_line('When others exception in '||g_pkg_name||'.'||l_api_name||' Error is ' || SQLERRM);
1858: END IF;
1859: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
1860: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1853: WHEN error_no_exception THEN
1854: NULL;
1855: WHEN OTHERS THEN
1856: IF nvl(g_debug, gme_debug.g_log_unexpected + 1) <= gme_debug.g_log_unexpected THEN
1857: gme_debug.put_line('When others exception in '||g_pkg_name||'.'||l_api_name||' Error is ' || SQLERRM);
1858: END IF;
1859: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
1860: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1861: END create_batch_exception;
1898: error_unexp_phantom EXCEPTION;
1899: error_unexp_downstream EXCEPTION;
1900:
1901: BEGIN
1902: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1903: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1904: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batch_id='||p_batch_id);
1905: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batchstep_id='||p_batchstep_id);
1906: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' mode='||p_auto_by_step);
1899: error_unexp_downstream EXCEPTION;
1900:
1901: BEGIN
1902: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1903: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1904: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batch_id='||p_batch_id);
1905: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batchstep_id='||p_batchstep_id);
1906: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' mode='||p_auto_by_step);
1907: END IF;
1900:
1901: BEGIN
1902: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1903: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1904: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batch_id='||p_batch_id);
1905: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batchstep_id='||p_batchstep_id);
1906: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' mode='||p_auto_by_step);
1907: END IF;
1908:
1901: BEGIN
1902: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1903: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1904: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batch_id='||p_batch_id);
1905: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batchstep_id='||p_batchstep_id);
1906: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' mode='||p_auto_by_step);
1907: END IF;
1908:
1909: x_return_status := FND_API.G_RET_STS_SUCCESS;
1902: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1903: gme_debug.put_line('Entering api '||g_pkg_name||'.'||l_api_name);
1904: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batch_id='||p_batch_id);
1905: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' batchstep_id='||p_batchstep_id);
1906: gme_debug.put_line(g_pkg_name||'.'||l_api_name||' mode='||p_auto_by_step);
1907: END IF;
1908:
1909: x_return_status := FND_API.G_RET_STS_SUCCESS;
1910:
1916: l_matl_dtl_id := l_matl_dtl_tab(i).material_detail_id;
1917: l_phantom_id := l_matl_dtl_tab(i).phantom_id;
1918: l_release_type := l_matl_dtl_tab(i).release_type;
1919:
1920: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1921: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' phantom ingredient found: material_detail_id='||l_matl_dtl_id);
1922: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' partner phantom batch id: batch_id='||l_phantom_id);
1923: END IF;
1924:
1917: l_phantom_id := l_matl_dtl_tab(i).phantom_id;
1918: l_release_type := l_matl_dtl_tab(i).release_type;
1919:
1920: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1921: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' phantom ingredient found: material_detail_id='||l_matl_dtl_id);
1922: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' partner phantom batch id: batch_id='||l_phantom_id);
1923: END IF;
1924:
1925: IF p_auto_by_step IN (0,1) AND l_release_type = gme_common_pvt.g_mtl_autobystep_release THEN
1918: l_release_type := l_matl_dtl_tab(i).release_type;
1919:
1920: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1921: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' phantom ingredient found: material_detail_id='||l_matl_dtl_id);
1922: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' partner phantom batch id: batch_id='||l_phantom_id);
1923: END IF;
1924:
1925: IF p_auto_by_step IN (0,1) AND l_release_type = gme_common_pvt.g_mtl_autobystep_release THEN
1926: OPEN Cur_associated_step(l_matl_dtl_id);
1936: l_step_id = p_batchstep_id AND
1937: l_release_type = gme_common_pvt.g_mtl_autobystep_release) OR
1938: (p_auto_by_step = 2)) THEN
1939: IF l_phantom_id IS NULL THEN
1940: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1941: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' phantom ingredient unexploded: material_detail_id='||l_matl_dtl_id);
1942: END IF;
1943: RAISE error_unexp_phantom;
1944: END IF;
1937: l_release_type = gme_common_pvt.g_mtl_autobystep_release) OR
1938: (p_auto_by_step = 2)) THEN
1939: IF l_phantom_id IS NULL THEN
1940: IF ( NVL(G_DEBUG,-1) = GME_DEBUG.G_LOG_STATEMENT ) THEN
1941: gme_debug.put_line (g_pkg_name||'.'||l_api_name||' phantom ingredient unexploded: material_detail_id='||l_matl_dtl_id);
1942: END IF;
1943: RAISE error_unexp_phantom;
1944: END IF;
1945:
1955: END IF;
1956: END IF;
1957: END LOOP;
1958:
1959: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1960: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1961: END IF;
1962:
1963: EXCEPTION
1956: END IF;
1957: END LOOP;
1958:
1959: IF nvl(g_debug, gme_debug.g_log_procedure + 1) <= gme_debug.g_log_procedure THEN
1960: gme_debug.put_line('Exiting api '||g_pkg_name||'.'||l_api_name);
1961: END IF;
1962:
1963: EXCEPTION
1964: WHEN error_unexp_phantom THEN
1966: x_return_status := FND_API.G_RET_STS_ERROR;
1967: WHEN error_unexp_downstream THEN
1968: NULL;
1969: WHEN OTHERS THEN
1970: IF nvl(g_debug, gme_debug.g_log_unexpected + 1) <= gme_debug.g_log_unexpected THEN
1971: gme_debug.put_line('When others exception in '||g_pkg_name||'.'||l_api_name||' Error is ' || SQLERRM);
1972: END IF;
1973: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
1974: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1967: WHEN error_unexp_downstream THEN
1968: NULL;
1969: WHEN OTHERS THEN
1970: IF nvl(g_debug, gme_debug.g_log_unexpected + 1) <= gme_debug.g_log_unexpected THEN
1971: gme_debug.put_line('When others exception in '||g_pkg_name||'.'||l_api_name||' Error is ' || SQLERRM);
1972: END IF;
1973: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
1974: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1975: END check_unexploded_phantom;
2006: error_vr_dates EXCEPTION;
2007: error_validation EXCEPTION;
2008:
2009: BEGIN
2010: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
2011: gme_debug.g_log_procedure THEN
2012: gme_debug.put_line ('Entering api ' || g_pkg_name || '.'
2013: || l_api_name);
2014: END IF;
2007: error_validation EXCEPTION;
2008:
2009: BEGIN
2010: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
2011: gme_debug.g_log_procedure THEN
2012: gme_debug.put_line ('Entering api ' || g_pkg_name || '.'
2013: || l_api_name);
2014: END IF;
2015:
2008:
2009: BEGIN
2010: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
2011: gme_debug.g_log_procedure THEN
2012: gme_debug.put_line ('Entering api ' || g_pkg_name || '.'
2013: || l_api_name);
2014: END IF;
2015:
2016: x_return_status := FND_API.g_ret_sts_success;
2093: IF x_return_status <> fnd_api.g_ret_sts_success THEN
2094: RAISE error_validation;
2095: END IF;
2096:
2097: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
2098: gme_debug.g_log_procedure THEN
2099: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
2100: END IF;
2101:
2094: RAISE error_validation;
2095: END IF;
2096:
2097: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
2098: gme_debug.g_log_procedure THEN
2099: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
2100: END IF;
2101:
2102: EXCEPTION
2095: END IF;
2096:
2097: IF NVL (g_debug, gme_debug.g_log_procedure + 1) <=
2098: gme_debug.g_log_procedure THEN
2099: gme_debug.put_line ('Exiting api ' || g_pkg_name || '.' || l_api_name);
2100: END IF;
2101:
2102: EXCEPTION
2103: WHEN error_validation THEN
2122: x_return_status := fnd_api.g_ret_sts_error;
2123: WHEN OTHERS THEN
2124: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
2125:
2126: IF g_debug <= gme_debug.g_log_procedure THEN
2127: gme_debug.put_line ( 'Unexpected error: '
2128: || g_pkg_name
2129: || '.'
2130: || l_api_name
2123: WHEN OTHERS THEN
2124: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
2125:
2126: IF g_debug <= gme_debug.g_log_procedure THEN
2127: gme_debug.put_line ( 'Unexpected error: '
2128: || g_pkg_name
2129: || '.'
2130: || l_api_name
2131: || ': '