46: l_cr_rec ar_cash_receipts%ROWTYPE;
47: l_rma_rec ar_receipt_method_accounts%ROWTYPE;
48: l_crh_rec_old ar_cash_receipt_history%ROWTYPE;
49: l_crh_rec_new ar_cash_receipt_history%ROWTYPE;
50: l_dist_rec ar_distributions%ROWTYPE;
51: l_radj_rec ar_rate_adjustments%ROWTYPE;
52: l_acctd_receipt_amt_new ar_cash_receipt_history.acctd_amount%TYPE;
53: l_acctd_receipt_amt_old ar_cash_receipt_history.acctd_amount%TYPE;
54: l_cash_amt ar_cash_receipt_history.amount%TYPE;
549: l_event_rec.xla_mode := 'O';
550: l_event_rec.xla_call := 'B';
551: arp_xla_events.Create_Events(p_xla_ev_rec => l_event_rec );
552:
553: -- Insert the cash account ar_distributions record
554: ------------------------------------------------------------------------------------
555: -- Removed the following 'if' as part of bug fix 868448
556: -- because we should be able to create zero dollar misc receipts and later clear them.
557: -- Because of this if, records are never created in ar_distributions and as a result
553: -- Insert the cash account ar_distributions record
554: ------------------------------------------------------------------------------------
555: -- Removed the following 'if' as part of bug fix 868448
556: -- because we should be able to create zero dollar misc receipts and later clear them.
557: -- Because of this if, records are never created in ar_distributions and as a result
558: -- gl_transfer does'nt pick up these records to post
559: -----------------------------------------------------------------------------------
560: --IF ( l_crh_rec_new.amount <>0 ) OR
561: -- ( l_crh_rec_new.acctd_amount <> 0 )
612: mrc engine */
613: /*
614: ar_mrc_engine2.maintain_mrc_data2(
615: p_event_mode => 'INSERT',
616: p_table_name => 'AR_DISTRIBUTIONS',
617: p_mode => 'SINGLE',
618: p_key_value => l_dist_rec.line_id,
619: p_row_info => l_dist_rec);
620: */
624: l_dist_rec.source_id_secondary := NULL;
625:
626: --END IF;
627:
628: -- insert the remittance account ar_distributions record
629:
630: /* Bug No. 3644849 JVARKEY */
631: -- For Remittance Row The exchange parameters must be as that of its history
632: IF ( l_crh_rec_old.status = 'REMITTED' )
680: mrc engine */
681: /*
682: ar_mrc_engine2.maintain_mrc_data2(
683: p_event_mode => 'INSERT',
684: p_table_name => 'AR_DISTRIBUTIONS',
685: p_mode => 'SINGLE',
686: p_key_value => l_dist_rec.line_id,
687: p_row_info => l_dist_rec);
688: */
696: l_dist_rec.currency_conversion_date := l_crh_rec_new.exchange_date;
697:
698: END IF;
699:
700: -- insert the short term debt account ar_distributions record
701: IF ( l_crh_rec_old.status = 'REMITTED' ) AND
702: ( l_crh_rec_old.factor_flag ='Y' ) -- AND
703: /* skoukunt: comment to Fix bug 1198295
704: (( l_crh_rec_old.amount <>0 ) OR
739: mrc engine */
740:
741: ar_mrc_engine2.maintain_mrc_data2(
742: p_event_mode => 'INSERT',
743: p_table_name => 'AR_DISTRIBUTIONS',
744: p_mode => 'SINGLE',
745: p_key_value => l_dist_rec.line_id,
746: p_row_info => l_dist_rec);
747:
746: p_row_info => l_dist_rec);
747:
748: END IF;
749:
750: -- insert the factor account ar_distributions record if it's
751: -- factor='Y' and there's a rate adj involved
752: IF ( l_crh_rec_old.factor_flag = 'Y' ) AND
753: ( l_crh_rec_old.exchange_rate <> l_crh_rec_new.exchange_rate ) AND
754: ( (l_acctd_receipt_amt_new - l_acctd_receipt_amt_old) <> 0 )
789: mrc engine */
790:
791: ar_mrc_engine2.maintain_mrc_data2(
792: p_event_mode => 'INSERT',
793: p_table_name => 'AR_DISTRIBUTIONS',
794: p_mode => 'SINGLE',
795: p_key_value => l_dist_rec.line_id,
796: p_row_info => l_dist_rec);
797:
796: p_row_info => l_dist_rec);
797:
798: END IF;
799:
800: -- insert the short term debt ar_distributions record if it's
801: -- factor='Y' and there's a rate adj involved and it's
802: -- prior history record is 'CLEARED'
803: IF ( l_crh_rec_old.factor_flag = 'Y' ) AND
804: ( l_crh_rec_old.status = 'CLEARED' ) AND
841: mrc engine */
842:
843: ar_mrc_engine2.maintain_mrc_data2(
844: p_event_mode => 'INSERT',
845: p_table_name => 'AR_DISTRIBUTIONS',
846: p_mode => 'SINGLE',
847: p_key_value => l_dist_rec.line_id,
848: p_row_info => l_dist_rec);
849:
848: p_row_info => l_dist_rec);
849:
850: END IF;
851:
852: -- insert the bank charge account ar_distributions record
853: IF ( l_crh_rec_new.factor_discount_amount <>0 ) OR
854: ( l_crh_rec_new.acctd_factor_discount_amount <> 0 )
855: THEN
856: l_dist_rec.source_id := l_crh_rec_new.cash_receipt_history_id;
899: mrc engine */
900:
901: ar_mrc_engine2.maintain_mrc_data2(
902: p_event_mode => 'INSERT',
903: p_table_name => 'AR_DISTRIBUTIONS',
904: p_mode => 'SINGLE',
905: p_key_value => l_dist_rec.line_id,
906: p_row_info => l_dist_rec);
907:
1067: l_crh_rec_old ar_cash_receipt_history%ROWTYPE;
1068: l_crh_rec_new ar_cash_receipt_history%ROWTYPE;
1069: l_rma_rec ar_receipt_method_accounts%ROWTYPE;
1070: l_radj_rec ar_rate_adjustments%ROWTYPE;
1071: l_dist_rec ar_distributions%ROWTYPE;
1072: l_receipt_amt ar_cash_receipt_history.amount%TYPE;
1073: l_acctd_receipt_amt ar_cash_receipt_history.acctd_amount%TYPE;
1074: l_new_crh_id_fr_radj ar_cash_receipt_history.cash_receipt_history_id%TYPE;
1075:
1309: ARP_XLA_EVENTS.create_events(p_xla_ev_rec => l_xla_ev_rec);
1310:
1311:
1312:
1313: -- Insert the remittance/short_term_debt account ar_distributions record
1314: /* skoukunt: comment to Fix bug 1198295
1315: IF ( l_receipt_amt <>0 ) OR
1316: ( l_acctd_receipt_amt <> 0 )
1317: THEN
1357: arp_distributions_pkg.insert_p( l_dist_rec,l_dist_rec.line_id );
1358:
1359: -- END IF;
1360:
1361: -- Insert the cash account ar_distributions record
1362: /* skoukunt: comment to Fix bug 1198295
1363: IF ( l_crh_rec_old.amount <>0 ) OR
1364: ( l_crh_rec_old.acctd_amount <> 0 )
1365: THEN
1436:
1437:
1438: -- END IF;
1439:
1440: -- Insert the bank charge account ar_distributions record
1441: IF ( NVL(l_crh_rec_old.factor_discount_amount,0) <>0 ) OR
1442: ( NVL(l_crh_rec_old.acctd_factor_discount_amount,0) <> 0 )
1443: THEN
1444: l_dist_rec.source_id := l_crh_rec_new.cash_receipt_history_id;
1516: p_crh_id OUT NOCOPY ar_cash_receipt_history.cash_receipt_history_id%TYPE ) IS
1517: --
1518: l_crh_rec_old ar_cash_receipt_history%ROWTYPE;
1519: l_crh_rec_new ar_cash_receipt_history%ROWTYPE;
1520: l_dist_rec ar_distributions%ROWTYPE;
1521: l_receipt_amt ar_cash_receipt_history.amount%TYPE;
1522: l_acctd_receipt_amt ar_cash_receipt_history.acctd_amount%TYPE;
1523: NULL_VAR ar_receipt_method_accounts%ROWTYPE;
1524: l_cr_rec ar_cash_receipts%ROWTYPE;
1617: l_risk_event_rec.xla_mode := 'O';
1618: l_risk_event_rec.xla_call := 'B';
1619: arp_xla_events.Create_Events(p_xla_ev_rec => l_risk_event_rec );
1620:
1621: -- Insert the short_term_debt account ar_distributions record
1622: /* skoukunt: comment to Fix bug 1198295
1623: IF ( l_receipt_amt <>0 ) OR
1624: ( l_acctd_receipt_amt <> 0 )
1625: THEN
1659: mrc engine */
1660:
1661: ar_mrc_engine2.maintain_mrc_data2(
1662: p_event_mode => 'INSERT',
1663: p_table_name => 'AR_DISTRIBUTIONS',
1664: p_mode => 'SINGLE',
1665: p_key_value => l_dist_rec.line_id,
1666: p_row_info => l_dist_rec);
1667:
1666: p_row_info => l_dist_rec);
1667:
1668: -- END IF;
1669:
1670: -- Insert the factor account ar_distributions record
1671: /* skoukunt: comment to Fix bug 1198295
1672: IF ( l_crh_rec_old.amount <>0 ) OR
1673: ( l_crh_rec_old.acctd_amount <> 0 )
1674: THEN
1708: mrc engine */
1709:
1710: ar_mrc_engine2.maintain_mrc_data2(
1711: p_event_mode => 'INSERT',
1712: p_table_name => 'AR_DISTRIBUTIONS',
1713: p_mode => 'SINGLE',
1714: p_key_value => l_dist_rec.line_id,
1715: p_row_info => l_dist_rec);
1716:
1794: p_crh_id OUT NOCOPY ar_cash_receipt_history.cash_receipt_history_id%TYPE ) IS
1795: --
1796: l_crh_rec_old ar_cash_receipt_history%ROWTYPE;
1797: l_crh_rec_new ar_cash_receipt_history%ROWTYPE;
1798: l_dist_rec ar_distributions%ROWTYPE;
1799: l_receipt_amt ar_cash_receipt_history.amount%TYPE;
1800: l_acctd_receipt_amt ar_cash_receipt_history.acctd_amount%TYPE;
1801: NULL_VAR ar_receipt_method_accounts%ROWTYPE;
1802: l_cr_rec ar_cash_receipts%ROWTYPE;
1879: l_crh_rec_old.reversal_posting_control_id := -3;
1880: l_crh_rec_old.reversal_created_from := substrb(p_module_name||'ARP_CASHBOOK.UNDO_RISK_ELIMINATE',1,30);
1881: arp_cr_history_pkg.update_p( l_crh_rec_old );
1882:
1883: -- Insert the short_term_debt account ar_distributions record
1884: /* skoukunt: comment to Fix bug 1198295
1885: IF ( l_receipt_amt <>0 ) OR
1886: ( l_acctd_receipt_amt <> 0 )
1887: THEN
1921: mrc engine */
1922:
1923: ar_mrc_engine2.maintain_mrc_data2(
1924: p_event_mode => 'INSERT',
1925: p_table_name => 'AR_DISTRIBUTIONS',
1926: p_mode => 'SINGLE',
1927: p_key_value => l_dist_rec.line_id,
1928: p_row_info => l_dist_rec);
1929:
1929:
1930:
1931: -- END IF;
1932:
1933: -- Insert the factor account ar_distributions record
1934: /* skoukunt: comment to Fix bug 1198295
1935: IF ( l_crh_rec_old.amount <>0 ) OR
1936: ( l_crh_rec_old.acctd_amount <> 0 )
1937: THEN
1971: mrc engine */
1972:
1973: ar_mrc_engine2.maintain_mrc_data2(
1974: p_event_mode => 'INSERT',
1975: p_table_name => 'AR_DISTRIBUTIONS',
1976: p_mode => 'SINGLE',
1977: p_key_value => l_dist_rec.line_id,
1978: p_row_info => l_dist_rec);
1979:
2072: p_row_id VARCHAR2(30);
2073: l_cr_id ar_cash_Receipts.cash_receipt_id%TYPE;
2074: l_dis_set_id ar_cash_receipts.distribution_set_id%TYPE;
2075: /* Bug fix 2300268 */
2076: l_tax_account_id ar_distributions.code_combination_id%TYPE;
2077: /* Bug fix 2742388 */
2078: l_crh_id ar_cash_receipt_history.cash_receipt_history_id%TYPE;
2079: l_org_id NUMBER; --added by Jixun for bug#14726865
2080: BEGIN