202: po_session_gt gt
203: WHERE gt.key=p_key
204: AND poll.line_location_id = gt.index_num1 -- lowestentityid i.e.
205: AND poll.po_line_id = pol.po_line_id
206: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
207: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
208: AND ((POLL.matching_basis ='QUANTITY'
209: AND round(nvl(POLL.quantity_received,0),5) >0
210: AND round(nvl(POLL.quantity_received,0),5) > = round(nvl(POLL.quantity,0),5))
203: WHERE gt.key=p_key
204: AND poll.line_location_id = gt.index_num1 -- lowestentityid i.e.
205: AND poll.po_line_id = pol.po_line_id
206: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
207: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
208: AND ((POLL.matching_basis ='QUANTITY'
209: AND round(nvl(POLL.quantity_received,0),5) >0
210: AND round(nvl(POLL.quantity_received,0),5) > = round(nvl(POLL.quantity,0),5))
211: OR
366: po_lines pol,
367: po_session_gt gt
368: WHERE
369: gt.key = p_key
370: AND gt.char1 = po_document_cancel_pvt.c_doc_type_PA
371: AND gt.char2 <>po_document_cancel_pvt.c_doc_subtype_contract
372: AND pol.po_line_id=gt.index_num1
373: AND nvl(POL.allow_price_override_flag, 'N') = 'Y'
374: AND POL.not_to_exceed_price IS NOT NULL
367: po_session_gt gt
368: WHERE
369: gt.key = p_key
370: AND gt.char1 = po_document_cancel_pvt.c_doc_type_PA
371: AND gt.char2 <>po_document_cancel_pvt.c_doc_subtype_contract
372: AND pol.po_line_id=gt.index_num1
373: AND nvl(POL.allow_price_override_flag, 'N') = 'Y'
374: AND POL.not_to_exceed_price IS NOT NULL
375: AND ((POL.unit_price IS NOT NULL and POL.not_to_exceed_price < POL.unit_price)
533: AND gt.num1 IN
534: (SELECT pol1.po_line_id
535: FROM po_lines pol1
536: WHERE pol1.po_line_id=pol.po_line_id
537: AND gt.char3=po_document_cancel_pvt.c_entity_level_LINE
538: UNION ALL
539: SELECT pol1.po_header_id
540: FROM po_lines pol1
541: WHERE pol1.po_line_id=pol.po_line_id
538: UNION ALL
539: SELECT pol1.po_header_id
540: FROM po_lines pol1
541: WHERE pol1.po_line_id=pol.po_line_id
542: AND gt.char3=po_document_cancel_pvt.c_entity_level_HEADER)),
543: (SELECT gt.char3
544: FROM po_session_gt gt
545: WHERE
546: gt.KEY=p_key
547: AND gt.num1 IN
548: (SELECT pol1.po_line_id
549: FROM po_lines pol1
550: WHERE pol1.po_line_id=pol.po_line_id
551: AND gt.char3=po_document_cancel_pvt.c_entity_level_LINE
552: UNION ALL
553: SELECT pol1.po_header_id
554: FROM po_lines pol1
555: WHERE pol1.po_line_id=pol.po_line_id
552: UNION ALL
553: SELECT pol1.po_header_id
554: FROM po_lines pol1
555: WHERE pol1.po_line_id=pol.po_line_id
556: AND gt.char3=po_document_cancel_pvt.c_entity_level_HEADER))
557:
558: FROM
559: po_lines pol
560: WHERE
563: FROM po_line_locations,
564: po_session_gt gt
565: WHERE gt.KEY=p_key
566: AND line_location_id= gt.index_num1 -- lowestentityid)
567: AND gt.char1 = po_document_cancel_pvt.c_doc_type_PO
568: AND gt.char3<> po_document_cancel_pvt.c_entity_level_SHIPMENT)
569:
570: AND ((POL.quantity IS NOT null
571: AND pol.quantity <> (SELECT Sum(poll.quantity - nvl(poll.quantity_cancelled,0))
564: po_session_gt gt
565: WHERE gt.KEY=p_key
566: AND line_location_id= gt.index_num1 -- lowestentityid)
567: AND gt.char1 = po_document_cancel_pvt.c_doc_type_PO
568: AND gt.char3<> po_document_cancel_pvt.c_entity_level_SHIPMENT)
569:
570: AND ((POL.quantity IS NOT null
571: AND pol.quantity <> (SELECT Sum(poll.quantity - nvl(poll.quantity_cancelled,0))
572: FROM po_line_locations poll
733: WHERE
734: gt.key=p_key
735: AND poll.line_location_id = gt.index_num1 -- lowestentityid i.e.
736: AND poll.po_line_id = pol.po_line_id
737: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
738: AND pol.unit_price <> poll.price_override
739: AND poll.shipment_type in ('STANDARD','PLANNED')
740: AND po_control_action_validations.is_complex_work_po(poll.po_header_id) ='N'
741: );
913: WHERE
914: gt.key=p_key
915: AND poll.line_location_id = gt.index_num1 -- lowestentityid i.e.
916: AND poll.po_line_id = pol.po_line_id
917: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
918: AND ((POLL.quantity IS NOT null
919: AND POLL.quantity <> (SELECT sum(POD2.quantity_ordered)
920: FROM PO_DISTRIBUTIONS_ALL POD2
921: WHERE POD2.line_location_id = poll.line_location_id ))
1089: WHERE
1090: gt.key=p_key
1091: AND poll.line_location_id = gt.index_num1 -- i.e lowestentityid .
1092: AND poll.po_line_id = pol.po_line_id
1093: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
1094: AND Nvl(poll.LCM_FLAG,'N') = 'Y'
1095: AND Nvl(poll.match_option,'P') <> 'R');
1096:
1097:
1259: gt.key=p_key
1260: AND poll.line_location_id = gt.index_num1 -- i.e lowestentityid .
1261: AND poll.po_line_id = pol.po_line_id
1262: AND poll.line_location_id=pod.line_location_id
1263: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
1264: AND Nvl(poll.LCM_FLAG,'N') = 'Y'
1265: AND pod.DESTINATION_TYPE_CODE <> 'INVENTORY');
1266:
1267:
1434: gt.key=p_key
1435: AND pod.line_location_id = gt.index_num1
1436: AND pod.line_location_id = poll.line_location_id
1437: AND pol.po_line_id = poll.po_line_id
1438: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
1439: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
1440: AND ((POLL.matching_basis ='QUANTITY'
1441: AND nvl(pod.quantity_delivered,0)> 0
1442: AND round(nvl(pod.quantity_delivered,0),5) > round(nvl(pod.quantity_ordered,0),5)) --Bug15869000
1435: AND pod.line_location_id = gt.index_num1
1436: AND pod.line_location_id = poll.line_location_id
1437: AND pol.po_line_id = poll.po_line_id
1438: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
1439: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
1440: AND ((POLL.matching_basis ='QUANTITY'
1441: AND nvl(pod.quantity_delivered,0)> 0
1442: AND round(nvl(pod.quantity_delivered,0),5) > round(nvl(pod.quantity_ordered,0),5)) --Bug15869000
1443: OR
1621: gt.key=p_key
1622: AND pod.line_location_id = gt.index_num1
1623: AND pod.line_location_id = poll.line_location_id
1624: AND pol.po_line_id = poll.po_line_id
1625: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
1626: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
1627: AND ((POLL.matching_basis ='QUANTITY'
1628: AND nvl(DECODE(POD.distribution_type,
1629: 'PREPAYMENT',
1622: AND pod.line_location_id = gt.index_num1
1623: AND pod.line_location_id = poll.line_location_id
1624: AND pol.po_line_id = poll.po_line_id
1625: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
1626: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
1627: AND ((POLL.matching_basis ='QUANTITY'
1628: AND nvl(DECODE(POD.distribution_type,
1629: 'PREPAYMENT',
1630: POD.quantity_financed,
1818: WHERE gt.key=p_key
1819: AND poll.line_location_id = gt.index_num1
1820: AND pol.po_line_id = poll.po_line_id
1821: AND nvl(POLL.receipt_required_flag, 'Y')<> 'N'
1822: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
1823: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
1824: AND ((POLL.matching_basis ='QUANTITY'
1825: AND nvl(DECODE(poll.shipment_type,
1826: 'PREPAYMENT',
1819: AND poll.line_location_id = gt.index_num1
1820: AND pol.po_line_id = poll.po_line_id
1821: AND nvl(POLL.receipt_required_flag, 'Y')<> 'N'
1822: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
1823: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
1824: AND ((POLL.matching_basis ='QUANTITY'
1825: AND nvl(DECODE(poll.shipment_type,
1826: 'PREPAYMENT',
1827: poll.quantity_financed,
2012: AND pod.line_location_id = gt.index_num1
2013: AND pod.line_location_id = poll.line_location_id
2014: AND pol.po_line_id = poll.po_line_id
2015: AND nvl(POLL.receipt_required_flag, 'Y')<> 'N'
2016: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
2017: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
2018: AND ((POLL.matching_basis ='QUANTITY'
2019: AND nvl(DECODE(pod.distribution_type,
2020: 'PREPAYMENT',
2013: AND pod.line_location_id = poll.line_location_id
2014: AND pol.po_line_id = poll.po_line_id
2015: AND nvl(POLL.receipt_required_flag, 'Y')<> 'N'
2016: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
2017: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
2018: AND ((POLL.matching_basis ='QUANTITY'
2019: AND nvl(DECODE(pod.distribution_type,
2020: 'PREPAYMENT',
2021: pod.quantity_financed,
2213:
2214: WHERE gt.KEY =p_key
2215: AND poll.line_location_id =gt.index_num1
2216: AND pol.po_line_id = poll.po_line_id
2217: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
2218: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
2219: AND ((poll.matching_basis = 'AMOUNT'
2220: AND nvl(poll.amount_received, 0) <>(SELECT Sum(Nvl(amount_delivered, 0))
2221: FROM po_distributions_all
2214: WHERE gt.KEY =p_key
2215: AND poll.line_location_id =gt.index_num1
2216: AND pol.po_line_id = poll.po_line_id
2217: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
2218: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
2219: AND ((poll.matching_basis = 'AMOUNT'
2220: AND nvl(poll.amount_received, 0) <>(SELECT Sum(Nvl(amount_delivered, 0))
2221: FROM po_distributions_all
2222: WHERE line_location_id=poll.line_location_id))
2374: WHERE
2375: gt.key=p_key
2376: AND poll.line_location_id =gt.index_num1
2377: AND pol.po_line_id = poll.po_line_id
2378: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
2379: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
2380: AND EXISTS
2381: (SELECT 'Pending Transaction'
2382: FROM RCV_TRANSACTIONS_INTERFACE RTI
2375: gt.key=p_key
2376: AND poll.line_location_id =gt.index_num1
2377: AND pol.po_line_id = poll.po_line_id
2378: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
2379: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
2380: AND EXISTS
2381: (SELECT 'Pending Transaction'
2382: FROM RCV_TRANSACTIONS_INTERFACE RTI
2383: WHERE RTI.processing_status_code = 'PENDING'
2529: po_session_gt gt
2530: WHERE gt.key=p_key
2531: AND poll.line_location_id =gt.index_num1
2532: AND pol.po_line_id = poll.po_line_id
2533: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
2534: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
2535: AND POLL.payment_type IS NULL
2536: AND EXISTS
2537: (SELECT 'ASN outstanding'
2530: WHERE gt.key=p_key
2531: AND poll.line_location_id =gt.index_num1
2532: AND pol.po_line_id = poll.po_line_id
2533: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
2534: AND gt.char2 <> po_document_cancel_pvt.c_doc_subtype_PLANNED
2535: AND POLL.payment_type IS NULL
2536: AND EXISTS
2537: (SELECT 'ASN outstanding'
2538: FROM RCV_SHIPMENT_LINES RSL
2701: AND POD.line_location_id = POLL.line_location_id
2702: AND POL.po_line_id = POLL.po_line_id
2703: AND POLL.shipment_type in ('STANDARD', 'PLANNED','PREPAYMENT')
2704: AND GCC.code_combination_id = POD.BUDGET_ACCOUNT_ID
2705: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
2706: AND fsp.purch_encumbrance_flag = 'Y'
2707: AND (GCC.enabled_flag <> 'Y' OR
2708: nvl(p_action_date,trunc(sysdate)) not between
2709: nvl(GCC.start_date_active, nvl(p_action_date,trunc(sysdate)-1))
2868: AND pod.line_location_id=gt.index_num1
2869: AND POD.line_location_id = POLL.line_location_id
2870: AND POL.po_line_id = POLL.po_line_id
2871: AND GCC.code_combination_id = POD.code_combination_id
2872: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
2873: AND (Nvl(GCC.enabled_flag,'N') <> 'Y' OR
2874: nvl(p_action_date,trunc(sysdate)) not between
2875: nvl(GCC.start_date_active, nvl(p_action_date,trunc(sysdate)-1))
2876: AND NVL(GCC.end_date_active, nvl(p_action_date,trunc(sysdate)+1))));
3023: po_session_gt gt
3024: WHERE gt.key=p_key
3025: AND poh.po_header_id=pol.po_header_id
3026: AND pol.po_line_id =gt.index_num1
3027: AND gt.char1 = po_document_cancel_pvt.c_doc_type_PA
3028: AND poh.global_agreement_flag = 'Y'
3029: AND EXISTS
3030: (SELECT 'Uncancelled std PO lines ref this ga line Exist'
3031: FROM po_lines POL1
3179: po_session_gt gt
3180: WHERE gt.key=p_key
3181: AND pol.po_line_id =gt.index_num1
3182: -- bug 16174863
3183: AND gt.char1 = po_document_cancel_pvt.c_doc_type_PA
3184: AND EXISTS
3185: (SELECT 'Uncancelled Releases Exist'
3186: FROM PO_LINE_LOCATIONS PLL
3187: WHERE PLL.po_line_id = POL.po_line_id
3192: SELECT 'Uncancelled Releases Exist'
3193: FROM po_releases por
3194: WHERE POR.po_header_id = pol.po_header_id
3195: -- bug 16590732: Do this check if it is Header level cancel
3196: AND gt.char3 = po_document_cancel_pvt.c_entity_level_header
3197: AND nvl(POR.cancel_flag,'N') = 'N'
3198: AND nvl(POR.closed_code,'OPEN') <> 'FINALLY CLOSED')
3199: );
3200: -- bug 16525950: seperately validate for Planned PO
3238: po_session_gt gt
3239: WHERE gt.key=p_key
3240: AND poll.LINE_LOCATION_ID =gt.index_num1
3241: AND pol.po_line_id =poll.po_line_id
3242: AND gt.char2 = po_document_cancel_pvt.c_doc_subtype_PLANNED
3243: AND EXISTS(
3244: SELECT 'Uncancelled Releases Exist'
3245: FROM PO_LINE_LOCATIONS PLL
3246: WHERE
3252: SELECT 'Uncancelled Releases Exist'
3253: FROM po_releases por
3254: WHERE POR.po_header_id = pol.po_header_id
3255: -- bug 16590732: Do this check if it is Header level cancel
3256: AND gt.char3 = po_document_cancel_pvt.c_entity_level_header
3257: AND nvl(POR.cancel_flag,'N') = 'N'
3258: AND nvl(POR.closed_code,'OPEN') <> 'FINALLY CLOSED')
3259: );
3260: p_sequence := P_SEQUENCE + SQL%ROWCOUNT;
3394: gt.char3
3395: FROM
3396: po_session_gt gt
3397: WHERE gt.key=p_key
3398: AND gt.char1 = po_document_cancel_pvt.c_doc_type_PA
3399: AND EXISTS
3400: (SELECT 'Has open std Po lines ref this contract'
3401: FROM po_lines POL
3402: WHERE POL.contract_id = gt.index_num1
3634: char4,
3635: 'Y',
3636: Decode (
3637: pgt.char1,
3638: po_document_cancel_pvt.c_doc_type_RELEASE,
3639: (SELECT poh.segment1||'-'|| por.release_num
3640: FROM po_releases por,
3641: po_headers poh
3642: WHERE por.po_release_id=poll.po_release_id
3650: po_session_gt pgt
3651: WHERE pgt.key = l_old_key
3652: AND nvl(poll.cancel_flag,'N') = 'N'
3653: AND nvl(poll.closed_code, 'OPEN') <> 'FINALLY CLOSED'
3654: AND ( ( pgt.char3 = po_document_cancel_pvt.c_entity_level_shipment
3655: AND pgt.num1 = line_location_id )
3656: OR( pgt.char3 = po_document_cancel_pvt.c_entity_level_line
3657: AND pgt.char1 <> po_document_cancel_pvt.c_doc_type_PA
3658: -- bug 16525950 : consider only the PO shipment and not release
3652: AND nvl(poll.cancel_flag,'N') = 'N'
3653: AND nvl(poll.closed_code, 'OPEN') <> 'FINALLY CLOSED'
3654: AND ( ( pgt.char3 = po_document_cancel_pvt.c_entity_level_shipment
3655: AND pgt.num1 = line_location_id )
3656: OR( pgt.char3 = po_document_cancel_pvt.c_entity_level_line
3657: AND pgt.char1 <> po_document_cancel_pvt.c_doc_type_PA
3658: -- bug 16525950 : consider only the PO shipment and not release
3659: -- In case of PPO, the release shipment will also be considered
3660: -- if we do not add this condition, and as this is for level =Line
3653: AND nvl(poll.closed_code, 'OPEN') <> 'FINALLY CLOSED'
3654: AND ( ( pgt.char3 = po_document_cancel_pvt.c_entity_level_shipment
3655: AND pgt.num1 = line_location_id )
3656: OR( pgt.char3 = po_document_cancel_pvt.c_entity_level_line
3657: AND pgt.char1 <> po_document_cancel_pvt.c_doc_type_PA
3658: -- bug 16525950 : consider only the PO shipment and not release
3659: -- In case of PPO, the release shipment will also be considered
3660: -- if we do not add this condition, and as this is for level =Line
3661: -- it is not applicable for releases
3660: -- if we do not add this condition, and as this is for level =Line
3661: -- it is not applicable for releases
3662: AND poll.po_release_id IS NULL
3663: AND pgt.num1 = po_line_id )
3664: OR(pgt.char1 = po_document_cancel_pvt.c_doc_type_PO
3665: AND pgt.char3 = po_document_cancel_pvt.c_entity_level_header
3666: -- bug 16525950
3667: AND poll.po_release_id IS NULL
3668: AND pgt.num1 = po_header_id )
3661: -- it is not applicable for releases
3662: AND poll.po_release_id IS NULL
3663: AND pgt.num1 = po_line_id )
3664: OR(pgt.char1 = po_document_cancel_pvt.c_doc_type_PO
3665: AND pgt.char3 = po_document_cancel_pvt.c_entity_level_header
3666: -- bug 16525950
3667: AND poll.po_release_id IS NULL
3668: AND pgt.num1 = po_header_id )
3669: OR (pgt.char1 = po_document_cancel_pvt.c_doc_type_RELEASE
3665: AND pgt.char3 = po_document_cancel_pvt.c_entity_level_header
3666: -- bug 16525950
3667: AND poll.po_release_id IS NULL
3668: AND pgt.num1 = po_header_id )
3669: OR (pgt.char1 = po_document_cancel_pvt.c_doc_type_RELEASE
3670: AND pgt.char3 = po_document_cancel_pvt.c_entity_level_header
3671: AND pgt.num1 = po_release_id ) ));
3672:
3673:
3666: -- bug 16525950
3667: AND poll.po_release_id IS NULL
3668: AND pgt.num1 = po_header_id )
3669: OR (pgt.char1 = po_document_cancel_pvt.c_doc_type_RELEASE
3670: AND pgt.char3 = po_document_cancel_pvt.c_entity_level_header
3671: AND pgt.num1 = po_release_id ) ));
3672:
3673:
3674:
3705: po_session_gt pgt
3706: WHERE pgt.key = l_old_key
3707: AND nvl(pol.cancel_flag,'N') = 'N'
3708: AND nvl(pol.closed_code, 'OPEN') <> 'FINALLY CLOSED'
3709: AND (( pgt.char3 = po_document_cancel_pvt.c_entity_level_line
3710: AND pgt.char1 = po_document_cancel_pvt.c_doc_type_PA
3711: AND pgt.num1 = po_line_id )
3712: OR(pgt.char1 = po_document_cancel_pvt.c_doc_type_PA
3713: AND pgt.char3 = po_document_cancel_pvt.c_entity_level_header
3706: WHERE pgt.key = l_old_key
3707: AND nvl(pol.cancel_flag,'N') = 'N'
3708: AND nvl(pol.closed_code, 'OPEN') <> 'FINALLY CLOSED'
3709: AND (( pgt.char3 = po_document_cancel_pvt.c_entity_level_line
3710: AND pgt.char1 = po_document_cancel_pvt.c_doc_type_PA
3711: AND pgt.num1 = po_line_id )
3712: OR(pgt.char1 = po_document_cancel_pvt.c_doc_type_PA
3713: AND pgt.char3 = po_document_cancel_pvt.c_entity_level_header
3714: AND pgt.num1 = pol.po_header_id ) ));
3708: AND nvl(pol.closed_code, 'OPEN') <> 'FINALLY CLOSED'
3709: AND (( pgt.char3 = po_document_cancel_pvt.c_entity_level_line
3710: AND pgt.char1 = po_document_cancel_pvt.c_doc_type_PA
3711: AND pgt.num1 = po_line_id )
3712: OR(pgt.char1 = po_document_cancel_pvt.c_doc_type_PA
3713: AND pgt.char3 = po_document_cancel_pvt.c_entity_level_header
3714: AND pgt.num1 = pol.po_header_id ) ));
3715:
3716:
3709: AND (( pgt.char3 = po_document_cancel_pvt.c_entity_level_line
3710: AND pgt.char1 = po_document_cancel_pvt.c_doc_type_PA
3711: AND pgt.num1 = po_line_id )
3712: OR(pgt.char1 = po_document_cancel_pvt.c_doc_type_PA
3713: AND pgt.char3 = po_document_cancel_pvt.c_entity_level_header
3714: AND pgt.num1 = pol.po_header_id ) ));
3715:
3716:
3717:
3744: ),
3745: date1
3746: FROM po_session_gt pgt
3747: WHERE pgt.key = l_old_key
3748: AND pgt.char1 = po_document_cancel_pvt.c_doc_type_PA
3749: AND pgt.char2 = po_document_cancel_pvt.c_doc_subtype_contract);
3750:
3751:
3752: -- Return the new key
3745: date1
3746: FROM po_session_gt pgt
3747: WHERE pgt.key = l_old_key
3748: AND pgt.char1 = po_document_cancel_pvt.c_doc_type_PA
3749: AND pgt.char2 = po_document_cancel_pvt.c_doc_subtype_contract);
3750:
3751:
3752: -- Return the new key
3753: p_key :=l_new_key;
4484: FROM po_headers poh,
4485: po_session_gt gt
4486: WHERE gt.key=p_key
4487: AND poh.po_header_id = gt.char4
4488: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_RELEASE
4489: AND (po_control_action_validations.val_doc_security(
4490: poh.agent_id,
4491: p_agent_id,
4492: gt.char1,
4538: po_releases prh,
4539: po_session_gt gt
4540: WHERE gt.key=p_key
4541: AND prh.po_release_id = gt.char4
4542: AND gt.char1 = po_document_cancel_pvt.c_doc_type_RELEASE
4543: AND(po_control_action_validations.val_doc_security(
4544: prh.agent_id,
4545: p_agent_id,
4546: gt.char1,
4675:
4676: -- If the calling mode is cancel api, then only validate the applicability
4677: -- of cancel action on the current entity state, other wise, it will
4678: -- already be validated
4679: IF nvl(p_source,'NULL') NOT IN(PO_DOCUMENT_CANCEL_PVT.c_HTML_CONTROL_ACTION,
4680: PO_DOCUMENT_CANCEL_PVT.c_FORM_CONTROL_ACTION)
4681: THEN
4682:
4683: l_action_ok := FALSE;
4676: -- If the calling mode is cancel api, then only validate the applicability
4677: -- of cancel action on the current entity state, other wise, it will
4678: -- already be validated
4679: IF nvl(p_source,'NULL') NOT IN(PO_DOCUMENT_CANCEL_PVT.c_HTML_CONTROL_ACTION,
4680: PO_DOCUMENT_CANCEL_PVT.c_FORM_CONTROL_ACTION)
4681: THEN
4682:
4683: l_action_ok := FALSE;
4684:
4681: THEN
4682:
4683: l_action_ok := FALSE;
4684:
4685: IF p_entity_rec_tbl(i).entity_level=po_document_cancel_pvt.c_entity_level_HEADER THEN
4686: l_doc_line_id := NULL;
4687: l_doc_line_loc_id := NULL;
4688:
4689: IF g_debug_stmt THEN
4691: PO_DEBUG.debug_var(d_module,l_progress,'l_doc_id',l_doc_id);
4692: PO_DEBUG.debug_var(d_module,l_progress,'l_doc_type',l_doc_type);
4693: END IF;
4694:
4695: IF l_doc_type =po_document_cancel_pvt.c_doc_type_RELEASE THEN
4696: l_progress :='002';
4697: l_action := 'CANCEL REL';
4698:
4699: PO_Document_Control_PVT.get_rel_header_actions(
4714: x_displayed_field_tbl => l_displayed_field_tbl,
4715: x_return_status => x_return_status);
4716: END IF;
4717:
4718: ELSIF p_entity_rec_tbl(i).entity_level=po_document_cancel_pvt.c_entity_level_LINE THEN
4719: l_doc_line_id := p_entity_rec_tbl(i).entity_id;
4720: l_doc_line_loc_id := NULL;
4721:
4722: l_progress :='004';
4731: x_return_status => x_return_status);
4732:
4733:
4734:
4735: ELSIF p_entity_rec_tbl(i).entity_level=po_document_cancel_pvt.c_entity_level_SHIPMENT THEN
4736: l_doc_line_id := NULL;
4737: l_doc_line_loc_id :=p_entity_rec_tbl(i).entity_id;
4738:
4739: IF l_doc_type =po_document_cancel_pvt.c_doc_type_RELEASE THEN
4735: ELSIF p_entity_rec_tbl(i).entity_level=po_document_cancel_pvt.c_entity_level_SHIPMENT THEN
4736: l_doc_line_id := NULL;
4737: l_doc_line_loc_id :=p_entity_rec_tbl(i).entity_id;
4738:
4739: IF l_doc_type =po_document_cancel_pvt.c_doc_type_RELEASE THEN
4740: l_progress :='005';
4741: l_action := 'CANCEL REL SHIPMENT';
4742:
4743: PO_Document_Control_PVT.get_rel_shipment_actions(
4757: p_agent_id => p_agent_id,
4758: x_lookup_code_tbl => l_allowable_actions_tbl,
4759: x_displayed_field_tbl => l_displayed_field_tbl,
4760: x_return_status => x_return_status);
4761: END IF; -- l_doc_type =po_document_cancel_pvt.c_doc_type_RELEASE
4762:
4763: END IF;-- p_entity_rec_tbl(i).entity_level=c_entity_level_HEADER
4764:
4765:
4832: PO_CORE_S.get_translated_text(
4833: 'PO_CAN_CONTROL_INVALID_ACTION',
4834: 'DOC_NUM',
4835: Decode(p_entity_rec_tbl(i).document_type,
4836: po_document_cancel_pvt.c_doc_type_RELEASE,
4837: (SELECT poh.segment1||'-'|| por.release_num
4838: FROM po_releases por,
4839: po_headers poh
4840: WHERE por.po_release_id=p_entity_rec_tbl(i).doc_id
5006: FROM po_session_gt gt,
5007: po_line_locations poll,
5008: po_line_locations_archive_all poall
5009: WHERE gt.key=p_key
5010: AND gt.char1 <> PO_Document_Cancel_PVT.c_doc_type_PA
5011: AND nvl(gt.char5,'Y') <> 'N'
5012: AND poall.line_location_id =poll.line_location_id
5013: AND poall.latest_external_flag ='Y'
5014: AND (Nvl(poll.price_override,0) <> Nvl(poall.price_override,0)
5016: OR Nvl(poll.amount,0) <> Nvl(poall.amount,0)
5017: OR Nvl(poll.promised_date,sysdate) <> Nvl(poall.promised_date,sysdate)
5018: OR Nvl(poll.need_by_date,sysdate) <> Nvl(poall.need_by_date,sysdate))
5019: AND (( poll.line_location_id=gt.num1
5020: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_SHIPMENT)
5021: OR (poll.po_line_id=gt.num1
5022: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_LINE)
5023: OR (poll.po_header_id=gt.num1
5024: AND gt.char1<>PO_Document_Cancel_PVT.c_doc_type_RELEASE
5018: OR Nvl(poll.need_by_date,sysdate) <> Nvl(poall.need_by_date,sysdate))
5019: AND (( poll.line_location_id=gt.num1
5020: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_SHIPMENT)
5021: OR (poll.po_line_id=gt.num1
5022: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_LINE)
5023: OR (poll.po_header_id=gt.num1
5024: AND gt.char1<>PO_Document_Cancel_PVT.c_doc_type_RELEASE
5025: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5026: OR (poll.po_release_id=gt.num1
5020: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_SHIPMENT)
5021: OR (poll.po_line_id=gt.num1
5022: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_LINE)
5023: OR (poll.po_header_id=gt.num1
5024: AND gt.char1<>PO_Document_Cancel_PVT.c_doc_type_RELEASE
5025: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5026: OR (poll.po_release_id=gt.num1
5027: AND gt.char1=PO_Document_Cancel_PVT.c_doc_type_RELEASE
5028: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5021: OR (poll.po_line_id=gt.num1
5022: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_LINE)
5023: OR (poll.po_header_id=gt.num1
5024: AND gt.char1<>PO_Document_Cancel_PVT.c_doc_type_RELEASE
5025: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5026: OR (poll.po_release_id=gt.num1
5027: AND gt.char1=PO_Document_Cancel_PVT.c_doc_type_RELEASE
5028: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5029:
5023: OR (poll.po_header_id=gt.num1
5024: AND gt.char1<>PO_Document_Cancel_PVT.c_doc_type_RELEASE
5025: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5026: OR (poll.po_release_id=gt.num1
5027: AND gt.char1=PO_Document_Cancel_PVT.c_doc_type_RELEASE
5028: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5029:
5030: ))
5031:
5024: AND gt.char1<>PO_Document_Cancel_PVT.c_doc_type_RELEASE
5025: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5026: OR (poll.po_release_id=gt.num1
5027: AND gt.char1=PO_Document_Cancel_PVT.c_doc_type_RELEASE
5028: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5029:
5030: ))
5031:
5032: RETURNING line_location_id,po_line_id
5194: po_lines pol,
5195: po_session_gt gt
5196: WHERE
5197: gt.key=p_key
5198: AND gt.char1 <> PO_Document_Cancel_PVT.c_doc_type_PA
5199: AND poll.po_line_id = pol.po_line_id
5200: AND poll.line_location_id IN
5201: (SELECT line_location_id
5202: FROM TABLE (CAST (l_line_loc_id_tbl AS po_tbl_number)))
5200: AND poll.line_location_id IN
5201: (SELECT line_location_id
5202: FROM TABLE (CAST (l_line_loc_id_tbl AS po_tbl_number)))
5203: AND ( (poll.line_location_id=gt.num1
5204: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_SHIPMENT)
5205: OR(poll.po_line_id=gt.num1
5206: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_LINE)
5207: OR(poll.po_header_id=gt.num1
5208: AND gt.char1<>PO_Document_Cancel_PVT.c_doc_type_RELEASE
5202: FROM TABLE (CAST (l_line_loc_id_tbl AS po_tbl_number)))
5203: AND ( (poll.line_location_id=gt.num1
5204: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_SHIPMENT)
5205: OR(poll.po_line_id=gt.num1
5206: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_LINE)
5207: OR(poll.po_header_id=gt.num1
5208: AND gt.char1<>PO_Document_Cancel_PVT.c_doc_type_RELEASE
5209: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5210: OR (poll.po_release_id=gt.num1
5204: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_SHIPMENT)
5205: OR(poll.po_line_id=gt.num1
5206: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_LINE)
5207: OR(poll.po_header_id=gt.num1
5208: AND gt.char1<>PO_Document_Cancel_PVT.c_doc_type_RELEASE
5209: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5210: OR (poll.po_release_id=gt.num1
5211: AND gt.char1=PO_Document_Cancel_PVT.c_doc_type_RELEASE
5212: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5205: OR(poll.po_line_id=gt.num1
5206: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_LINE)
5207: OR(poll.po_header_id=gt.num1
5208: AND gt.char1<>PO_Document_Cancel_PVT.c_doc_type_RELEASE
5209: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5210: OR (poll.po_release_id=gt.num1
5211: AND gt.char1=PO_Document_Cancel_PVT.c_doc_type_RELEASE
5212: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5213:
5207: OR(poll.po_header_id=gt.num1
5208: AND gt.char1<>PO_Document_Cancel_PVT.c_doc_type_RELEASE
5209: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5210: OR (poll.po_release_id=gt.num1
5211: AND gt.char1=PO_Document_Cancel_PVT.c_doc_type_RELEASE
5212: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5213:
5214: ));
5215:
5208: AND gt.char1<>PO_Document_Cancel_PVT.c_doc_type_RELEASE
5209: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5210: OR (poll.po_release_id=gt.num1
5211: AND gt.char1=PO_Document_Cancel_PVT.c_doc_type_RELEASE
5212: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER)
5213:
5214: ));
5215:
5216:
5363: gt.key=p_low_level_key
5364: AND pod.line_location_id=poll.line_location_id
5365: AND poll.line_location_id = gt.index_num1 -- lowestentityid i.e.
5366: AND poll.po_line_id = pol.po_line_id
5367: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
5368: AND Nvl(poll.approved_flag,'N')<>'Y'
5369: -- <13503748: Edit without unreserve ER START>
5370: -- Throw an error if the encumbered flag at PO distributions is N for
5371: -- encumbered enabled environment
5490: gt.key=p_low_level_key
5491: AND pod.line_location_id=poll.line_location_id
5492: AND poll.line_location_id = gt.index_num1 -- lowestentityid i.e.
5493: AND poll.po_line_id = pol.po_line_id
5494: AND gt.char1 <> po_document_cancel_pvt.c_doc_type_PA
5495: AND ((NOT EXISTS (SELECT 'exists archive'
5496: FROM po_distributions_archive_all
5497: WHERE po_distribution_id =pod.po_distribution_id)
5498: AND Nvl(poll.approved_flag,'N')<>'Y')
5694: IF (x_cancel_reqs_flag ='Y'
5695: AND p_po_encumbrance_flag = 'Y'
5696: AND p_req_encumbrance_flag='Y')
5697: THEN
5698: PO_Document_Cancel_PVT.val_cancel_backing_reqs(
5699: p_api_version => 1.0,
5700: p_init_msg_list => FND_API.G_FALSE,
5701: x_return_status => x_return_status,
5702: p_doc_type => p_doc_type,
5849: po_session_gt gt
5850: WHERE gt.key=p_key
5851: AND (gt.char1 IS NULL
5852: OR gt.char2 IS NULL
5853: OR gt.char1 NOT IN (po_document_cancel_pvt.c_doc_type_PO,
5854: po_document_cancel_pvt.c_doc_type_PA,
5855: po_document_cancel_pvt.c_doc_type_RELEASE)
5856: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PO
5857: AND gt.char2 NOT IN(po_document_cancel_pvt.c_doc_subtype_STANDARD,
5850: WHERE gt.key=p_key
5851: AND (gt.char1 IS NULL
5852: OR gt.char2 IS NULL
5853: OR gt.char1 NOT IN (po_document_cancel_pvt.c_doc_type_PO,
5854: po_document_cancel_pvt.c_doc_type_PA,
5855: po_document_cancel_pvt.c_doc_type_RELEASE)
5856: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PO
5857: AND gt.char2 NOT IN(po_document_cancel_pvt.c_doc_subtype_STANDARD,
5858: po_document_cancel_pvt.c_doc_subtype_PLANNED))
5851: AND (gt.char1 IS NULL
5852: OR gt.char2 IS NULL
5853: OR gt.char1 NOT IN (po_document_cancel_pvt.c_doc_type_PO,
5854: po_document_cancel_pvt.c_doc_type_PA,
5855: po_document_cancel_pvt.c_doc_type_RELEASE)
5856: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PO
5857: AND gt.char2 NOT IN(po_document_cancel_pvt.c_doc_subtype_STANDARD,
5858: po_document_cancel_pvt.c_doc_subtype_PLANNED))
5859: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PA
5852: OR gt.char2 IS NULL
5853: OR gt.char1 NOT IN (po_document_cancel_pvt.c_doc_type_PO,
5854: po_document_cancel_pvt.c_doc_type_PA,
5855: po_document_cancel_pvt.c_doc_type_RELEASE)
5856: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PO
5857: AND gt.char2 NOT IN(po_document_cancel_pvt.c_doc_subtype_STANDARD,
5858: po_document_cancel_pvt.c_doc_subtype_PLANNED))
5859: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PA
5860: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5853: OR gt.char1 NOT IN (po_document_cancel_pvt.c_doc_type_PO,
5854: po_document_cancel_pvt.c_doc_type_PA,
5855: po_document_cancel_pvt.c_doc_type_RELEASE)
5856: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PO
5857: AND gt.char2 NOT IN(po_document_cancel_pvt.c_doc_subtype_STANDARD,
5858: po_document_cancel_pvt.c_doc_subtype_PLANNED))
5859: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PA
5860: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5861: po_document_cancel_pvt.c_doc_subtype_contract))
5854: po_document_cancel_pvt.c_doc_type_PA,
5855: po_document_cancel_pvt.c_doc_type_RELEASE)
5856: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PO
5857: AND gt.char2 NOT IN(po_document_cancel_pvt.c_doc_subtype_STANDARD,
5858: po_document_cancel_pvt.c_doc_subtype_PLANNED))
5859: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PA
5860: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5861: po_document_cancel_pvt.c_doc_subtype_contract))
5862: OR (gt.char1=po_document_cancel_pvt.c_doc_type_RELEASE
5855: po_document_cancel_pvt.c_doc_type_RELEASE)
5856: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PO
5857: AND gt.char2 NOT IN(po_document_cancel_pvt.c_doc_subtype_STANDARD,
5858: po_document_cancel_pvt.c_doc_subtype_PLANNED))
5859: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PA
5860: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5861: po_document_cancel_pvt.c_doc_subtype_contract))
5862: OR (gt.char1=po_document_cancel_pvt.c_doc_type_RELEASE
5863: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5856: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PO
5857: AND gt.char2 NOT IN(po_document_cancel_pvt.c_doc_subtype_STANDARD,
5858: po_document_cancel_pvt.c_doc_subtype_PLANNED))
5859: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PA
5860: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5861: po_document_cancel_pvt.c_doc_subtype_contract))
5862: OR (gt.char1=po_document_cancel_pvt.c_doc_type_RELEASE
5863: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5864: po_document_cancel_pvt.c_doc_subtype_SCHEDULED))
5857: AND gt.char2 NOT IN(po_document_cancel_pvt.c_doc_subtype_STANDARD,
5858: po_document_cancel_pvt.c_doc_subtype_PLANNED))
5859: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PA
5860: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5861: po_document_cancel_pvt.c_doc_subtype_contract))
5862: OR (gt.char1=po_document_cancel_pvt.c_doc_type_RELEASE
5863: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5864: po_document_cancel_pvt.c_doc_subtype_SCHEDULED))
5865: ));
5858: po_document_cancel_pvt.c_doc_subtype_PLANNED))
5859: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PA
5860: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5861: po_document_cancel_pvt.c_doc_subtype_contract))
5862: OR (gt.char1=po_document_cancel_pvt.c_doc_type_RELEASE
5863: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5864: po_document_cancel_pvt.c_doc_subtype_SCHEDULED))
5865: ));
5866:
5859: OR (gt.char1=po_document_cancel_pvt.c_doc_type_PA
5860: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5861: po_document_cancel_pvt.c_doc_subtype_contract))
5862: OR (gt.char1=po_document_cancel_pvt.c_doc_type_RELEASE
5863: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5864: po_document_cancel_pvt.c_doc_subtype_SCHEDULED))
5865: ));
5866:
5867: p_sequence := P_SEQUENCE + SQL%ROWCOUNT;
5860: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5861: po_document_cancel_pvt.c_doc_subtype_contract))
5862: OR (gt.char1=po_document_cancel_pvt.c_doc_type_RELEASE
5863: AND gt.char2 NOT IN (po_document_cancel_pvt.c_doc_subtype_BLANKET,
5864: po_document_cancel_pvt.c_doc_subtype_SCHEDULED))
5865: ));
5866:
5867: p_sequence := P_SEQUENCE + SQL%ROWCOUNT;
5868: l_progress := '002';
5902: gt.char3
5903: FROM
5904: po_session_gt gt
5905: WHERE gt.key=p_key
5906: AND gt.char3 =po_document_cancel_pvt.c_entity_level_SHIPMENT
5907: AND NOT EXISTS (SELECT '1'
5908: FROM po_line_locations poll
5909: WHERE poll.line_location_id = gt.num1
5910: ));
5948: gt.char3
5949: FROM
5950: po_session_gt gt
5951: WHERE gt.key=p_key
5952: AND gt.char3 =po_document_cancel_pvt.c_entity_level_LINE
5953: AND NOT EXISTS(SELECT '1'
5954: FROM po_lines pol
5955: WHERE pol.po_line_id = gt.num1
5956: ));
5994: gt.char3
5995: FROM
5996: po_session_gt gt
5997: WHERE gt.key=p_key
5998: AND gt.char3 =po_document_cancel_pvt.c_entity_level_HEADER
5999: AND gt.char1<>po_document_cancel_pvt.c_doc_type_RELEASE
6000: AND NOT EXISTS (SELECT '1'
6001: FROM po_headers poh
6002: WHERE poh.po_header_id = gt.num1
5995: FROM
5996: po_session_gt gt
5997: WHERE gt.key=p_key
5998: AND gt.char3 =po_document_cancel_pvt.c_entity_level_HEADER
5999: AND gt.char1<>po_document_cancel_pvt.c_doc_type_RELEASE
6000: AND NOT EXISTS (SELECT '1'
6001: FROM po_headers poh
6002: WHERE poh.po_header_id = gt.num1
6003: ));
6040: gt.char3
6041: FROM
6042: po_session_gt gt
6043: WHERE gt.key=p_key
6044: AND gt.char3 =po_document_cancel_pvt.c_entity_level_HEADER
6045: AND gt.char1 =po_document_cancel_pvt.c_doc_type_RELEASE
6046: AND NOT EXISTS (SELECT '1'
6047: FROM po_releases poh
6048: WHERE poh.po_release_id = gt.num1 ));
6041: FROM
6042: po_session_gt gt
6043: WHERE gt.key=p_key
6044: AND gt.char3 =po_document_cancel_pvt.c_entity_level_HEADER
6045: AND gt.char1 =po_document_cancel_pvt.c_doc_type_RELEASE
6046: AND NOT EXISTS (SELECT '1'
6047: FROM po_releases poh
6048: WHERE poh.po_release_id = gt.num1 ));
6049:
6088: gt.char3
6089: FROM
6090: po_session_gt gt
6091: WHERE gt.key=p_key
6092: AND GT.char3 <> PO_Document_Cancel_PVT.c_entity_level_HEADER
6093: AND NOT EXISTS (SELECT '1'
6094: FROM po_headers poh
6095: WHERE poh.po_header_id = gt.char4
6096: UNION ALL
6114: FROM po_lines pol,
6115: po_session_gt gt
6116: WHERE gt.KEY=p_key
6117: AND gt.num1=pol.po_line_id
6118: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_LINE
6119: UNION ALL
6120: SELECT poll.po_header_id
6121: FROM po_line_locations poll,
6122: po_session_gt gt
6121: FROM po_line_locations poll,
6122: po_session_gt gt
6123: WHERE gt.KEY=p_key
6124: AND gt.num1=poll.line_location_id
6125: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_SHIPMENT
6126: UNION ALL
6127: SELECT gt.num1
6128: FROM po_session_gt gt
6129: WHERE gt.KEY=p_key
6126: UNION ALL
6127: SELECT gt.num1
6128: FROM po_session_gt gt
6129: WHERE gt.KEY=p_key
6130: AND gt.char3=PO_Document_Cancel_PVT.c_entity_level_HEADER
6131: ) ;
6132:
6133: IF l_org_count>1 THEN
6134:
6322: -- to same doc_id[ ex: 2 shipemnts from same PO],
6323: -- hence, checking if the action_date is already validated for that
6324: IF NOT l_doc_id_tbl.EXISTS(l_entity_rec_tbl(i).doc_id) THEN
6325:
6326: IF nvl(l_source,'NULL') NOT IN (PO_DOCUMENT_CANCEL_PVT.c_HTML_CONTROL_ACTION,
6327: PO_DOCUMENT_CANCEL_PVT.c_FORM_CONTROL_ACTION)
6328: THEN
6329:
6330: -- Initialize the action date
6323: -- hence, checking if the action_date is already validated for that
6324: IF NOT l_doc_id_tbl.EXISTS(l_entity_rec_tbl(i).doc_id) THEN
6325:
6326: IF nvl(l_source,'NULL') NOT IN (PO_DOCUMENT_CANCEL_PVT.c_HTML_CONTROL_ACTION,
6327: PO_DOCUMENT_CANCEL_PVT.c_FORM_CONTROL_ACTION)
6328: THEN
6329:
6330: -- Initialize the action date
6331: -- If x_action_date is NULL, then sets it to a valid CBC accounting
6346: ELSIF (x_return_status = FND_API.g_ret_sts_unexp_error) THEN
6347: RAISE FND_API.g_exc_unexpected_error;
6348: END IF;
6349:
6350: END IF; --nvl(l_source,'NULL') NOT IN (PO_DOCUMENT_CANCEL_PVT.c_HTML_CONTROL_ACTION,PO_DOCUMENT_CANCEL_PVT.c_FORM_CONTROL_ACTION)
6351:
6352: l_progress := '005';
6353:
6354: IF g_debug_stmt THEN