170: IS
171:
172: CURSOR line_location_cur IS
173: SELECT closed_code
174: FROM po_line_locations_all
175: WHERE po_header_id = v_po_header_id
176: AND po_line_id = v_po_line_id
177: AND org_id = v_org_id;
178:
182: WHERE po_header_id = v_po_header_id
183: AND po_line_id = v_po_line_id
184: AND org_id = v_org_id;
185:
186: v_closed_code po_line_locations_all.closed_code%TYPE;
187: v_new_status po_lines_all.closed_code%TYPE;
188: v_old_status po_lines_all.closed_code%TYPE;
189: v_all_locations_closed BOOLEAN :=TRUE;
190:
263: IS
264:
265: CURSOR line_location_cur IS
266: SELECT closed_code
267: FROM po_line_locations_all
268: WHERE po_header_id = v_po_header_id
269: AND po_release_id = v_po_release_id
270: AND org_id = v_org_id;
271:
275: WHERE po_header_id = v_po_header_id
276: AND po_release_id = v_po_release_id
277: AND org_id = v_org_id;
278:
279: v_closed_code po_line_locations_all.closed_code%TYPE;
280: v_new_status po_lines_all.closed_code%TYPE;
281: v_old_status po_lines_all.closed_code%TYPE;
282: v_all_locations_closed BOOLEAN :=TRUE;
283:
354: v_returned_qty IN po_rtrn_dtl.return_qty1%TYPE,
355: v_created_by IN po_recv_dtl.created_by%TYPE,
356: v_timestamp IN cpg_oragems_mapping.time_stamp%TYPE)
357: IS
358: v_closed_code po_line_locations_all.closed_code%TYPE;
359: v_last_updated_by po_line_locations_all.last_updated_by%TYPE;
360: v_closed_reason po_line_locations_all.closed_reason%TYPE;
361: v_closed_date po_line_locations_all.closed_date%TYPE;
362: v_closed_by po_line_locations_all.closed_by%TYPE;
355: v_created_by IN po_recv_dtl.created_by%TYPE,
356: v_timestamp IN cpg_oragems_mapping.time_stamp%TYPE)
357: IS
358: v_closed_code po_line_locations_all.closed_code%TYPE;
359: v_last_updated_by po_line_locations_all.last_updated_by%TYPE;
360: v_closed_reason po_line_locations_all.closed_reason%TYPE;
361: v_closed_date po_line_locations_all.closed_date%TYPE;
362: v_closed_by po_line_locations_all.closed_by%TYPE;
363: v_close_status po_line_locations_all.closed_code%TYPE;
356: v_timestamp IN cpg_oragems_mapping.time_stamp%TYPE)
357: IS
358: v_closed_code po_line_locations_all.closed_code%TYPE;
359: v_last_updated_by po_line_locations_all.last_updated_by%TYPE;
360: v_closed_reason po_line_locations_all.closed_reason%TYPE;
361: v_closed_date po_line_locations_all.closed_date%TYPE;
362: v_closed_by po_line_locations_all.closed_by%TYPE;
363: v_close_status po_line_locations_all.closed_code%TYPE;
364: v_source_shipment_id po_line_locations_all.source_shipment_id%TYPE;
357: IS
358: v_closed_code po_line_locations_all.closed_code%TYPE;
359: v_last_updated_by po_line_locations_all.last_updated_by%TYPE;
360: v_closed_reason po_line_locations_all.closed_reason%TYPE;
361: v_closed_date po_line_locations_all.closed_date%TYPE;
362: v_closed_by po_line_locations_all.closed_by%TYPE;
363: v_close_status po_line_locations_all.closed_code%TYPE;
364: v_source_shipment_id po_line_locations_all.source_shipment_id%TYPE;
365: v_canceled VARCHAR2(1);
358: v_closed_code po_line_locations_all.closed_code%TYPE;
359: v_last_updated_by po_line_locations_all.last_updated_by%TYPE;
360: v_closed_reason po_line_locations_all.closed_reason%TYPE;
361: v_closed_date po_line_locations_all.closed_date%TYPE;
362: v_closed_by po_line_locations_all.closed_by%TYPE;
363: v_close_status po_line_locations_all.closed_code%TYPE;
364: v_source_shipment_id po_line_locations_all.source_shipment_id%TYPE;
365: v_canceled VARCHAR2(1);
366:
359: v_last_updated_by po_line_locations_all.last_updated_by%TYPE;
360: v_closed_reason po_line_locations_all.closed_reason%TYPE;
361: v_closed_date po_line_locations_all.closed_date%TYPE;
362: v_closed_by po_line_locations_all.closed_by%TYPE;
363: v_close_status po_line_locations_all.closed_code%TYPE;
364: v_source_shipment_id po_line_locations_all.source_shipment_id%TYPE;
365: v_canceled VARCHAR2(1);
366:
367: /* NC 12/16/99 */
360: v_closed_reason po_line_locations_all.closed_reason%TYPE;
361: v_closed_date po_line_locations_all.closed_date%TYPE;
362: v_closed_by po_line_locations_all.closed_by%TYPE;
363: v_close_status po_line_locations_all.closed_code%TYPE;
364: v_source_shipment_id po_line_locations_all.source_shipment_id%TYPE;
365: v_canceled VARCHAR2(1);
366:
367: /* NC 12/16/99 */
368: v_user_id NUMBER;
371:
372:
373: CURSOR canceled_cur IS
374: SELECT cancel_flag
375: FROM po_line_locations_all
376: WHERE line_location_id = v_line_location_id;
377:
378: CURSOR close_status_cur IS
379: SELECT closed_code
376: WHERE line_location_id = v_line_location_id;
377:
378: CURSOR close_status_cur IS
379: SELECT closed_code
380: FROM po_line_locations_all
381: WHERE line_location_id = v_line_location_id;
382:
383: CURSOR po_cur IS
384: SELECT segment1
391: WHERE po_line_id = v_po_line_id;
392:
393: CURSOR shipment_cur IS
394: SELECT shipment_num
395: FROM po_line_locations_all
396: WHERE line_location_id = v_line_location_id;
397:
398: CURSOR user_id_cur IS
399: SELECT user_id
423: /* CLOSE user_id_cur; */
424:
425: v_last_updated_by := v_created_by;
426:
427: /* When closed_code is updated in po_line_locations_all, a trigger on
428: that table tries to fire a concurrent program. For some reason
429: the FND_GLOBAL user_id and resp_id had wrong values becoz of which
430: the concurrenct request was not getting fired( returning "CONC-Unable to
431: get oracle name") error. Hence added the following APPS_INITIALIZE call.
459: v_closed_date := NULL;
460: v_closed_by := NULL;
461: END IF;
462:
463: UPDATE po_line_locations_all
464: SET last_update_date = v_timestamp,
465: last_updated_by = v_last_updated_by,
466: quantity_received = v_received_qty,
467: quantity_rejected = v_returned_qty
474: /* IF it is a Blanket or a Planned PO, Update Recd qty for the Parent Line*/
475:
476: SELECT source_shipment_id
477: INTO v_source_shipment_id
478: FROM po_line_locations_all
479: WHERE line_location_id = v_line_location_id;
480:
481: UPDATE po_line_locations_all
482: SET last_update_date = v_timestamp,
477: INTO v_source_shipment_id
478: FROM po_line_locations_all
479: WHERE line_location_id = v_line_location_id;
480:
481: UPDATE po_line_locations_all
482: SET last_update_date = v_timestamp,
483: last_updated_by = v_last_updated_by,
484: quantity_received = (select sum(quantity_received)
485: from po_line_locations_all
481: UPDATE po_line_locations_all
482: SET last_update_date = v_timestamp,
483: last_updated_by = v_last_updated_by,
484: quantity_received = (select sum(quantity_received)
485: from po_line_locations_all
486: where source_shipment_id = v_source_shipment_id),
487: quantity_rejected = (select sum(quantity_rejected)
488: from po_line_locations_all
489: where source_shipment_id = v_source_shipment_id)
484: quantity_received = (select sum(quantity_received)
485: from po_line_locations_all
486: where source_shipment_id = v_source_shipment_id),
487: quantity_rejected = (select sum(quantity_rejected)
488: from po_line_locations_all
489: where source_shipment_id = v_source_shipment_id)
490: WHERE po_header_id = v_po_header_id
491: AND po_line_id = v_po_line_id
492: AND line_location_id = (select source_shipment_id
489: where source_shipment_id = v_source_shipment_id)
490: WHERE po_header_id = v_po_header_id
491: AND po_line_id = v_po_line_id
492: AND line_location_id = (select source_shipment_id
493: from po_line_locations_all
494: where line_location_id = v_line_location_id)
495: AND org_id = v_org_id;
496:
497: OPEN canceled_cur;
523: ELSE
524: /* BUG#:1222247 */
525: /* Commented following 3 lines.Prevent updating unnecessary fields */
526:
527: UPDATE po_line_locations_all
528: SET closed_code = v_closed_code
529: /* closed_reason = v_closed_reason, */
530: /* closed_date = v_closed_date, */
531: /* closed_by = v_closed_by */