DBA Data[Home] [Help]

APPS.JAI_CMN_RGM_TAX_DIST_PKG dependencies on JAI_RGM_STL_BALANCES

Line 414: FROM jai_rgm_stl_balances stl

410: SELECT
411: --(credit_balance - debit_balance) cr_balance, 8671217
412: ( sum(nvl(credit_balance,0))-sum(nvl(debit_balance,0))) cr_balance ,
413: tax_type
414: FROM jai_rgm_stl_balances stl
415: WHERE settlement_id =
416: (SELECT MAX(jstl.settlement_id)
417: FROM jai_rgm_stl_balances jstl,
418: jai_rgm_Settlements jrs

Line 417: FROM jai_rgm_stl_balances jstl,

413: tax_type
414: FROM jai_rgm_stl_balances stl
415: WHERE settlement_id =
416: (SELECT MAX(jstl.settlement_id)
417: FROM jai_rgm_stl_balances jstl,
418: jai_rgm_Settlements jrs
419: WHERE
420: jstl.party_id = cp_org_id /* 8671217 ,12706846*/
421: AND jstl.location_id = cp_location_id /* 8671217 ,12706846*/

Line 443: jai_rgm_Stl_balances are populated with the below for MAY:

439:
440: I1 ,I2,I3,I4 are there under registration number 'ABC'.
441: registration level settlement has been performed in the month of may .
442:
443: jai_rgm_Stl_balances are populated with the below for MAY:
444: Credit_balance debit_balance
445: I1 1000 2500
446: I2 3000 4000
447: I3 2000 5000

Line 467: jai_rgm_Stl_balances.credit_balance)

463: 8000 6000
464:
465: Ideally the credit shall show 3000 (I1+I2+I3).
466: Difference is of 5000 (i.e I4 credit _balance available for the month of May
467: jai_rgm_Stl_balances.credit_balance)
468:
469: The above discrepancy is caused due to the credit population logic in populate_all_orgs_vat
470:
471: Fix :

Line 486: FROM jai_rgm_stl_balances jstl,

482: select '1'
483: FROM JAI_RGM_SETTLEMENTS stL
484: WHERE settlement_id =
485: (SELECT MAX(jstl.settlement_id)
486: FROM jai_rgm_stl_balances jstl,
487: jai_rgm_Settlements jrs
488: WHERE
489: jstl.party_id = cp_org_id /* 8671217 ,12706846*/
490: AND jstl.location_id = cp_location_id /* 8671217 ,12706846*/

Line 921: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl

917: FROM jai_rgm_trx_records
918: WHERE regime_primary_regno = p_regn_no
919: AND source_trx_type = 'Invoice Payment'
920: AND settlement_id = ( SELECT MAX(jbal.settlement_id)
921: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl
922: WHERE jbal.settlement_id = jstl.settlement_id
923: AND jstl.primary_registration_no = p_regn_no
924: AND jbal.party_type = p_org_type
925: AND jbal.party_id = p_org_id

Line 949: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl

945: WHERE source_trx_type = 'Invoice Payment'
946: -- AND service_type_code = nvl(cp_service_type_code,service_type_code)/*added nvl for bug#13865856*/
947: and (cp_service_type_code is null or service_type_code =cp_service_type_code) /*Commented the above and added the condition for bug 14475128 */
948: AND settlement_id = ( SELECT MAX(jbal.settlement_id)
949: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl
950: WHERE jbal.settlement_id = jstl.settlement_id
951: AND jbal.party_type = cp_org_type
952: AND jbal.party_id = cp_org_id
953: AND jbal.location_id = nvl(cp_location_id,jbal.location_id)/*5694855*/

Line 976: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl

972: FROM jai_rgm_trx_records
973: WHERE /*regime_primary_regno = p_regn_no*/ -- Commented, Harshita for Bug 5694855
974: source_trx_type = 'Invoice Payment'
975: AND settlement_id = ( SELECT MAX(jbal.settlement_id)
976: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl
977: WHERE jbal.settlement_id = jstl.settlement_id
978: AND jbal.party_type = cp_org_type
979: AND jbal.party_id = cp_org_id
980: AND jbal.tax_type = cp_tax_type

Line 990: FROM jai_rgm_stl_balances jrs,

986: || This cursor is used to retrieve the sum of credit and debit balances as on
987: || last settlement date for the given registration number,organization and location grouped at the tax type
988: */
989: SELECT sum(credit_balance) credit_balance,sum(debit_balance) debit_balance,jrs.settlement_id,jrs.tax_type,jrs.location_id
990: FROM jai_rgm_stl_balances jrs,
991: (
992: SELECT MAX(jbal.settlement_id) settlement_id,tax_type
993: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl
994: WHERE jbal.settlement_id = jstl.settlement_id

Line 993: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl

989: SELECT sum(credit_balance) credit_balance,sum(debit_balance) debit_balance,jrs.settlement_id,jrs.tax_type,jrs.location_id
990: FROM jai_rgm_stl_balances jrs,
991: (
992: SELECT MAX(jbal.settlement_id) settlement_id,tax_type
993: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl
994: WHERE jbal.settlement_id = jstl.settlement_id
995: AND jstl.primary_registration_no = p_regn_no
996: AND jbal.party_type = p_org_type
997: AND jbal.party_id = p_org_id

Line 1011: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl

1007: CURSOR cur_last_settlement_id
1008: /* added this cursor for bug 7606212 by vumaasha */
1009: IS
1010: SELECT MAX(jbal.settlement_id)
1011: FROM jai_rgm_stl_balances jbal,jai_rgm_settlements jstl
1012: WHERE jbal.settlement_id = jstl.settlement_id
1013: AND jstl.primary_registration_no = p_regn_no
1014: AND jbal.party_type = p_org_type
1015: AND jbal.party_id = p_org_id

Line 1035: FROM jai_rgm_stl_balances jbal,

1031: FROM jai_rgm_trx_records
1032: WHERE regime_primary_regno = p_regn_no
1033: AND source_trx_type = 'Invoice Payment'
1034: AND settlement_id = ( SELECT MAX(jbal.settlement_id)
1035: FROM jai_rgm_stl_balances jbal,
1036: jai_rgm_settlements jstl,
1037: jai_rgm_definitions jrg
1038: WHERE jbal.settlement_id = jstl.settlement_id
1039: AND jrg.regime_id = jstl.regime_id

Line 1060: FROM jai_rgm_stl_balances jrs,

1056: || last settlement date for the given registration number,organization and location grouped at the tax type
1057: || for VAT
1058: */
1059: SELECT sum(credit_balance) credit_balance,sum(debit_balance) debit_balance,jrs.settlement_id,jrs.tax_type,jrs.location_id
1060: FROM jai_rgm_stl_balances jrs,
1061: ( SELECT MAX(jbal.settlement_id) settlement_id,tax_type
1062: FROM jai_rgm_stl_balances jbal,
1063: jai_rgm_settlements jstl,
1064: JAI_RGM_DEFINITIONS jrg

Line 1062: FROM jai_rgm_stl_balances jbal,

1058: */
1059: SELECT sum(credit_balance) credit_balance,sum(debit_balance) debit_balance,jrs.settlement_id,jrs.tax_type,jrs.location_id
1060: FROM jai_rgm_stl_balances jrs,
1061: ( SELECT MAX(jbal.settlement_id) settlement_id,tax_type
1062: FROM jai_rgm_stl_balances jbal,
1063: jai_rgm_settlements jstl,
1064: JAI_RGM_DEFINITIONS jrg
1065: WHERE jbal.settlement_id = jstl.settlement_id
1066: AND jrg.regime_id = jstl.regime_id

Line 1094: FROM jai_rgm_stl_balances jbal,

1090: )
1091: IS
1092: /* added this cursor for bug 7606212 by vumaasha */
1093: SELECT MAX(jbal.settlement_id)
1094: FROM jai_rgm_stl_balances jbal,
1095: jai_rgm_settlements jstl,
1096: JAI_RGM_DEFINITIONS jrg
1097: WHERE jbal.settlement_id = jstl.settlement_id
1098: AND jrg.regime_id = jstl.regime_id

Line 1151: FROM JAI_RGM_STL_BALANCES

1147: cp_location_id IN NUMBER,
1148: cp_tax_type IN VARCHAR2)
1149: IS
1150: SELECT sum(debit_balance), sum(credit_balance)
1151: FROM JAI_RGM_STL_BALANCES
1152: WHERE party_id = cp_org_id
1153: AND location_id = cp_location_id
1154: AND tax_type = cp_tax_type
1155: AND settlement_id = (SELECT MAX(jbal.settlement_id)

Line 1156: FROM JAI_RGM_STL_BALANCES jbal,

1152: WHERE party_id = cp_org_id
1153: AND location_id = cp_location_id
1154: AND tax_type = cp_tax_type
1155: AND settlement_id = (SELECT MAX(jbal.settlement_id)
1156: FROM JAI_RGM_STL_BALANCES jbal,
1157: jai_rgm_settlements jstl
1158: WHERE jbal.settlement_id = jstl.settlement_id
1159: AND jstl.regime_id = cp_regime_id
1160: AND party_id = cp_org_id

Line 1172: cr_balance jai_rgm_stl_balances.credit_balance%type; /*added by ssawant for bug 5662296*/

1168: ln_settled_debit_balance number ;
1169: ln_settled_credit_balance number ;
1170: -- lv_inv_amount jai_rgm_trx_records.credit_amount%type;/* commented by ssawant for bug 5662296*/
1171: ln_invoice_amount jai_rgm_trx_records.credit_amount%type;
1172: cr_balance jai_rgm_stl_balances.credit_balance%type; /*added by ssawant for bug 5662296*/
1173: dr_balance jai_rgm_stl_balances.debit_balance%type; /*added by ssawant for bug 5662296*/
1174: ln_settled_flag NUMBER(1) := 0;/*added by ssawant for bug 5662296*/
1175: v_last_settlement_id NUMBER; /* added for bug 7606212 by vumaasha */
1176: v_credit_exceeds_debit BOOLEAN:=FALSE;/* added by vumaasha for bug 7606212 */

Line 1173: dr_balance jai_rgm_stl_balances.debit_balance%type; /*added by ssawant for bug 5662296*/

1169: ln_settled_credit_balance number ;
1170: -- lv_inv_amount jai_rgm_trx_records.credit_amount%type;/* commented by ssawant for bug 5662296*/
1171: ln_invoice_amount jai_rgm_trx_records.credit_amount%type;
1172: cr_balance jai_rgm_stl_balances.credit_balance%type; /*added by ssawant for bug 5662296*/
1173: dr_balance jai_rgm_stl_balances.debit_balance%type; /*added by ssawant for bug 5662296*/
1174: ln_settled_flag NUMBER(1) := 0;/*added by ssawant for bug 5662296*/
1175: v_last_settlement_id NUMBER; /* added for bug 7606212 by vumaasha */
1176: v_credit_exceeds_debit BOOLEAN:=FALSE;/* added by vumaasha for bug 7606212 */
1177:

Line 1358: /**start additions for bug#11821537 by vkaranam,budget 2011 phase2,calculation logic for jai_rgm_stl_balances.credit_utilized

1354: ln_settled_debit_balance := 0;
1355: END IF;
1356: --bug#8289991, end
1357:
1358: /**start additions for bug#11821537 by vkaranam,budget 2011 phase2,calculation logic for jai_rgm_stl_balances.credit_utilized
1359: column based on the ST credit utilization ptg provided on the regime registration setup **/
1360: ln_total_debit_balance := nvl(ln_settled_debit_balance,0) + delta_rec.debit_amt ;
1361: ln_total_credit_balance := nvl(ln_settled_credit_balance,0) + delta_rec.credit_amt ;
1362: -- ln_utilization_amount := round(ln_total_debit_balance*nvl(ln_crptg_utilize_st,0)/100, jai_constants.service_rgm_rnd_factor);

Line 1756: FROM jai_rgm_stl_balances jrs,

1752: SUM(debit_balance) debit_balance,
1753: jrs.settlement_id,
1754: jrs.tax_type,
1755: jrs.location_id
1756: FROM jai_rgm_stl_balances jrs,
1757: (SELECT MAX(jbal.settlement_id) settlement_id,
1758: tax_type
1759: FROM jai_rgm_stl_balances jbal,
1760: jai_rgm_settlements jstl,

Line 1759: FROM jai_rgm_stl_balances jbal,

1755: jrs.location_id
1756: FROM jai_rgm_stl_balances jrs,
1757: (SELECT MAX(jbal.settlement_id) settlement_id,
1758: tax_type
1759: FROM jai_rgm_stl_balances jbal,
1760: jai_rgm_settlements jstl,
1761: jai_rgm_definitions jrg
1762: WHERE jbal.settlement_id = jstl.settlement_id
1763: AND jrg.regime_id = jstl.regime_id

Line 1780: FROM jai_rgm_stl_balances jbal,

1776: jrs.location_id;
1777:
1778: CURSOR cur_last_settlement_id_tcs(cp_organization_type VARCHAR2, cp_organization_id NUMBER, cp_location_id NUMBER) IS
1779: SELECT MAX(jbal.settlement_id)
1780: FROM jai_rgm_stl_balances jbal,
1781: jai_rgm_settlements jstl,
1782: jai_rgm_definitions jrg
1783: WHERE jbal.settlement_id = jstl.settlement_id
1784: AND jrg.regime_id = jstl.regime_id

Line 1799: FROM jai_rgm_stl_balances jbal,

1795: WHERE org_tan_no = P_TAN_NO
1796: --AND source_document_type = 'Invoice Payment' --mmurtuza need to discuss
1797: AND settlement_id =
1798: (SELECT MAX(jbal.settlement_id)
1799: FROM jai_rgm_stl_balances jbal,
1800: jai_rgm_settlements jstl,
1801: jai_rgm_definitions jrg
1802: WHERE jbal.settlement_id = jstl.settlement_id
1803: AND jrg.regime_id = jstl.regime_id

Line 1827: cr_balance jai_rgm_stl_balances.credit_balance%type;

1823: r_last_settlement_dtls c_last_settlement_dtls%rowtype;
1824: ln_settled_flag number(1) := 0;
1825: ln_settled_credit_balance number:= 0;
1826: ln_invoice_amount jai_rgm_trx_records.credit_amount%type;
1827: cr_balance jai_rgm_stl_balances.credit_balance%type;
1828: dr_balance jai_rgm_stl_balances.debit_balance%type:= 0;
1829: ln_settled_debit_balance number:= 0;
1830: v_credit_exceeds_debit BOOLEAN :=FALSE;
1831: ln_organization_type jai_rgm_org_regns_v.organization_type%type;

Line 1828: dr_balance jai_rgm_stl_balances.debit_balance%type:= 0;

1824: ln_settled_flag number(1) := 0;
1825: ln_settled_credit_balance number:= 0;
1826: ln_invoice_amount jai_rgm_trx_records.credit_amount%type;
1827: cr_balance jai_rgm_stl_balances.credit_balance%type;
1828: dr_balance jai_rgm_stl_balances.debit_balance%type:= 0;
1829: ln_settled_debit_balance number:= 0;
1830: v_credit_exceeds_debit BOOLEAN :=FALSE;
1831: ln_organization_type jai_rgm_org_regns_v.organization_type%type;
1832: v_last_settlement_id NUMBER;