DBA Data[Home] [Help]

APPS.JAI_CMN_RGM_SETTLEMENT_PKG dependencies on JAI_RGM_SETTLEMENTS

Line 387: FROM jai_rgm_settlements

383:
384:
385: CURSOR cur_regime_id IS
386: SELECT regime_id
387: FROM jai_rgm_settlements
388: WHERE settlement_id = pn_settlement_id;
389:
390: lv_regime_id jai_rgm_settlements.regime_id%type;
391:

Line 390: lv_regime_id jai_rgm_settlements.regime_id%type;

386: SELECT regime_id
387: FROM jai_rgm_settlements
388: WHERE settlement_id = pn_settlement_id;
389:
390: lv_regime_id jai_rgm_settlements.regime_id%type;
391:
392: cursor cur_regime_code is /*Ravi */
393: select regime_code
394: from JAI_RGM_DEFINITIONS

Line 412: FROM jai_rgm_settlements

408: AND settlement_id = pn_settlement_id;
409:
410: /*CURSOR cur_regno IS
411: SELECT primary_registration_no
412: FROM jai_rgm_settlements
413: WHERE settlement_id = pn_settlement_id;*/
414: /*rchandan for bug#5642053..commented the above cursor and defined the following cursor*/
415:
416: CURSOR cur_stl_details IS

Line 421: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl

417: SELECT jstl.primary_registration_no,
418: jbal.party_type ,
419: jbal.party_id ,
420: jbal.location_id
421: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl
422: WHERE jbal.settlement_id = jstl.settlement_id
423: AND jbal.settlement_id = pn_settlement_id;
424:
425:

Line 437: from jai_rgm_stl_balances jbal,jai_rgm_settlements jstl

433: AND source_trx_type = 'Invoice Payment'
434: AND transaction_date = ( select max(settlement_date) + 1
435: from jai_rgm_stl_balances a
436: where 2 = (select count(distinct jbal.settlement_date)
437: from jai_rgm_stl_balances jbal,jai_rgm_settlements jstl
438: where jbal.settlement_id = jstl.settlement_id
439: and jstl.primary_registration_no = lp_regn_no and jbal.settlement_date >= a.settlement_date));
440:
441:

Line 447: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl

443: IS
444: --|| This cursor is used to retrieve the sum of credit and debit balances as on
445: --|| last settlement date for the given registration number
446: SELECT sum(jbal.credit_balance) credit_balance,sum(jbal.debit_balance) debit_balance
447: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl
448: WHERE jbal.settlement_id = jstl.settlement_id
449: AND jstl.primary_registration_no = lp_regn_no
450: AND jbal.tax_type = lp_tax_type
451: AND jbal.party_id = lp_org_id

Line 455: from jai_rgm_stl_balances jbal,jai_rgm_settlements jstl

451: AND jbal.party_id = lp_org_id
452: AND jstl.settlement_date = ( select max(settlement_date)
453: from jai_rgm_stl_balances a
454: where 2 = (select count(distinct jbal.settlement_date)
455: from jai_rgm_stl_balances jbal,jai_rgm_settlements jstl
456: where jbal.settlement_id = jstl.settlement_id
457: and jstl.primary_registration_no = lp_regn_no and jbal.settlement_date >= a.settlement_date ));
458:
459: */

Line 476: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl

472: SELECT sum(credit_amount)
473: FROM jai_rgm_trx_records
474: WHERE source_trx_type = 'Invoice Payment'
475: AND settlement_id = ( SELECT MAX(jbal.settlement_id)
476: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl
477: WHERE jbal.settlement_id = jstl.settlement_id
478: AND jstl.primary_registration_no = cp_regn_no
479: AND jbal.party_type = cp_org_type
480: AND jbal.party_id = cp_org_id

Line 498: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl

494: */
495: SELECT sum(credit_balance) credit_balance,sum(debit_balance) debit_balance
496: FROM jai_rgm_stl_balances
497: WHERE settlement_id = ( SELECT MAX(jbal.settlement_id)
498: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl
499: WHERE jbal.settlement_id = jstl.settlement_id
500: AND jstl.primary_registration_no = cp_regn_no
501: AND jbal.party_type = cp_org_type
502: AND jbal.party_id = cp_org_id

Line 523: lv_regn_no jai_rgm_settlements.primary_registration_no%type;

519: ln_charge_accounting_id jai_rgm_trx_records.charge_account_id%type; /* added by ssawant for bug 6020629 */
520: lv_organization_type VARCHAR2(10); /* added by ssawant for bug 6020629 */
521: ln_invoice_amount jai_rgm_trx_records.credit_amount%type ; /* added by ssawant for bug 6020629 */
522: rec_balances cur_balances%ROWTYPE;/* added by ssawant for bug 6020629 */
523: lv_regn_no jai_rgm_settlements.primary_registration_no%type;
524: /*rchandan for bug#5642053 start*/
525: ln_organization_id jai_rgm_stl_balances.party_id%TYPE;
526: ln_location_id jai_rgm_stl_balances.location_id%TYPE;
527: lv_org_type jai_rgm_stl_balances.party_type%TYPE;

Line 638: p_source_table_name => 'JAI_RGM_SETTLEMENTS',

634: p_organization_type => lv_organization_type,
635: p_organization_id => r_acct_balances.party_id,
636: p_source => jai_constants.source_settle_in,
637: p_source_trx_type => 'Invoice Payment',
638: p_source_table_name => 'JAI_RGM_SETTLEMENTS',
639: p_source_document_id => pn_settlement_id,
640: p_code_combination_id => ln_charge_accounting_id,
641: p_entered_cr => NULL,
642: p_entered_dr => ln_acct_amount,

Line 678: p_source_table_name => 'JAI_RGM_SETTLEMENTS',

674: p_organization_type => lv_organization_type,
675: p_organization_id => r_acct_balances.party_id,
676: p_source => jai_constants.source_settle_in,
677: p_source_trx_type => 'Invoice Payment',
678: p_source_table_name => 'JAI_RGM_SETTLEMENTS',
679: p_source_document_id => pn_settlement_id,
680: p_code_combination_id => ln_charge_accounting_id,
681: p_entered_cr => ln_acct_amount,
682: p_entered_dr => NULL,

Line 710: jai_rgm_settlements b

706:
707:
708: FOR I in (select distinct b.regime_id, b.settlement_date, a.tax_type
709: from jai_rgm_stl_balances a,
710: jai_rgm_settlements b
711: where a.settlement_id = b.settlement_id
712: AND a.settlement_id = pn_settlement_id)
713: LOOP
714: SELECT count(*)

Line 785: p_source_table_name => 'JAI_RGM_SETTLEMENTS',

781: p_trx_date => i.settlement_date,
782: p_acct_req => jai_constants.yes,
783: p_source => 'SETTLEMENT',
784: p_source_trx_type => 'SETTLEMENT',
785: p_source_table_name => 'JAI_RGM_SETTLEMENTS',
786: p_source_doc_id => pn_settlement_id,
787: p_settlement_id => pn_settlement_id,
788: p_reference_id => NULL,
789: p_process_flag => pv_process_flag,

Line 821: p_source_table_name => 'JAI_RGM_SETTLEMENTS',

817: p_trx_date => i.settlement_date,
818: p_acct_req => jai_constants.yes,
819: p_source => 'SETTLEMENT',
820: p_source_trx_type => 'SETTLEMENT',
821: p_source_table_name => 'JAI_RGM_SETTLEMENTS',
822: p_source_doc_id => ln_dist_dtl_id,
823: p_settlement_id => pn_settlement_id,
824: p_reference_id => NULL,
825: p_process_flag => pv_process_flag,

Line 967: PROCEDURE create_invoice( pn_regime_id IN jai_rgm_settlements.regime_id%TYPE,

963: pv_process_message := SUBSTR(SQLERRM,1,200);
964: END transfer_balance;
965:
966:
967: PROCEDURE create_invoice( pn_regime_id IN jai_rgm_settlements.regime_id%TYPE,
968: pn_settlement_id IN jai_rgm_settlements.settlement_id%TYPE,
969: pd_settlement_date IN jai_rgm_settlements.settlement_date%TYPE,
970: pn_vendor_id IN jai_rgm_settlements.tax_authority_id%TYPE,
971: pn_vendor_site_id IN jai_rgm_settlements.tax_authority_site_id%TYPE,

Line 968: pn_settlement_id IN jai_rgm_settlements.settlement_id%TYPE,

964: END transfer_balance;
965:
966:
967: PROCEDURE create_invoice( pn_regime_id IN jai_rgm_settlements.regime_id%TYPE,
968: pn_settlement_id IN jai_rgm_settlements.settlement_id%TYPE,
969: pd_settlement_date IN jai_rgm_settlements.settlement_date%TYPE,
970: pn_vendor_id IN jai_rgm_settlements.tax_authority_id%TYPE,
971: pn_vendor_site_id IN jai_rgm_settlements.tax_authority_site_id%TYPE,
972: pn_calculated_amount IN jai_rgm_settlements.calculated_amount%TYPE,

Line 969: pd_settlement_date IN jai_rgm_settlements.settlement_date%TYPE,

965:
966:
967: PROCEDURE create_invoice( pn_regime_id IN jai_rgm_settlements.regime_id%TYPE,
968: pn_settlement_id IN jai_rgm_settlements.settlement_id%TYPE,
969: pd_settlement_date IN jai_rgm_settlements.settlement_date%TYPE,
970: pn_vendor_id IN jai_rgm_settlements.tax_authority_id%TYPE,
971: pn_vendor_site_id IN jai_rgm_settlements.tax_authority_site_id%TYPE,
972: pn_calculated_amount IN jai_rgm_settlements.calculated_amount%TYPE,
973: pn_invoice_amount IN jai_rgm_settlements.payment_amount%TYPE,

Line 970: pn_vendor_id IN jai_rgm_settlements.tax_authority_id%TYPE,

966:
967: PROCEDURE create_invoice( pn_regime_id IN jai_rgm_settlements.regime_id%TYPE,
968: pn_settlement_id IN jai_rgm_settlements.settlement_id%TYPE,
969: pd_settlement_date IN jai_rgm_settlements.settlement_date%TYPE,
970: pn_vendor_id IN jai_rgm_settlements.tax_authority_id%TYPE,
971: pn_vendor_site_id IN jai_rgm_settlements.tax_authority_site_id%TYPE,
972: pn_calculated_amount IN jai_rgm_settlements.calculated_amount%TYPE,
973: pn_invoice_amount IN jai_rgm_settlements.payment_amount%TYPE,
974: pn_org_id IN jai_rgm_stl_balances.party_id%TYPE,

Line 971: pn_vendor_site_id IN jai_rgm_settlements.tax_authority_site_id%TYPE,

967: PROCEDURE create_invoice( pn_regime_id IN jai_rgm_settlements.regime_id%TYPE,
968: pn_settlement_id IN jai_rgm_settlements.settlement_id%TYPE,
969: pd_settlement_date IN jai_rgm_settlements.settlement_date%TYPE,
970: pn_vendor_id IN jai_rgm_settlements.tax_authority_id%TYPE,
971: pn_vendor_site_id IN jai_rgm_settlements.tax_authority_site_id%TYPE,
972: pn_calculated_amount IN jai_rgm_settlements.calculated_amount%TYPE,
973: pn_invoice_amount IN jai_rgm_settlements.payment_amount%TYPE,
974: pn_org_id IN jai_rgm_stl_balances.party_id%TYPE,
975: pv_regsitration_no IN jai_rgm_settlements.primary_registration_no%TYPE,

Line 972: pn_calculated_amount IN jai_rgm_settlements.calculated_amount%TYPE,

968: pn_settlement_id IN jai_rgm_settlements.settlement_id%TYPE,
969: pd_settlement_date IN jai_rgm_settlements.settlement_date%TYPE,
970: pn_vendor_id IN jai_rgm_settlements.tax_authority_id%TYPE,
971: pn_vendor_site_id IN jai_rgm_settlements.tax_authority_site_id%TYPE,
972: pn_calculated_amount IN jai_rgm_settlements.calculated_amount%TYPE,
973: pn_invoice_amount IN jai_rgm_settlements.payment_amount%TYPE,
974: pn_org_id IN jai_rgm_stl_balances.party_id%TYPE,
975: pv_regsitration_no IN jai_rgm_settlements.primary_registration_no%TYPE,
976: pn_created_by IN ap_invoices_interface.created_by%TYPE,

Line 973: pn_invoice_amount IN jai_rgm_settlements.payment_amount%TYPE,

969: pd_settlement_date IN jai_rgm_settlements.settlement_date%TYPE,
970: pn_vendor_id IN jai_rgm_settlements.tax_authority_id%TYPE,
971: pn_vendor_site_id IN jai_rgm_settlements.tax_authority_site_id%TYPE,
972: pn_calculated_amount IN jai_rgm_settlements.calculated_amount%TYPE,
973: pn_invoice_amount IN jai_rgm_settlements.payment_amount%TYPE,
974: pn_org_id IN jai_rgm_stl_balances.party_id%TYPE,
975: pv_regsitration_no IN jai_rgm_settlements.primary_registration_no%TYPE,
976: pn_created_by IN ap_invoices_interface.created_by%TYPE,
977: pd_creation_date IN ap_invoices_interface.creation_date%TYPE,

Line 975: pv_regsitration_no IN jai_rgm_settlements.primary_registration_no%TYPE,

971: pn_vendor_site_id IN jai_rgm_settlements.tax_authority_site_id%TYPE,
972: pn_calculated_amount IN jai_rgm_settlements.calculated_amount%TYPE,
973: pn_invoice_amount IN jai_rgm_settlements.payment_amount%TYPE,
974: pn_org_id IN jai_rgm_stl_balances.party_id%TYPE,
975: pv_regsitration_no IN jai_rgm_settlements.primary_registration_no%TYPE,
976: pn_created_by IN ap_invoices_interface.created_by%TYPE,
977: pd_creation_date IN ap_invoices_interface.creation_date%TYPE,
978: pn_last_updated_by IN ap_invoices_interface.last_updated_by%TYPE,
979: pd_last_update_date IN ap_invoices_interface.last_update_date%TYPE,

Line 981: pv_system_invoice_no OUT NOCOPY jai_rgm_settlements.system_invoice_no%TYPE,

977: pd_creation_date IN ap_invoices_interface.creation_date%TYPE,
978: pn_last_updated_by IN ap_invoices_interface.last_updated_by%TYPE,
979: pd_last_update_date IN ap_invoices_interface.last_update_date%TYPE,
980: pn_last_update_login IN ap_invoices_interface.last_update_login%TYPE,
981: pv_system_invoice_no OUT NOCOPY jai_rgm_settlements.system_invoice_no%TYPE,
982: pv_process_flag OUT NOCOPY VARCHAR2,
983: pv_process_message OUT NOCOPY VARCHAR2)
984: IS
985:

Line 1015: SELECT jai_rgm_settlements_s1.NEXTVAL --rchandan for bug#4487676. JAI_RGM_SETTLEMENT_INVOICE_S is replaced with JAI_RGM_SETTLEMENTS_S1

1011: -- bug 4929081. Added by Lakshmi Gopalsami
1012: WHERE invoice_id = pn_invoice_id;
1013:
1014: CURSOR cur_invoice_no IS
1015: SELECT jai_rgm_settlements_s1.NEXTVAL --rchandan for bug#4487676. JAI_RGM_SETTLEMENT_INVOICE_S is replaced with JAI_RGM_SETTLEMENTS_S1
1016: FROM dual;
1017:
1018: /* commented the below cursor by ssawant for bug 5879769
1019: CURSOR cur_distributions IS

Line 1566: pn_regime_id IN jai_rgm_settlements.regime_id%TYPE DEFAULT NULL

1562:
1563: FUNCTION get_last_settlement_date
1564: (pn_org_id IN jai_rgm_stl_balances.party_id%TYPE,
1565: /* Bug 5096787. Added by Lakshmi Gopalsami */
1566: pn_regime_id IN jai_rgm_settlements.regime_id%TYPE DEFAULT NULL
1567: )
1568: RETURN DATE
1569: IS
1570: CURSOR c_last_settlement_date

Line 1587: FUNCTION get_last_settlement_date(pn_regime_id IN jai_rgm_settlements.regime_id%type,

1583: RETURN ld_last_settlement_date;
1584:
1585: END get_last_settlement_date;
1586:
1587: FUNCTION get_last_settlement_date(pn_regime_id IN jai_rgm_settlements.regime_id%type,
1588: pn_org_id IN jai_rgm_stl_balances.party_id%TYPE,
1589: pn_location_id IN jai_rgm_stl_balances.location_id%TYPE)
1590: RETURN DATE
1591: IS

Line 1595: FROM JAI_RGM_STL_BALANCES jbal,jai_rgm_settlements jstl

1591: IS
1592: CURSOR c_last_settlement_date
1593: IS
1594: SELECT MAX(jbal.settlement_date)
1595: FROM JAI_RGM_STL_BALANCES jbal,jai_rgm_settlements jstl
1596: WHERE jbal.settlement_id = jstl.settlement_id
1597: AND jstl.regime_id = pn_regime_id
1598: AND party_id = pn_org_id
1599: AND location_id = pn_location_id;

Line 1667: PROCEDURE get_last_balance_amount(pn_regime_id IN jai_rgm_settlements.regime_id%type,

1663: app_exception.raise_exception;
1664:
1665: END get_last_balance_amount;
1666:
1667: PROCEDURE get_last_balance_amount(pn_regime_id IN jai_rgm_settlements.regime_id%type,
1668: pn_org_id IN jai_rgm_stl_balances.party_id%TYPE,
1669: pn_location_id IN jai_rgm_stl_balances.location_id%TYPE,
1670: pv_tax_type IN jai_rgm_stl_balances.tax_type%TYPE,
1671: pn_debit_amount OUT NOCOPY jai_rgm_stl_balances.debit_balance%TYPE,

Line 1686: jai_rgm_settlements jstl

1682: AND tax_type = pv_tax_type
1683: AND nvl(service_type_code,'-999') = nvl(pv_service_type_code, '-999' ) /* added by ssawant for bug 5879769 */
1684: AND settlement_id = (SELECT MAX(jbal.settlement_id)
1685: FROM JAI_RGM_STL_BALANCES jbal,
1686: jai_rgm_settlements jstl
1687: WHERE jbal.settlement_id = jstl.settlement_id
1688: AND jstl.regime_id = pn_regime_id
1689: AND party_id = pn_org_id
1690: AND location_id = pn_location_id

Line 1741: FROM jai_rgm_settlements

1737: HAVING NVL(SUM(debit_balance),0) - NVL(SUM(credit_balance),0) > 0;
1738:
1739: CURSOR cur_settlement IS
1740: SELECT *
1741: FROM jai_rgm_settlements
1742: WHERE settlement_id = pn_settlement_id;
1743:
1744: CURSOR cur_tax_types(p_reg_type jai_rgm_registrations.registration_type%TYPE ) IS --rchandan for bug#4428980
1745: SELECT attribute_sequence, attribute_code tax_type, RATE

Line 1821: p_source_table_name => 'JAI_RGM_SETTLEMENTS',

1817: p_organization_id => i.party_id,
1818: p_location_id => i.location_id , /* added by ssawant for bug 5879769 */
1819: p_source => jai_constants.source_settle_in,
1820: p_source_trx_type => 'Invoice Payment',
1821: p_source_table_name => 'JAI_RGM_SETTLEMENTS',
1822: p_source_document_id => pn_settlement_id,
1823: p_transaction_date => pd_transaction_date,/* +1 is removed by ssawant for bug 5662296 */
1824: p_account_name => NULL,
1825: p_charge_account_id => NULL,

Line 1874: pv_source_table_name => 'JAI_RGM_SETTLEMENTS',

1870: pn_organization_id => i.party_id,
1871: pn_location_id => i.location_id,
1872: pv_source => jai_constants.source_settle_in,
1873: pv_source_trx_type => 'Invoice Payment',
1874: pv_source_table_name => 'JAI_RGM_SETTLEMENTS',
1875: pn_source_id => pn_settlement_id,
1876: pd_transaction_date => pd_transaction_date,/* +1 is removed by ssawant for bug 5662296 */
1877: pv_account_name => jai_constants.recovery,
1878: pn_charge_account_id => ln_charge_accounting_id,

Line 1942: p_source_table_name => 'JAI_RGM_SETTLEMENTS',

1938: p_organization_id => ln_org_id,
1939: p_location_id => NULL,
1940: p_source => jai_constants.source_settle_in,
1941: p_source_trx_type => 'Invoice Payment',
1942: p_source_table_name => 'JAI_RGM_SETTLEMENTS',
1943: p_source_document_id => pn_settlement_id,
1944: p_transaction_date => pd_transaction_date,/* +1 is removed by ssawant for bug 5662296 */
1945: p_account_name => NULL,
1946: p_charge_account_id => NULL,

Line 1976: p_source_table_name => 'JAI_RGM_SETTLEMENTS',

1972: p_organization_id => ln_org_id,
1973: p_location_id => NULL,
1974: p_source => jai_constants.source_settle_in,
1975: p_source_trx_type => 'Invoice Payment',
1976: p_source_table_name => 'JAI_RGM_SETTLEMENTS',
1977: p_source_document_id => pn_settlement_id,
1978: p_transaction_date => pd_transaction_date, /* +1 is removed by ssawant for bug 5662296 */
1979: p_account_name => NULL,
1980: p_charge_account_id => NULL,

Line 2030: pv_source_table_name => 'JAI_RGM_SETTLEMENTS',

2026: pn_organization_id => org_io_rec.party_id,
2027: pn_location_id => org_io_rec.location_id,
2028: pv_source => jai_constants.source_settle_in,
2029: pv_source_trx_type => 'Invoice Payment',
2030: pv_source_table_name => 'JAI_RGM_SETTLEMENTS',
2031: pn_source_id => pn_settlement_id,
2032: pd_transaction_date => pd_transaction_date, /* +1 is removed by ssawant for bug 5662296 */
2033: pv_account_name => NULL,
2034: pn_charge_account_id => NULL,

Line 2085: FROM JAI_RGM_STL_BALANCES jbal,jai_rgm_settlements jstl

2081: IS
2082: CURSOR c_last_settlement_date
2083: IS
2084: SELECT MAX(jbal.settlement_date)
2085: FROM JAI_RGM_STL_BALANCES jbal,jai_rgm_settlements jstl
2086: WHERE jbal.settlement_id = jstl.settlement_id
2087: AND jstl.regime_id = pn_regime_id
2088: AND jstl.primary_registration_no = pn_regn_no
2089: AND jbal.party_id = nvl(pn_organization_id,jbal.party_id)