[Home] [Help]
82: CURSOR successful_documents_csr(p_requisition_header_id IN NUMBER) IS
83: SELECT zxlgt.trx_line_id
84: FROM zx_transaction_lines_gt zxlgt
85: WHERE p_requisition_header_id=zxlgt.trx_id
86: AND p_requisition_header_id NOT IN (SELECT trx_id FROM zx_errors_gt zxegt)
87: AND zxlgt.application_id = PO_CONSTANTS_SV.APPLICATION_ID
88: AND zxlgt.entity_code = PO_CONSTANTS_SV.REQ_ENTITY_CODE
89: AND zxlgt.event_class_code = PO_CONSTANTS_SV.REQ_EVENT_CLASS_CODE;
90:
536: ,zxegt.event_class_code
537: ,zxegt.message_text
538: ,'CALCULATE_TAX'
539: ,ph.segment1
540: FROM zx_errors_gt zxegt, po_headers_all ph
541: WHERE zxegt.event_class_code = PO_CONSTANTS_SV.PO_EVENT_CLASS_CODE
542: AND zxegt.trx_id = ph.po_header_id;
543:
544: d_progress := 240;
560: ,zxegt.event_class_code
561: ,zxegt.message_text
562: ,'CALCULATE_TAX'
563: ,ph.segment1
564: FROM zx_errors_gt zxegt, po_headers_all ph, po_releases_all pr
565: WHERE zxegt.event_class_code = PO_CONSTANTS_SV.REL_EVENT_CLASS_CODE
566: AND zxegt.trx_id = pr.po_release_id
567: AND pr.po_header_id = ph.po_header_id;
568:
566: AND zxegt.trx_id = pr.po_release_id
567: AND pr.po_header_id = ph.po_header_id;
568:
569: BEGIN
570: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
571: EXCEPTION WHEN OTHERS THEN
572: IF PO_LOG.d_stmt THEN
573: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
574: END IF;
569: BEGIN
570: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
571: EXCEPTION WHEN OTHERS THEN
572: IF PO_LOG.d_stmt THEN
573: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
574: END IF;
575: l_count := 0;
576: END;
577:
578: -- Bug 12907158
579: RAISE FND_API.G_EXC_ERROR;
580:
581: IF PO_LOG.d_stmt THEN
582: PO_LOG.stmt(d_module_base,d_progress,'Number of records in zx_errors_gt '||l_count);
583: END IF;
584:
585: /* Bug#12317965: ZX_LINE_DET_FACTORS should not have records inserted, in case
586: the tax lines insertion in to ZX_LINES fails. */
728: ,zxegt.event_class_code
729: ,zxegt.message_text
730: ,'DETERMINE_RECOVERY'
731: ,ph.segment1
732: FROM zx_errors_gt zxegt, po_headers_all ph
733: WHERE zxegt.event_class_code = PO_CONSTANTS_SV.PO_EVENT_CLASS_CODE
734: AND zxegt.trx_id = ph.po_header_id;
735:
736: d_progress := 360;
752: ,zxegt.event_class_code
753: ,zxegt.message_text
754: ,'DETERMINE_RECOVERY'
755: ,ph.segment1
756: FROM zx_errors_gt zxegt, po_headers_all ph, po_releases_all pr
757: WHERE zxegt.event_class_code = PO_CONSTANTS_SV.REL_EVENT_CLASS_CODE
758: AND zxegt.trx_id = pr.po_release_id
759: AND pr.po_header_id = ph.po_header_id;
760:
759: AND pr.po_header_id = ph.po_header_id;
760:
761: d_progress := 370;
762: BEGIN
763: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
764: EXCEPTION WHEN OTHERS THEN
765: IF PO_LOG.d_stmt THEN
766: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
767: END IF;
762: BEGIN
763: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
764: EXCEPTION WHEN OTHERS THEN
765: IF PO_LOG.d_stmt THEN
766: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
767: END IF;
768: l_count := 0;
769: END;
770:
768: l_count := 0;
769: END;
770:
771: IF PO_LOG.d_stmt THEN
772: PO_LOG.stmt(d_module_base,d_progress,'Number of records in zx_errors_gt '||l_count);
773: END IF;
774:
775: -- Bug 5169449. Removed deletions from headers and lines gt tables
776: -- because if the control has come till determine_recovery then the
1503: -- and copy over errors into global tax errors record
1504: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1505: x_return_status := l_return_status;
1506: d_progress := 180;
1507: -- Read validation errors from zx_errors_gt into the global
1508: -- error record defined in the spec
1509: SELECT
1510: 'CALCULATE_TAX' --error_level,
1511: ,PO_CONSTANTS_SV.REQUISITION --document_type_code,
1518: ,null --distribution_id,
1519: ,null --distribution_num,
1520: ,zxegt.message_text --message_text
1521: BULK COLLECT INTO G_TAX_ERRORS_TBL
1522: FROM zx_errors_gt zxegt, po_requisition_headers_all prh,
1523: po_requisition_lines_all prl
1524: WHERE zxegt.trx_id = prh.requisition_header_id
1525: AND zxegt.trx_line_id = prl.requisition_line_id(+);
1526:
1524: WHERE zxegt.trx_id = prh.requisition_header_id
1525: AND zxegt.trx_line_id = prl.requisition_line_id(+);
1526:
1527: BEGIN
1528: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
1529: EXCEPTION WHEN OTHERS THEN
1530: IF PO_LOG.d_stmt THEN
1531: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
1532: END IF;
1527: BEGIN
1528: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
1529: EXCEPTION WHEN OTHERS THEN
1530: IF PO_LOG.d_stmt THEN
1531: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
1532: END IF;
1533: l_count := 0;
1534: END;
1535:
1533: l_count := 0;
1534: END;
1535:
1536: IF PO_LOG.d_stmt THEN
1537: PO_LOG.stmt(d_module_base,d_progress,'Number of records in zx_errors_gt '||l_count);
1538: PO_LOG.stmt(d_module_base,d_progress,'Number of error records collected '||G_TAX_ERRORS_TBL.error_level.COUNT);
1539: END IF;
1540:
1541: d_progress := 190;
1603: -- If there are any expected errors then set the return status accordingly
1604: -- and copy over errors into global tax errors record
1605: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1606: x_return_status := l_return_status;
1607: -- Read validation errors from zx_errors_gt into the global
1608: -- error record defined in the spec
1609: d_progress := 260;
1610: SELECT
1611: 'DETERMINE_RECOVERY' --error_level,
1619: ,zxegt.trx_line_dist_id --distribution_id,
1620: ,prd.distribution_id --distribution_num,
1621: ,zxegt.message_text --message_text
1622: BULK COLLECT INTO G_TAX_ERRORS_TBL
1623: FROM zx_errors_gt zxegt, po_requisition_headers_all prh,
1624: po_requisition_lines_all prl, po_req_distributions_all prd
1625: WHERE zxegt.trx_id = prh.requisition_header_id
1626: AND zxegt.trx_line_id = prl.requisition_line_id(+)
1627: AND zxegt.trx_line_dist_id = prd.distribution_id(+);
1627: AND zxegt.trx_line_dist_id = prd.distribution_id(+);
1628:
1629: d_progress := 270;
1630: BEGIN
1631: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
1632: EXCEPTION WHEN OTHERS THEN
1633: IF PO_LOG.d_stmt THEN
1634: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
1635: END IF;
1630: BEGIN
1631: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
1632: EXCEPTION WHEN OTHERS THEN
1633: IF PO_LOG.d_stmt THEN
1634: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
1635: END IF;
1636: l_count := 0;
1637: END;
1638:
1636: l_count := 0;
1637: END;
1638:
1639: IF PO_LOG.d_stmt THEN
1640: PO_LOG.stmt(d_module_base,d_progress,'Number of records in zx_errors_gt '||l_count);
1641: PO_LOG.stmt(d_module_base,d_progress,'Number of error records collected '||G_TAX_ERRORS_TBL.error_level.COUNT);
1642: END IF;
1643:
1644: d_progress := 280;
1924:
1925: -- If expected errors, store error details in po_session_gt temporarily
1926: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1927: x_return_status := l_return_status;
1928: -- Read validation errors from zx_errors_gt into the global
1929: -- error record defined in the spec
1930: SELECT
1931: 'DETERMINE_RECOVERY' --error_level,
1932: ,PO_CONSTANTS_SV.PO --document_type_code,
1939: ,zxegt.trx_line_dist_id --distribution_id,
1940: ,pd.distribution_num --distribution_num,
1941: ,zxegt.message_text --message_text
1942: BULK COLLECT INTO G_TAX_ERRORS_TBL
1943: FROM zx_errors_gt zxegt, po_headers_all ph,
1944: po_line_locations_all pll, po_distributions_all pd
1945: WHERE zxegt.trx_id = ph.po_header_id
1946: AND zxegt.trx_line_id = pll.line_location_id(+)
1947: AND zxegt.trx_line_dist_id = pd.po_distribution_id(+);
1946: AND zxegt.trx_line_id = pll.line_location_id(+)
1947: AND zxegt.trx_line_dist_id = pd.po_distribution_id(+);
1948:
1949: BEGIN
1950: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
1951: EXCEPTION WHEN OTHERS THEN
1952: IF PO_LOG.d_stmt THEN
1953: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
1954: END IF;
1949: BEGIN
1950: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
1951: EXCEPTION WHEN OTHERS THEN
1952: IF PO_LOG.d_stmt THEN
1953: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
1954: END IF;
1955: l_count := 0;
1956: END;
1957:
1955: l_count := 0;
1956: END;
1957:
1958: IF PO_LOG.d_stmt THEN
1959: PO_LOG.stmt(d_module_base,d_progress,'Number of records in zx_errors_gt '||l_count);
1960: PO_LOG.stmt(d_module_base,d_progress,'Number of error records collected '||G_TAX_ERRORS_TBL.error_level.COUNT);
1961: END IF;
1962:
1963: RAISE FND_API.G_EXC_ERROR;
2158:
2159: -- If expected errors, store error details in po_session_gt temporarily
2160: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
2161: x_return_status := l_return_status;
2162: -- Read validation errors from zx_errors_gt into the global
2163: -- error record defined in the spec
2164: SELECT
2165: 'DETERMINE_RECOVERY' --error_level,
2166: ,PO_CONSTANTS_SV.PO --document_type_code,
2173: ,zxegt.trx_line_dist_id --distribution_id,
2174: ,pd.distribution_num --distribution_num,
2175: ,zxegt.message_text --message_text
2176: BULK COLLECT INTO G_TAX_ERRORS_TBL
2177: FROM zx_errors_gt zxegt, po_releases_all pr, po_headers_all ph,
2178: po_line_locations_all pll, po_distributions_all pd
2179: WHERE zxegt.trx_id = pr.po_release_id
2180: AND pr.po_header_id = ph.po_header_id
2181: AND zxegt.trx_line_id = pll.line_location_id(+)
2181: AND zxegt.trx_line_id = pll.line_location_id(+)
2182: AND zxegt.trx_line_dist_id = pd.po_distribution_id(+);
2183:
2184: BEGIN
2185: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
2186: EXCEPTION WHEN OTHERS THEN
2187: IF PO_LOG.d_stmt THEN
2188: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
2189: END IF;
2184: BEGIN
2185: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
2186: EXCEPTION WHEN OTHERS THEN
2187: IF PO_LOG.d_stmt THEN
2188: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
2189: END IF;
2190: l_count := 0;
2191: END;
2192:
2190: l_count := 0;
2191: END;
2192:
2193: IF PO_LOG.d_stmt THEN
2194: PO_LOG.stmt(d_module_base,d_progress,'Number of records in zx_errors_gt '||l_count);
2195: PO_LOG.stmt(d_module_base,d_progress,'Number of error records collected '||G_TAX_ERRORS_TBL.error_level.COUNT);
2196: END IF;
2197:
2198: RAISE FND_API.G_EXC_ERROR;
2381: -- If there are any expected errors then set the return status accordingly
2382: -- and copy over errors into global tax errors record
2383: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
2384: x_return_status := l_return_status;
2385: -- Read validation errors from zx_errors_gt into the global
2386: -- error record defined in the spec
2387: SELECT
2388: 'DETERMINE_RECOVERY' --error_level,
2389: ,PO_CONSTANTS_SV.REQUISITION --document_type_code,
2396: ,zxegt.trx_line_dist_id --distribution_id,
2397: ,prd.distribution_num --distribution_num,
2398: ,zxegt.message_text --message_text
2399: BULK COLLECT INTO G_TAX_ERRORS_TBL
2400: FROM zx_errors_gt zxegt, po_requisition_headers_all prh,
2401: po_requisition_lines_all prl, po_req_distributions_all prd
2402: WHERE zxegt.trx_id = prh.requisition_header_id
2403: AND zxegt.trx_line_id = prl.requisition_line_id(+)
2404: AND zxegt.trx_line_dist_id = prd.distribution_id(+);
2403: AND zxegt.trx_line_id = prl.requisition_line_id(+)
2404: AND zxegt.trx_line_dist_id = prd.distribution_id(+);
2405:
2406: BEGIN
2407: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
2408: EXCEPTION WHEN OTHERS THEN
2409: IF PO_LOG.d_stmt THEN
2410: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
2411: END IF;
2406: BEGIN
2407: SELECT COUNT(1) INTO l_count FROM zx_errors_gt;
2408: EXCEPTION WHEN OTHERS THEN
2409: IF PO_LOG.d_stmt THEN
2410: PO_LOG.stmt(d_module_base,d_progress,'Exception while hitting zx_errors_gt');
2411: END IF;
2412: l_count := 0;
2413: END;
2414:
2412: l_count := 0;
2413: END;
2414:
2415: IF PO_LOG.d_stmt THEN
2416: PO_LOG.stmt(d_module_base,d_progress,'Number of records in zx_errors_gt '||l_count);
2417: PO_LOG.stmt(d_module_base,d_progress,'Number of error records collected '||G_TAX_ERRORS_TBL.error_level.COUNT);
2418: END IF;
2419:
2420: RAISE FND_API.G_EXC_ERROR;
5625: -- ZX_TRX_HEADERS_GT
5626: -- ZX_TRANSACTION_LINES_GT
5627: -- ZX_ITM_DISTRIBUTIONS_GT
5628: -- ZX_VALIDATION_ERRORS_GT
5629: -- ZX_ERRORS_GT
5630: --Locks:
5631: -- ZX_TRX_HEADERS_GT
5632: -- ZX_TRANSACTION_LINES_GT
5633: -- ZX_ITM_DISTRIBUTIONS_GT
5631: -- ZX_TRX_HEADERS_GT
5632: -- ZX_TRANSACTION_LINES_GT
5633: -- ZX_ITM_DISTRIBUTIONS_GT
5634: -- ZX_VALIDATION_ERRORS_GT
5635: -- ZX_ERRORS_GT
5636: --Function:
5637: -- Wipe out all data from ZX Global Temporary tables used in PO transaction
5638: -- except if there are lines populated that have action='DELETE'. This
5639: -- exception is for HTML Orders case where deletions come pre-populated in
5705: -- ZX_TRX_HEADERS_GT
5706: -- ZX_TRANSACTION_LINES_GT
5707: -- ZX_ITM_DISTRIBUTIONS_GT
5708: -- ZX_VALIDATION_ERRORS_GT
5709: -- ZX_ERRORS_GT
5710: --Locks:
5711: -- ZX_TRX_HEADERS_GT
5712: -- ZX_TRANSACTION_LINES_GT
5713: -- ZX_ITM_DISTRIBUTIONS_GT
5711: -- ZX_TRX_HEADERS_GT
5712: -- ZX_TRANSACTION_LINES_GT
5713: -- ZX_ITM_DISTRIBUTIONS_GT
5714: -- ZX_VALIDATION_ERRORS_GT
5715: -- ZX_ERRORS_GT
5716: --Function:
5717: -- Wipe out all data from ZX Global Temporary tables
5718: --Parameters:
5719: --IN:
5742: DELETE ZX_ITM_DISTRIBUTIONS_GT;
5743: d_progress := 30;
5744: DELETE ZX_VALIDATION_ERRORS_GT;
5745: d_progress := 40;
5746: DELETE ZX_ERRORS_GT;
5747:
5748: d_progress := 50;
5749: IF (PO_LOG.d_proc) THEN
5750: PO_LOG.proc_end(d_module_base);