46: AND EXISTS
47: ( SELECT 'X' FROM AR_SYSTEM_PARAMETERS where org_id = gt.org_id))
48: AND posting_control_id = -3;
49:
50: arp_standard.debug ('update_ar_acct_date: total records updated in ra_cust_trx_line_gl_dist_all: '||sql%rowcount);
51:
52: <
53: UPDATE ar_receivable_applications_all
54: SET gl_date = g_sweep_to_date,
62: AND EXISTS
63: ( SELECT 'X' FROM AR_SYSTEM_PARAMETERS where org_id = gt.org_id))
64: AND posting_control_id = -3;
65:
66: arp_standard.debug ('update_ar_acct_date: total records updated in ar_receivable_applications_all: '||sql%rowcount);
67:
68: <
69: UPDATE ar_cash_receipt_history_all
70: SET gl_date = g_sweep_to_date,
78: AND EXISTS
79: ( SELECT 'X' FROM AR_SYSTEM_PARAMETERS where org_id = gt.org_id))
80: AND posting_control_id = -3;
81:
82: arp_standard.debug ('update_ar_acct_date: total records updated in ar_cash_receipt_history_all: '||sql%rowcount);
83:
84: <
85: UPDATE ar_receivable_applications_all
86: SET gl_date = g_sweep_to_date,
94: AND EXISTS
95: ( SELECT 'X' FROM AR_SYSTEM_PARAMETERS where org_id = gt.org_id))
96: AND posting_control_id = -3;
97:
98: arp_standard.debug ('update_ar_acct_date: total records updated in ar_receivable_applications_all: '||sql%rowcount);
99:
100: <
101: UPDATE ar_misc_cash_distributions_all
102: SET gl_date = g_sweep_to_date,
110: AND EXISTS
111: ( SELECT 'X' FROM AR_SYSTEM_PARAMETERS where org_id = gt.org_id))
112: AND posting_control_id = -3;
113:
114: arp_standard.debug ('update_ar_acct_date: total records updated in ar_misc_cash_distributions_all: '||sql%rowcount);
115:
116: <
117: UPDATE ar_adjustments_all
118: SET gl_date = g_sweep_to_date,
126: AND EXISTS
127: ( SELECT 'X' FROM AR_SYSTEM_PARAMETERS where org_id = gt.org_id))
128: AND posting_control_id = -3;
129:
130: arp_standard.debug ('update_ar_acct_date: total records updated in ar_adjustments_all: '||sql%rowcount);
131:
132: <
133: UPDATE ar_transaction_history_all
134: SET gl_date = g_sweep_to_date,
142: AND EXISTS
143: ( SELECT 'X' FROM AR_SYSTEM_PARAMETERS where org_id = gt.org_id))
144: AND posting_control_id = -3;
145:
146: arp_standard.debug ('update_ar_acct_date: total records updated in ar_transaction_history_all: '||sql%rowcount);
147:
148:
149: <
150: -- TRX
406: ( SELECT 'X' FROM AR_SYSTEM_PARAMETERS where org_id = gt.org_id);
407:
408: begin
409:
410: arp_standard.debug ('begin update_xla_events: Bulk fetch cursor c_events');
411:
412: OPEN c_events;
413: LOOP
414: FETCH c_events
420: l_trans_nums,
421: l_entity_codes
422: LIMIT g_fetch_limit;
423:
424: arp_standard.debug ('update_xla_events: l_event_ids.count='||l_event_ids.count );
425:
426: EXIT WHEN
427: l_event_ids.count = 0;
428:
500:
501: END LOOP;
502: CLOSE c_events;
503:
504: arp_standard.debug ('end update_xla_events');
505:
506: return TRUE;
507:
508: EXCEPTION
510:
511: IF (c_events%ISOPEN) THEN
512: CLOSE c_events;
513: END IF;
514: arp_standard.debug ('EXCEPTION: update_xla_events: '|| sqlerrm);
515: return FALSE;
516:
517: END;
518:
544:
545: l_success := update_xla_events;
546:
547: if (l_success <> TRUE) then
548: arp_standard.debug ('Failure in update_xla_events while updating XLA unaccounted events');
549: return FALSE;
550: end if;
551:
552: l_success := FALSE;
555:
556: l_success := update_ar_acct_date;
557:
558: if (l_success <> TRUE) then
559: arp_standard.debug ('Failure in update_ar_acct_date while updating payables invoices and payments');
560: end if;
561:
562: return l_success;
563:
667:
668:
669: l_rowcount := sql%rowcount;
670:
671: arp_standard.debug ('Total records inserted in ar_period_close_excps_gt for source_type='||G_SRC_TYP_UNACCT_TRX||' is:'||l_rowcount);
672:
673: l_rowcount := NULL;
674:
675: <
750:
751:
752: l_rowcount := sql%rowcount;
753:
754: arp_standard.debug ('Total records inserted in ar_period_close_excps_gt for source_type='||G_SRC_TYP_UNACCT_TRX||' is:'||l_rowcount);
755:
756: l_rowcount := NULL;
757:
758: --------------
832:
833:
834: l_rowcount := sql%rowcount;
835:
836: arp_standard.debug ('Total records inserted in ar_period_close_excps_gt for cash receipts source_type='||G_SRC_TYP_UNACCT_RCT||' for table= CRH is:'||l_rowcount);
837:
838: l_rowcount := NULL;
839:
840: <
909:
910:
911: l_rowcount := sql%rowcount;
912:
913: arp_standard.debug ('Total records inserted in ar_period_close_excps_gt for MCD receipts source_type='||G_SRC_TYP_UNACCT_RCT||' for table= CRH is:'||l_rowcount);
914:
915: l_rowcount := NULL;
916:
917: <
988:
989:
990: l_rowcount := sql%rowcount;
991:
992: arp_standard.debug ('Total records inserted in ar_period_close_excps_gt for source_type='||G_SRC_TYP_UNACCT_RCT||' for table= RA is:'||l_rowcount);
993:
994: l_rowcount := NULL;
995:
996: <
1064:
1065:
1066: l_rowcount := sql%rowcount;
1067:
1068: arp_standard.debug ('Total records inserted in ar_period_close_excps_gt for source_type='||G_SRC_TYP_UNACCT_RCT||' for table= MCD is:'||l_rowcount);
1069:
1070: l_rowcount := NULL;
1071:
1072: --------------
1147:
1148:
1149: l_rowcount := sql%rowcount;
1150:
1151: arp_standard.debug ('Total records inserted in ar_period_close_excps_gt for source_type='||G_SRC_TYP_UNACCT_ADJ||' is:'||l_rowcount);
1152:
1153: l_rowcount := NULL;
1154:
1155: --------------
1230:
1231:
1232: l_rowcount := sql%rowcount;
1233:
1234: arp_standard.debug ('Total records inserted in ar_period_close_excps_gt for source_type='||G_SRC_TYP_UNACCT_BR||' is:'||l_rowcount);
1235:
1236: l_rowcount := NULL;
1237:
1238:
1316: , ld_period_end_date
1317: , lv_closing_status;
1318: close c_get_period_dates;
1319:
1320: arp_standard.debug ('cursor c_get_period_dates: ld_period_start_date='||ld_period_start_date
1321: ||'; ld_period_end_date='||ld_period_end_date
1322: ||'; lv_closing_status='||lv_closing_status
1323: );
1324:
1353: ,ld_sweep_to_end_date
1354: ,lv_closing_status;
1355: close c_get_period_dates;
1356:
1357: arp_standard.debug ('cursor c_get_period_dates (p_period_name=>'||g_sweep_period_name||',p_include_adj_period=N');
1358: arp_standard.debug ('cursor c_get_period_dates: g_sweep_to_date='||g_sweep_to_date
1359: ||'; ld_sweep_to_end_date='||ld_sweep_to_end_date
1360: ||'; lv_closing_status='||lv_closing_status
1361: );
1354: ,lv_closing_status;
1355: close c_get_period_dates;
1356:
1357: arp_standard.debug ('cursor c_get_period_dates (p_period_name=>'||g_sweep_period_name||',p_include_adj_period=N');
1358: arp_standard.debug ('cursor c_get_period_dates: g_sweep_to_date='||g_sweep_to_date
1359: ||'; ld_sweep_to_end_date='||ld_sweep_to_end_date
1360: ||'; lv_closing_status='||lv_closing_status
1361: );
1362:
1401: lv_dummy varchar2(3);
1402:
1403: BEGIN
1404: IF G_DEBUG in ('Y', 'C') THEN
1405: arp_standard.debug( 'AR_SWEEP_UNACCOUNTED_TRX.sweep()+');
1406: arp_standard.debug( 'p_reporting_level '|| p_reporting_level);
1407: arp_standard.debug( 'p_reporting_entity_id '|| p_reporting_entity_id);
1408: arp_standard.debug( 'p_period_name '|| p_period_name);
1409: arp_standard.debug( 'p_sweep_period_name '|| p_sweep_period_name);
1402:
1403: BEGIN
1404: IF G_DEBUG in ('Y', 'C') THEN
1405: arp_standard.debug( 'AR_SWEEP_UNACCOUNTED_TRX.sweep()+');
1406: arp_standard.debug( 'p_reporting_level '|| p_reporting_level);
1407: arp_standard.debug( 'p_reporting_entity_id '|| p_reporting_entity_id);
1408: arp_standard.debug( 'p_period_name '|| p_period_name);
1409: arp_standard.debug( 'p_sweep_period_name '|| p_sweep_period_name);
1410: arp_standard.debug( 'p_sweep_now '|| p_sweep_now);
1403: BEGIN
1404: IF G_DEBUG in ('Y', 'C') THEN
1405: arp_standard.debug( 'AR_SWEEP_UNACCOUNTED_TRX.sweep()+');
1406: arp_standard.debug( 'p_reporting_level '|| p_reporting_level);
1407: arp_standard.debug( 'p_reporting_entity_id '|| p_reporting_entity_id);
1408: arp_standard.debug( 'p_period_name '|| p_period_name);
1409: arp_standard.debug( 'p_sweep_period_name '|| p_sweep_period_name);
1410: arp_standard.debug( 'p_sweep_now '|| p_sweep_now);
1411: END IF;
1404: IF G_DEBUG in ('Y', 'C') THEN
1405: arp_standard.debug( 'AR_SWEEP_UNACCOUNTED_TRX.sweep()+');
1406: arp_standard.debug( 'p_reporting_level '|| p_reporting_level);
1407: arp_standard.debug( 'p_reporting_entity_id '|| p_reporting_entity_id);
1408: arp_standard.debug( 'p_period_name '|| p_period_name);
1409: arp_standard.debug( 'p_sweep_period_name '|| p_sweep_period_name);
1410: arp_standard.debug( 'p_sweep_now '|| p_sweep_now);
1411: END IF;
1412:
1405: arp_standard.debug( 'AR_SWEEP_UNACCOUNTED_TRX.sweep()+');
1406: arp_standard.debug( 'p_reporting_level '|| p_reporting_level);
1407: arp_standard.debug( 'p_reporting_entity_id '|| p_reporting_entity_id);
1408: arp_standard.debug( 'p_period_name '|| p_period_name);
1409: arp_standard.debug( 'p_sweep_period_name '|| p_sweep_period_name);
1410: arp_standard.debug( 'p_sweep_now '|| p_sweep_now);
1411: END IF;
1412:
1413: g_reporting_level := p_reporting_level;
1406: arp_standard.debug( 'p_reporting_level '|| p_reporting_level);
1407: arp_standard.debug( 'p_reporting_entity_id '|| p_reporting_entity_id);
1408: arp_standard.debug( 'p_period_name '|| p_period_name);
1409: arp_standard.debug( 'p_sweep_period_name '|| p_sweep_period_name);
1410: arp_standard.debug( 'p_sweep_now '|| p_sweep_now);
1411: END IF;
1412:
1413: g_reporting_level := p_reporting_level;
1414: g_reporting_entity_id := p_reporting_entity_id;
1438: (p_validation_flag => p_process_flag
1439: ,p_validation_message => p_process_message
1440: );
1441:
1442: arp_standard.debug ('validate_parameters: flag='||p_process_flag ||'; message='|| p_process_message);
1443: if (p_process_flag <> 'SS') then
1444: -- parameters are not proper hence should avoid processing further
1445: return;
1446: end if;
1448: --
1449: -- Get Unposted Transactions
1450: --
1451: lv_dummy := get_unposted_transactions;
1452: arp_standard.debug ('get_unposted_transaction: return value='||lv_dummy);
1453:
1454: --
1455: -- Sweep unposted Transactions
1456: --
1455: -- Sweep unposted Transactions
1456: --
1457: if g_sweep_now = 'Y' then
1458:
1459: arp_standard.debug ('begin sweep_transactions: current timestamp is= '||current_timestamp);
1460:
1461: if NOT sweep_transactions then -- perform the SWEEP logic
1462: p_process_flag := 'EE';
1463: p_process_message := 'AR_SWEEP_FAILED';
1463: p_process_message := 'AR_SWEEP_FAILED';
1464: return;
1465: end if;
1466:
1467: arp_standard.debug ('sweep_transactions: flag='||p_process_flag||'; message='||p_process_message);
1468: arp_standard.debug ('end sweep_transactions: current timestamp is= '||current_timestamp);
1469:
1470: end if;
1471:
1464: return;
1465: end if;
1466:
1467: arp_standard.debug ('sweep_transactions: flag='||p_process_flag||'; message='||p_process_message);
1468: arp_standard.debug ('end sweep_transactions: current timestamp is= '||current_timestamp);
1469:
1470: end if;
1471:
1472: arp_standard.debug ('end process period: current timestamp is= '||current_timestamp);
1468: arp_standard.debug ('end sweep_transactions: current timestamp is= '||current_timestamp);
1469:
1470: end if;
1471:
1472: arp_standard.debug ('end process period: current timestamp is= '||current_timestamp);
1473: p_process_flag := 'SS';
1474:
1475: EXCEPTION WHEN OTHERS THEN
1476: p_process_flag := 'UE';
1474:
1475: EXCEPTION WHEN OTHERS THEN
1476: p_process_flag := 'UE';
1477: p_process_message:='ERROR: process_period:' || sqlerrm;
1478: arp_standard.debug ('EXCEPTION: process_period: '||sqlerrm);
1479: END process_period;
1480:
1481:
1482: FUNCTION before_report_artrxswp RETURN BOOLEAN IS
1484: lv_process_message varchar2 (2000);
1485:
1486: BEGIN
1487:
1488: arp_standard.debug ('begin before_report_artrxswp: current timestamp:' || current_timestamp);
1489:
1490: process_period(p_reporting_level => P_REPORTING_LEVEL,
1491: p_reporting_entity_id => P_REPORTING_ENTITY_ID,
1492: p_period_name => P_PERIOD_NAME,
1495: ,p_process_flag => lv_process_flag
1496: ,p_process_message => lv_process_message
1497: );
1498:
1499: arp_standard.debug ('end before_report_artrxswp: current timestamp: '|| current_timestamp);
1500: IF lv_process_flag = 'SS' THEN
1501: RETURN TRUE;
1502: ELSE
1503: RETURN FALSE;
1503: RETURN FALSE;
1504: END IF;
1505:
1506: EXCEPTION WHEN OTHERS THEN
1507: arp_standard.debug ('EXCEPTION: Before Report: '||sqlerrm);
1508: RAISE;
1509: END;
1510:
1511: FUNCTION get_ledger_name RETURN varchar2
1516: where set_of_books_id=g_ledger_id ;
1517:
1518: return l_ledger;
1519: EXCEPTION WHEN OTHERS THEN
1520: arp_standard.debug ('EXCEPTION: get_ledger_name: '||sqlerrm);
1521: END get_ledger_name;
1522:
1523:
1524: FUNCTION get_acct_start_date RETURN varchar2 IS