DBA Data[Home] [Help]

APPS.AP_WEB_DB_EXPDIST_PKG dependencies on AP_EXP_REPORT_DISTS

Line 36: FROM ap_exp_report_dists aerd

32: BEGIN
33:
34: SELECT code_combination_id
35: INTO l_line_ccid
36: FROM ap_exp_report_dists aerd
37: WHERE aerd.report_distribution_id = p_report_distribution_id
38: AND aerd.code_combination_id is not null;
39:
40: x_line_ccid := l_line_ccid;

Line 67: FROM ap_exp_report_dists rd

63: BEGIN
64:
65: SELECT 'Y'
66: INTO l_temp
67: FROM ap_exp_report_dists rd
68: WHERE rd.report_distribution_id = p_report_distribution_id;
69:
70: return TRUE;
71:

Line 90: UPDATE ap_exp_report_dists RD

86: p_exp_line_ccid IN expDist_CODE_COMBINATION_ID)
87: RETURN BOOLEAN IS
88: -----------------------------------------------------------------------------
89: BEGIN
90: UPDATE ap_exp_report_dists RD
91: SET RD.code_combination_id = p_exp_line_ccid
92: WHERE RD.report_header_id = p_report_header_id
93: AND RD.report_line_id = p_report_line_id;
94:

Line 116: UPDATE ap_exp_report_dists RD

112: ) RETURN BOOLEAN IS
113: --------------------------------------------------------------------------------
114: BEGIN
115:
116: UPDATE ap_exp_report_dists RD
117: SET RD.code_combination_id = p_exp_dist_ccid
118: WHERE RD.report_header_id = p_report_header_id
119: AND RD.report_distribution_id = p_report_distribution_id;
120:

Line 144: FROM AP_EXP_REPORT_DISTS

140: -- in the FOR UPDATE is missing and NOWAIT is used, so the OF
141: -- REPORT_HEADER_ID is used as a place holder.
142: CURSOR ReportDistributions IS
143: SELECT REPORT_HEADER_ID
144: FROM AP_EXP_REPORT_DISTS
145: WHERE (REPORT_HEADER_ID = P_ReportID)
146: FOR UPDATE OF REPORT_HEADER_ID NOWAIT;
147:
148: BEGIN

Line 159: DELETE AP_EXP_REPORT_DISTS WHERE CURRENT OF ReportDistributions;

155: FETCH ReportDistributions into l_TempReportHeaderID;
156: EXIT WHEN ReportDistributions%NOTFOUND;
157:
158: -- Delete matching line
159: DELETE AP_EXP_REPORT_DISTS WHERE CURRENT OF ReportDistributions;
160: END LOOP;
161:
162: CLOSE ReportDistributions;
163:

Line 199: FROM ap_exp_report_dists

195: Added rownum condition to avoid TOO_MANY_ROWS_RETURNED exception. */
196:
197: SELECT report_line_id
198: INTO l_has_dist
199: FROM ap_exp_report_dists
200: WHERE report_line_id = p_source_report_line_id
201: AND ROWNUM = 1;
202:
203:

Line 216: UPDATE AP_EXP_REPORT_DISTS

212:
213:
214: -- For the given line, move its distributions from original ER
215: -- to the new ER
216: UPDATE AP_EXP_REPORT_DISTS
217: SET report_header_id = p_target_report_header_id,
218: report_line_id = p_target_report_line_id
219: WHERE report_line_id = p_source_report_line_id;
220:

Line 250: INSERT INTO AP_EXP_REPORT_DISTS

246: AP_WEB_UTILITIES_PKG.LogProcedure('AP_WEB_DB_EXPDIST_PKG',
247: 'start DuplicateDistributions');
248:
249: -- For the given line, duplicate its distributions
250: INSERT INTO AP_EXP_REPORT_DISTS
251: (
252: report_header_id,
253: report_line_id,
254: report_distribution_id,

Line 303: AP_EXP_REPORT_DISTS_S.NEXTVAL AS report_distribution_id,

299: )
300: SELECT
301: p_target_report_header_id AS report_header_id,
302: p_target_report_line_id AS report_line_id,
303: AP_EXP_REPORT_DISTS_S.NEXTVAL AS report_distribution_id,
304: org_id,
305: sequence_num,
306: SYSDATE AS last_update_date,
307: nvl(p_user_id,last_updated_by) AS last_updated_by,

Line 348: FROM AP_EXP_REPORT_DISTS

344: award_id,
345: expenditure_organization_id,
346: cost_center,
347: preparer_modified_flag
348: FROM AP_EXP_REPORT_DISTS
349: WHERE
350: report_line_id = p_source_report_line_id;
351:
352:

Line 392: FROM ap_exp_report_dists

388:
389: BEGIN
390: SELECT report_distribution_id
391: INTO l_report_distribution_id
392: FROM ap_exp_report_dists
393: WHERE report_header_id = p_report_header_id
394: AND report_line_id = p_report_line_id
395: AND rownum = 1;
396:

Line 407: UPDATE ap_exp_report_dists

403: END;
404:
405: end if;
406:
407: UPDATE ap_exp_report_dists
408: SET (code_combination_id,
409: segment1,
410: segment2,
411: segment3,

Line 511: FROM ap_exp_report_dists

507:
508: BEGIN
509: SELECT report_distribution_id
510: INTO l_report_distribution_id
511: FROM ap_exp_report_dists
512: WHERE report_header_id = p_report_header_id
513: AND report_line_id = p_report_line_id
514: AND rownum = 1;
515:

Line 526: UPDATE ap_exp_report_dists

522: END;
523:
524: end if;
525:
526: UPDATE ap_exp_report_dists
527: SET (code_combination_id,
528: segment1,
529: segment2,
530: segment3,

Line 609: FROM AP_EXP_REPORT_DISTS_ALL

605: IS
606: --------------------------------------------------------------------------------
607: CURSOR dist_lines_c IS
608: SELECT *
609: FROM AP_EXP_REPORT_DISTS_ALL
610: WHERE REPORT_HEADER_ID = p_report_header_id
611: FOR UPDATE OF REPORT_HEADER_ID NOWAIT;
612:
613: dist_lines_rec dist_lines_c%ROWTYPE;

Line 624: UPDATE ap_exp_report_dists_all

620: FETCH dist_lines_c into dist_lines_rec;
621: EXIT WHEN dist_lines_c%NOTFOUND;
622:
623: IF dist_lines_rec.CODE_COMBINATION_ID IS NOT NULL THEN
624: UPDATE ap_exp_report_dists_all
625: SET (segment1,
626: segment2,
627: segment3,
628: segment4,

Line 710: l_dist_id AP_EXP_REPORT_DISTS.REPORT_DISTRIBUTION_ID%TYPE;

706: l_report_distribution_id expDist_REPORT_DISTRIBUTION_ID;
707: c_line_ccid_cursor AP_WEB_DB_EXPLINE_PKG.ExpLineCCIDCursor;
708: l_report_line_id AP_WEB_DB_EXPLINE_PKG.expLines_report_line_id;
709: l_line_ccid AP_WEB_DB_EXPLINE_PKG.expLines_codeCombID;
710: l_dist_id AP_EXP_REPORT_DISTS.REPORT_DISTRIBUTION_ID%TYPE;
711: l_line_amount NUMBER;
712: BEGIN
713:
714: IF (AP_WEB_DB_EXPLINE_PKG.GetLineCCIDCursor(p_report_header_id, c_line_ccid_cursor)) THEN

Line 724: FROM ap_exp_report_dists

720: BEGIN
721: /* If there is no distribution line, add one. */
722: SELECT report_distribution_id
723: INTO l_dist_id
724: FROM ap_exp_report_dists
725: WHERE report_header_id = p_report_header_id
726: AND report_line_id = l_report_line_id;
727:
728: EXCEPTION

Line 758: INSERT INTO AP_EXP_REPORT_DISTS

754: 'start AddDistributionLine');
755: l_sequence_num := 0;
756:
757: -- For the given line, duplicate its distributions
758: INSERT INTO AP_EXP_REPORT_DISTS
759: (
760: report_header_id,
761: report_line_id,
762: report_distribution_id,

Line 811: AP_EXP_REPORT_DISTS_S.NEXTVAL,

807: )
808: SELECT
809: XL.report_header_id,
810: XL.report_line_id,
811: AP_EXP_REPORT_DISTS_S.NEXTVAL,
812: l_sequence_num,
813: SYSDATE,
814: XL.last_updated_by,
815: SYSDATE,

Line 897: l_amount ap_exp_report_dists_all.amount%TYPE;

893: l_created_by NUMBER;
894: l_report_distribution_id expDist_REPORT_DISTRIBUTION_ID;
895: l_code_combination_id expDist_CODE_COMBINATION_ID;
896: l_org_id NUMBER;
897: l_amount ap_exp_report_dists_all.amount%TYPE;
898: l_project_id ap_exp_report_dists_all.project_id%TYPE;
899: l_task_id ap_exp_report_dists_all.task_id%TYPE;
900: l_award_id ap_exp_report_dists_all.award_id%TYPE;
901: l_expenditure_organization_id ap_exp_report_dists_all.expenditure_organization_id%TYPE;

Line 898: l_project_id ap_exp_report_dists_all.project_id%TYPE;

894: l_report_distribution_id expDist_REPORT_DISTRIBUTION_ID;
895: l_code_combination_id expDist_CODE_COMBINATION_ID;
896: l_org_id NUMBER;
897: l_amount ap_exp_report_dists_all.amount%TYPE;
898: l_project_id ap_exp_report_dists_all.project_id%TYPE;
899: l_task_id ap_exp_report_dists_all.task_id%TYPE;
900: l_award_id ap_exp_report_dists_all.award_id%TYPE;
901: l_expenditure_organization_id ap_exp_report_dists_all.expenditure_organization_id%TYPE;
902: l_cost_center ap_exp_report_dists_all.cost_center%TYPE;

Line 899: l_task_id ap_exp_report_dists_all.task_id%TYPE;

895: l_code_combination_id expDist_CODE_COMBINATION_ID;
896: l_org_id NUMBER;
897: l_amount ap_exp_report_dists_all.amount%TYPE;
898: l_project_id ap_exp_report_dists_all.project_id%TYPE;
899: l_task_id ap_exp_report_dists_all.task_id%TYPE;
900: l_award_id ap_exp_report_dists_all.award_id%TYPE;
901: l_expenditure_organization_id ap_exp_report_dists_all.expenditure_organization_id%TYPE;
902: l_cost_center ap_exp_report_dists_all.cost_center%TYPE;
903: l_cost_center_seg_num NUMBER;

Line 900: l_award_id ap_exp_report_dists_all.award_id%TYPE;

896: l_org_id NUMBER;
897: l_amount ap_exp_report_dists_all.amount%TYPE;
898: l_project_id ap_exp_report_dists_all.project_id%TYPE;
899: l_task_id ap_exp_report_dists_all.task_id%TYPE;
900: l_award_id ap_exp_report_dists_all.award_id%TYPE;
901: l_expenditure_organization_id ap_exp_report_dists_all.expenditure_organization_id%TYPE;
902: l_cost_center ap_exp_report_dists_all.cost_center%TYPE;
903: l_cost_center_seg_num NUMBER;
904: l_chart_of_accounts_id gl_sets_of_books.chart_of_accounts_id%type;

Line 901: l_expenditure_organization_id ap_exp_report_dists_all.expenditure_organization_id%TYPE;

897: l_amount ap_exp_report_dists_all.amount%TYPE;
898: l_project_id ap_exp_report_dists_all.project_id%TYPE;
899: l_task_id ap_exp_report_dists_all.task_id%TYPE;
900: l_award_id ap_exp_report_dists_all.award_id%TYPE;
901: l_expenditure_organization_id ap_exp_report_dists_all.expenditure_organization_id%TYPE;
902: l_cost_center ap_exp_report_dists_all.cost_center%TYPE;
903: l_cost_center_seg_num NUMBER;
904: l_chart_of_accounts_id gl_sets_of_books.chart_of_accounts_id%type;
905:

Line 902: l_cost_center ap_exp_report_dists_all.cost_center%TYPE;

898: l_project_id ap_exp_report_dists_all.project_id%TYPE;
899: l_task_id ap_exp_report_dists_all.task_id%TYPE;
900: l_award_id ap_exp_report_dists_all.award_id%TYPE;
901: l_expenditure_organization_id ap_exp_report_dists_all.expenditure_organization_id%TYPE;
902: l_cost_center ap_exp_report_dists_all.cost_center%TYPE;
903: l_cost_center_seg_num NUMBER;
904: l_chart_of_accounts_id gl_sets_of_books.chart_of_accounts_id%type;
905:
906: -- BUG 7025517

Line 1000: l_debug_info := 'get next AP_EXP_REPORT_DISTS_S';

996: WHERE XL.report_line_id = p_report_line_id
997: AND XL.report_header_id = XH.report_header_id;
998:
999: -----------------------------------------------------
1000: l_debug_info := 'get next AP_EXP_REPORT_DISTS_S';
1001: -----------------------------------------------------
1002: SELECT AP_EXP_REPORT_DISTS_S.NEXTVAL
1003: INTO l_report_distribution_id
1004: FROM DUAL;

Line 1002: SELECT AP_EXP_REPORT_DISTS_S.NEXTVAL

998:
999: -----------------------------------------------------
1000: l_debug_info := 'get next AP_EXP_REPORT_DISTS_S';
1001: -----------------------------------------------------
1002: SELECT AP_EXP_REPORT_DISTS_S.NEXTVAL
1003: INTO l_report_distribution_id
1004: FROM DUAL;
1005:
1006: l_sqlstmt := 'INSERT INTO AP_EXP_REPORT_DISTS ( ';

Line 1006: l_sqlstmt := 'INSERT INTO AP_EXP_REPORT_DISTS ( ';

1002: SELECT AP_EXP_REPORT_DISTS_S.NEXTVAL
1003: INTO l_report_distribution_id
1004: FROM DUAL;
1005:
1006: l_sqlstmt := 'INSERT INTO AP_EXP_REPORT_DISTS ( ';
1007: l_sqlstmt := l_sqlstmt || 'report_header_id, ';
1008: l_sqlstmt := l_sqlstmt || 'report_line_id, ';
1009: l_sqlstmt := l_sqlstmt || 'report_distribution_id, ';
1010: l_sqlstmt := l_sqlstmt || 'sequence_num, ';

Line 1325: FROM AP_EXP_REPORT_DISTS

1321:
1322: -- Check if project-related dist exists
1323: SELECT 'dist exists'
1324: INTO V_Temp
1325: FROM AP_EXP_REPORT_DISTS
1326: WHERE REPORT_HEADER_ID = p_report_header_id
1327: AND PROJECT_ID IS NOT NULL
1328: AND TASK_ID IS NOT NULL;
1329:

Line 1356: FROM AP_EXP_REPORT_DISTS

1352:
1353: -- Check if non-project-related dist exists
1354: SELECT 'dist exists'
1355: INTO V_Temp
1356: FROM AP_EXP_REPORT_DISTS
1357: WHERE REPORT_HEADER_ID = p_report_header_id
1358: AND PROJECT_ID IS NULL
1359: AND TASK_ID IS NULL;
1360:

Line 1387: from ap_exp_report_dists_all

1383: l_last_dist_id NUMBER;
1384:
1385: cursor c_dists is
1386: select report_distribution_id, amount
1387: from ap_exp_report_dists_all
1388: where report_line_id = p_report_line_id;
1389:
1390: BEGIN
1391: select sum(amount) into l_dist_sum

Line 1392: from ap_exp_report_dists_all

1388: where report_line_id = p_report_line_id;
1389:
1390: BEGIN
1391: select sum(amount) into l_dist_sum
1392: from ap_exp_report_dists_all
1393: where report_line_id = p_report_line_id;
1394:
1395: IF (l_dist_sum <> 0) THEN
1396: l_remainder := p_line_amt;

Line 1407: update ap_exp_report_dists_all set amount = l_dist_amt

1403: -- 300 and 300, the new dists will be 200 * (300/600) = 100 and 100
1404: -- This logic will work in all cases and is used in ExpenseAllocationAMImpl.java as well.
1405: l_dist_amt := AP_WEB_UTILITIES_PKG.OIE_ROUND_CURRENCY(p_line_amt * (l_dist_amt/l_dist_sum), p_currency_code);
1406:
1407: update ap_exp_report_dists_all set amount = l_dist_amt
1408: where report_distribution_id = l_dist_id;
1409: l_remainder := l_remainder - l_dist_amt;
1410: l_last_dist_id := l_dist_id;
1411: end loop;

Line 1415: update ap_exp_report_dists_all set amount = (amount + l_remainder)

1411: end loop;
1412: close c_dists;
1413: -- If there is any line amount still remaining add it to the last line.
1414: if(l_remainder <> 0) then
1415: update ap_exp_report_dists_all set amount = (amount + l_remainder)
1416: where report_distribution_id = l_last_dist_id;
1417: end if;
1418: END IF;
1419: exception