DBA Data[Home] [Help]

APPS.JAI_AP_DTC_PREPAYMENTS_PKG dependencies on STANDARD

Line 29: Get tax category id separately for Prepayment and Standard Invoice.

25: functionality onto AP invoice.
26:
27: 2. 14-MAR-2012 Modified by Zhiwei.xin for bug #13837788
28: Fixed :
29: Get tax category id separately for Prepayment and Standard Invoice.
30:
31: --------------------------------------------------------------------------- */
32:
33: -- Added by Jia for FP bug6929483, Begin

Line 256: P_process_message := 'Error - Cannot Unapply prepayment as it was Applied before Validating the Standard invoice';

252:
253: if p_event = 'INSERT' and nvl(ln_prepay_apply,0) > 0 and nvl(ln_prepay_apply_trx_id, 0) = 0 and ln_cnt_thrshold <> 0 then
254: /*added condition of ln_cnt_thrshold by mmurtuza for bug 13620923*/
255: p_process_flag := 'E';
256: P_process_message := 'Error - Cannot Unapply prepayment as it was Applied before Validating the Standard invoice';
257: goto exit_from_procedure;
258: end if;
259:
260: jai_cmn_utils_pkg.WRITE_FND_LOG_MSG('JAI.PLSQL.JAI_AP_DTC_PREPAYMENTS_PKG.PROCESS_PREPAYMENT', '1.2 process_unapply ');

Line 365: SELECT get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)) tax_category_id,

361: /**
362: * Change the logic here, convert the application amount back to functional currency for bug13833254.
363: */
364: cursor c_tds_details_apply(p_invoice_id number, p_invoice_distribution_id number, p_exchange_rate in number) is
365: SELECT get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)) tax_category_id,
366: tds_section_code_prepay section_code,
367: tds_threshold_grp_id,
368: tds_threshold_trx_id_apply,
369: -- Bug 6363056

Line 385: get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)),

381: and invoice_distribution_id_prepay = p_invoice_distribution_id
382: and tds_threshold_grp_id is not null
383: and nvl(unapply_flag, 'N') <> 'Y' -- Bug 6363056
384: group BY
385: get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)),
386: tds_section_code_prepay,
387: tds_threshold_grp_id,
388: tds_threshold_trx_id_apply; /*Bug 9132694 - Added Group By clause to sum the tax amounts and create a single RTN reversal entry on unapplication*/
389:

Line 391: select get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)) tax_category_id,

387: tds_threshold_grp_id,
388: tds_threshold_trx_id_apply; /*Bug 9132694 - Added Group By clause to sum the tax amounts and create a single RTN reversal entry on unapplication*/
389:
390: cursor c_wct_details_apply(p_invoice_id number, p_invoice_distribution_id number) IS
391: select get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)) tax_category_id,
392: tds_section_code_prepay section_code,
393: wct_threshold_trx_id_apply,
394: sum(decode(wct_applicable_flag, 'Y', application_amount, 0))* nvl(p_exchange_rate,1) wct_taxable_basis,
395: sum(decode(wct_applicable_flag, 'Y', calc_wct_appln_amt, 0)) wct_amount

Line 402: get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)),

398: and invoice_distribution_id_prepay = p_invoice_distribution_id
399: and wct_threshold_trx_id_apply is not NULL
400: and wct_threshold_trx_id_unapply IS NULL
401: GROUP BY
402: get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)),
403: tds_section_code_prepay,
404: wct_threshold_trx_id_apply
405: ;
406: cursor c_essi_details_apply(p_invoice_id number, p_invoice_distribution_id number) is

Line 407: select get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)) tax_category_id,

403: tds_section_code_prepay,
404: wct_threshold_trx_id_apply
405: ;
406: cursor c_essi_details_apply(p_invoice_id number, p_invoice_distribution_id number) is
407: select get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)) tax_category_id,
408: tds_section_code_prepay section_code,
409: essi_threshold_trx_id_apply,
410: sum(decode(essi_applicable_flag, 'Y', application_amount, 0))* nvl(p_exchange_rate,1) essi_taxable_basis,
411: sum(decode(essi_applicable_flag, 'Y', calc_essi_appln_amt, 0)) essi_amount

Line 418: get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)),

414: and invoice_distribution_id_prepay = p_invoice_distribution_id
415: and essi_threshold_trx_id_apply is not NULL
416: and essi_threshold_trx_id_unapply IS NULL
417: GROUP BY
418: get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)),
419: tds_section_code_prepay,
420: essi_threshold_trx_id_apply
421: ;
422: cursor c_gl_sets_of_books(cp_set_of_books_id number) is

Line 723: ,pn_invoice_distribution_id => p_invoice_distribution_id --create Prepy line in applied standard invoice

719: ,pv_section_type => 'TDS_SECTION'
720: ,pv_section_code => r_tds_details_apply.section_code
721: ,pn_threshold_grp_id => r_tds_details_apply.tds_threshold_grp_id
722: ,pn_threshold_hdr_id => ln_temp_threshold_hdr_id
723: ,pn_invoice_distribution_id => p_invoice_distribution_id --create Prepy line in applied standard invoice
724: ,pn_prepay_distribution_id => p_prepay_distribution_id --distribution of the PP invoice applied
725: ,pn_threshold_type_id => NULL
726: ,pn_threshold_slab_id => NULL
727: );

Line 1258: lv_application_basis := 'STANDARD INVOICE';

1254: fetch c_get_tds_application_basis into lv_is_si_validated_flag;
1255: close c_get_tds_application_basis;
1256:
1257: if nvl(lv_is_si_validated_flag, 'Y') = 'Y' then
1258: lv_application_basis := 'STANDARD INVOICE';
1259: else
1260: lv_application_basis := 'PREPAYMENT';
1261: end if;
1262: *\

Line 1278: -- Get the threshold_trx_id of the standard invoice.

1274: OPEN get_threshold_trx_id (pre_pay_inv_id,p_prepay_distribution_id );
1275: FETCH get_threshold_trx_id INTO lv_pp_thhold_trx_id ;
1276: CLOSE get_threshold_trx_id;
1277:
1278: -- Get the threshold_trx_id of the standard invoice.
1279: SELECT max(nvl(threshold_trx_id, 0))
1280: INTO lv_si_thhold_trx_id
1281: FROM jai_ap_tds_inv_taxes
1282: WHERE invoice_id = p_invoice_id ;

Line 1285: lv_application_basis := 'STANDARD INVOICE';

1281: FROM jai_ap_tds_inv_taxes
1282: WHERE invoice_id = p_invoice_id ;
1283:
1284: IF (lv_si_thhold_trx_id > NVL (lv_pp_thhold_trx_id,0 )) THEN
1285: lv_application_basis := 'STANDARD INVOICE';
1286: ELSIF ( NVL (lv_pp_thhold_trx_id,0 ) <> 0 ) THEN
1287: lv_application_basis := 'PREPAYMENT';
1288: END IF ;
1289: \*Bug 5751783 - End*\

Line 1417: decode(application_basis, 'STANDARD INVOICE', tds_tax_id_other, tds_tax_id_prepay),

1413: application_amount,
1414: application_basis,
1415: \*
1416: decode(tds_applicable_flag, 'Y',
1417: decode(application_basis, 'STANDARD INVOICE', tds_tax_id_other, tds_tax_id_prepay),
1418: null) tds_tax_id,
1419: decode(wct_applicable_flag, 'Y',
1420: decode(application_basis, 'STANDARD INVOICE', wct_tax_id_other, wct_tax_id_prepay),
1421: null) wct_tax_id,

Line 1420: decode(application_basis, 'STANDARD INVOICE', wct_tax_id_other, wct_tax_id_prepay),

1416: decode(tds_applicable_flag, 'Y',
1417: decode(application_basis, 'STANDARD INVOICE', tds_tax_id_other, tds_tax_id_prepay),
1418: null) tds_tax_id,
1419: decode(wct_applicable_flag, 'Y',
1420: decode(application_basis, 'STANDARD INVOICE', wct_tax_id_other, wct_tax_id_prepay),
1421: null) wct_tax_id,
1422: decode(essi_applicable_flag, 'Y',
1423: decode(application_basis, 'STANDARD INVOICE', essi_tax_id_other, essi_tax_id_prepay),
1424: null) essi_tax_id

Line 1423: decode(application_basis, 'STANDARD INVOICE', essi_tax_id_other, essi_tax_id_prepay),

1419: decode(wct_applicable_flag, 'Y',
1420: decode(application_basis, 'STANDARD INVOICE', wct_tax_id_other, wct_tax_id_prepay),
1421: null) wct_tax_id,
1422: decode(essi_applicable_flag, 'Y',
1423: decode(application_basis, 'STANDARD INVOICE', essi_tax_id_other, essi_tax_id_prepay),
1424: null) essi_tax_id
1425: *\
1426: \* Bug 6363056. Commented the above
1427: * and added the following. Need to selected the lowest rate between

Line 2016: IF lv_application_basis = 'STANDARD INVOICE' THEN

2012: end if;
2013: \*Bug 8431516 - End*\
2014:
2015: IF ln_amt_tds_inv_generated_si > 0 THEN
2016: IF lv_application_basis = 'STANDARD INVOICE' THEN
2017: \* get the standard invoice number *\
2018: OPEN c_si_ap_invoices_all(p_invoice_id);
2019: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
2020: CLOSE c_si_ap_invoices_all;

Line 2017: \* get the standard invoice number *\

2013: \*Bug 8431516 - End*\
2014:
2015: IF ln_amt_tds_inv_generated_si > 0 THEN
2016: IF lv_application_basis = 'STANDARD INVOICE' THEN
2017: \* get the standard invoice number *\
2018: OPEN c_si_ap_invoices_all(p_invoice_id);
2019: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
2020: CLOSE c_si_ap_invoices_all;
2021: ELSE

Line 2057: IF lv_application_basis = 'STANDARD INVOICE' THEN

2053: end if; \* if r_get_total_prepayment_tax.tds_amount > 0 then *\ --moved this statement from above to here for Bug 6972230
2054:
2055: \*Bug 8431516 - Start*\
2056: IF ln_tot_tds_amt > 0 THEN
2057: IF lv_application_basis = 'STANDARD INVOICE' THEN
2058: \* get the standard invoice number *\
2059: OPEN c_si_ap_invoices_all(p_invoice_id);
2060: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
2061: CLOSE c_si_ap_invoices_all;

Line 2058: \* get the standard invoice number *\

2054:
2055: \*Bug 8431516 - Start*\
2056: IF ln_tot_tds_amt > 0 THEN
2057: IF lv_application_basis = 'STANDARD INVOICE' THEN
2058: \* get the standard invoice number *\
2059: OPEN c_si_ap_invoices_all(p_invoice_id);
2060: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
2061: CLOSE c_si_ap_invoices_all;
2062: ELSE

Line 2185: if lv_application_basis = 'STANDARD INVOICE' then

2181: ln_pp_section_tax_id := null;
2182: ln_parent_invoice_id := null;
2183:
2184: \*Bug 6363056*\
2185: if lv_application_basis = 'STANDARD INVOICE' then
2186: \* get the standard invoice number *\
2187: ln_parent_invoice_id := p_invoice_id;
2188: else
2189: \* Get the prepayment number *\

Line 2186: \* get the standard invoice number *\

2182: ln_parent_invoice_id := null;
2183:
2184: \*Bug 6363056*\
2185: if lv_application_basis = 'STANDARD INVOICE' then
2186: \* get the standard invoice number *\
2187: ln_parent_invoice_id := p_invoice_id;
2188: else
2189: \* Get the prepayment number *\
2190: open c_get_pp_section_tax_id(p_prepay_distribution_id, 'WCT_SECTION');

Line 2244: if lv_application_basis = 'STANDARD INVOICE' then

2240: \* get the tax_id *\
2241: ln_pp_section_tax_id := null;
2242: ln_parent_invoice_id := null;
2243: \*Bug 6363056*\
2244: if lv_application_basis = 'STANDARD INVOICE' then
2245: \* get the standard invoice number *\
2246: ln_parent_invoice_id := p_invoice_id;
2247: else
2248: \* Get the prepayment number *\

Line 2245: \* get the standard invoice number *\

2241: ln_pp_section_tax_id := null;
2242: ln_parent_invoice_id := null;
2243: \*Bug 6363056*\
2244: if lv_application_basis = 'STANDARD INVOICE' then
2245: \* get the standard invoice number *\
2246: ln_parent_invoice_id := p_invoice_id;
2247: else
2248: \* Get the prepayment number *\
2249: open c_get_pp_section_tax_id(p_prepay_distribution_id, 'WCT_SECTION');

Line 2298: Records are inserted into AP Interface tables using Standard Invoice, but import_and_approve

2294: end if; \* if r_get_total_prepayment_tax.essi_amount > 0 then *\
2295:
2296: if ln_start_threshold_trx_id is not null then
2297: \*Bug - 9826422
2298: Records are inserted into AP Interface tables using Standard Invoice, but import_and_approve
2299: was called using the Prepayment Invoice ID. Hence wrong group_id was getting passed and no
2300: Invoices were getting improved*\
2301: jai_ap_tds_generation_pkg.import_and_approve
2302: (

Line 2376: -- the standard invoice does not have tds attached to it.

2372: fetch c_tds_count into ln_tds_count_attribute1;
2373: close c_tds_count;
2374:
2375: if ln_tds_count_attribute1 = 0 then
2376: -- the standard invoice does not have tds attached to it.
2377: -- check if there is TDS record in temp table, this would happen when the invoice is unapproved.
2378: -- Bug 4754213. Added by Lakshmi Gopalsami
2379: open c_tds_count_unapp(p_invoice_id, 'TDS_SECTION'); --rchandan for bug#4428980
2380: fetch c_tds_count_unapp into ln_tds_count_attribute1;

Line 2447: -- the standard invoice does not have tds attached to it.

2443: fetch c_tds_count into ln_tds_count_attribute2;
2444: close c_tds_count;
2445:
2446: if ln_tds_count_attribute2 = 0 then
2447: -- the standard invoice does not have tds attached to it.
2448: -- check if there is TDS record in temp table, this would happen when the invoice is unapproved.
2449: open c_tds_count_unapp(p_invoice_id, 'WCT_SECTION');
2450: fetch c_tds_count_unapp into ln_tds_count_attribute2;
2451: close c_tds_count_unapp;

Line 2517: -- the standard invoice does not have tds attached to it.

2513: fetch c_tds_count into ln_tds_count_attribute3;
2514: close c_tds_count;
2515:
2516: if ln_tds_count_attribute3 = 0 then
2517: -- the standard invoice does not have tds attached to it.
2518: -- check if there is TDS record in temp table, this would happen when the invoice is unapproved.
2519: open c_tds_count_unapp(p_invoice_id, 'ESSI_SECTION');
2520: fetch c_tds_count_unapp into ln_tds_count_attribute3;
2521: close c_tds_count_unapp;

Line 2688: ld_standard_gl_date DATE;

2684:
2685: ln_remaining_prepayment_amount NUMBER;
2686: ln_prepay_invoice_id NUMBER;
2687: ld_prepay_gl_date DATE;
2688: ld_standard_gl_date DATE;
2689: lv_application_basis VARCHAR2(50);
2690: lv_ppay_tds_section_code VARCHAR2(100);
2691: lv_ppay_wct_applicable VARCHAR2(1);
2692: lv_ppay_essi_applicable VARCHAR2(1);

Line 2711: FETCH c_gl_date INTO ld_standard_gl_date;

2707: get_prepay_invoice_id(p_prepay_distribution_id,ln_prepay_invoice_id);
2708: get_prepay_invoice_gl_date(p_prepay_distribution_id,ld_prepay_gl_date);
2709:
2710: OPEN c_gl_date(p_invoice_id);
2711: FETCH c_gl_date INTO ld_standard_gl_date;
2712: CLOSE c_gl_date;
2713:
2714: IF ld_prepay_gl_date > ld_standard_gl_date THEN
2715: lv_application_basis := 'PREPAYMENT';

Line 2714: IF ld_prepay_gl_date > ld_standard_gl_date THEN

2710: OPEN c_gl_date(p_invoice_id);
2711: FETCH c_gl_date INTO ld_standard_gl_date;
2712: CLOSE c_gl_date;
2713:
2714: IF ld_prepay_gl_date > ld_standard_gl_date THEN
2715: lv_application_basis := 'PREPAYMENT';
2716: ELSE
2717: lv_application_basis := 'STANDARD';
2718: END IF;

Line 2717: lv_application_basis := 'STANDARD';

2713:
2714: IF ld_prepay_gl_date > ld_standard_gl_date THEN
2715: lv_application_basis := 'PREPAYMENT';
2716: ELSE
2717: lv_application_basis := 'STANDARD';
2718: END IF;
2719:
2720: OPEN c_section_code;
2721: FETCH c_section_code INTO lv_ppay_tds_section_code;

Line 3088: select get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)) tax_category_id,

3084: --Updated by Wenqiong for bug13787605 begin
3085: CURSOR c_get_tds_group_amt (cv_section_code VARCHAR2)IS
3086: -- modified by zhiwei.xin for bug 13837788 on 14-Mar-2012 begin
3087: --select get_tax_category(jatp.invoice_distribution_id ) tax_category_id,
3088: select get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)) tax_category_id,
3089: -- modified by zhiwei.xin for bug 13837788 on 14-Mar-2012 end.
3090: sum(tds_application_amount)* nvl(p_exchange_rate,1) tds_amount,
3091: sum(application_amount)* nvl(p_exchange_rate,1) amount
3092: from jai_ap_tds_prepayments jatp

Line 3099: GROUP BY get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id));

3095: AND jatp.tds_section_code_other= cv_section_code
3096: AND jatp.invoice_distribution_id_prepay = p_invoice_distribution_id
3097: -- modified by zhiwei.xin for bug 13837788 on 14-Mar-2012 begin
3098: --GROUP BY get_tax_category(jatp.invoice_distribution_id );
3099: GROUP BY get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id));
3100: -- modified by zhiwei.xin for bug 13837788 on 14-Mar-2012 end.
3101: --Updated by Wenqiong for bug13787605 end
3102:
3103: /*Update for adding exchange rate for bug13833254 */

Line 3108: select get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)) tax_category_id,

3104: --Updated by Wenqiong for bug13787605 begin
3105: CURSOR c_get_wct_group_amt (cv_section_code VARCHAR2)IS
3106: -- modified by zhiwei.xin for bug 13837788 on 14-Mar-2012 begin
3107: --SELECT get_tax_category(jatp.invoice_distribution_id ) tax_category_id,
3108: select get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)) tax_category_id,
3109: -- modified by zhiwei.xin for bug 13837788 on 14-Mar-2012 end.
3110: sum(wct_application_amount)* nvl(p_exchange_rate,1) wct_amount,
3111: sum(application_amount)* nvl(p_exchange_rate,1) amount
3112: from jai_ap_tds_prepayments jatp

Line 3119: GROUP BY get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id));

3115: AND jatp.tds_section_code_other= cv_section_code
3116: AND jatp.invoice_distribution_id_prepay = p_invoice_distribution_id
3117: -- modified by zhiwei.xin for bug 13837788 on 14-Mar-2012 begin
3118: --GROUP BY get_tax_category(jatp.invoice_distribution_id );
3119: GROUP BY get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id));
3120: -- modified by zhiwei.xin for bug 13837788 on 14-Mar-2012 end.
3121: --Updated by Wenqiong for bug13787605 end
3122:
3123: /*Update for adding exchange rate for bug13833254 */

Line 3127: select get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)) tax_category_id,

3123: /*Update for adding exchange rate for bug13833254 */
3124: CURSOR c_get_essi_group_amt (cv_section_code VARCHAR2)IS
3125: -- modifed by zhiwei.xin for bug 13837788 on 14-Mar-2012 begin
3126: --select get_tax_category(jatp.invoice_distribution_id ) tax_category_id,
3127: select get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id)) tax_category_id,
3128: -- modified by zhiwei.xin for bug 13837788 on 14-Mar-2012 end.
3129: sum(essi_application_amount)* nvl(p_exchange_rate,1) essi_amount,
3130: sum(application_amount)* nvl(p_exchange_rate,1) amount
3131: from jai_ap_tds_prepayments jatp

Line 3138: GROUP BY get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id));

3134: AND jatp.tds_section_code_other= cv_section_code
3135: AND jatp.invoice_distribution_id_prepay = p_invoice_distribution_id
3136: -- modified by zhiwei.xin for bug 13837788 on 14-Mar-2012 begin
3137: --GROUP BY get_tax_category(jatp.invoice_distribution_id );
3138: GROUP BY get_tax_category(decode(jatp.application_basis,'STANDARD',jatp.invoice_distribution_id,p_prepay_distribution_id));
3139: -- modified by zhiwei.xin for bug 13837788 on 14-Mar-2012 end.
3140: --Updated by Wenqiong for bug13787605.
3141:
3142: cursor c_si_ap_invoices_all (p_invoice_id number) is

Line 3274: IF lv_application_basis = 'STANDARD' THEN

3270:
3271: /* TDS application amount */
3272: IF cur_rec.tds_applicable_flag = 'Y' THEN
3273:
3274: IF lv_application_basis = 'STANDARD' THEN
3275: OPEN c_jai_tds_tax(cur_rec.invoice_distribution_id,cur_rec.tds_section_code_other,'TDS_SECTION');
3276: FETCH c_jai_tds_tax INTO ln_tax_amount;
3277: CLOSE c_jai_tds_tax;
3278:

Line 3314: IF lv_application_basis = 'STANDARD' THEN

3310: --Added by Chong.Lei for bug#13802244 end
3311:
3312: END IF;
3313: IF cur_rec.wct_applicable_flag = 'Y' THEN /* WCT application*/
3314: IF lv_application_basis = 'STANDARD' THEN
3315: OPEN c_jai_tds_tax(cur_rec.invoice_distribution_id,cur_rec.tds_section_code_other,'WCT_SECTION');
3316: FETCH c_jai_tds_tax INTO ln_tax_amount;
3317: CLOSE c_jai_tds_tax;
3318:

Line 3340: IF lv_application_basis = 'STANDARD' THEN

3336: calc_wct_appln_amt = ln_tds_tmp_amt * ln_exchange_rate --updated by Wenqiong for bug 13771948
3337: where tds_prepayment_id = cur_rec.tds_prepayment_id;
3338: END IF;
3339: IF cur_rec.essi_applicable_flag = 'Y' THEN /* ESSI application */
3340: IF lv_application_basis = 'STANDARD' THEN
3341: OPEN c_jai_tds_tax(cur_rec.invoice_distribution_id,cur_rec.tds_section_code_other,'ESSI_SECTION');
3342: FETCH c_jai_tds_tax INTO ln_tax_amount;
3343: CLOSE c_jai_tds_tax;
3344:

Line 3590: IF lv_application_basis = 'STANDARD' THEN

3586: end if;
3587:
3588:
3589: IF ln_amt_tds_inv_generated_si > 0 THEN
3590: IF lv_application_basis = 'STANDARD' THEN
3591: /* get the standard invoice number */
3592: OPEN c_si_ap_invoices_all(p_invoice_id);
3593: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
3594: CLOSE c_si_ap_invoices_all;

Line 3591: /* get the standard invoice number */

3587:
3588:
3589: IF ln_amt_tds_inv_generated_si > 0 THEN
3590: IF lv_application_basis = 'STANDARD' THEN
3591: /* get the standard invoice number */
3592: OPEN c_si_ap_invoices_all(p_invoice_id);
3593: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
3594: CLOSE c_si_ap_invoices_all;
3595: ELSE

Line 3639: IF lv_application_basis = 'STANDARD' THEN

3635:
3636: jai_cmn_utils_pkg.WRITE_FND_LOG(G_LEVEL_STATEMENT, G_MODULE_NAME||l_api_name, 'in loop ln_tot_tds_amt: '|| ln_tot_tds_amt);
3637:
3638: IF ln_tot_tds_amt > 0 THEN
3639: IF lv_application_basis = 'STANDARD' THEN
3640: /* get the standard invoice number */
3641: OPEN c_si_ap_invoices_all(p_invoice_id);
3642: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
3643: CLOSE c_si_ap_invoices_all;

Line 3640: /* get the standard invoice number */

3636: jai_cmn_utils_pkg.WRITE_FND_LOG(G_LEVEL_STATEMENT, G_MODULE_NAME||l_api_name, 'in loop ln_tot_tds_amt: '|| ln_tot_tds_amt);
3637:
3638: IF ln_tot_tds_amt > 0 THEN
3639: IF lv_application_basis = 'STANDARD' THEN
3640: /* get the standard invoice number */
3641: OPEN c_si_ap_invoices_all(p_invoice_id);
3642: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
3643: CLOSE c_si_ap_invoices_all;
3644:

Line 3727: IF lv_application_basis = 'STANDARD' THEN

3723: /* Update jai_ap_tds_prepayments with threshold_trx_id_apply*/
3724: -- Update each distribution with the threshold grp id as
3725: -- it may vary depending on the date and the group.
3726: -- changed invoice_distribution_id_prepay to invoice_distribution_id.
3727: IF lv_application_basis = 'STANDARD' THEN
3728: update jai_ap_tds_prepayments tds_prepay
3729: set tds_threshold_trx_id_apply = ln_threshold_trx_id_tds
3730: where tds_threshold_trx_id_apply = -999
3731: and invoice_id = p_invoice_id

Line 3791: ,pn_invoice_distribution_id => p_invoice_distribution_id --create Prepy line in applied standard invoice

3787: ,pv_section_type => 'TDS_SECTION'
3788: ,pv_section_code => lv_section_code
3789: ,pn_threshold_grp_id => NVL(ln_threshold_grp_id,ln_si_thgrp_id)
3790: ,pn_threshold_hdr_id => ln_temp_threshold_hdr_id
3791: ,pn_invoice_distribution_id => p_invoice_distribution_id --create Prepy line in applied standard invoice
3792: ,pn_prepay_distribution_id => p_prepay_distribution_id --distribution of the PP invoice applied
3793: ,pn_threshold_type_id => NULL
3794: ,pn_threshold_slab_id => NULL
3795: );

Line 3858: IF lv_application_basis = 'STANDARD' THEN

3854: where invoice_id = p_invoice_id;
3855:
3856: if r_get_total_prepayment_tax.wct_amount > 0 THEN
3857:
3858: IF lv_application_basis = 'STANDARD' THEN
3859: /* get the standard invoice number */
3860: OPEN c_si_ap_invoices_all(p_invoice_id);
3861: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
3862: CLOSE c_si_ap_invoices_all;

Line 3859: /* get the standard invoice number */

3855:
3856: if r_get_total_prepayment_tax.wct_amount > 0 THEN
3857:
3858: IF lv_application_basis = 'STANDARD' THEN
3859: /* get the standard invoice number */
3860: OPEN c_si_ap_invoices_all(p_invoice_id);
3861: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
3862: CLOSE c_si_ap_invoices_all;
3863: ELSE

Line 3914: IF lv_application_basis = 'STANDARD' THEN

3910: if p_process_flag = 'E' then
3911: goto exit_from_procedure;
3912: end if;
3913:
3914: IF lv_application_basis = 'STANDARD' THEN
3915: update jai_ap_tds_prepayments tds_prepay
3916: set wct_threshold_trx_id_apply = ln_threshold_trx_id_wct
3917: where invoice_id = p_invoice_id
3918: and invoice_distribution_id_prepay = p_invoice_distribution_id

Line 3941: IF lv_application_basis = 'STANDARD' THEN

3937: end if; /* if r_get_total_prepayment_tax.wct_amount > 0 then */
3938:
3939:
3940: if r_get_total_prepayment_tax.essi_amount > 0 then
3941: IF lv_application_basis = 'STANDARD' THEN
3942: /* get the standard invoice number */
3943: OPEN c_si_ap_invoices_all(p_invoice_id);
3944: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
3945: CLOSE c_si_ap_invoices_all;

Line 3942: /* get the standard invoice number */

3938:
3939:
3940: if r_get_total_prepayment_tax.essi_amount > 0 then
3941: IF lv_application_basis = 'STANDARD' THEN
3942: /* get the standard invoice number */
3943: OPEN c_si_ap_invoices_all(p_invoice_id);
3944: FETCH c_si_ap_invoices_all INTO lv_invoice_num_prepay_apply, ln_parent_invoice_id;
3945: CLOSE c_si_ap_invoices_all;
3946:

Line 3994: IF lv_application_basis = 'STANDARD' THEN

3990: );
3991: if p_process_flag = 'E' then
3992: goto exit_from_procedure;
3993: end if;
3994: IF lv_application_basis = 'STANDARD' THEN
3995:
3996: update jai_ap_tds_prepayments tds_prepay
3997: set essi_threshold_trx_id_apply = ln_threshold_trx_id_essi
3998: where invoice_id = p_invoice_id

Line 4021: Records are inserted into AP Interface tables using Standard Invoice, but import_and_approve

4017: end if; /* if r_get_total_prepayment_tax.essi_amount > 0 then */
4018:
4019: if ln_start_threshold_trx_id is not null then
4020: /*
4021: Records are inserted into AP Interface tables using Standard Invoice, but import_and_approve
4022: was called using the Prepayment Invoice ID. Hence wrong group_id was getting passed and no
4023: Invoices were getting improved*/
4024: jai_ap_dtc_generation_pkg.import_and_approve
4025: (