DBA Data[Home] [Help]

APPS.CST_ACCOUNTINGPERIOD_PUB dependencies on ORG_ACCT_PERIODS

Line 219: FROM org_acct_periods

215:
216: l_stmt_num := 63;
217: SELECT period_start_date
218: INTO l_le_closing_fm_date
219: FROM org_acct_periods
220: WHERE acct_period_id = p_closing_period
221: AND organization_id = p_org_id;
222:
223: l_stmt_num := 65;

Line 406: FROM org_acct_periods

402: -- Retrieve close date of last open period
403: CURSOR get_last_close_date IS
404: SELECT NVL(MAX(schedule_close_date), sysdate),
405: count(*)
406: FROM org_acct_periods
407: WHERE organization_id = p_org_id;
408:
409: -- Check that there is no period prior to one we are trying to open
410: -- that is in GL_PERIODS but not open (i.e. not in ORG_ACCT_PERIODS)

Line 410: -- that is in GL_PERIODS but not open (i.e. not in ORG_ACCT_PERIODS)

406: FROM org_acct_periods
407: WHERE organization_id = p_org_id;
408:
409: -- Check that there is no period prior to one we are trying to open
410: -- that is in GL_PERIODS but not open (i.e. not in ORG_ACCT_PERIODS)
411: -- A status of %NOTFOUND indicates it is okay to open the next period.
412: CURSOR check_prior_open_period IS
413: SELECT start_date
414: FROM gl_periods

Line 419: from org_acct_periods

415: WHERE end_date < p_period_end_date
416: AND end_date >= x_last_scheduled_close_date
417: AND (period_name, period_year) not in
418: (select period_name, period_year
419: from org_acct_periods
420: where organization_id = p_org_id)
421: AND period_type = p_acct_period_type
422: AND period_set_name = p_org_period_set_name
423: AND adjustment_period_flag = 'N';

Line 427: SELECT org_acct_periods_s.nextval

423: AND adjustment_period_flag = 'N';
424:
425: -- Get next period id
426: CURSOR get_new_period_id IS
427: SELECT org_acct_periods_s.nextval
428: FROM sys.dual;
429:
430: -- See if another open period process has already committed same data
431: CURSOR check_if_duplicating IS

Line 433: FROM org_acct_periods

429:
430: -- See if another open period process has already committed same data
431: CURSOR check_if_duplicating IS
432: SELECT period_start_date
433: FROM org_acct_periods
434: WHERE organization_id = p_org_id
435: AND period_name = p_open_period_name
436: AND period_year = p_open_period_year
437: AND period_num = p_open_period_num

Line 443: FROM org_acct_periods

439:
440: --BUG#5903883
441: CURSOR c_org_acct_unique IS
442: SELECT NULL
443: FROM org_acct_periods
444: WHERE organization_id = p_org_id
445: AND period_year = p_open_period_year
446: AND period_name = p_open_period_name
447: AND period_num = p_open_period_num;

Line 458: org_acct_periods_u2 EXCEPTION;

454: l_api_version CONSTANT NUMBER := 1.0;
455: l_msg_level_threshold NUMBER;
456: l_stmt_num NUMBER := 0;
457:
458: org_acct_periods_u2 EXCEPTION;
459: PRAGMA EXCEPTION_INIT(org_acct_periods_u2,-1);
460:
461: BEGIN
462:

Line 459: PRAGMA EXCEPTION_INIT(org_acct_periods_u2,-1);

455: l_msg_level_threshold NUMBER;
456: l_stmt_num NUMBER := 0;
457:
458: org_acct_periods_u2 EXCEPTION;
459: PRAGMA EXCEPTION_INIT(org_acct_periods_u2,-1);
460:
461: BEGIN
462:
463: -- Standard Start of API savepoint

Line 569: -- Insert record into org_acct_periods to open the period

565:
566:
567:
568: l_stmt_num := 40;
569: -- Insert record into org_acct_periods to open the period
570: INSERT INTO org_acct_periods
571: (acct_period_id,
572: organization_id,
573: last_update_date,

Line 570: INSERT INTO org_acct_periods

566:
567:
568: l_stmt_num := 40;
569: -- Insert record into org_acct_periods to open the period
570: INSERT INTO org_acct_periods
571: (acct_period_id,
572: organization_id,
573: last_update_date,
574: last_updated_by,

Line 615: FROM org_acct_periods

611: AND GLP.adjustment_period_flag = 'N'
612: AND (GLP.period_name, GLP.period_year)
613: NOT IN
614: (SELECT period_name, period_year
615: FROM org_acct_periods
616: WHERE organization_id = p_org_id)
617: AND NOT EXISTS
618: (SELECT period_start_date
619: FROM org_acct_periods

Line 619: FROM org_acct_periods

615: FROM org_acct_periods
616: WHERE organization_id = p_org_id)
617: AND NOT EXISTS
618: (SELECT period_start_date
619: FROM org_acct_periods
620: WHERE organization_id = p_org_id
621: AND period_year = p_open_period_year
622: AND period_name = p_open_period_name
623: AND period_num = p_open_period_num);

Line 667: FROM org_acct_periods

663: -- Update last_schedule_close_date with newly opened period's
664: -- scheduled close date
665: SELECT NVL(MAX(schedule_close_date), SYSDATE)
666: INTO x_last_scheduled_close_date
667: FROM org_acct_periods
668: WHERE organization_id = p_org_id;
669:
670: GOTO success_label;
671:

Line 686: WHEN org_acct_periods_u2 THEN

682: <>
683: NULL;
684:
685: EXCEPTION
686: WHEN org_acct_periods_u2 THEN
687: ROLLBACK TO Open_Period_PUB;
688: IF INSTRB(SQLERRM,'ORG_ACCT_PERIODS_U2') <> 0 THEN
689: x_return_status := FND_API.G_RET_STS_ERROR;
690: ELSE

Line 688: IF INSTRB(SQLERRM,'ORG_ACCT_PERIODS_U2') <> 0 THEN

684:
685: EXCEPTION
686: WHEN org_acct_periods_u2 THEN
687: ROLLBACK TO Open_Period_PUB;
688: IF INSTRB(SQLERRM,'ORG_ACCT_PERIODS_U2') <> 0 THEN
689: x_return_status := FND_API.G_RET_STS_ERROR;
690: ELSE
691: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
692: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR

Line 766: FROM org_acct_periods

762:
763: -- Finds the earliest period that can be closed
764: CURSOR get_next_period_to_close IS
765: SELECT acct_period_id
766: FROM org_acct_periods
767: WHERE organization_id = p_org_id
768: AND schedule_close_date = (SELECT MIN(schedule_close_date)
769: FROM org_acct_periods
770: WHERE organization_id = p_org_id

Line 769: FROM org_acct_periods

765: SELECT acct_period_id
766: FROM org_acct_periods
767: WHERE organization_id = p_org_id
768: AND schedule_close_date = (SELECT MIN(schedule_close_date)
769: FROM org_acct_periods
770: WHERE organization_id = p_org_id
771: AND (open_flag = 'Y' or open_flag = 'P'));
772:
773: -- Finds the next period in org_acct_periods

Line 773: -- Finds the next period in org_acct_periods

769: FROM org_acct_periods
770: WHERE organization_id = p_org_id
771: AND (open_flag = 'Y' or open_flag = 'P'));
772:
773: -- Finds the next period in org_acct_periods
774: CURSOR get_next_open_period IS
775: SELECT MIN(acct_period_id)
776: FROM org_acct_periods
777: WHERE organization_id = p_org_id

Line 776: FROM org_acct_periods

772:
773: -- Finds the next period in org_acct_periods
774: CURSOR get_next_open_period IS
775: SELECT MIN(acct_period_id)
776: FROM org_acct_periods
777: WHERE organization_id = p_org_id
778: AND acct_period_id > p_closing_acct_period_id;
779:
780: -- Checks if period is already in process of closing

Line 783: FROM org_acct_periods

779:
780: -- Checks if period is already in process of closing
781: CURSOR check_reclose_period IS
782: SELECT acct_period_id
783: FROM org_acct_periods
784: WHERE organization_id = p_org_id
785: AND acct_period_id = p_closing_acct_period_id
786: AND period_close_date IS NOT NULL
787: AND open_flag = 'P';

Line 995: UPDATE org_acct_periods

991: END IF;
992:
993: l_stmt_num := 20;
994: -- Update period status to processing
995: UPDATE org_acct_periods
996: SET
997: open_flag = 'P',
998: period_close_date = trunc(sysdate),
999: last_update_date = sysdate, --trunc(sysdate),

Line 1040: FROM org_acct_periods

1036:
1037: l_stmt_num := 50;
1038: SELECT period_start_date, schedule_close_date
1039: INTO l_period_start_date, l_sched_close_date
1040: FROM org_acct_periods
1041: WHERE acct_period_id = p_closing_acct_period_id
1042: AND organization_id = p_org_id;
1043:
1044: l_stmt_num := 60;

Line 1136: UPDATE org_acct_periods

1132: RAISE UNPROCESSED_TXNS_EXIST;
1133: END IF;
1134:
1135: l_stmt_num := 140;
1136: UPDATE org_acct_periods
1137: SET summarized_flag = 'N',
1138: open_flag = 'N'
1139: WHERE organization_id = p_org_id
1140: AND acct_period_id = p_closing_acct_period_id;

Line 1231: UPDATE org_acct_periods

1227: ROLLBACK TO Close_Period_PUB;
1228: x_close_failed := TRUE;
1229: WHEN UNPROCESSED_TXNS_EXIST THEN
1230: ROLLBACK TO Close_Period_PUB;
1231: UPDATE org_acct_periods
1232: SET open_flag = 'N'
1233: WHERE organization_id = p_org_id
1234: AND acct_period_id = p_closing_acct_period_id;
1235: x_unprocessed_txns := TRUE;

Line 1271: FROM org_acct_periods

1267: l_prior_periods_enddate DATE;
1268:
1269: CURSOR get_prior_periods_enddate IS
1270: SELECT NVL(MAX(schedule_close_date), p_new_end_date - 1)
1271: FROM org_acct_periods
1272: WHERE organization_id = p_org_id
1273: AND acct_period_id < p_changed_acct_period_id;
1274:
1275: CURSOR get_next_periods_enddate IS

Line 1277: FROM org_acct_periods

1273: AND acct_period_id < p_changed_acct_period_id;
1274:
1275: CURSOR get_next_periods_enddate IS
1276: SELECT NVL(MIN(schedule_close_date), p_new_end_date + 1)
1277: FROM org_acct_periods
1278: WHERE organization_id = p_org_id
1279: AND acct_period_id > p_changed_acct_period_id;
1280:
1281: l_api_name CONSTANT VARCHAR2(30) := 'Update_EndDate';

Line 1358: UPDATE org_acct_periods

1354:
1355: x_period_order := TRUE;
1356:
1357: -- Update end date for this period
1358: UPDATE org_acct_periods
1359: SET schedule_close_date = p_new_end_date,
1360: last_update_date = sysdate, --trunc(SYSDATE),
1361: last_updated_by = p_user_id,
1362: last_update_login = p_login_id

Line 1367: UPDATE org_acct_periods

1363: WHERE organization_id = p_org_id
1364: AND acct_period_id = p_changed_acct_period_id;
1365:
1366: -- Update start date for next period
1367: UPDATE org_acct_periods
1368: SET period_start_date = p_new_end_date + 1,
1369: last_update_date = sysdate, --trunc(SYSDATE),
1370: last_updated_by = p_user_id,
1371: last_update_login = p_login_id

Line 1375: FROM org_acct_periods

1371: last_update_login = p_login_id
1372: WHERE organization_id = p_org_id
1373: AND acct_period_id =
1374: (SELECT MIN(acct_period_id)
1375: FROM org_acct_periods
1376: WHERE acct_period_id > p_changed_acct_period_id
1377: AND organization_id = p_org_id);
1378:
1379: END IF;

Line 1458: DELETE FROM org_acct_periods

1454: );
1455: END IF;
1456:
1457: l_stmt_num := 10;
1458: DELETE FROM org_acct_periods
1459: WHERE organization_id = p_org_id
1460: AND acct_period_id = x_acct_period_id;
1461:
1462: COMMIT;

Line 1576: FROM org_acct_periods

1572:
1573: l_stmt_num := 7;
1574: SELECT period_start_date, schedule_close_date
1575: INTO l_le_period_start_date, l_le_to_date
1576: FROM org_acct_periods
1577: WHERE organization_id = p_org_id
1578: AND acct_period_id = p_period_id;
1579:
1580: l_stmt_num := 8;

Line 1652: FROM org_acct_periods

1648: l_stmt_num := 20;
1649: --find id of the previous period
1650: SELECT MAX(acct_period_id)
1651: INTO l_prior_period_id
1652: FROM org_acct_periods
1653: WHERE organization_id = p_org_id
1654: AND acct_period_id < p_period_id;
1655:
1656: l_stmt_num := 30;

Line 1657: --if summarized_flag in org_acct_periods is 'N' and data exists in CPCS

1653: WHERE organization_id = p_org_id
1654: AND acct_period_id < p_period_id;
1655:
1656: l_stmt_num := 30;
1657: --if summarized_flag in org_acct_periods is 'N' and data exists in CPCS
1658: --for the same period, delete the rows from CPCS.
1659:
1660: SELECT count(*)
1661: INTO l_resummarize

Line 1662: FROM org_acct_periods

1658: --for the same period, delete the rows from CPCS.
1659:
1660: SELECT count(*)
1661: INTO l_resummarize
1662: FROM org_acct_periods
1663: WHERE organization_id = p_org_id
1664: AND acct_period_id = p_period_id
1665: AND summarized_flag = 'N'
1666: AND EXISTS

Line 1690: /* Updating org_acct_periods in case the customer has not updated summarized_flag

1686: DELETE cst_period_close_summary
1687: WHERE organization_id = p_org_id
1688: AND acct_period_id >= p_period_id;
1689:
1690: /* Updating org_acct_periods in case the customer has not updated summarized_flag
1691: for all succeeding periods */
1692: l_stmt_num := 37;
1693: UPDATE org_acct_periods
1694: SET summarized_flag = 'N'

Line 1693: UPDATE org_acct_periods

1689:
1690: /* Updating org_acct_periods in case the customer has not updated summarized_flag
1691: for all succeeding periods */
1692: l_stmt_num := 37;
1693: UPDATE org_acct_periods
1694: SET summarized_flag = 'N'
1695: WHERE organization_id = p_org_id
1696: AND acct_period_id >= p_period_id
1697: AND summarized_flag = 'Y';

Line 1704: FROM org_acct_periods

1700: l_stmt_num := 40;
1701: --check if previous period is summarized
1702: SELECT count(*)
1703: INTO l_prev_summary
1704: FROM org_acct_periods
1705: WHERE organization_id = p_org_id
1706: AND acct_period_id = l_prior_period_id
1707: AND summarized_flag = 'Y';
1708:

Line 1731: FROM org_acct_periods OAP1,

1727:
1728: SELECT NVL(OAP1.schedule_close_date+1-(1/(24*3600)),
1729: OAP2.period_start_date-(1/(24*3600)))
1730: INTO l_le_prior_end_date
1731: FROM org_acct_periods OAP1,
1732: org_acct_periods OAP2
1733: WHERE OAP1.organization_id(+) = OAP2.organization_id
1734: AND OAP1.acct_period_id(+) = l_prior_period_id
1735: AND OAP2.organization_id = p_org_id

Line 1732: org_acct_periods OAP2

1728: SELECT NVL(OAP1.schedule_close_date+1-(1/(24*3600)),
1729: OAP2.period_start_date-(1/(24*3600)))
1730: INTO l_le_prior_end_date
1731: FROM org_acct_periods OAP1,
1732: org_acct_periods OAP2
1733: WHERE OAP1.organization_id(+) = OAP2.organization_id
1734: AND OAP1.acct_period_id(+) = l_prior_period_id
1735: AND OAP2.organization_id = p_org_id
1736: AND OAP2.acct_period_id = p_period_id;

Line 2496: UPDATE org_acct_periods

2492: );
2493: END IF;
2494:
2495: l_stmt_num := 130;
2496: UPDATE org_acct_periods
2497: SET summarized_flag = 'Y'
2498:
2499: WHERE organization_id = p_org_id
2500: AND acct_period_id = p_period_id;