1: package body pa_purge_billing as
2: /*$Header: PAXBIPRB.pls 120.5 2007/02/07 10:46:49 rgandhi ship $*/
3:
4: l_commit_size NUMBER ;
5:
139: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
140: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
141:
142: WHEN OTHERS THEN
143: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_CUSTREVDISTLINES' );
144: pa_debug.debug('Error stage is '||x_err_stage );
145: pa_debug.debug('Error stack is '||x_err_stack );
146: pa_debug.debug(SQLERRM);
147: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
507:
508: else */
509: -- After "deleting" or "deleting and inserting" a set of records
510: -- the transaction is commited. This also creates a record in the
511: -- Pa_Purge_Project_details which will show the no. of records
512: -- that are purged from each table.
513:
514: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
515:
510: -- the transaction is commited. This also creates a record in the
511: -- Pa_Purge_Project_details which will show the no. of records
512: -- that are purged from each table.
513:
514: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
515:
516: IF l_NoOfRecordsDel > 0 Then
517: pa_purge.CommitProcess
518: (p_purge_batch_id => p_purge_batch_id,
513:
514: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
515:
516: IF l_NoOfRecordsDel > 0 Then
517: pa_purge.CommitProcess
518: (p_purge_batch_id => p_purge_batch_id,
519: p_project_id => p_project_id,
520: p_table_name => 'PA_CUST_REV_DIST_LINES_ALL',
521: p_NoOfRecordsIns => l_NoOfRecordsIns,
542: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
543: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
544:
545: WHEN OTHERS THEN
546: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_CUSTREVDISTLINES' );
547: pa_debug.debug('Error stage is '||x_err_stage );
548: pa_debug.debug('Error stack is '||x_err_stack );
549: pa_debug.debug(SQLERRM);
550: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
657: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
658: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
659:
660: WHEN OTHERS THEN
661: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_EventRevDistLines');
662: pa_debug.debug('Error stage is '||x_err_stage );
663: pa_debug.debug('Error stack is '||x_err_stack );
664: pa_debug.debug(SQLERRM);
665: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM;
994:
995: else */
996: -- After "deleting" or "deleting and inserting" a set of records
997: -- the transaction is commited. This also creates a record in the
998: -- Pa_Purge_Project_details which will show the no. of records
999: -- that are purged from each table.
1000:
1001: If l_NoOfRecordsDel > 0 Then
1002: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
998: -- Pa_Purge_Project_details which will show the no. of records
999: -- that are purged from each table.
1000:
1001: If l_NoOfRecordsDel > 0 Then
1002: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
1003: pa_purge.CommitProcess
1004: (p_purge_batch_id => p_purge_batch_id,
1005: p_project_id => p_project_id,
1006: p_table_name => 'PA_CUST_EVENT_RDL_ALL',
999: -- that are purged from each table.
1000:
1001: If l_NoOfRecordsDel > 0 Then
1002: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
1003: pa_purge.CommitProcess
1004: (p_purge_batch_id => p_purge_batch_id,
1005: p_project_id => p_project_id,
1006: p_table_name => 'PA_CUST_EVENT_RDL_ALL',
1007: p_NoOfRecordsIns => l_NoOfRecordsIns,
1028: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
1029: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1030:
1031: WHEN OTHERS THEN
1032: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_EventRevDistLines' );
1033: pa_debug.debug('Error stage is '||x_err_stage );
1034: pa_debug.debug('Error stack is '||x_err_stack );
1035: pa_debug.debug(SQLERRM);
1036: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1130: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
1131: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1132:
1133: WHEN OTHERS THEN
1134: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_Events_Trx');
1135: pa_debug.debug('Error stage is '||x_err_stage );
1136: pa_debug.debug('Error stack is '||x_err_stack );
1137: pa_debug.debug(SQLERRM);
1138: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM;
1536:
1537: else
1538: -- After "deleting" or "deleting and inserting" a set of records
1539: -- the transaction is commited. This also creates a record in the
1540: -- Pa_Purge_Project_details which will show the no. of records
1541: -- that are purged from each table.
1542:
1543: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
1544: pa_purge.CommitProcess
1539: -- the transaction is commited. This also creates a record in the
1540: -- Pa_Purge_Project_details which will show the no. of records
1541: -- that are purged from each table.
1542:
1543: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
1544: pa_purge.CommitProcess
1545: (p_purge_batch_id => p_purge_batch_id,
1546: p_project_id => p_project_id,
1547: p_table_name => 'PA_EVENTS',
1540: -- Pa_Purge_Project_details which will show the no. of records
1541: -- that are purged from each table.
1542:
1543: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
1544: pa_purge.CommitProcess
1545: (p_purge_batch_id => p_purge_batch_id,
1546: p_project_id => p_project_id,
1547: p_table_name => 'PA_EVENTS',
1548: p_NoOfRecordsIns => l_NoOfRecordsIns,
1566: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
1567: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1568:
1569: WHEN OTHERS THEN
1570: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_Event' );
1571: pa_debug.debug('Error stage is '||x_err_stage );
1572: pa_debug.debug('Error stack is '||x_err_stack );
1573: pa_debug.debug(SQLERRM);
1574: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1772:
1773: else
1774: -- After "deleting" or "deleting and inserting" a set of records
1775: -- the transaction is commited. This also creates a record in the
1776: -- Pa_Purge_Project_details which will show the no. of records
1777: -- that are purged from each table.
1778:
1779: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
1780: pa_purge.CommitProcess
1775: -- the transaction is commited. This also creates a record in the
1776: -- Pa_Purge_Project_details which will show the no. of records
1777: -- that are purged from each table.
1778:
1779: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
1780: pa_purge.CommitProcess
1781: (p_purge_batch_id => p_purge_batch_id,
1782: p_project_id => p_project_id,
1783: p_table_name => 'PA_DRAFT_REVENUE_ITEMS',
1776: -- Pa_Purge_Project_details which will show the no. of records
1777: -- that are purged from each table.
1778:
1779: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
1780: pa_purge.CommitProcess
1781: (p_purge_batch_id => p_purge_batch_id,
1782: p_project_id => p_project_id,
1783: p_table_name => 'PA_DRAFT_REVENUE_ITEMS',
1784: p_NoOfRecordsIns => l_NoOfRecordsIns,
1797: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
1798: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1799:
1800: WHEN OTHERS THEN
1801: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftRevItems' );
1802: pa_debug.debug('Error stage is '||x_err_stage );
1803: pa_debug.debug('Error stack is '||x_err_stack );
1804: pa_debug.debug(SQLERRM);
1805: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
1894: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
1895: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
1896:
1897: WHEN OTHERS THEN
1898: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_DRAFTINVOICEITEMS' );
1899: pa_debug.debug('Error stage is '||x_err_stage );
1900: pa_debug.debug('Error stack is '||x_err_stack );
1901: pa_debug.debug(SQLERRM);
1902: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2196:
2197: else
2198: -- After "deleting" or "deleting and inserting" a set of records
2199: -- the transaction is commited. This also creates a record in the
2200: -- Pa_Purge_Project_details which will show the no. of records
2201: -- that are purged from each table.
2202:
2203: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
2204: pa_purge.CommitProcess
2199: -- the transaction is commited. This also creates a record in the
2200: -- Pa_Purge_Project_details which will show the no. of records
2201: -- that are purged from each table.
2202:
2203: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
2204: pa_purge.CommitProcess
2205: (p_purge_batch_id => p_purge_batch_id,
2206: p_project_id => p_project_id,
2207: p_table_name => 'PA_DRAFT_INVOICE_ITEMS',
2200: -- Pa_Purge_Project_details which will show the no. of records
2201: -- that are purged from each table.
2202:
2203: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
2204: pa_purge.CommitProcess
2205: (p_purge_batch_id => p_purge_batch_id,
2206: p_project_id => p_project_id,
2207: p_table_name => 'PA_DRAFT_INVOICE_ITEMS',
2208: p_NoOfRecordsIns => l_NoOfRecordsIns,
2226: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
2227: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
2228:
2229: WHEN OTHERS THEN
2230: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftInvItems' );
2231: pa_debug.debug('Error stage is '||x_err_stage );
2232: pa_debug.debug('Error stack is '||x_err_stack );
2233: pa_debug.debug(SQLERRM);
2234: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2336: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
2337: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
2338:
2339: WHEN OTHERS THEN
2340: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_RETNINVDETAILS' );
2341: pa_debug.debug('Error stage is '||x_err_stage );
2342: pa_debug.debug('Error stack is '||x_err_stack );
2343: pa_debug.debug(SQLERRM);
2344: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2577:
2578: else
2579: -- After "deleting" or "deleting and inserting" a set of records
2580: -- the transaction is commited. This also creates a record in the
2581: -- Pa_Purge_Project_details which will show the no. of records
2582: -- that are purged from each table.
2583:
2584: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
2585: pa_purge.CommitProcess
2580: -- the transaction is commited. This also creates a record in the
2581: -- Pa_Purge_Project_details which will show the no. of records
2582: -- that are purged from each table.
2583:
2584: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
2585: pa_purge.CommitProcess
2586: (p_purge_batch_id => p_purge_batch_id,
2587: p_project_id => p_project_id,
2588: p_table_name => 'PA_RETN_INVOICE_DETAILS',
2581: -- Pa_Purge_Project_details which will show the no. of records
2582: -- that are purged from each table.
2583:
2584: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
2585: pa_purge.CommitProcess
2586: (p_purge_batch_id => p_purge_batch_id,
2587: p_project_id => p_project_id,
2588: p_table_name => 'PA_RETN_INVOICE_DETAILS',
2589: p_NoOfRecordsIns => l_NoOfRecordsIns,
2607: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
2608: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
2609:
2610: WHEN OTHERS THEN
2611: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_RetnInvDetails' );
2612: pa_debug.debug('Error stage is '||x_err_stage );
2613: pa_debug.debug('Error stack is '||x_err_stack );
2614: pa_debug.debug(SQLERRM);
2615: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2722: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
2723: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
2724:
2725: WHEN OTHERS THEN
2726: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_MC_DRAFTREVENUES' );
2727: pa_debug.debug('Error stage is '||x_err_stage );
2728: pa_debug.debug('Error stack is '||x_err_stack );
2729: pa_debug.debug(SQLERRM);
2730: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
2971:
2972: else
2973: -- After "deleting" or "deleting and inserting" a set of records
2974: -- the transaction is commited. This also creates a record in the
2975: -- Pa_Purge_Project_details which will show the no. of records
2976: -- that are purged from each table.
2977:
2978: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
2979: pa_purge.CommitProcess
2974: -- the transaction is commited. This also creates a record in the
2975: -- Pa_Purge_Project_details which will show the no. of records
2976: -- that are purged from each table.
2977:
2978: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
2979: pa_purge.CommitProcess
2980: (p_purge_batch_id => p_purge_batch_id,
2981: p_project_id => p_project_id,
2982: p_table_name => 'PA_DRAFT_REVENUES_ALL',
2975: -- Pa_Purge_Project_details which will show the no. of records
2976: -- that are purged from each table.
2977:
2978: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
2979: pa_purge.CommitProcess
2980: (p_purge_batch_id => p_purge_batch_id,
2981: p_project_id => p_project_id,
2982: p_table_name => 'PA_DRAFT_REVENUES_ALL',
2983: p_NoOfRecordsIns => l_NoOfRecordsIns,
3001: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
3002: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3003:
3004: WHEN OTHERS THEN
3005: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftRevenues' );
3006: pa_debug.debug('Error stage is '||x_err_stage );
3007: pa_debug.debug('Error stack is '||x_err_stack );
3008: pa_debug.debug(SQLERRM);
3009: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3312:
3313: else
3314: -- After "deleting" or "deleting and inserting" a set of records
3315: -- the transaction is commited. This also creates a record in the
3316: -- Pa_Purge_Project_details which will show the no. of records
3317: -- that are purged from each table.
3318:
3319: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
3320: pa_purge.CommitProcess
3315: -- the transaction is commited. This also creates a record in the
3316: -- Pa_Purge_Project_details which will show the no. of records
3317: -- that are purged from each table.
3318:
3319: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
3320: pa_purge.CommitProcess
3321: (p_purge_batch_id => p_purge_batch_id,
3322: p_project_id => p_project_id,
3323: p_table_name => 'PA_DRAFT_INVOICES_ALL',
3316: -- Pa_Purge_Project_details which will show the no. of records
3317: -- that are purged from each table.
3318:
3319: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
3320: pa_purge.CommitProcess
3321: (p_purge_batch_id => p_purge_batch_id,
3322: p_project_id => p_project_id,
3323: p_table_name => 'PA_DRAFT_INVOICES_ALL',
3324: p_NoOfRecordsIns => l_NoOfRecordsIns,
3336: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
3337: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3338:
3339: WHEN OTHERS THEN
3340: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DraftInvoices' );
3341: pa_debug.debug('Error stage is '||x_err_stage );
3342: pa_debug.debug('Error stack is '||x_err_stack );
3343: pa_debug.debug(SQLERRM);
3344: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3523:
3524: else
3525: -- After "deleting" or "deleting and inserting" a set of records
3526: -- the transaction is commited. This also creates a record in the
3527: -- Pa_Purge_Project_details which will show the no. of records
3528: -- that are purged from each table.
3529:
3530: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
3531: pa_purge.CommitProcess
3526: -- the transaction is commited. This also creates a record in the
3527: -- Pa_Purge_Project_details which will show the no. of records
3528: -- that are purged from each table.
3529:
3530: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
3531: pa_purge.CommitProcess
3532: (p_purge_batch_id => p_purge_batch_id,
3533: p_project_id => p_project_id,
3534: p_table_name => 'PA_DISTRIBUTION_WARNINGS',
3527: -- Pa_Purge_Project_details which will show the no. of records
3528: -- that are purged from each table.
3529:
3530: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
3531: pa_purge.CommitProcess
3532: (p_purge_batch_id => p_purge_batch_id,
3533: p_project_id => p_project_id,
3534: p_table_name => 'PA_DISTRIBUTION_WARNINGS',
3535: p_NoOfRecordsIns => l_NoOfRecordsIns,
3548: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
3549: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3550:
3551: WHEN OTHERS THEN
3552: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_DistWarnings' );
3553: pa_debug.debug('Error stage is '||x_err_stage );
3554: pa_debug.debug('Error stack is '||x_err_stack );
3555: pa_debug.debug(SQLERRM);
3556: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3764:
3765: else
3766: -- After "deleting" or "deleting and inserting" a set of records
3767: -- the transaction is commited. This also creates a record in the
3768: -- Pa_Purge_Project_details which will show the no. of records
3769: -- that are purged from each table.
3770:
3771: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
3772: pa_purge.CommitProcess
3767: -- the transaction is commited. This also creates a record in the
3768: -- Pa_Purge_Project_details which will show the no. of records
3769: -- that are purged from each table.
3770:
3771: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
3772: pa_purge.CommitProcess
3773: (p_purge_batch_id => p_purge_batch_id,
3774: p_project_id => p_project_id,
3775: p_table_name => 'PA_BILLING_MESSAGES',
3768: -- Pa_Purge_Project_details which will show the no. of records
3769: -- that are purged from each table.
3770:
3771: pa_debug.debug( ' ->Calling pa_purge.CommitProcess ') ;
3772: pa_purge.CommitProcess
3773: (p_purge_batch_id => p_purge_batch_id,
3774: p_project_id => p_project_id,
3775: p_table_name => 'PA_BILLING_MESSAGES',
3776: p_NoOfRecordsIns => l_NoOfRecordsIns,
3789: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
3790: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3791:
3792: WHEN OTHERS THEN
3793: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.PA_BillingMessages' );
3794: pa_debug.debug('Error stage is '||x_err_stage );
3795: pa_debug.debug('Error stack is '||x_err_stack );
3796: pa_debug.debug(SQLERRM);
3797: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3848:
3849: -- Call the procedures to archive/purge data for each billing table
3850: --
3851: pa_debug.debug('*-> About to purge CRDLs ') ;
3852: pa_purge_billing.PA_CustRevDistLines
3853: (p_purge_batch_id => p_purge_batch_id,
3854: p_project_id => p_project_id,
3855: p_txn_to_date => p_txn_to_date,
3856: p_purge_release => p_purge_release,
3861: x_err_stage => x_err_stage
3862: ) ;
3863:
3864: pa_debug.debug('*-> About to purge ERDLs ') ;
3865: pa_purge_billing.PA_EventRevDistLines
3866: (p_purge_batch_id => p_purge_batch_id,
3867: p_project_id => p_project_id,
3868: p_txn_to_date => p_txn_to_date,
3869: p_purge_release => p_purge_release,
3874: x_err_stage => x_err_stage
3875: ) ;
3876:
3877: pa_debug.debug('*-> About to purge Events ') ;
3878: pa_purge_billing.PA_Event
3879: (p_purge_batch_id => p_purge_batch_id,
3880: p_project_id => p_project_id,
3881: p_txn_to_date => p_txn_to_date,
3882: p_purge_release => p_purge_release,
3887: x_err_stage => x_err_stage
3888: ) ;
3889:
3890: pa_debug.debug('*-> About to purge Draft Revenue Items ') ;
3891: pa_purge_billing.PA_DraftRevItems
3892: (p_purge_batch_id => p_purge_batch_id,
3893: p_project_id => p_project_id,
3894: p_txn_to_date => p_txn_to_date,
3895: p_purge_release => p_purge_release,
3900: x_err_stage => x_err_stage
3901: ) ;
3902:
3903: pa_debug.debug('*-> About to purge Draft Invoice Items ') ;
3904: pa_purge_billing.PA_DraftInvItems
3905: (p_purge_batch_id => p_purge_batch_id,
3906: p_project_id => p_project_id,
3907: p_txn_to_date => p_txn_to_date,
3908: p_purge_release => p_purge_release,
3913: x_err_stage => x_err_stage
3914: ) ;
3915:
3916: pa_debug.debug('*-> About to purge Draft Revenues ') ;
3917: pa_purge_billing.PA_DraftRevenues
3918: (p_purge_batch_id => p_purge_batch_id,
3919: p_project_id => p_project_id,
3920: p_txn_to_date => p_txn_to_date,
3921: p_purge_release => p_purge_release,
3926: x_err_stage => x_err_stage
3927: ) ;
3928:
3929: pa_debug.debug('*-> About to purge Draft Invoices ') ;
3930: pa_purge_billing.PA_DraftInvoices
3931: (p_purge_batch_id => p_purge_batch_id,
3932: p_project_id => p_project_id,
3933: p_txn_to_date => p_txn_to_date,
3934: p_purge_release => p_purge_release,
3939: x_err_stage => x_err_stage
3940: ) ;
3941:
3942: pa_debug.debug('*-> About to purge distribution warnings ');
3943: pa_purge_billing.PA_DistWarnings
3944: (p_purge_batch_id => p_purge_batch_id,
3945: p_project_id => p_project_id,
3946: p_txn_to_date => p_txn_to_date,
3947: p_purge_release => p_purge_release,
3952: x_err_stage => x_err_stage
3953: ) ;
3954:
3955: pa_debug.debug('*-> About to purge billing messages ');
3956: pa_purge_billing.PA_BillingMessages
3957: (p_purge_batch_id => p_purge_batch_id,
3958: p_project_id => p_project_id,
3959: p_txn_to_date => p_txn_to_date,
3960: p_purge_release => p_purge_release,
3965: x_err_stage => x_err_stage
3966: ) ;
3967:
3968: pa_debug.debug('*-> About to purge retention details ');
3969: pa_purge_billing.PA_RetnInvDetails
3970: ( p_purge_batch_id => p_purge_batch_id,
3971: p_project_id => p_project_id,
3972: p_txn_to_date => p_txn_to_date,
3973: p_purge_release => p_purge_release,
3984: WHEN PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error then
3985: RAISE PA_PROJECT_UTILS2.PA_Arch_Pur_Subroutine_Error ;
3986:
3987: WHEN OTHERS THEN
3988: pa_debug.debug('Error Procedure Name := PA_PURGE_BILLING.pa_billing_main_purge' );
3989: pa_debug.debug('Error stage is '||x_err_stage );
3990: pa_debug.debug('Error stack is '||x_err_stack );
3991: pa_debug.debug(SQLERRM);
3992: PA_PROJECT_UTILS2.g_sqlerrm := SQLERRM ;
3999:
4000: END pa_billing_main_purge ;
4001:
4002:
4003: END pa_purge_billing;