[Home] [Help]
656: ard.tax_group_code_id tax_group_code_id,
657: ard.tax_code_id tax_code_id,
658: ard.code_combination_id code_combination_id';
659:
660: from1_stmt VARCHAR2(150) := ' from ar_distributions ard,
661: ar_receivable_applications app
662: where ';
663:
664: where1_stmt VARCHAR2(3000) := ' app.applied_customer_trx_id = :p_customer_trx_id
692: nvl(ard.taxable_accounted_cr,0)) <> 0))';
693:
694: -- Get the Reconciliation entries created for Adjustments
695:
696: from2_stmt VARCHAR2(150) := ' from ar_distributions ard,
697: ar_adjustments adj
698: where ';
699:
700: where2_stmt VARCHAR2(3000) := ' adj.customer_trx_id = :p_customer_trx_id
737: ard.tax_code_id tax_code_id,
738: ard.code_combination_id code_combination_id';
739:
740: from3_stmt VARCHAR2(150) := 'from ra_customer_trx_lines ctl,
741: ar_distributions ard
742: where ';
743:
744: where3_stmt VARCHAR2(3000) := ' ctl.br_ref_customer_trx_id = :p_customer_trx_id
745: and :p_calling_point IN (''TRAN'', ''BLTR'')
794: ard.tax_group_code_id tax_group_code_id,
795: ard.tax_code_id tax_code_id,
796: ard.code_combination_id code_combination_id ';
797:
798: from4_stmt VARCHAR2(100) := ' from ar_distributions ard
799: where ';
800:
801: where4_stmt VARCHAR2(3000) := ' ard.source_id_secondary = :p_customer_trx_line_id
802: and :p_calling_point = ''BILL''
2307: sum(nvl(ard.taxable_entered_dr,0) * -1 +
2308: nvl(ard.taxable_entered_cr,0)) taxable_amount ,
2309: sum(nvl(ard.taxable_accounted_dr,0) * -1 +
2310: nvl(ard.taxable_accounted_cr,0)) taxable_acctd_amount
2311: from ar_distributions ard,
2312: ar_receivable_applications app
2313: where p_ae_sys_rec.sob_type = 'P'
2314: and app.applied_customer_trx_id = p_customer_trx_id
2315: and p_calling_point IN ('TRAN', 'BLTR')
2341: sum(nvl(ard.taxable_entered_dr,0) * -1 +
2342: nvl(ard.taxable_entered_cr,0)) taxable_amount ,
2343: sum(nvl(ard.taxable_accounted_dr,0) * -1 +
2344: nvl(ard.taxable_accounted_cr,0)) taxable_acctd_amount
2345: from ar_distributions ard,
2346: ar_adjustments adj
2347: where p_ae_sys_rec.sob_type = 'P'
2348: and adj.customer_trx_id = p_customer_trx_id
2349: and p_calling_point IN ('TRAN', 'BLTR')
2378: nvl(ard.taxable_entered_cr,0)) taxable_amount ,
2379: sum(nvl(ard.taxable_accounted_dr,0) * -1 +
2380: nvl(ard.taxable_accounted_cr,0)) taxable_acctd_amount
2381: from ra_customer_trx_lines ctl,
2382: ar_distributions ard
2383: where p_ae_sys_rec.sob_type = 'P'
2384: and ctl.br_ref_customer_trx_id = p_customer_trx_id
2385: and p_calling_point IN ('TRAN', 'BLTR')
2386: and ard.source_id_secondary = ctl.customer_trx_line_id
2409: sum(nvl(ard.taxable_entered_dr,0) * -1 +
2410: nvl(ard.taxable_entered_cr,0)) taxable_amount ,
2411: sum(nvl(ard.taxable_accounted_dr,0) * -1 +
2412: nvl(ard.taxable_accounted_cr,0)) taxable_acctd_amount
2413: from ar_distributions ard
2414: where p_ae_sys_rec.sob_type = 'P'
2415: and ard.source_id_secondary = p_br_cust_trx_line_id
2416: and p_calling_point = 'BILL'
2417: and ard.source_table_secondary = 'CTL'
2721: arp_standard.debug('Process_Recon: ' || 'Start caching physically created tax accounting entries due to past activity');
2722: END IF;
2723:
2724: /*---------------------------------------------------------------------------------+
2725: |Cache the deferred tax accounting entries physically created in ar_distributions |
2726: |due to activity on the bill. |
2727: +---------------------------------------------------------------------------------*/
2728: FOR l_inv_nr IN get_def_tax_acct LOOP
2729:
2763: l_cached := TRUE;
2764:
2765: END IF;
2766:
2767: END LOOP; --for activity table from ar_distributions
2768:
2769: END IF; --activity table exists for already cached entries
2770:
2771: /*---------------------------------------------------------------------------------+
2768:
2769: END IF; --activity table exists for already cached entries
2770:
2771: /*---------------------------------------------------------------------------------+
2772: |If an entry is not already cached when retrieved from ar_distributions then cache|
2773: +---------------------------------------------------------------------------------*/
2774: IF (NOT l_cached) THEN
2775:
2776: IF PG_DEBUG in ('Y', 'C') THEN
2894: l_cached := TRUE;
2895:
2896: END IF;
2897:
2898: END LOOP; --for activity table from ar_distributions
2899:
2900: END IF; --activity table exists for already cached entries
2901:
2902: /*---------------------------------------------------------------------------------+
2899:
2900: END IF; --activity table exists for already cached entries
2901:
2902: /*---------------------------------------------------------------------------------+
2903: |If an entry is not already cached when retrieved from ar_distributions then cache|
2904: +---------------------------------------------------------------------------------*/
2905: IF ((NOT l_cached)
2906: AND ((p_calling_point = 'TRAN')
2907: OR ((p_calling_point IN ('BILL', 'BLTR'))
2954: END IF; --entries exist in the global accounting table for a activity
2955:
2956: /*------------------------------------------------------------------------------------------+
2957: |Reconcile the simulated application accounting for deferred tax for the shadow adjustment |
2958: |accounting with that of the physically stored accounting entries in ar_distributions, due |
2959: |to activity on the Bill |
2960: +------------------------------------------------------------------------------------------*/
2961: IF PG_DEBUG in ('Y', 'C') THEN
2962: arp_standard.debug('Process_Recon: ' || 'Reconciling original accounting with the activity accounting ');
3178:
3179: END IF; --no matching condition
3180:
3181: /*---------------------------------------------------------------------------------+
3182: |Build the ar distributions accounting record for cache into the global accounting|
3183: |table. |
3184: +---------------------------------------------------------------------------------*/
3185: IF (l_cre_rec) THEN --set other attributes of accounting lines reconciliation entry
3186: