DBA Data[Home] [Help]

APPS.PO_ENCUMBRANCE_PREPROCESSING dependencies on PO_ENCUMBRANCE_GT

Line 272: g_result_SUCCESS CONSTANT PO_ENCUMBRANCE_GT.result_type%TYPE

268:
269: g_date_format CONSTANT varchar2(25) := 'YYYY/MM/DD';
270:
271: -- result classifications
272: g_result_SUCCESS CONSTANT PO_ENCUMBRANCE_GT.result_type%TYPE
273: := PO_DOCUMENT_FUNDS_PVT.g_result_SUCCESS;
274:
275: g_result_WARNING CONSTANT PO_ENCUMBRANCE_GT.result_type%TYPE
276: := PO_DOCUMENT_FUNDS_PVT.g_result_WARNING;

Line 275: g_result_WARNING CONSTANT PO_ENCUMBRANCE_GT.result_type%TYPE

271: -- result classifications
272: g_result_SUCCESS CONSTANT PO_ENCUMBRANCE_GT.result_type%TYPE
273: := PO_DOCUMENT_FUNDS_PVT.g_result_SUCCESS;
274:
275: g_result_WARNING CONSTANT PO_ENCUMBRANCE_GT.result_type%TYPE
276: := PO_DOCUMENT_FUNDS_PVT.g_result_WARNING;
277:
278: g_result_ERROR CONSTANT PO_ENCUMBRANCE_GT.result_type%TYPE
279: := PO_DOCUMENT_FUNDS_PVT.g_result_ERROR;

Line 278: g_result_ERROR CONSTANT PO_ENCUMBRANCE_GT.result_type%TYPE

274:
275: g_result_WARNING CONSTANT PO_ENCUMBRANCE_GT.result_type%TYPE
276: := PO_DOCUMENT_FUNDS_PVT.g_result_WARNING;
277:
278: g_result_ERROR CONSTANT PO_ENCUMBRANCE_GT.result_type%TYPE
279: := PO_DOCUMENT_FUNDS_PVT.g_result_ERROR;
280:
281: --note: this classification currently maps to Warning, but is
282: --given a seperate label so as to easily identify this condition

Line 283: g_result_NOT_PROCESSED CONSTANT PO_ENCUMBRANCE_GT.result_type%TYPE

279: := PO_DOCUMENT_FUNDS_PVT.g_result_ERROR;
280:
281: --note: this classification currently maps to Warning, but is
282: --given a seperate label so as to easily identify this condition
283: g_result_NOT_PROCESSED CONSTANT PO_ENCUMBRANCE_GT.result_type%TYPE
284: := PO_DOCUMENT_FUNDS_PVT.g_result_WARNING;
285:
286:
287: -- doc state check results

Line 488: -- PO_ENCUMBRANCE_GT

484: -- For POs with backing GAs, the org context of the PO must be set
485: -- in order to correctly determine whether or not there needs to
486: -- be a backing entry for the GA.
487: --Modifies:
488: -- PO_ENCUMBRANCE_GT
489: --Locks:
490: -- PO_REQUISITION_HEADERS_ALL
491: -- PO_REQ_DISTRIBUTIONS_ALL
492: -- PO_HEADERS_ALL

Line 496: -- This procedure populates the global temp table PO_ENCUMBRANCE_GT

492: -- PO_HEADERS_ALL
493: -- PO_RELEASES_ALL
494: -- PO_DISTRIBUTIONS_ALL
495: --Function:
496: -- This procedure populates the global temp table PO_ENCUMBRANCE_GT
497: -- with all of the information required for each distribution that has any
498: -- encumbrance impact.
499: -- It will either retrieve the information from the document tables for
500: -- the given doc ids or use what has already been populated in the

Line 633: --

629: --
630: -- populate_encumbrance_gt ( main doc ) ->
631: -- lock_headers
632: -- lock_distributions
633: --
634: --
635: -- remove_unnecessary_dists
636: --
637: -- update_encumbrance_gt ( main doc )

Line 647: --

643: --
644: -- filter_backing_distributions ( backing Reqs )
645: --
646: -- populate_encumbrance_gt ( backing Reqs )
647: --
648: --
649: -- update_encumbrance_gt ( backing Reqs )
650: --
651: -- get_distributions ( backing GAs ) ->

Line 659: --

655: --
656: -- filter_backing_distributions ( backing GAs )
657: --
658: -- populate_encumbrance_gt ( backing GAs )
659: --
660: --
661: -- update_encumbrance_gt ( backing GAs )
662: --
663: -- END get_all_distributions

Line 858: -- PO_ENCUMBRANCE_GT

854: --Name: initialize_encumbrance_gt
855: --Pre-reqs:
856: -- None.
857: --Modifies:
858: -- PO_ENCUMBRANCE_GT
859: --Locks:
860: -- None.
861: --Function:
862: -- Cleans the encumbrance table for use.

Line 896: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Truncating PO_ENCUMBRANCE_GT');

892: IF (p_use_enc_gt_flag = g_parameter_NO) THEN
893:
894: l_progress := '020';
895: IF g_debug_stmt THEN
896: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Truncating PO_ENCUMBRANCE_GT');
897: END IF;
898:
899: -- If we shouldn't be using whatever was in the encumbrance table,
900: -- get rid of all of it.

Line 910: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows,NULL,'PO');

906: ELSIF (p_use_enc_gt_flag = g_parameter_YES) THEN
907:
908: l_progress := '040';
909: IF g_debug_stmt THEN
910: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows,NULL,'PO');
911: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cleaning PO_ENCUMBRANCE_GT');
912: END IF;
913:
914: -- If we are trusting the data in the encumbrance table,

Line 911: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cleaning PO_ENCUMBRANCE_GT');

907:
908: l_progress := '040';
909: IF g_debug_stmt THEN
910: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows,NULL,'PO');
911: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cleaning PO_ENCUMBRANCE_GT');
912: END IF;
913:
914: -- If we are trusting the data in the encumbrance table,
915: -- we need to make sure that we have our own keys into it.

Line 917: UPDATE PO_ENCUMBRANCE_GT

913:
914: -- If we are trusting the data in the encumbrance table,
915: -- we need to make sure that we have our own keys into it.
916:
917: UPDATE PO_ENCUMBRANCE_GT
918: SET
919: sequence_num = NULL
920: , origin_sequence_num = NULL
921: ;

Line 969: -- PO_ENCUMBRANCE_GT

965: -- For POs with backing GAs, the org context of the PO must be set
966: -- in order to correctly determine whether or not there needs to
967: -- be a backing entry for the GA.
968: --Modifies:
969: -- PO_ENCUMBRANCE_GT
970: --Locks:
971: -- PO_REQUISITION_HEADERS_ALL
972: -- PO_REQ_DISTRIBUTIONS_ALL
973: -- PO_HEADERS_ALL

Line 1265: FROM PO_ENCUMBRANCE_GT ENC

1261: l_progress := '410';
1262:
1263: SELECT COUNT(*)
1264: INTO x_count
1265: FROM PO_ENCUMBRANCE_GT ENC
1266: WHERE ENC.sequence_num IS NULL
1267: ;
1268:
1269: l_progress := '420';

Line 1332: -- PO_ENCUMBRANCE_GT

1328: --Name: remove_unnecessary_dists
1329: --Pre-reqs:
1330: -- The encumbrance table has been populated only with main doc data.
1331: --Modifies:
1332: -- PO_ENCUMBRANCE_GT
1333: --Locks:
1334: -- None.
1335: --Function:
1336: -- For the given action, removes any rows that aren't relevant to the

Line 1374: DELETE FROM PO_ENCUMBRANCE_GT ENC

1370:
1371: -- Remove any entries that have no encumbrance impact.
1372: -- Keep the other prevent encumbrance rows, as they need to be reported.
1373:
1374: DELETE FROM PO_ENCUMBRANCE_GT ENC
1375: WHERE
1376: -- Delete already encumbered rows for Reserve, FC
1377: -- Bug 3364450: also delete enc rows for INV Cancel
1378: /* <> */

Line 1534: -- PO_ENCUMBRANCE_GT

1530: -- For POs with backing GAs, the org context of the PO must be set
1531: -- in order to correctly determine whether or not there needs to
1532: -- be a backing entry for the GA.
1533: --Modifies:
1534: -- PO_ENCUMBRANCE_GT
1535: --Locks:
1536: -- None.
1537: --Function:
1538: -- Polishes the data in the encumbrance table.

Line 1606: UPDATE PO_ENCUMBRANCE_GT ENC

1602:
1603: -- Clean up the inputs columns to make future calculations easier,
1604: -- and derive other column values needed for calculations.
1605:
1606: UPDATE PO_ENCUMBRANCE_GT ENC
1607: SET
1608:
1609: -- input columns
1610: ENC.unencumbered_amount = NVL(ENC.unencumbered_amount,0)

Line 1651: UPDATE PO_ENCUMBRANCE_GT ENC

1647:
1648: -- Fill in the minimum accountable unit and precision for foreign currencies.
1649: -- We probably don't need to do this for the functional currency rows.
1650:
1651: UPDATE PO_ENCUMBRANCE_GT ENC
1652: SET
1653: ( ENC.min_acct_unit_foreign
1654: , ENC.cur_precision_foreign
1655: )

Line 1673: UPDATE PO_ENCUMBRANCE_GT ENC

1669:
1670: -- Fill in the sequence_num.
1671: -- Do this for prevent rows as well, for error reporting.
1672:
1673: UPDATE PO_ENCUMBRANCE_GT ENC
1674: SET ENC.sequence_num = PO_ENCUMBRANCE_GT_S.nextval
1675: WHERE ENC.sequence_num IS NULL
1676: ;
1677:

Line 1674: SET ENC.sequence_num = PO_ENCUMBRANCE_GT_S.nextval

1670: -- Fill in the sequence_num.
1671: -- Do this for prevent rows as well, for error reporting.
1672:
1673: UPDATE PO_ENCUMBRANCE_GT ENC
1674: SET ENC.sequence_num = PO_ENCUMBRANCE_GT_S.nextval
1675: WHERE ENC.sequence_num IS NULL
1676: ;
1677:
1678: l_progress := '190';

Line 1707: UPDATE PO_ENCUMBRANCE_GT PO_DIST

1703: IF g_debug_stmt THEN
1704: PO_DEBUG.debug_stmt(l_log_head,l_progress,'updating GA dist_id');
1705: END IF;
1706:
1707: UPDATE PO_ENCUMBRANCE_GT PO_DIST
1708: SET PO_DIST.agreement_dist_id =
1709: ( SELECT GA_DIST.po_distribution_id
1710: FROM PO_DISTRIBUTIONS GA_DIST
1711: WHERE GA_DIST.po_header_id = PO_DIST.from_header_id

Line 1740: UPDATE PO_ENCUMBRANCE_GT REL_DIST

1736: IF g_debug_stmt THEN
1737: PO_DEBUG.debug_stmt(l_log_head,l_progress,'updating BPA dist ids');
1738: END IF;
1739:
1740: UPDATE PO_ENCUMBRANCE_GT REL_DIST
1741: SET REL_DIST.agreement_dist_id =
1742: ( SELECT BPA_DIST.po_distribution_id
1743: FROM PO_DISTRIBUTIONS_ALL BPA_DIST
1744: WHERE BPA_DIST.po_header_id = REL_DIST.header_id

Line 1773: UPDATE PO_ENCUMBRANCE_GT BACKING

1769: PO_DEBUG.debug_stmt(l_log_head,l_progress,'updating backing link');
1770: END IF;
1771:
1772: FORALL i IN 1 .. p_origin_seq_num_tbl.COUNT
1773: UPDATE PO_ENCUMBRANCE_GT BACKING
1774: SET BACKING.origin_sequence_num = p_origin_seq_num_tbl(i)
1775: WHERE BACKING.distribution_id = p_backing_dist_id_tbl(i)
1776: AND BACKING.distribution_type = p_distribution_type
1777: AND BACKING.origin_sequence_num IS NULL

Line 1795: UPDATE PO_ENCUMBRANCE_GT BACKING

1791: --bug 3568512: do not send Unreserved backing BPA/PPO lines to GL; we
1792: --only keep them in the GTT to maintain the unencumbered_amount column
1793: --Invoice Cancel is excluded b/c it has a different set of conditions
1794: --for backing docs in the filter_backing_distributions code
1795: UPDATE PO_ENCUMBRANCE_GT BACKING
1796: SET BACKING.send_to_gl_flag = 'N'
1797: , BACKING.update_encumbered_amount_flag = 'N'
1798: WHERE BACKING.origin_sequence_num IS NOT NULL --backing doc
1799: AND BACKING.encumbered_flag = 'N'

Line 1822: UPDATE PO_ENCUMBRANCE_GT MAINDOC

1818: -- passed in by AP for the main document
1819: IF (p_action IN (g_action_INVOICE_CANCEL, g_action_CR_MEMO_CANCEL)
1820: AND p_main_or_backing = g_MAIN) THEN
1821:
1822: UPDATE PO_ENCUMBRANCE_GT MAINDOC
1823: SET MAINDOC.budget_account_id = p_ap_budget_account_id
1824: WHERE MAINDOC.origin_sequence_num IS NULL;
1825:
1826: END IF;

Line 1906: FROM PO_ENCUMBRANCE_GT DISTS

1902: END IF;
1903:
1904: SELECT DISTS.req_distribution_id
1905: BULK COLLECT INTO l_distribution_id_tbl
1906: FROM PO_ENCUMBRANCE_GT DISTS
1907: WHERE DISTS.req_distribution_id IS NOT NULL
1908: AND DISTS.origin_sequence_num IS NULL
1909: AND DISTS.prevent_encumbrance_flag = 'N'
1910: ;

Line 1923: FROM PO_ENCUMBRANCE_GT DISTS

1919: END IF;
1920:
1921: SELECT DISTS.source_distribution_id
1922: BULK COLLECT INTO l_distribution_id_tbl
1923: FROM PO_ENCUMBRANCE_GT DISTS
1924: WHERE DISTS.source_distribution_id IS NOT NULL
1925: AND DISTS.origin_sequence_num IS NULL
1926: AND DISTS.prevent_encumbrance_flag = 'N'
1927: ;

Line 1940: FROM PO_ENCUMBRANCE_GT DISTS

1936: END IF;
1937:
1938: SELECT DISTS.agreement_dist_id
1939: BULK COLLECT INTO l_distribution_id_tbl
1940: FROM PO_ENCUMBRANCE_GT DISTS
1941: WHERE DISTS.agreement_dist_id IS NOT NULL
1942: AND DISTS.origin_sequence_num IS NULL
1943: AND DISTS.prevent_encumbrance_flag = 'N'
1944: ;

Line 2089: PO_ENCUMBRANCE_GT ENC

2085: l_backing_req_key
2086: , ENC.sequence_num
2087: , PRD.distribution_id
2088: FROM
2089: PO_ENCUMBRANCE_GT ENC
2090: , PO_REQUISITION_LINES_ALL PRL
2091: , PO_REQ_DISTRIBUTIONS_ALL PRD
2092: WHERE PRD.distribution_id = ENC.req_distribution_id --JOIN
2093: AND PRL.requisition_line_id = PRD.requisition_line_id --JOIN

Line 2236: , PO_ENCUMBRANCE_GT SR_DIST

2232: , x_origin_seq_num_tbl
2233: FROM
2234: PO_DISTRIBUTIONS_ALL POD
2235: , PO_LINE_LOCATIONS_ALL POLL
2236: , PO_ENCUMBRANCE_GT SR_DIST
2237: WHERE POLL.line_location_id = POD.line_location_id --JOIN
2238: AND POD.po_distribution_id = SR_DIST.source_distribution_id --JOIN
2239: AND NVL(POD.prevent_encumbrance_flag,'N') = 'N'
2240: AND NVL(POLL.closed_code,g_clsd_OPEN) <> g_clsd_FINALLY_CLOSED

Line 2275: , PO_ENCUMBRANCE_GT REL_DIST

2271: , x_origin_seq_num_tbl
2272: FROM
2273: PO_DISTRIBUTIONS_ALL POD
2274: , PO_HEADERS_ALL POH
2275: , PO_ENCUMBRANCE_GT REL_DIST
2276: WHERE POH.po_header_id = POD.po_header_id --JOIN
2277: AND POD.po_distribution_id = REL_DIST.agreement_dist_id --JOIN
2278: AND NVL(POD.prevent_encumbrance_flag,'N') = 'N'
2279: AND NVL(POH.closed_code,g_clsd_OPEN) <> g_clsd_FINALLY_CLOSED

Line 2539: -- PO_ENCUMBRANCE_GT

2535: --Pre-reqs:
2536: -- The encumbrance table may need to be populated with
2537: -- the appropriate data.
2538: --Modifies:
2539: -- PO_ENCUMBRANCE_GT
2540: -- Submission check tables, online report table
2541: --Locks:
2542: -- PO_HEADERS_ALL
2543: -- PO_RELEASES_ALL

Line 2550: -- If PO_ENCUMBRANCE_GT contains ids for this encumbrance action

2546: -- Performs the validations necessary in order for an encumbrance
2547: -- action to be taken.
2548: -- Most validation failures will raise an exception from this procedure.
2549: --
2550: -- If PO_ENCUMBRANCE_GT contains ids for this encumbrance action
2551: -- (p_check_only_flag = NO and p_use_enc_gt_flag = YES),
2552: -- the table will be replaced with the data for these ids.
2553: --Parameters:
2554: --IN:

Line 2813: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT'

2809:
2810: l_progress := 'a20';
2811: IF g_debug_stmt THEN
2812: PO_DEBUG.debug_stmt(l_log_head,l_progress,'multiple id do action');
2813: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT'
2814: ,PO_DEBUG.g_all_rows
2815: ,po_tbl_varchar30('distribution_type','doc_level','doc_level_id')
2816: );
2817: END IF;

Line 2829: FROM PO_ENCUMBRANCE_GT ENC

2825: BULK COLLECT INTO
2826: l_doc_level_tbl
2827: , l_dist_type_tbl
2828: , l_count_tbl
2829: FROM PO_ENCUMBRANCE_GT ENC
2830: GROUP BY ENC.doc_level, ENC.distribution_type
2831: ;
2832:
2833: l_progress := 'a30';

Line 2854: FROM PO_ENCUMBRANCE_GT ENC

2850: -- Make sure we're not trying to act on the same entity twice.
2851:
2852: SELECT DISTINCT ENC.doc_level_id
2853: BULK COLLECT INTO l_doc_level_id_tbl
2854: FROM PO_ENCUMBRANCE_GT ENC
2855: ;
2856:
2857: l_progress := 'a50';
2858:

Line 2873: -- (i.e., DELETE FROM PO_ENCUMBRANCE_GT)

2869: -- Then we can proceed as normal.
2870:
2871: -- We've already gathered the ids from the table, so now
2872: -- we should clear it for the normal encumbrance flow.
2873: -- (i.e., DELETE FROM PO_ENCUMBRANCE_GT)
2874:
2875: delete_encumbrance_gt();
2876:
2877: -- Now fill the table up with all of the info.

Line 3015: FROM PO_ENCUMBRANCE_GT ENC

3011: , g_doc_type_RELEASE, ENC.po_release_id
3012: , ENC.header_id
3013: )
3014: INTO l_doc_id
3015: FROM PO_ENCUMBRANCE_GT ENC
3016: WHERE rownum = 1
3017: ;
3018:
3019: l_progress := '220';

Line 3042: FROM PO_ENCUMBRANCE_GT ENC

3038: END IF;
3039:
3040: SELECT 'Y'
3041: INTO l_multiple_docs_flag
3042: FROM PO_ENCUMBRANCE_GT ENC
3043: WHERE (ENC.po_release_id <> l_doc_id
3044: OR ENC.po_release_id IS NULL
3045: )
3046: AND rownum = 1;

Line 3059: FROM PO_ENCUMBRANCE_GT ENC

3055: END IF;
3056:
3057: SELECT 'Y'
3058: INTO l_multiple_docs_flag
3059: FROM PO_ENCUMBRANCE_GT ENC
3060: WHERE (ENC.header_id <> l_doc_id
3061: OR ENC.header_id IS NULL
3062: )
3063: AND rownum = 1;

Line 3799: -- PO_ENCUMBRANCE_GT has been populated with the distribution

3795: -------------------------------------------------------------------------------
3796: --Start of Comments
3797: --Name: derive_packet_values
3798: --Pre-reqs:
3799: -- PO_ENCUMBRANCE_GT has been populated with the distribution
3800: -- information for both the original doc and backing docs.
3801: --Modifies:
3802: -- PO_ENCUMBRANCE_GT
3803: --Locks:

Line 3802: -- PO_ENCUMBRANCE_GT

3798: --Pre-reqs:
3799: -- PO_ENCUMBRANCE_GT has been populated with the distribution
3800: -- information for both the original doc and backing docs.
3801: --Modifies:
3802: -- PO_ENCUMBRANCE_GT
3803: --Locks:
3804: -- None.
3805: --Function:
3806: -- This procedure updates all of the information required for each

Line 3807: -- entry in PO_ENCUMBRANCE_GT that will be sent to GL for an

3803: --Locks:
3804: -- None.
3805: --Function:
3806: -- This procedure updates all of the information required for each
3807: -- entry in PO_ENCUMBRANCE_GT that will be sent to GL for an
3808: -- encumbrance action. It prepares all of the columns of
3809: -- PO_ENCUMBRANCE_GT that map to columns of GL_BC_PACKETS.
3810: --Parameters:
3811: --IN:

Line 3809: -- PO_ENCUMBRANCE_GT that map to columns of GL_BC_PACKETS.

3805: --Function:
3806: -- This procedure updates all of the information required for each
3807: -- entry in PO_ENCUMBRANCE_GT that will be sent to GL for an
3808: -- encumbrance action. It prepares all of the columns of
3809: -- PO_ENCUMBRANCE_GT that map to columns of GL_BC_PACKETS.
3810: --Parameters:
3811: --IN:
3812: --p_action
3813: -- Specifies the action that is being taken on the main doc.

Line 3964: UPDATE PO_ENCUMBRANCE_GT PO_DISTS

3960: 'PO'
3961: , 'PO_ENC_DIST_NOT_PROCESSED'
3962: );
3963:
3964: UPDATE PO_ENCUMBRANCE_GT PO_DISTS
3965: SET PO_DISTS.send_to_gl_flag = 'Y',
3966: PO_DISTS.result_type = g_result_NOT_PROCESSED,
3967: PO_DISTS.result_text = l_not_processed_msg
3968: WHERE PO_DISTS.sequence_num IN (SELECT REQ_DISTS.origin_sequence_num

Line 3969: FROM PO_ENCUMBRANCE_GT REQ_DISTS

3965: SET PO_DISTS.send_to_gl_flag = 'Y',
3966: PO_DISTS.result_type = g_result_NOT_PROCESSED,
3967: PO_DISTS.result_text = l_not_processed_msg
3968: WHERE PO_DISTS.sequence_num IN (SELECT REQ_DISTS.origin_sequence_num
3969: FROM PO_ENCUMBRANCE_GT REQ_DISTS
3970: WHERE REQ_DISTS.amount_based_flag = 'N'
3971: AND REQ_DISTS.prevent_encumbrance_flag = 'N'
3972: AND REQ_DISTS.origin_sequence_num IS NOT NULL
3973: AND REQ_DISTS.distribution_type = g_dist_type_REQUISITION

Line 3993: -- PO_ENCUMBRANCE_GT has been populated with the date information

3989: -------------------------------------------------------------------------------
3990: --Start of Comments
3991: --Name: get_period_info
3992: --Pre-reqs:
3993: -- PO_ENCUMBRANCE_GT has been populated with the date information
3994: -- for both the original doc and backing docs.
3995: --Modifies:
3996: -- PO_ENCUMBRANCE_GT
3997: --Locks:

Line 3996: -- PO_ENCUMBRANCE_GT

3992: --Pre-reqs:
3993: -- PO_ENCUMBRANCE_GT has been populated with the date information
3994: -- for both the original doc and backing docs.
3995: --Modifies:
3996: -- PO_ENCUMBRANCE_GT
3997: --Locks:
3998: -- n/a
3999: --Function:
4000: -- This procedure updates the period information in PO_ENCUMBRANCE_GT

Line 4000: -- This procedure updates the period information in PO_ENCUMBRANCE_GT

3996: -- PO_ENCUMBRANCE_GT
3997: --Locks:
3998: -- n/a
3999: --Function:
4000: -- This procedure updates the period information in PO_ENCUMBRANCE_GT
4001: -- for both the main doc and backing docs.
4002: -- For backing docs, it sets the period information equal to the
4003: -- period information of the main doc.
4004: --Parameters:

Line 4204: UPDATE PO_ENCUMBRANCE_GT BACKING

4200:
4201: -- By now, the period info has been set for the original
4202: -- document's distributions.
4203: -- Now update the backing distributions.
4204: UPDATE PO_ENCUMBRANCE_GT BACKING
4205: SET (
4206: BACKING.period_name
4207: , BACKING.period_year
4208: , BACKING.period_num

Line 4221: PO_ENCUMBRANCE_GT ORIG

4217: , ORIG.period_num
4218: , ORIG.quarter_num
4219: , ORIG.gl_period_date --bug#5098665
4220: FROM
4221: PO_ENCUMBRANCE_GT ORIG
4222: WHERE
4223: ORIG.sequence_num = BACKING.origin_sequence_num
4224: AND ORIG.origin_sequence_num IS NULL
4225: AND ORIG.distribution_type <> g_dist_type_REQUISITION

Line 4250: UPDATE PO_ENCUMBRANCE_GT DISTS

4246: , 'PO_PDOI_INVALID_GL_ENC_PER'
4247: );
4248:
4249: -- Mark the missing date lines to not be sent to GL
4250: UPDATE PO_ENCUMBRANCE_GT DISTS
4251: SET DISTS.send_to_gl_flag = 'N' --bug 5413111 gl period failed rows shouldn't be sent to GL
4252: , DISTS.gl_result_code = 'F25' --GL error code for no period found
4253: , DISTS.result_type = g_result_ERROR
4254: , DISTS.result_text = l_period_error_text

Line 4265: UPDATE PO_ENCUMBRANCE_GT DISTS

4261: , 'PO_ENC_DIST_NOT_PROCESSED'
4262: );
4263:
4264: -- Mark the other lines as failures, since packet is hosed
4265: UPDATE PO_ENCUMBRANCE_GT DISTS
4266: SET DISTS.send_to_gl_flag = 'Y' --bug 3568512: new send_to_gl column
4267: , DISTS.result_text = l_not_processed_msg
4268: , DISTS.result_type = g_result_NOT_PROCESSED
4269: WHERE DISTS.period_name IS NOT NULL;

Line 4314: -- PO_ENCUMBRANCE_GT has been populated with the date information

4310: -------------------------------------------------------------------------------
4311: --Start of Comments
4312: --Name: find_open_period
4313: --Pre-reqs:
4314: -- PO_ENCUMBRANCE_GT has been populated with the date information
4315: -- for both the original doc.
4316: --Modifies:
4317: -- PO_ENCUMBRANCE_GT
4318: -- PO_SESSION_GT

Line 4317: -- PO_ENCUMBRANCE_GT

4313: --Pre-reqs:
4314: -- PO_ENCUMBRANCE_GT has been populated with the date information
4315: -- for both the original doc.
4316: --Modifies:
4317: -- PO_ENCUMBRANCE_GT
4318: -- PO_SESSION_GT
4319: --Locks:
4320: -- n/a
4321: --Function:

Line 4322: -- This procedure updates the period information in PO_ENCUMBRANCE_GT

4318: -- PO_SESSION_GT
4319: --Locks:
4320: -- n/a
4321: --Function:
4322: -- This procedure updates the period information in PO_ENCUMBRANCE_GT
4323: -- for both the main doc, based on parameters which decide whether to
4324: -- use the distribution GL date, override date, roll-forward or
4325: -- roll-backward logic.
4326: --Parameters:

Line 4421: FROM PO_ENCUMBRANCE_GT DISTS

4417:
4418: )
4419: )
4420: )
4421: FROM PO_ENCUMBRANCE_GT DISTS
4422: WHERE
4423: DISTS.origin_sequence_num IS NULL --main doc
4424: AND DISTS.period_name IS NULL
4425: --bug 3568512: use send_to_gl_flag for this filter condition

Line 4733: --po_encumbrance_gt with gl_period_start_date that we derived earlier

4729:
4730: --bug#5098665 From now on we would populate the open period start date
4731: --instead of gl_encumbered_date. This is to ensure that the funds get
4732: --reserved/unreserved in the correct period. We would first populate
4733: --po_encumbrance_gt with gl_period_start_date that we derived earlier
4734: --and then this would be passed onto po_bc_distributions.
4735:
4736: UPDATE PO_ENCUMBRANCE_GT DISTS
4737: SET (

Line 4736: UPDATE PO_ENCUMBRANCE_GT DISTS

4732: --reserved/unreserved in the correct period. We would first populate
4733: --po_encumbrance_gt with gl_period_start_date that we derived earlier
4734: --and then this would be passed onto po_bc_distributions.
4735:
4736: UPDATE PO_ENCUMBRANCE_GT DISTS
4737: SET (
4738: DISTS.period_name
4739: , DISTS.period_year
4740: , DISTS.period_num

Line 4771: --po_encumbrance_gt with gl_period_start_date that we derived earlier

4767: l_progress := '080';
4768: --bug#5098665 From now on we would populate the open period start date
4769: --instead of gl_encumbered_date. This is to ensure that the funds get
4770: --reserved/unreserved in the correct period. We would first populate
4771: --po_encumbrance_gt with gl_period_start_date that we derived earlier
4772: --and then this would be passed onto po_bc_distributions.
4773:
4774: UPDATE PO_ENCUMBRANCE_GT DISTS
4775: SET (

Line 4774: UPDATE PO_ENCUMBRANCE_GT DISTS

4770: --reserved/unreserved in the correct period. We would first populate
4771: --po_encumbrance_gt with gl_period_start_date that we derived earlier
4772: --and then this would be passed onto po_bc_distributions.
4773:
4774: UPDATE PO_ENCUMBRANCE_GT DISTS
4775: SET (
4776: DISTS.period_name
4777: , DISTS.period_year
4778: , DISTS.period_num

Line 4857: -- The PO_ENCUMBRANCE_GT temp table has been populated with all

4853: -------------------------------------------------------------------------------
4854: --Start of Comments
4855: --Name: get_amounts
4856: --Pre-reqs:
4857: -- The PO_ENCUMBRANCE_GT temp table has been populated with all
4858: -- required information about the main and backing documents; and
4859: -- Encumbrance is on for the doc type of the main doc.
4860: --Modifies:
4861: -- PO_ENCUMBRANCE_GT

Line 4861: -- PO_ENCUMBRANCE_GT

4857: -- The PO_ENCUMBRANCE_GT temp table has been populated with all
4858: -- required information about the main and backing documents; and
4859: -- Encumbrance is on for the doc type of the main doc.
4860: --Modifies:
4861: -- PO_ENCUMBRANCE_GT
4862: --Locks:
4863: -- None.
4864: --Function:
4865: -- This procedure calculates the total amount being transacted by

Line 4867: -- column for each row in the PO_ENCUMBRANCE_GT table

4863: -- None.
4864: --Function:
4865: -- This procedure calculates the total amount being transacted by
4866: -- the encumbrance action and populates this value in the final_amt
4867: -- column for each row in the PO_ENCUMBRANCE_GT table
4868: --Parameters:
4869: --IN:
4870: --p_action
4871: -- Specifies the action that is being taken on the main doc.

Line 5017: FROM PO_ENCUMBRANCE_GT

5013: -- Requester Change Order is not supported for Complex Work POs.
5014:
5015: SELECT header_id
5016: INTO l_header_id
5017: FROM PO_ENCUMBRANCE_GT
5018: WHERE origin_sequence_num is null --main doc
5019: AND rownum = 1 --just get first record since all should have same ID
5020: ;
5021:

Line 5070: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows);

5066:
5067: l_progress := '070';
5068:
5069: IF g_debug_stmt THEN
5070: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows);
5071: PO_DEBUG.debug_end(l_log_head);
5072: END IF;
5073:
5074:

Line 5098: -- The PO_ENCUMBRANCE_GT temp table has been populated with all

5094: -------------------------------------------------------------------------------
5095: --Start of Comments
5096: --Name: get_initial_amounts
5097: --Pre-reqs:
5098: -- The PO_ENCUMBRANCE_GT temp table has been populated with all
5099: -- required information about the main and backing documents; and
5100: -- Encumbrance is on for the doc type of the main doc.
5101: --Modifies:
5102: -- PO_ENCUMBRANCE_GT

Line 5102: -- PO_ENCUMBRANCE_GT

5098: -- The PO_ENCUMBRANCE_GT temp table has been populated with all
5099: -- required information about the main and backing documents; and
5100: -- Encumbrance is on for the doc type of the main doc.
5101: --Modifies:
5102: -- PO_ENCUMBRANCE_GT
5103: --Locks:
5104: -- None.
5105: --Function:
5106: -- Performs the basic calculations for both main and backing docs:

Line 5182: UPDATE PO_ENCUMBRANCE_GT DISTS

5178: -- Now, calculate the intial amount_ordered for both the
5179: -- main and backing documents
5180:
5181: -- First, get the qty_ordered for quantity-based lines
5182: UPDATE PO_ENCUMBRANCE_GT DISTS
5183: SET DISTS.qty_ordered = nvl(DISTS.quantity_ordered, 0)
5184: WHERE DISTS.prevent_encumbrance_flag = 'N'
5185: AND DISTS.amount_based_flag = 'N'
5186: ;

Line 5191: UPDATE PO_ENCUMBRANCE_GT DISTS

5187:
5188: l_progress := '020';
5189:
5190: -- Now, get amt_ordered for both Service and non-Service lines
5191: UPDATE PO_ENCUMBRANCE_GT DISTS
5192: SET DISTS.amt_ordered =
5193: DECODE(DISTS.distribution_type
5194: -- Agreements
5195: , g_dist_type_AGREEMENT, amt_to_encumber_func

Line 5213: l_log_head, l_progress,'PO_ENCUMBRANCE_GT', PO_DEBUG.g_all_rows,

5209: l_progress := '030';
5210:
5211: IF g_debug_stmt THEN
5212: PO_DEBUG.debug_table(
5213: l_log_head, l_progress,'PO_ENCUMBRANCE_GT', PO_DEBUG.g_all_rows,
5214: po_tbl_varchar30( 'amount_based_flag', 'qty_ordered', 'amt_ordered' )
5215: );
5216: END IF;
5217:

Line 5228: UPDATE PO_ENCUMBRANCE_GT DISTS

5224:
5225: -- Note: the nonrecoverable_tax can be negative due
5226: -- to tax adjustments from Req Split.(bug 3428139, bug 3428600)
5227:
5228: UPDATE PO_ENCUMBRANCE_GT DISTS
5229: SET DISTS.nonrecoverable_tax_rate =
5230: DECODE( NVL(DISTS.amt_ordered,0)
5231:
5232: -- Bug 3410522: If amt_ordered is 0, we can ignore tax.

Line 5245: l_log_head, l_progress,'PO_ENCUMBRANCE_GT', PO_DEBUG.g_all_rows,

5241: l_progress := '040';
5242:
5243: IF g_debug_stmt THEN
5244: PO_DEBUG.debug_table(
5245: l_log_head, l_progress,'PO_ENCUMBRANCE_GT', PO_DEBUG.g_all_rows,
5246: po_tbl_varchar30( 'nonrecoverable_tax_rate')
5247: );
5248: PO_DEBUG.debug_end(l_log_head);
5249: END IF;

Line 5272: -- The PO_ENCUMBRANCE_GT temp table has been populated with all

5268: -------------------------------------------------------------------------------
5269: --Start of Comments
5270: --Name: get_main_doc_amts
5271: --Pre-reqs:
5272: -- The PO_ENCUMBRANCE_GT temp table has been populated with all
5273: -- required information about the main and backing documents; and
5274: -- Encumbrance is on for the doc type of the main doc.
5275: --Modifies:
5276: -- PO_ENCUMBRANCE_GT

Line 5276: -- PO_ENCUMBRANCE_GT

5272: -- The PO_ENCUMBRANCE_GT temp table has been populated with all
5273: -- required information about the main and backing documents; and
5274: -- Encumbrance is on for the doc type of the main doc.
5275: --Modifies:
5276: -- PO_ENCUMBRANCE_GT
5277: --Locks:
5278: -- None.
5279: --Function:
5280: -- Calculates the amount of encumbrance from the main document that

Line 5338: UPDATE PO_ENCUMBRANCE_GT DISTS

5334: IF (p_doc_type = g_doc_type_REQUISITION) THEN
5335: -- main doc is a Req
5336: l_progress := '020';
5337:
5338: UPDATE PO_ENCUMBRANCE_GT DISTS
5339: SET DISTS.amt_closed =
5340: DISTS.amt_ordered *
5341: DECODE( DISTS.amount_based_flag
5342:

Line 5362: UPDATE PO_ENCUMBRANCE_GT DISTS

5358: l_progress := '030';
5359:
5360: -- The closed amount for BPAs is the amount of encumbrance already
5361: -- relieved against the BPA
5362: UPDATE PO_ENCUMBRANCE_GT DISTS
5363: SET DISTS.amt_closed = DISTS.unencumbered_amount
5364: WHERE DISTS.prevent_encumbrance_flag = 'N'
5365: ;
5366:

Line 5377: UPDATE PO_ENCUMBRANCE_GT DISTS

5373: IF (p_doc_subtype = g_doc_subtype_PLANNED) THEN
5374: l_progress := '040';
5375:
5376: -- For PPO, qty closed = qty unencumbered by SR's against the PPO
5377: UPDATE PO_ENCUMBRANCE_GT DISTS
5378: SET DISTS.qty_closed = DISTS.unencumbered_quantity
5379: WHERE DISTS.origin_sequence_num IS NULL -- main doc
5380: AND DISTS.prevent_encumbrance_flag = 'N'
5381: AND DISTS.amount_based_flag = 'N'

Line 5392: UPDATE PO_ENCUMBRANCE_GT DISTS

5388:
5389: -- in this case, qty closed is the amount that is already
5390: -- moved to an actual (and not considered for future encumbrance
5391: -- actions)
5392: UPDATE PO_ENCUMBRANCE_GT DISTS
5393: SET DISTS.qty_closed =
5394: DECODE( DISTS.accrue_on_receipt_flag
5395:
5396: -- Online Accruals

Line 5448: UPDATE PO_ENCUMBRANCE_GT DISTS

5444: l_progress := '060';
5445:
5446: -- Now that we have the qty_closed for the qty-based main doc
5447: -- lines, we can get the amt_closed for all main doc lines.
5448: UPDATE PO_ENCUMBRANCE_GT DISTS
5449: SET DISTS.amt_closed =
5450: DECODE( DISTS.amount_based_flag
5451:
5452: -- quantity-based: use qty_closed calc from above

Line 5531: UPDATE PO_ENCUMBRANCE_GT DISTS

5527: -- will be used for backing doc calculations.
5528: -- qty_closed must be updated before amt_closed,
5529: -- since it is used in the calculation for amt_closed.
5530:
5531: UPDATE PO_ENCUMBRANCE_GT DISTS
5532: SET DISTS.qty_closed =
5533: DECODE( p_action
5534: , g_action_INVOICE_CANCEL,
5535: DISTS.quantity_billed + p_ap_cancelled_qty

Line 5550: UPDATE PO_ENCUMBRANCE_GT DISTS

5546:
5547: -- Bug 3480949: Use p_ap_reinstated_enc_amt instead of
5548: -- deleted variable l_ap_amt_billed_change
5549:
5550: UPDATE PO_ENCUMBRANCE_GT DISTS
5551: SET DISTS.amt_closed =
5552: DECODE( DISTS.amount_based_flag
5553:
5554: , 'N', DISTS.qty_closed * DISTS.price

Line 5577: l_log_head, l_progress,'PO_ENCUMBRANCE_GT', PO_DEBUG.g_all_rows,

5573: PO_DEBUG.debug_stmt(l_log_head,l_progress,
5574: 'Calculated amount_closed for main document'
5575: );
5576: PO_DEBUG.debug_table(
5577: l_log_head, l_progress,'PO_ENCUMBRANCE_GT', PO_DEBUG.g_all_rows,
5578: po_tbl_varchar30( 'amount_based_flag', 'qty_closed', 'amt_closed')
5579: );
5580: PO_DEBUG.debug_end(l_log_head);
5581: END IF;

Line 5605: -- The PO_ENCUMBRANCE_GT temp table has been populated with all

5601: -------------------------------------------------------------------------------
5602: --Start of Comments
5603: --Name: get_backing_doc_amts
5604: --Pre-reqs:
5605: -- The PO_ENCUMBRANCE_GT temp table has been populated with all
5606: -- required information about the main and backing documents; and
5607: -- Encumbrance is on for the doc type of the main doc.
5608: --Modifies:
5609: -- PO_ENCUMBRANCE_GT

Line 5609: -- PO_ENCUMBRANCE_GT

5605: -- The PO_ENCUMBRANCE_GT temp table has been populated with all
5606: -- required information about the main and backing documents; and
5607: -- Encumbrance is on for the doc type of the main doc.
5608: --Modifies:
5609: -- PO_ENCUMBRANCE_GT
5610: --Locks:
5611: -- None.
5612: --Function:
5613: -- Calculates the amount of encumbrance from the backing Req/PPO that

Line 5713: UPDATE PO_ENCUMBRANCE_GT REQ_DISTS

5709:
5710:
5711: -- Get unit of measure conversion rate, if backing Req UOM is
5712: -- different from main doc UOM
5713: UPDATE PO_ENCUMBRANCE_GT REQ_DISTS
5714: SET REQ_DISTS.uom_conversion_rate =
5715: (SELECT PO_UOM_S.PO_UOM_CONVERT_P( PO_DISTS.unit_meas_lookup_code
5716: , REQ_DISTS.unit_meas_lookup_code
5717: , REQ_DISTS.item_id

Line 5719: FROM PO_ENCUMBRANCE_GT PO_DISTS

5715: (SELECT PO_UOM_S.PO_UOM_CONVERT_P( PO_DISTS.unit_meas_lookup_code
5716: , REQ_DISTS.unit_meas_lookup_code
5717: , REQ_DISTS.item_id
5718: )
5719: FROM PO_ENCUMBRANCE_GT PO_DISTS
5720: WHERE REQ_DISTS.origin_sequence_num = PO_DISTS.sequence_num
5721: AND PO_DISTS.distribution_type <> g_dist_type_REQUISITION
5722: AND REQ_DISTS.unit_meas_lookup_code <>
5723: PO_DISTS.unit_meas_lookup_code

Line 5734: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows

5730: l_progress := '030';
5731:
5732: IF g_debug_stmt THEN
5733: PO_DEBUG.debug_stmt(l_log_head,l_progress,'did UoM conversion');
5734: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows
5735: ,po_tbl_varchar30('prevent_encumbrance_flag','amount_based_flag'
5736: ,'distribution_type','uom_conversion_rate','unit_meas_lookup_code'
5737: ,'item_id','sequence_num','origin_sequence_num'
5738: )

Line 5746: update po_encumbrance_gt req_dists

5742: -- Bug 13823506 - start
5743: -- overriding the uom conv. since line type FD doesnt honor the line type between
5744: -- req and po anymore and also, the uom found here is used for calc. closed_amount
5745: -- which is not used for clm docs
5746: update po_encumbrance_gt req_dists
5747: set uom_conversion_rate = 1
5748: where req_dists.clm_doc_flag = 'Y'
5749: and req_dists.uom_conversion_rate = -999
5750: and req_dists.prevent_encumbrance_flag = 'N'

Line 5760: FROM PO_ENCUMBRANCE_GT REQ_DISTS

5756: -- Check to see if any of the rows returned error from the function
5757: BEGIN
5758: SELECT 'Y'
5759: INTO l_uom_conversion_error
5760: FROM PO_ENCUMBRANCE_GT REQ_DISTS
5761: WHERE REQ_DISTS.distribution_type = g_dist_type_REQUISITION
5762: AND REQ_DISTS.amount_based_flag = 'N'
5763: AND REQ_DISTS.prevent_encumbrance_flag = 'N'
5764: AND REQ_DISTS.uom_conversion_rate = -999

Line 5783: -- Added the below code to update PO_ENCUMBRANCE_GT table with result text

5779: -- When the Conversion rate is not defined between the main document UOM
5780: -- and Backing Requistion UOM , user defined exception FND_API.G_EXC_ERROR
5781: -- is being thrown and the encumbrance action is stopped without showning the details
5782: -- of the error.
5783: -- Added the below code to update PO_ENCUMBRANCE_GT table with result text
5784: -- showing the details of the error .
5785: -- This error text is shown in budgetary control exception report
5786: -- from copy_detail_gl_results procedure.
5787:

Line 5794: UPDATE PO_ENCUMBRANCE_GT PO_DISTS

5790: l_uom_conversion_err_text := FND_MESSAGE.get_string('PO',
5791: 'PO_REQ_UOM_CONVERT_FAIL'
5792: );
5793:
5794: UPDATE PO_ENCUMBRANCE_GT PO_DISTS
5795: SET PO_DISTS.send_to_gl_flag = 'N',
5796: PO_DISTS.result_type = g_result_ERROR,
5797: PO_DISTS.result_text = l_uom_conversion_err_text
5798: WHERE PO_DISTS.sequence_num IN (SELECT REQ_DISTS.origin_sequence_num

Line 5799: FROM PO_ENCUMBRANCE_GT REQ_DISTS

5795: SET PO_DISTS.send_to_gl_flag = 'N',
5796: PO_DISTS.result_type = g_result_ERROR,
5797: PO_DISTS.result_text = l_uom_conversion_err_text
5798: WHERE PO_DISTS.sequence_num IN (SELECT REQ_DISTS.origin_sequence_num
5799: FROM PO_ENCUMBRANCE_GT REQ_DISTS
5800: WHERE REQ_DISTS.amount_based_flag = 'N'
5801: AND REQ_DISTS.prevent_encumbrance_flag = 'N'
5802: AND REQ_DISTS.origin_sequence_num IS NOT NULL
5803: AND REQ_DISTS.distribution_type = g_dist_type_REQUISITION

Line 5836: UPDATE PO_ENCUMBRANCE_GT REQ_DISTS

5832: -- Cancel w/ recreate demand uses new Req line (so not this calc)
5833: -- and backing Req for Invoice Cancel is calculated separately
5834: l_progress := '060';
5835:
5836: UPDATE PO_ENCUMBRANCE_GT REQ_DISTS
5837: SET REQ_DISTS.amt_closed =
5838: (SELECT
5839: DECODE( REQ_DISTS.amount_based_flag
5840:

Line 5849: FROM PO_ENCUMBRANCE_GT PO_DISTS

5845:
5846: -- amount based
5847: , PO_DISTS.amt_closed_func --bug 3435571
5848: )
5849: FROM PO_ENCUMBRANCE_GT PO_DISTS
5850: WHERE REQ_DISTS.origin_sequence_num = PO_DISTS.sequence_num
5851: AND PO_DISTS.distribution_type <> g_dist_type_REQUISITION
5852: )
5853: WHERE REQ_DISTS.distribution_type = g_dist_type_REQUISITION

Line 5861: UPDATE PO_ENCUMBRANCE_GT REQ_DISTS

5857: ELSE
5858: -- p_action is Invoice/Credit Memo Cancel
5859: l_progress := '070';
5860:
5861: UPDATE PO_ENCUMBRANCE_GT REQ_DISTS
5862: SET REQ_DISTS.qty_open =
5863: (SELECT
5864: DECODE( greatest(0, REQ_DISTS.qty_ordered -
5865: (PO_DISTS.qty_closed *

Line 5882: FROM PO_ENCUMBRANCE_GT PO_DISTS

5878: --put entire cancelled qty on Req
5879: , (p_ap_cancelled_qty
5880: * NVL(REQ_DISTS.uom_conversion_rate,1))
5881: )
5882: FROM PO_ENCUMBRANCE_GT PO_DISTS
5883: WHERE REQ_DISTS.origin_sequence_num = PO_DISTS.sequence_num
5884: AND PO_DISTS.distribution_type <> g_dist_type_REQUISITION
5885: ) --end select
5886: WHERE REQ_DISTS.distribution_type = g_dist_type_REQUISITION

Line 5893: UPDATE PO_ENCUMBRANCE_GT REQ_DISTS

5889: ;
5890:
5891: l_progress := '080';
5892:
5893: UPDATE PO_ENCUMBRANCE_GT REQ_DISTS
5894: SET REQ_DISTS.amt_open =
5895: (SELECT
5896: DECODE( REQ_DISTS.amount_based_flag
5897:

Line 5916: FROM PO_ENCUMBRANCE_GT PO_DISTS

5912: --we will add tax to and round this amt
5913: , p_ap_amt_billed_change
5914: )
5915: )
5916: FROM PO_ENCUMBRANCE_GT PO_DISTS
5917: WHERE REQ_DISTS.origin_sequence_num = PO_DISTS.sequence_num
5918: AND PO_DISTS.distribution_type <> g_dist_type_REQUISITION
5919: )
5920: WHERE REQ_DISTS.distribution_type = g_dist_type_REQUISITION

Line 5935: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows

5931: IF g_debug_stmt THEN
5932: PO_DEBUG.debug_stmt(l_log_head,l_progress,
5933: 'Calculated amount_closed for backing Reqs'
5934: );
5935: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows
5936: ,po_tbl_varchar30('prevent_encumbrance_flag','amount_based_flag'
5937: ,'qty_open','qty_ordered','qty_closed','uom_conversion_rate'
5938: ,'quantity_billed','distribution_type','sequence_num','origin_sequence_num'
5939: ,'amt_open','price','amt_ordered','amt_closed','amount_billed'

Line 5972: UPDATE PO_ENCUMBRANCE_GT PPO_DISTS

5968: -- Note: FC, Undo FC, Return do not have backing PPO scenarios,
5969: -- and backing PPO qty for Invoice Cancel is calculated separately
5970: l_progress := '110';
5971:
5972: UPDATE PO_ENCUMBRANCE_GT PPO_DISTS
5973: SET PPO_DISTS.qty_open =
5974: (SELECT SR_DISTS.qty_ordered - SR_DISTS.qty_closed
5975: FROM PO_ENCUMBRANCE_GT SR_DISTS
5976: WHERE SR_DISTS.sequence_num = PPO_DISTS.origin_sequence_num

Line 5975: FROM PO_ENCUMBRANCE_GT SR_DISTS

5971:
5972: UPDATE PO_ENCUMBRANCE_GT PPO_DISTS
5973: SET PPO_DISTS.qty_open =
5974: (SELECT SR_DISTS.qty_ordered - SR_DISTS.qty_closed
5975: FROM PO_ENCUMBRANCE_GT SR_DISTS
5976: WHERE SR_DISTS.sequence_num = PPO_DISTS.origin_sequence_num
5977: )
5978: WHERE PPO_DISTS.origin_sequence_num IS NOT NULL
5979: AND PPO_DISTS.prevent_encumbrance_flag = 'N'

Line 5987: UPDATE PO_ENCUMBRANCE_GT PPO_DISTS

5983:
5984: -- p_action is Invoice/Credit Memo Cancel
5985: l_progress := '120';
5986:
5987: UPDATE PO_ENCUMBRANCE_GT PPO_DISTS
5988: SET PPO_DISTS.qty_open =
5989: (SELECT
5990: DECODE( greatest(0, SR_DISTS.qty_ordered -
5991: SR_DISTS.qty_closed

Line 6009: FROM PO_ENCUMBRANCE_GT SR_DISTS

6005:
6006: --put entire cancelled qty on PPO
6007: , p_ap_cancelled_qty
6008: )
6009: FROM PO_ENCUMBRANCE_GT SR_DISTS
6010: WHERE PPO_DISTS.origin_sequence_num = SR_DISTS.sequence_num
6011: )
6012: WHERE PPO_DISTS.origin_sequence_num IS NOT NULL
6013: AND PPO_DISTS.prevent_encumbrance_flag = 'N'

Line 6022: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows

6018: IF g_debug_stmt THEN
6019: PO_DEBUG.debug_stmt(l_log_head,l_progress,
6020: 'Updated qty_open for backing PPO'
6021: );
6022: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows
6023: ,po_tbl_varchar30('prevent_encumbrance_flag'
6024: ,'qty_open','qty_ordered','qty_closed','quantity_billed'
6025: ,'distribution_type','sequence_num','origin_sequence_num')
6026: );

Line 6042: UPDATE PO_ENCUMBRANCE_GT REQ_DISTS

6038: IF g_debug_stmt THEN
6039: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Get last implemented Fund Value for backing Requisitions.');
6040: End If;
6041:
6042: UPDATE PO_ENCUMBRANCE_GT REQ_DISTS
6043: SET REQ_DISTS.FUNDED_VALUE = por_amendment_pkg.getLastImplFundValue(REQ_DISTS.distribution_id)
6044: WHERE REQ_DISTS.origin_sequence_num IS NOT NULL
6045: AND REQ_DISTS.distribution_type = g_dist_type_REQUISITION
6046: AND REQ_DISTS.CLM_DOC_FLAG = 'Y'

Line 6086: -- The PO_ENCUMBRANCE_GT temp table has been populated with all

6082: -------------------------------------------------------------------------------
6083: --Start of Comments
6084: --Name: get_final_amounts
6085: --Pre-reqs:
6086: -- The PO_ENCUMBRANCE_GT temp table has been populated with all
6087: -- required information about the main and backing documents; and
6088: -- Encumbrance is on for the doc type of the main doc.
6089: --Modifies:
6090: -- PO_ENCUMBRANCE_GT

Line 6090: -- PO_ENCUMBRANCE_GT

6086: -- The PO_ENCUMBRANCE_GT temp table has been populated with all
6087: -- required information about the main and backing documents; and
6088: -- Encumbrance is on for the doc type of the main doc.
6089: --Modifies:
6090: -- PO_ENCUMBRANCE_GT
6091: --Locks:
6092: -- None.
6093: --Function:
6094: -- Based on the initial encumbrance amounts, and any amounts that are already

Line 6174: UPDATE PO_ENCUMBRANCE_GT PPO_DISTS

6170: IF (p_doc_subtype = g_doc_subtype_SCHEDULED) THEN
6171:
6172: l_progress := '010';
6173:
6174: UPDATE PO_ENCUMBRANCE_GT PPO_DISTS
6175: SET PPO_DISTS.amt_open =
6176: PPO_DISTS.qty_open * PPO_DISTS.price
6177: -- no Services lines on PPOs/SRs
6178: WHERE PPO_DISTS.origin_sequence_num IS NOT NULL --backing document

Line 6206: UPDATE PO_ENCUMBRANCE_GT DISTS

6202: -- the difference in the original amount of encumbrance and the
6203: -- amount of encumbrance already moved off to actuals.
6204: -- The greatest(0, <>) adjusts for over-delivered/billed case
6205:
6206: UPDATE PO_ENCUMBRANCE_GT DISTS
6207: SET DISTS.amt_open =
6208: DECODE( DISTS.amt_open
6209:
6210: -- if NULL, then it needs to be calculated still

Line 6241: UPDATE PO_ENCUMBRANCE_GT DISTS

6237: --you cannot cancel quantity/amount on the BPA itself. You can do
6238: --it only on releases. For BPA's the unencumbered amount accounts
6239: --for cancelled quantity of the relese as well.
6240:
6241: UPDATE PO_ENCUMBRANCE_GT DISTS
6242: SET DISTS.amt_open =
6243: GREATEST( 0,
6244: DISTS.amt_open -
6245: DECODE( DISTS.amount_based_flag

Line 6273: UPDATE PO_ENCUMBRANCE_GT DISTS

6269: -- amt_open to p_ap_reinstated_enc_amt, so that we add tax below.
6270:
6271: l_progress := '055';
6272:
6273: UPDATE PO_ENCUMBRANCE_GT DISTS
6274: SET DISTS.amt_open = p_ap_reinstated_enc_amt
6275: WHERE DISTS.prevent_encumbrance_flag = 'N'
6276: AND DISTS.origin_sequence_num IS NULL -- main doc
6277: ;

Line 6289: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows

6285: IF g_debug_stmt THEN
6286: PO_DEBUG.debug_stmt(l_log_head,l_progress,
6287: 'Updated amt_open for all lines'
6288: );
6289: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows
6290: ,po_tbl_varchar30('prevent_encumbrance_flag' ,'amt_open',
6291: 'qty_ordered','qty_closed','quantity_billed', 'quantity_cancelled'
6292: ,'distribution_type','sequence_num','origin_sequence_num')
6293: );

Line 6298: UPDATE PO_ENCUMBRANCE_GT DISTS

6294: END IF;
6295:
6296:
6297: -- Before we do any rounding, we need to add in the tax (pro-rated)
6298: UPDATE PO_ENCUMBRANCE_GT DISTS
6299: SET DISTS.pre_round_amt = (DISTS.amt_open * DISTS.nonrecoverable_tax_rate)
6300: WHERE DISTS.prevent_encumbrance_flag = 'N'
6301: AND DISTS.amt_open IS NOT NULL
6302: ;

Line 6314: -- passing encumbered amount of po_encumbrance_gt for this purpose.

6310:
6311: l_progress := '060';
6312:
6313: -- calling this function as to pass the correct entered amount based on the currency and rounding used.
6314: -- passing encumbered amount of po_encumbrance_gt for this purpose.
6315: -- This is required to get the correct delta amount from pre round amount and encumbered amount.
6316: round_and_convert_amounts( p_action => p_action
6317: ,p_currency_code_func => p_currency_code_func
6318: , p_min_acct_unit_func => p_min_acct_unit_func

Line 6343: UPDATE PO_ENCUMBRANCE_GT DISTS

6339: );
6340: END IF;
6341:
6342: FORALL i IN 1..l_sequence_num_tbl.count
6343: UPDATE PO_ENCUMBRANCE_GT DISTS
6344: SET DISTS.pre_round_amt = DECODE (p_action ,g_action_RESERVE
6345: ,((DISTS.amt_ordered* DISTS.nonrecoverable_tax_rate )
6346: - l_enc_amt_tbl(i))
6347: ,g_action_CANCEL

Line 6360: UPDATE PO_ENCUMBRANCE_GT DISTS

6356:
6357: l_progress := '080';
6358:
6359: IF p_action = g_action_RESERVE THEN
6360: UPDATE PO_ENCUMBRANCE_GT DISTS
6361: SET DISTS.pre_round_amt = (DISTS.amount_to_encumber - ( DISTS.encumbered_amount + DISTS.unencumbered_amount ))
6362: WHERE Nvl(DISTS.amount_changed_flag,'N') = 'Y';
6363: ELSIF p_action = g_action_CANCEL THEN
6364: UPDATE PO_ENCUMBRANCE_GT DISTS

Line 6364: UPDATE PO_ENCUMBRANCE_GT DISTS

6360: UPDATE PO_ENCUMBRANCE_GT DISTS
6361: SET DISTS.pre_round_amt = (DISTS.amount_to_encumber - ( DISTS.encumbered_amount + DISTS.unencumbered_amount ))
6362: WHERE Nvl(DISTS.amount_changed_flag,'N') = 'Y';
6363: ELSIF p_action = g_action_CANCEL THEN
6364: UPDATE PO_ENCUMBRANCE_GT DISTS
6365: SET DISTS.pre_round_amt = (DISTS.encumbered_amount)
6366: WHERE DISTS.distribution_type = 'AGREEMENT' AND
6367: (DISTS.clm_doc_flag = 'N');
6368: END IF;

Line 6379: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows

6375: IF g_debug_stmt THEN
6376: PO_DEBUG.debug_stmt(l_log_head,l_progress,
6377: 'Updated pre_round_amt for all lines'
6378: );
6379: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows
6380: ,po_tbl_varchar30('prevent_encumbrance_flag' ,'pre_round_amt')
6381: );
6382: END IF;
6383:

Line 6491: -- The PO_ENCUMBRANCE_GT temp table has been populated with all

6487: -------------------------------------------------------------------------------
6488: --Start of Comments
6489: --Name: round_and_convert_amounts
6490: --Pre-reqs:
6491: -- The PO_ENCUMBRANCE_GT temp table has been populated with all
6492: -- required information about the main and backing documents; and
6493: -- Encumbrance is on for the doc type of the main doc.
6494: --Modifies:
6495: -- PO_ENCUMBRANCE_GT

Line 6495: -- PO_ENCUMBRANCE_GT

6491: -- The PO_ENCUMBRANCE_GT temp table has been populated with all
6492: -- required information about the main and backing documents; and
6493: -- Encumbrance is on for the doc type of the main doc.
6494: --Modifies:
6495: -- PO_ENCUMBRANCE_GT
6496: --Locks:
6497: -- None.
6498: --Function:
6499: -- This procedure is a wrapper around the currency rounding procedure

Line 6521: -- Specifies with column of PO_ENCUMBRANCE_GT to convert and round

6517: --p_cur_precision_func
6518: -- The precision (defined in FND_CURRENCIES) of the functional
6519: -- currency for the current Set of Books
6520: --p_column_to_use
6521: -- Specifies with column of PO_ENCUMBRANCE_GT to convert and round
6522: -- Valid Values:
6523: -- g_column_AMOUNT_TO_ENCUMBER,
6524: -- g_column_AMOUNT_CLOSED
6525: -- g_column_PRE_ROUND_AMT

Line 6624: FROM PO_ENCUMBRANCE_GT DISTS

6620: , l_cur_precision_func_tbl
6621: , l_min_acct_unit_func_tbl
6622: , l_round_only_flag_tbl --bug 3568671
6623: , l_origin_sequence_num_tbl -- bug 3480949
6624: FROM PO_ENCUMBRANCE_GT DISTS
6625: WHERE DISTS.prevent_encumbrance_flag = 'N'
6626: ORDER BY DISTS.sequence_num
6627: ;
6628:

Line 6683: UPDATE PO_ENCUMBRANCE_GT DISTS

6679: -- so that if we do not update those columns which do not
6680: -- correspond to the value of p_column_to_use
6681:
6682: FORALL i IN 1 .. l_sequence_num_tbl.COUNT
6683: UPDATE PO_ENCUMBRANCE_GT DISTS
6684: SET
6685: amt_to_encumber_func =
6686: DECODE( p_column_to_use
6687: , g_column_AMOUNT_TO_ENCUMBER, l_amount_result_tbl(i)

Line 6744: -- The final_amt column of PO_ENCUMBRANCE_GT has

6740: -------------------------------------------------------------------------------
6741: --Start of Comments
6742: --Name: check_backing_pa_amounts
6743: --Pre-reqs:
6744: -- The final_amt column of PO_ENCUMBRANCE_GT has
6745: -- been populated correctly with the rounded functional amount for
6746: -- each of the distributions with backing agreements
6747: -- (PO against GA, Release against BPA)
6748: -- and the backing agreement distributions have also been loaded into

Line 6749: -- PO_ENCUMBRANCE_GT.

6745: -- been populated correctly with the rounded functional amount for
6746: -- each of the distributions with backing agreements
6747: -- (PO against GA, Release against BPA)
6748: -- and the backing agreement distributions have also been loaded into
6749: -- PO_ENCUMBRANCE_GT.
6750: -- It only makes sense to call this if both PO and Req encumbrance are on
6751: -- (i.e., blanket encumbrance is enabled).
6752: --Modifies:
6753: -- PO_ENCUMBRANCE_GT

Line 6753: -- PO_ENCUMBRANCE_GT

6749: -- PO_ENCUMBRANCE_GT.
6750: -- It only makes sense to call this if both PO and Req encumbrance are on
6751: -- (i.e., blanket encumbrance is enabled).
6752: --Modifies:
6753: -- PO_ENCUMBRANCE_GT
6754: --Locks:
6755: -- n/a
6756: --Function:
6757: -- This procedure updates the final_amt column of backing agreement

Line 6758: -- rows in PO_ENCUMBRANCE_GT, based on the final_amt for each

6754: --Locks:
6755: -- n/a
6756: --Function:
6757: -- This procedure updates the final_amt column of backing agreement
6758: -- rows in PO_ENCUMBRANCE_GT, based on the final_amt for each
6759: -- of the PO/Release distributions.
6760: -- It prohibits the sum of the amounts against the backing agreement
6761: -- from exceeding the limits of the agreement's encumbrance, based on
6762: -- the action being taken.

Line 6837: PO_ENCUMBRANCE_GT PA_DISTS

6833: , l_amt_to_encumber_func_tbl
6834: , l_unencumbered_amount_tbl
6835: , l_amount_tbl
6836: FROM
6837: PO_ENCUMBRANCE_GT PA_DISTS
6838: , PO_ENCUMBRANCE_GT PO_DISTS
6839: WHERE PA_DISTS.origin_sequence_num = PO_DISTS.sequence_num
6840: AND PA_DISTS.distribution_id = PO_DISTS.agreement_dist_id
6841: AND PO_DISTS.prevent_encumbrance_flag = 'N'

Line 6838: , PO_ENCUMBRANCE_GT PO_DISTS

6834: , l_unencumbered_amount_tbl
6835: , l_amount_tbl
6836: FROM
6837: PO_ENCUMBRANCE_GT PA_DISTS
6838: , PO_ENCUMBRANCE_GT PO_DISTS
6839: WHERE PA_DISTS.origin_sequence_num = PO_DISTS.sequence_num
6840: AND PA_DISTS.distribution_id = PO_DISTS.agreement_dist_id
6841: AND PO_DISTS.prevent_encumbrance_flag = 'N'
6842: AND PA_DISTS.distribution_type = g_dist_type_AGREEMENT

Line 6947: UPDATE PO_ENCUMBRANCE_GT PA_DISTS

6943: -- Then, put the updated amounts back into the main GTT
6944: --IF (l_update_enc_gt_flag = 'Y') THEN
6945:
6946: FORALL i IN 1 .. l_amount_tbl.COUNT
6947: UPDATE PO_ENCUMBRANCE_GT PA_DISTS
6948: SET PA_DISTS.final_amt = l_amount_tbl(i)
6949: WHERE
6950: PA_DISTS.distribution_id = l_pa_dist_id_tbl(i)
6951: AND PA_DISTS.sequence_num = l_pa_sequence_num_tbl(i)

Line 6997: -- PO_ENCUMBRANCE_GT is populated correctly with information about all

6993: -------------------------------------------------------------------------------
6994: --Start of Comments
6995: --Name: correct_backing_pa_amounts
6996: --Pre-reqs:
6997: -- PO_ENCUMBRANCE_GT is populated correctly with information about all
6998: -- the main doc and backing PA distributions
6999: --Modifies:
7000: -- PO_ENCUMBRANCE_GT
7001: --Locks:

Line 7000: -- PO_ENCUMBRANCE_GT

6996: --Pre-reqs:
6997: -- PO_ENCUMBRANCE_GT is populated correctly with information about all
6998: -- the main doc and backing PA distributions
6999: --Modifies:
7000: -- PO_ENCUMBRANCE_GT
7001: --Locks:
7002: -- n/a
7003: --Function:
7004: -- This procedure updates the final_amt column of backing agreement

Line 7005: -- rows in PO_ENCUMBRANCE_GT, based on the final_amt for each

7001: --Locks:
7002: -- n/a
7003: --Function:
7004: -- This procedure updates the final_amt column of backing agreement
7005: -- rows in PO_ENCUMBRANCE_GT, based on the final_amt for each
7006: -- of the PO/Release distributions.
7007: -- It prohibits the sum of the amounts against the backing agreement
7008: -- from exceeding the limits of the agreement's encumbrance, based on
7009: -- the action being taken.

Line 7028: -- the PO_ENCUMBRANCE_GT of each backing PA row

7024: --p_unencumbered_amt
7025: -- The unencumbered amount for the current PA, in functional currency
7026: --p_pa_sequence_num_tbl
7027: -- A colletion of sequence_nums corresponding to the sequence_nums in
7028: -- the PO_ENCUMBRANCE_GT of each backing PA row
7029: --p_pa_multiplier_tbl
7030: -- A collection where each element represents whether the corresponding
7031: -- element of the amount tbl is a DR or CR
7032: --IN OUT:

Line 7035: -- in the PO_ENCUMBRANCE_GT table, for a given backing PA entry

7031: -- element of the amount tbl is a DR or CR
7032: --IN OUT:
7033: --x_pa_amount_tbl
7034: -- A collection where each element represent the final_amt calculated
7035: -- in the PO_ENCUMBRANCE_GT table, for a given backing PA entry
7036: --Testing:
7037: --
7038: --End of Comments
7039: -------------------------------------------------------------------------------

Line 7166: -- The final_amt column of PO_ENCUMBRANCE_GT has

7162: -------------------------------------------------------------------------------
7163: --Start of Comments
7164: --Name: set_complex_work_req_amounts
7165: --Pre-reqs:
7166: -- The final_amt column of PO_ENCUMBRANCE_GT has
7167: -- been populated correctly with the rounded functional amount for
7168: -- each of the Complex Work PO distributions
7169: --Modifies:
7170: -- PO_ENCUMBRANCE_GT

Line 7170: -- PO_ENCUMBRANCE_GT

7166: -- The final_amt column of PO_ENCUMBRANCE_GT has
7167: -- been populated correctly with the rounded functional amount for
7168: -- each of the Complex Work PO distributions
7169: --Modifies:
7170: -- PO_ENCUMBRANCE_GT
7171: --Locks:
7172: -- n/a
7173: --Function:
7174: -- This procedure updates the final_amt column of backing Req rows in

Line 7175: -- PO_ENCUMBRANCE_GT, based on the final_amt for each of the main doc

7171: --Locks:
7172: -- n/a
7173: --Function:
7174: -- This procedure updates the final_amt column of backing Req rows in
7175: -- PO_ENCUMBRANCE_GT, based on the final_amt for each of the main doc
7176: -- (Complex Work PO doc) distributions
7177: -- It prohibits the sum of the amounts against the backing Requisition
7178: -- from exceeding the limits of the Requisition's encumbrance, if funds
7179: -- are being returned to the Requisition. If funds are being liquidated

Line 7227: UPDATE PO_ENCUMBRANCE_GT BACKING_REQ

7223: -- exceed this amount.
7224:
7225: -- First, set the backing Req dist final amount equal to the corresponding
7226: -- main doc final amount
7227: UPDATE PO_ENCUMBRANCE_GT BACKING_REQ
7228: SET BACKING_REQ.final_amt =
7229: (SELECT MAIN_DOC.final_amt
7230: FROM PO_ENCUMBRANCE_GT MAIN_DOC
7231: WHERE MAIN_DOC.sequence_num = BACKING_REQ.origin_sequence_num

Line 7230: FROM PO_ENCUMBRANCE_GT MAIN_DOC

7226: -- main doc final amount
7227: UPDATE PO_ENCUMBRANCE_GT BACKING_REQ
7228: SET BACKING_REQ.final_amt =
7229: (SELECT MAIN_DOC.final_amt
7230: FROM PO_ENCUMBRANCE_GT MAIN_DOC
7231: WHERE MAIN_DOC.sequence_num = BACKING_REQ.origin_sequence_num
7232: AND MAIN_DOC.origin_sequence_num IS NULL)
7233: WHERE BACKING_REQ.origin_sequence_num IS NOT NULL
7234: AND BACKING_REQ.distribution_type = g_dist_type_REQUISITION

Line 7238: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows,NULL,'PO');

7234: AND BACKING_REQ.distribution_type = g_dist_type_REQUISITION
7235: AND BACKING_REQ.prevent_encumbrance_flag = 'N'
7236: ;
7237: IF g_debug_stmt THEN
7238: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows,NULL,'PO');
7239: END IF;
7240: l_progress := '010';
7241:
7242: -- Next, extract the l_max_total_tbl for each distinct Req distribution: it

Line 7259: FROM PO_ENCUMBRANCE_GT BACKING_REQ

7255: BULK COLLECT INTO
7256: l_req_dist_id_tbl
7257: , l_max_total_tbl
7258: , l_req_dist_gtt_total_tbl
7259: FROM PO_ENCUMBRANCE_GT BACKING_REQ
7260: WHERE BACKING_REQ.origin_sequence_num IS NOT NULL
7261: AND BACKING_REQ.distribution_type = g_dist_type_REQUISITION
7262: AND BACKING_REQ.prevent_encumbrance_flag = 'N'
7263: GROUP BY distribution_id

Line 7327: -- PO_ENCUMBRANCE_GT is populated correctly with all information about all

7323: -------------------------------------------------------------------------------
7324: --Start of Comments
7325: --Name: correct_backing_req_amounts
7326: --Pre-reqs:
7327: -- PO_ENCUMBRANCE_GT is populated correctly with all information about all
7328: -- the main doc and backing Req distributions
7329: --Modifies:
7330: -- PO_ENCUMBRANCE_GT
7331: --Locks:

Line 7330: -- PO_ENCUMBRANCE_GT

7326: --Pre-reqs:
7327: -- PO_ENCUMBRANCE_GT is populated correctly with all information about all
7328: -- the main doc and backing Req distributions
7329: --Modifies:
7330: -- PO_ENCUMBRANCE_GT
7331: --Locks:
7332: -- n/a
7333: --Function:
7334: -- This procedure adjusts the final_amt column of backing Req rows in

Line 7335: -- PO_ENCUMBRANCE_GT for the Complex Work case.

7331: --Locks:
7332: -- n/a
7333: --Function:
7334: -- This procedure adjusts the final_amt column of backing Req rows in
7335: -- PO_ENCUMBRANCE_GT for the Complex Work case.
7336: -- It prohibits the sum of the amounts against the backing Requisition
7337: -- from exceeding the limits of the Requisition's encumbrance, if funds
7338: -- are being returned to the Requisition. If funds are being liquidated
7339: -- from the Requisition, it ensures that no hanging balances are left on

Line 7359: -- the PO_ENCUMBRANCE_GT of each backing PA row

7355: --p_unencumbered_amt
7356: -- The unencumbered amount for the current PA, in functional currency
7357: --p_pa_sequence_num_tbl
7358: -- A colletion of sequence_nums corresponding to the sequence_nums in
7359: -- the PO_ENCUMBRANCE_GT of each backing PA row
7360: --p_pa_multiplier_tbl
7361: -- A collection where each element represents whether the corresponding
7362: -- element of the amount tbl is a DR or CR
7363: --IN OUT:

Line 7366: -- in the PO_ENCUMBRANCE_GT table, for a given backing PA entry

7362: -- element of the amount tbl is a DR or CR
7363: --IN OUT:
7364: --x_pa_amount_tbl
7365: -- A collection where each element represent the final_amt calculated
7366: -- in the PO_ENCUMBRANCE_GT table, for a given backing PA entry
7367: --Testing:
7368: --
7369: --End of Comments
7370: -------------------------------------------------------------------------------

Line 7405: FROM PO_ENCUMBRANCE_GT BACKING_REQ

7401: , final_amt
7402: BULK COLLECT INTO
7403: l_sequence_num_tbl
7404: , l_gtt_amount_tbl
7405: FROM PO_ENCUMBRANCE_GT BACKING_REQ
7406: WHERE BACKING_REQ.origin_sequence_num IS NOT NULL
7407: AND BACKING_REQ.distribution_type = g_dist_type_REQUISITION
7408: AND BACKING_REQ.prevent_encumbrance_flag = 'N'
7409: AND BACKING_REQ.distribution_id = p_req_dist_id

Line 7469: UPDATE PO_ENCUMBRANCE_GT BACKING_REQ

7465: l_progress := '040';
7466:
7467: --Update the GTT with the adjusted amounts
7468: FORALL i IN l_start_row..l_end_row
7469: UPDATE PO_ENCUMBRANCE_GT BACKING_REQ
7470: SET BACKING_REQ.final_amt = l_gtt_amount_tbl(i)
7471: WHERE BACKING_REQ.sequence_num = l_sequence_num_tbl(i)
7472: ;
7473:

Line 7494: -- PO_ENCUMBRANCE_GT has been populated with the information for

7490: -------------------------------------------------------------------------------
7491: --Start of Comments
7492: --Name: get_gl_references
7493: --Pre-reqs:
7494: -- PO_ENCUMBRANCE_GT has been populated with the information for
7495: -- each of the distributions that will have an entry in GL_BC_PACKETS.
7496: --Modifies:
7497: -- PO_ENCUMBRANCE_GT
7498: --Locks:

Line 7497: -- PO_ENCUMBRANCE_GT

7493: --Pre-reqs:
7494: -- PO_ENCUMBRANCE_GT has been populated with the information for
7495: -- each of the distributions that will have an entry in GL_BC_PACKETS.
7496: --Modifies:
7497: -- PO_ENCUMBRANCE_GT
7498: --Locks:
7499: -- n/a
7500: --Function:
7501: -- This procedure updates the references and other non-complex columns

Line 7502: -- in PO_ENCUMBRANCE_GT that map to columns of GL_BC_PACKETS.

7498: --Locks:
7499: -- n/a
7500: --Function:
7501: -- This procedure updates the references and other non-complex columns
7502: -- in PO_ENCUMBRANCE_GT that map to columns of GL_BC_PACKETS.
7503: --Parameters:
7504: --IN:
7505: --p_action
7506: -- Specifies the action that is being taken on the main doc.

Line 7539: l_source_doc_reference PO_ENCUMBRANCE_GT.reference10%TYPE;

7535:
7536: l_cbc_action VARCHAR2(30) := NULL;
7537: l_cbc_line_description PO_LOOKUP_CODES.description%TYPE := NULL;
7538:
7539: l_source_doc_reference PO_ENCUMBRANCE_GT.reference10%TYPE;
7540:
7541: /* Start Bug 3292870 */
7542:
7543: TYPE g_rowid_char_tbl_type IS TABLE OF VARCHAR2(18);

Line 7567: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS

7563: * it compatible with an 8i db.
7564: */
7565:
7566:
7567: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS
7568: SET
7569: ALL_DISTS.je_category_name =
7570: DECODE( ALL_DISTS.distribution_type
7571: , g_dist_type_REQUISITION, g_je_category_Requisitions

Line 7628: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS

7624:
7625:
7626: l_progress := '050';
7627:
7628: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS
7629: SET ALL_DISTS.reference5 = ALL_DISTS.reference_num
7630: WHERE ALL_DISTS.send_to_gl_flag = 'Y' --bug 3568512: use new column
7631: and ALL_DISTS.distribution_type = g_dist_type_REQUISITION
7632: ;

Line 7636: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS

7632: ;
7633:
7634: l_progress := '060';
7635:
7636: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS
7637: SET ALL_DISTS.reference5 =
7638: ( SELECT PPO_DISTS.segment1
7639: FROM PO_ENCUMBRANCE_GT PPO_DISTS
7640: WHERE PPO_DISTS.origin_sequence_num

Line 7639: FROM PO_ENCUMBRANCE_GT PPO_DISTS

7635:
7636: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS
7637: SET ALL_DISTS.reference5 =
7638: ( SELECT PPO_DISTS.segment1
7639: FROM PO_ENCUMBRANCE_GT PPO_DISTS
7640: WHERE PPO_DISTS.origin_sequence_num
7641: = ALL_DISTS.sequence_num
7642: AND PPO_DISTS.distribution_id
7643: = ALL_DISTS.source_distribution_id

Line 7651: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS

7647: ;
7648:
7649: l_progress := '070';
7650:
7651: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS
7652: SET ALL_DISTS.reference5 =
7653: ( SELECT PA_DISTS.segment1
7654: FROM PO_ENCUMBRANCE_GT PA_DISTS
7655: WHERE PA_DISTS.origin_sequence_num =

Line 7654: FROM PO_ENCUMBRANCE_GT PA_DISTS

7650:
7651: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS
7652: SET ALL_DISTS.reference5 =
7653: ( SELECT PA_DISTS.segment1
7654: FROM PO_ENCUMBRANCE_GT PA_DISTS
7655: WHERE PA_DISTS.origin_sequence_num =
7656: ALL_DISTS.sequence_num
7657: AND PA_DISTS.distribution_id =
7658: ALL_DISTS.agreement_dist_id

Line 7668: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS

7664:
7665: l_progress := '080';
7666:
7667: FORALL i IN 1..l_rowid_char_tbl.COUNT
7668: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS
7669: SET ALL_DISTS.reference5 =
7670: ( SELECT REQ_DISTS.segment1
7671: FROM PO_ENCUMBRANCE_GT REQ_DISTS
7672: WHERE REQ_DISTS.origin_sequence_num =

Line 7671: FROM PO_ENCUMBRANCE_GT REQ_DISTS

7667: FORALL i IN 1..l_rowid_char_tbl.COUNT
7668: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS
7669: SET ALL_DISTS.reference5 =
7670: ( SELECT REQ_DISTS.segment1
7671: FROM PO_ENCUMBRANCE_GT REQ_DISTS
7672: WHERE REQ_DISTS.origin_sequence_num =
7673: ALL_DISTS.sequence_num
7674: AND REQ_DISTS.distribution_type =
7675: g_dist_type_REQUISITION

Line 7693: UPDATE PO_ENCUMBRANCE_GT BACKING

7689: -- Backing Reqs/PPOs/BPAs/GAs point to the {PO|Rel}/SR/BR/StdPO's po_header_id.
7690: -- During an invoice activity, the main doc (StdPO/BR/SR)
7691: -- points to the invoice_id.
7692:
7693: UPDATE PO_ENCUMBRANCE_GT BACKING
7694: SET
7695: BACKING.reference6 = g_reference6_SRCDOC
7696: , BACKING.reference10 =
7697: (

Line 7699: FROM PO_ENCUMBRANCE_GT MAIN

7695: BACKING.reference6 = g_reference6_SRCDOC
7696: , BACKING.reference10 =
7697: (
7698: SELECT TO_CHAR(MAIN.header_id)
7699: FROM PO_ENCUMBRANCE_GT MAIN
7700: WHERE MAIN.sequence_num = BACKING.origin_sequence_num
7701: )
7702: WHERE BACKING.origin_sequence_num IS NOT NULL --backing doc
7703: AND BACKING.send_to_gl_flag = 'Y' --bug 3568512: use new column

Line 7717: UPDATE PO_ENCUMBRANCE_GT MAIN

7713: -- it needs to be referenced by the main doc rows.
7714:
7715: l_source_doc_reference := TO_CHAR(p_invoice_id);
7716:
7717: UPDATE PO_ENCUMBRANCE_GT MAIN
7718: SET
7719: MAIN.reference6 = g_reference6_SRCDOC
7720: , MAIN.reference10 = l_source_doc_reference
7721: WHERE MAIN.send_to_gl_flag = 'Y' --bug 3568512: use new column

Line 7748: UPDATE PO_ENCUMBRANCE_GT MAIN

7744: -- or during an invoice transaction.
7745: -- In these cases, the Grants data must have been saved in the
7746: -- PO transaction tables anyway, so Grants can still figure it out.
7747:
7748: UPDATE PO_ENCUMBRANCE_GT MAIN
7749: SET
7750: MAIN.reference6 = g_reference6_GMSIP
7751:
7752: , MAIN.reference7 = to_char(project_id)

Line 7787: UPDATE PO_ENCUMBRANCE_GT BACKING_REQ

7783: IF p_action = g_action_CANCEL THEN
7784:
7785: l_progress := '160';
7786:
7787: UPDATE PO_ENCUMBRANCE_GT BACKING_REQ
7788: SET reference14 =
7789: (SELECT REQ_TABLE.source_req_distribution_id
7790: FROM PO_REQ_DISTRIBUTIONS_ALL REQ_TABLE
7791: WHERE BACKING_REQ.distribution_id = REQ_TABLE.distribution_id

Line 7802: UPDATE PO_ENCUMBRANCE_GT MAIN_REQ

7798: ELSIF p_action = g_action_ADJUST THEN
7799:
7800: l_progress := '180';
7801:
7802: UPDATE PO_ENCUMBRANCE_GT MAIN_REQ
7803: SET reference14 =
7804: (SELECT PARENT_DIST.distribution_id
7805: FROM PO_REQ_DISTRIBUTIONS_ALL PARENT_DIST
7806: , PO_REQUISITION_LINES_ALL PARENT_LINE

Line 7855: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS

7851: PO_DEBUG.debug_var(l_log_head,l_progress,'l_cbc_action',l_cbc_action);
7852: PO_DEBUG.debug_var(l_log_head,l_progress,'l_cbc_line_description',l_cbc_line_description);
7853: END IF;
7854:
7855: UPDATE PO_ENCUMBRANCE_GT ALL_DISTS
7856: SET
7857: ALL_DISTS.je_line_description =
7858: SUBSTRB(ALL_DISTS.je_line_description,1,100)
7859: || '-'

Line 7898: -- PO_ENCUMBRANCE_GT

7894: --Name: check_enc_action_possible
7895: --Pre-reqs:
7896: -- This check is meaningless if the appropriate encumbrance is not turned on.
7897: --Modifies:
7898: -- PO_ENCUMBRANCE_GT
7899: --Locks:
7900: -- None.
7901: --Function:
7902: -- This procedure determines whether there are any distributions below

Line 8008: -- PO_ENCUMBRANCE_GT

8004: --Name: delete_encumbrance_gt
8005: --Pre-reqs:
8006: -- None.
8007: --Modifies:
8008: -- PO_ENCUMBRANCE_GT
8009: --Locks:
8010: -- None.
8011: --Function:
8012: -- Deletes all of the existing data from PO_ENCUMBRANCE_GT.

Line 8012: -- Deletes all of the existing data from PO_ENCUMBRANCE_GT.

8008: -- PO_ENCUMBRANCE_GT
8009: --Locks:
8010: -- None.
8011: --Function:
8012: -- Deletes all of the existing data from PO_ENCUMBRANCE_GT.
8013: --Parameters:
8014: -- None.
8015: --Testing:
8016: --

Line 8034: DELETE FROM PO_ENCUMBRANCE_GT ;

8030: END IF;
8031:
8032: l_progress := '010';
8033:
8034: DELETE FROM PO_ENCUMBRANCE_GT ;
8035:
8036: l_progress := '900';
8037:
8038: IF g_debug_stmt THEN

Line 8063: -- values in PO_ENCUMBRANCE_GT.

8059: --Locks:
8060: -- None.
8061: --Function:
8062: -- This procedure will be used to update proper entered and accounted amount
8063: -- values in PO_ENCUMBRANCE_GT.
8064: --Parameters:
8065: --IN:
8066: -- p_action : specifies the action
8067: -- p_currency_code_func: currency code of the functional currency.

Line 8074: -- update proper entered and accounted amount values in PO_ENCUMBRANCE_GT.

8070: --OUT:
8071: -- None.
8072: --Notes:
8073: -- The algorithm of the procedure is as follows :
8074: -- update proper entered and accounted amount values in PO_ENCUMBRANCE_GT.
8075: --Testing:
8076: --
8077: --End of Comments
8078: -------------------------------------------------------------------------------

Line 8148: UPDATE PO_ENCUMBRANCE_GT DISTS

8144: --foreign currency.
8145: --
8146: --For requisitions it is allright to have entered_amt=accounted_amt=final_amt.
8147: --This is because the requisitions are in functional currency all the time.
8148: UPDATE PO_ENCUMBRANCE_GT DISTS
8149: SET DISTS.entered_amount = decode(DISTS.distribution_type,g_dist_type_AGREEMENT,
8150: DISTS.final_amt,g_dist_type_REQUISITION,DISTS.final_amt,
8151: DISTS.pre_round_amt)
8152: ,DISTS.accounted_amount = DISTS.final_amt

Line 8161: UPDATE PO_ENCUMBRANCE_GT DISTS

8157: -- Filtering the amounts to process if the entered amount is 0
8158: -- for Changed distributions
8159: IF p_action = g_action_RESERVE THEN
8160:
8161: UPDATE PO_ENCUMBRANCE_GT DISTS
8162: SET DISTS.send_to_gl_flag = 'N'
8163: WHERE DISTS.amount_changed_flag = 'Y'
8164: AND Nvl(DISTS.entered_amount,0) = 0;
8165: END IF;

Line 8171: FROM PO_ENCUMBRANCE_GT DISTS

8167: UPDATE po_distributions_all POD
8168: SET POD.amount_changed_flag = NULL
8169: WHERE po_distribution_id IN
8170: (SELECT distribution_id
8171: FROM PO_ENCUMBRANCE_GT DISTS
8172: WHERE DISTS.amount_changed_flag = 'Y'
8173: AND Nvl(DISTS.entered_amount,0) = 0);
8174: -- <13503748: Edit without unreserve ER END>
8175:

Line 8198: UPDATE PO_ENCUMBRANCE_GT DISTS

8194: --foreign currency.
8195: --
8196: --For requisitions it is allright to have entered_amt=accounted_amt=final_amt.
8197: --This is because the requisitions are in functional currency all the time.
8198: UPDATE PO_ENCUMBRANCE_GT DISTS
8199: SET DISTS.entered_amount = -1 *decode(DISTS.distribution_type,g_dist_type_AGREEMENT,
8200: DISTS.final_amt,g_dist_type_REQUISITION,DISTS.final_amt,
8201: DISTS.pre_round_amt)
8202: ,DISTS.accounted_amount = -1 * DISTS.final_amt

Line 8215: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Before starting currency conversions on entered_amount_fields in po_encumbrance_gt');

8211: l_progress:= '060';
8212: --
8213: -- Get functional currency setup
8214: IF g_debug_stmt THEN
8215: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Before starting currency conversions on entered_amount_fields in po_encumbrance_gt');
8216: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows,NULL,'PO');
8217: END IF;
8218:
8219: SELECT

Line 8216: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows,NULL,'PO');

8212: --
8213: -- Get functional currency setup
8214: IF g_debug_stmt THEN
8215: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Before starting currency conversions on entered_amount_fields in po_encumbrance_gt');
8216: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows,NULL,'PO');
8217: END IF;
8218:
8219: SELECT
8220: FND_CUR.minimum_accountable_unit

Line 8268: FROM PO_ENCUMBRANCE_GT DISTS

8264: , l_cur_precision_to_tbl
8265: , l_min_acct_unit_to_tbl
8266: , l_round_only_flag_tbl
8267: , l_origin_sequence_num_tbl
8268: FROM PO_ENCUMBRANCE_GT DISTS
8269: WHERE DISTS.prevent_encumbrance_flag = 'N'
8270: AND DISTS.distribution_type <> g_dist_type_REQUISITION --
8271: ORDER BY DISTS.sequence_num
8272: ;

Line 8315: UPDATE PO_ENCUMBRANCE_GT DISTS

8311: END IF;
8312:
8313: l_progress:='100';
8314: FORALL i IN 1 .. l_sequence_num_tbl.COUNT
8315: UPDATE PO_ENCUMBRANCE_GT DISTS
8316: SET DISTS.entered_amount= l_amount_result_tbl(i)
8317: WHERE DISTS.prevent_encumbrance_flag = 'N'
8318: AND DISTS.sequence_num = l_sequence_num_tbl(i)
8319: ;

Line 8321: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After completing update on po_encumbrance_gt for distributions');

8317: WHERE DISTS.prevent_encumbrance_flag = 'N'
8318: AND DISTS.sequence_num = l_sequence_num_tbl(i)
8319: ;
8320: IF g_debug_stmt THEN
8321: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After completing update on po_encumbrance_gt for distributions');
8322: PO_DEBUG.debug_var(l_log_head,l_progress,'sql%rowcount',sql%rowcount);
8323: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows,NULL,'PO');
8324: END IF;
8325: --

Line 8323: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows,NULL,'PO');

8319: ;
8320: IF g_debug_stmt THEN
8321: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After completing update on po_encumbrance_gt for distributions');
8322: PO_DEBUG.debug_var(l_log_head,l_progress,'sql%rowcount',sql%rowcount);
8323: PO_DEBUG.debug_table(l_log_head,l_progress,'PO_ENCUMBRANCE_GT',PO_DEBUG.g_all_rows,NULL,'PO');
8324: END IF;
8325: --
8326: /* <> */
8327: -- Filter the CLM Distributions with No change in their Funded Value for Reserve Action

Line 8337: UPDATE PO_ENCUMBRANCE_GT CLM_DISTS

8333: IF g_debug_stmt THEN
8334: PO_DEBUG.debug_stmt(l_log_head,l_progress,'CLM Installed and Reserve Action. Setting Send to GL Flag as N for Zero Amounts.');
8335: End If;
8336:
8337: UPDATE PO_ENCUMBRANCE_GT CLM_DISTS
8338: SET CLM_DISTS.SEND_TO_GL_FLAG = 'N'
8339: WHERE (CLM_DISTS.CLM_DOC_FLAG = 'Y'
8340: AND CLM_DISTS.ENTERED_AMOUNT = 0
8341: AND CLM_DISTS.ACCOUNTED_AMOUNT = 0);

Line 8391: UPDATE PO_ENCUMBRANCE_GT CLM_DISTS

8387: END IF;
8388:
8389:
8390: l_progress := '010';
8391: UPDATE PO_ENCUMBRANCE_GT CLM_DISTS
8392: SET CLM_DISTS.AMT_ORDERED = DECODE(CLM_DISTS.amount_based_flag,
8393: 'N', NVL(CLM_DISTS.QUANTITY_FUNDED,0) * NVL(CLM_DISTS.PRICE,0) ,
8394: NVL(CLM_DISTS.AMOUNT_FUNDED,0))
8395: WHERE CLM_DISTS.CLM_DOC_FLAG = 'Y'

Line 8416: Procedure to calculate and update the Final Amount on the PO Encumbrance Gt for CLM documents in case of Reserve Action

8412: END UPDATE_CLM_INTIAL_AMOUNTS;
8413:
8414:
8415: /*
8416: Procedure to calculate and update the Final Amount on the PO Encumbrance Gt for CLM documents in case of Reserve Action
8417: */
8418: PROCEDURE UPDATE_CLM_FINAL_AMOUNTS
8419: (
8420: p_action IN VARCHAR2 ,

Line 8459: UPDATE PO_ENCUMBRANCE_GT MAIN_DISTS

8455: END IF;
8456: l_progress := '010';
8457: IF p_action IN (g_action_RESERVE)
8458: THEN
8459: UPDATE PO_ENCUMBRANCE_GT MAIN_DISTS
8460: SET MAIN_DISTS.PRE_ROUND_AMT = (MAIN_DISTS.CHANGE_IN_FUNDED_VALUE/MAIN_DISTS.RATE),
8461: MAIN_DISTS.FINAL_AMT = MAIN_DISTS.CHANGE_IN_FUNDED_VALUE
8462: WHERE MAIN_DISTS.ORIGIN_SEQUENCE_NUM IS NULL
8463: AND MAIN_DISTS.CLM_DOC_FLAG = 'Y'

Line 8473: UPDATE PO_ENCUMBRANCE_GT BACK_REQ

8469:
8470: IF (p_doc_type = g_doc_type_PO
8471: AND p_doc_subtype = g_doc_subtype_STANDARD) THEN
8472:
8473: UPDATE PO_ENCUMBRANCE_GT BACK_REQ
8474: SET (BACK_REQ.PRE_ROUND_AMT, BACK_REQ.FINAL_AMT) =
8475: (SELECT MAIN_DISTS.PRE_ROUND_AMT, MAIN_DISTS.FINAL_AMT
8476: FROM PO_ENCUMBRANCE_GT MAIN_DISTS
8477: WHERE MAIN_DISTS.ORIGIN_SEQUENCE_NUM IS NULL

Line 8476: FROM PO_ENCUMBRANCE_GT MAIN_DISTS

8472:
8473: UPDATE PO_ENCUMBRANCE_GT BACK_REQ
8474: SET (BACK_REQ.PRE_ROUND_AMT, BACK_REQ.FINAL_AMT) =
8475: (SELECT MAIN_DISTS.PRE_ROUND_AMT, MAIN_DISTS.FINAL_AMT
8476: FROM PO_ENCUMBRANCE_GT MAIN_DISTS
8477: WHERE MAIN_DISTS.ORIGIN_SEQUENCE_NUM IS NULL
8478: AND MAIN_DISTS.CLM_DOC_FLAG = 'Y'
8479: AND MAIN_DISTS.PREVENT_ENCUMBRANCE_FLAG = 'N'
8480: AND MAIN_DISTS.REQ_DISTRIBUTION_ID = BACK_REQ.DISTRIBUTION_ID

Line 8504: UPDATE PO_ENCUMBRANCE_GT MAIN_DISTS

8500: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Derive the Requisition amount that need to be liquidated');
8501: End If;
8502:
8503: BEGIN
8504: UPDATE PO_ENCUMBRANCE_GT MAIN_DISTS
8505: SET (MAIN_DISTS.CHANGE_IN_FUNDED_VALUE, MAIN_DISTS.PRE_ROUND_AMT, MAIN_DISTS.FINAL_AMT)
8506: = (SELECT NVL(PCDD.FUNDS_REMAINING,0), NVL(PCDD.FUNDS_REMAINING,0), NVL(PCDD.FUNDS_REMAINING,0)
8507: FROM PO_CLMREQ_DIST_DETAILS_V PCDD
8508: WHERE PCDD.DISTRIBUTION_ID = MAIN_DISTS.DISTRIBUTION_ID

Line 8541: FROM PO_ENCUMBRANCE_GT CLM_DISTS

8537: ,l_cur_precision_func_tbl
8538: ,l_min_acct_unit_func_tbl
8539: ,l_round_only_flag_tbl
8540: ,l_origin_sequence_num_tbl
8541: FROM PO_ENCUMBRANCE_GT CLM_DISTS
8542: WHERE CLM_DISTS.prevent_encumbrance_flag = 'N'
8543: AND CLM_DISTS.CLM_DOC_FLAG = 'Y'
8544: ORDER BY CLM_DISTS.sequence_num;
8545:

Line 8573: UPDATE PO_ENCUMBRANCE_GT CLM_DISTS

8569: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Rounding of CLM Document Amounts Successful');
8570: End If;
8571:
8572: FORALL i IN 1 .. l_sequence_num_tbl.COUNT
8573: UPDATE PO_ENCUMBRANCE_GT CLM_DISTS
8574: SET CLM_DISTS.final_amt = l_amount_result_tbl(i)
8575: WHERE CLM_DISTS.prevent_encumbrance_flag = 'N'
8576: AND CLM_DISTS.sequence_num = l_sequence_num_tbl(i) ;
8577: