DBA Data[Home] [Help]

APPS.JAI_AP_STND_TAX_PROCESS dependencies on JAI_AP_INVOICE_LINES

Line 50: --| 2011/12/27 amandali Code fix for 13535569 to avoid unique constraint (JA.JAI_AP_INVOICE_LINES_U2) violated error |

46: --| 2011/02/10 Xiao Lv Code change for Open Interface ER bug#11683927
47: --| 2011/05/12 Zhiwei Hou Code change for Open Interface ER bug#12537533
48: --| 2011/05/24 Xiao Lv Code change for POT, reg bug#12533434 --Added by Chong.Lei for POT code port
49: --| 2011/09/30 Zhiwei Hou Code change for Open API of POT change #13023443
50: --| 2011/12/27 amandali Code fix for 13535569 to avoid unique constraint (JA.JAI_AP_INVOICE_LINES_U2) violated error |
51: --| 2012/02/01 amandali code fix for bug 13617527 to avoid "ap_invoice_distributions_All.accounting date cannot be null"
52: --| 2012/03/04 amandali Code fix for bug 13793724 to pick the non recoverable tax lines by create mass additions concurrent
53: --| 2012/08/29 nkodakan Code fix for bug 14541702 added the 'End If' in two places.
54: --| 2012/10/10 amandali Bug:14650698

Line 1179: jai_ap_invoice_lines jail

1175: , jcdt.tax_id tax_id
1176: , NVL(jcdt.modvat_flag,'N') modvat_flag
1177: , aila.base_amount base_amount
1178: FROM
1179: jai_ap_invoice_lines jail
1180: , jai_cmn_document_taxes jcdt
1181: , ap_invoice_lines_all aila
1182: WHERE jcdt.source_doc_id = jail.invoice_id
1183: AND jcdt.source_doc_line_id = jail.invoice_line_number

Line 2568: jai_ap_invoice_lines jail

2564: AND EXISTS
2565: ( SELECT
2566: 'X'
2567: FROM
2568: jai_ap_invoice_lines jail
2569: WHERE jail.invoice_line_number = jcdt.source_doc_line_id
2570: AND jail.invoice_id = ln_invoice_id
2571: AND NVL(jail.parent_invoice_line_number,-1) =
2572: NVL(NVL( ln_invoice_line_number

Line 2598: jai_ap_invoice_lines jail

2594: (
2595: SELECT
2596: 'X'
2597: FROM
2598: jai_ap_invoice_lines jail
2599: WHERE jail.invoice_id = ln_invoice_id
2600: AND jail.invoice_line_number = aila.line_number
2601: AND jail.parent_invoice_line_number =
2602: NVL ( ln_invoice_line_number

Line 2629: jai_ap_invoice_lines jail

2625: (
2626: SELECT
2627: 'X'
2628: FROM
2629: jai_ap_invoice_lines jail
2630: WHERE jail.invoice_id = ln_invoice_id
2631: AND jail.invoice_line_number = aida.invoice_line_number
2632: AND jail.parent_invoice_line_number =
2633: NVL (ln_invoice_line_number, parent_invoice_line_number)

Line 2649: --invoice will be deleted from jai_ap_invoice_lines

2645:
2646:
2647: --Delete all exclusive taxes lines for the specified invoice id and item line
2648: --number. If invoice line number is null, all exclusive tax lines for the
2649: --invoice will be deleted from jai_ap_invoice_lines
2650:
2651:
2652: DELETE
2653: FROM

Line 2654: jai_ap_invoice_lines

2650:
2651:
2652: DELETE
2653: FROM
2654: jai_ap_invoice_lines
2655: WHERE invoice_id = ln_invoice_id
2656: AND parent_invoice_line_number =
2657: NVL(ln_invoice_line_number,parent_invoice_line_number)
2658: AND line_type_lookup_code = GV_CONSTANT_MISCELLANEOUS;

Line 2664: || '.Delete from jai_ap_invoice_lines'

2660: IF ( ln_proc_level >= ln_dbg_level)
2661: THEN
2662: FND_LOG.STRING( ln_proc_level
2663: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
2664: || '.Delete from jai_ap_invoice_lines'
2665: , SQL%ROWCOUNT||' ROWS DELETED '
2666: );
2667: FND_LOG.STRING ( ln_proc_level
2668: , GV_MODULE_PREFIX ||'.'|| lv_proc_name || '.end'

Line 2732: -- and the corresoponding item row in jai_ap_invoice_lines need to be erased

2728: END IF; --( ln_proc_level >= ln_dbg_level )
2729:
2730: -- when a item line is deleted from the Ap invoice work bench,
2731: -- the related tax rows have to be deleted from other 4 tables as well
2732: -- and the corresoponding item row in jai_ap_invoice_lines need to be erased
2733: -- either
2734:
2735: --delete all tax lines not attached to a item that exists in AP Inv Line
2736: --table from jai_cmn_document_taxes

Line 2762: jai_ap_invoice_lines jail

2758: (
2759: SELECT
2760: 'X'
2761: FROM
2762: jai_ap_invoice_lines jail
2763: WHERE jail.invoice_id = ln_invoice_id
2764: AND jail.invoice_line_number = jcdt.source_doc_line_id
2765: AND NOT EXISTS
2766: (

Line 2788: jai_ap_invoice_lines jail

2784: (
2785: SELECT
2786: 'X'
2787: FROM
2788: jai_ap_invoice_lines jail
2789: WHERE invoice_id = ln_invoice_id
2790: AND jail.invoice_line_number = aida.invoice_line_number
2791: AND NOT EXISTS
2792: (

Line 2813: jai_ap_invoice_lines jail

2809: (
2810: SELECT
2811: 'X'
2812: FROM
2813: jai_ap_invoice_lines jail
2814: WHERE jail.invoice_id = ln_invoice_id
2815: AND jail.invoice_line_number = aila.line_number
2816: AND NOT EXISTS
2817: (

Line 2828: -- delete ITEM lines from jai_ap_invoice_lines

2824: )
2825: )
2826: AND line_type_lookup_code = GV_CONSTANT_MISCELLANEOUS;
2827:
2828: -- delete ITEM lines from jai_ap_invoice_lines
2829: DELETE
2830: FROM
2831: jai_ap_invoice_lines jail
2832: WHERE jail.invoice_id = ln_invoice_id

Line 2831: jai_ap_invoice_lines jail

2827:
2828: -- delete ITEM lines from jai_ap_invoice_lines
2829: DELETE
2830: FROM
2831: jai_ap_invoice_lines jail
2832: WHERE jail.invoice_id = ln_invoice_id
2833: AND NOT EXISTS
2834: (
2835: SELECT

Line 2844: -- delete miscelleaneous line from jai_ap_invoice_lines

2840: AND aila.line_number = jail.invoice_line_number
2841: )
2842: AND line_type_lookup_code = GV_CONSTANT_ITEM;
2843:
2844: -- delete miscelleaneous line from jai_ap_invoice_lines
2845: DELETE
2846: FROM
2847: jai_ap_invoice_lines jail
2848: WHERE

Line 2847: jai_ap_invoice_lines jail

2843:
2844: -- delete miscelleaneous line from jai_ap_invoice_lines
2845: DELETE
2846: FROM
2847: jai_ap_invoice_lines jail
2848: WHERE
2849: jail.invoice_id = ln_invoice_id
2850: AND NOT EXISTS
2851: (

Line 2888: -- update item lines in jai_ap_invoice_lines table,tax category,

2884: -- Update_Jai_Line_Amount Private
2885: --
2886: -- DESCRIPTION:
2887: --
2888: -- update item lines in jai_ap_invoice_lines table,tax category,
2889: -- location_id, can be changed from IL form while line amount, currency,
2890: -- vendor_site_id, are only allowed to be modified from AP invoice work
2891: -- bench.
2892: --

Line 2940: jai_ap_invoice_lines

2936: );
2937: END IF; --( ln_proc_level >= ln_dbg_level )
2938:
2939: UPDATE
2940: jai_ap_invoice_lines
2941: SET
2942: line_amount = pn_line_amount
2943: where invoice_id = pn_invoice_id
2944: AND invoice_line_number = pn_line_number ;

Line 2951: || '.DML (UPDATE jai_ap_invoice_lines)'

2947: IF ( ln_proc_level >= ln_dbg_level)
2948: THEN
2949: FND_LOG.STRING ( ln_proc_level
2950: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
2951: || '.DML (UPDATE jai_ap_invoice_lines)'
2952: ,SQL%ROWCOUNT || ' ROWS UPDATED.'
2953: );
2954: FND_LOG.STRING ( ln_proc_level
2955: , GV_MODULE_PREFIX ||'.'|| lv_proc_name || '.end'

Line 2979: -- update item lines in jai_ap_invoice_lines table,tax category,

2975: -- Update_Jai_Item_Info Private
2976: --
2977: -- DESCRIPTION:
2978: --
2979: -- update item lines in jai_ap_invoice_lines table,tax category,
2980: -- location_id, can be changed from IL form while line amount, currency,
2981: -- vendor_site_id, are only allowed to be modified from AP invoice work
2982: -- bench.
2983: --

Line 3037: jai_ap_invoice_lines

3033: END IF; --( ln_proc_level >= ln_dbg_level )
3034:
3035:
3036: UPDATE
3037: jai_ap_invoice_lines
3038: SET
3039: supplier_site_id = pn_vndr_site_id
3040: , currency_code = pn_currency_code
3041: , tax_category_id = pn_tax_category_id

Line 3050: || '.DML (UPDATE jai_ap_invoice_lines)'

3046: IF ( ln_proc_level >= ln_dbg_level)
3047: THEN
3048: FND_LOG.STRING ( ln_proc_level
3049: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
3050: || '.DML (UPDATE jai_ap_invoice_lines)'
3051: ,SQL%ROWCOUNT || ' ROWS UPDATED.'
3052: );
3053: FND_LOG.STRING ( ln_proc_level
3054: , GV_MODULE_PREFIX ||'.'|| lv_proc_name || '.end'

Line 3116: AND source_table_name = 'JAI_AP_INVOICE_LINES'

3112: IS
3113: SELECT *
3114: FROM jai_cmn_document_taxes
3115: WHERE source_doc_type = 'STANDALONE_INVOICE'
3116: AND source_table_name = 'JAI_AP_INVOICE_LINES'
3117: AND source_doc_id = pn_invoice_id
3118: AND source_doc_parent_line_no = pn_line_number;
3119:
3120: CURSOR get_tax_cur (pn_tax_id NUMBER) IS

Line 3319: jai_ap_invoice_lines

3315: , currency_code
3316: , tax_category_id
3317: , line_amount
3318: FROM
3319: jai_ap_invoice_lines
3320: WHERE invoice_id = pn_invoice_id
3321: AND invoice_line_number = NVL (pn_line_number, invoice_line_number)
3322: AND line_type_lookup_code = GV_CONSTANT_ITEM;
3323:

Line 3328: jai_ap_invoice_lines

3324: CURSOR jai_tax_line_ctg_cur IS
3325: SELECT
3326: tax_category_id
3327: FROM
3328: jai_ap_invoice_lines
3329: WHERE invoice_id = pn_invoice_id
3330: AND parent_invoice_line_number = pn_line_number;
3331:
3332:

Line 3357: , jai_ap_invoice_lines jail

3353: apia.line_number line_number
3354: , apia.amount line_amount
3355: FROM
3356: ap_invoice_lines_all apia
3357: , jai_ap_invoice_lines jail
3358: WHERE apia.invoice_id = jail.invoice_id
3359: AND apia.line_number = jail.invoice_line_number
3360: AND apia.invoice_id = ln_std_invoice_id
3361: AND apia.amount <> jail.line_amount

Line 3380: , jai_ap_invoice_lines jail

3376: apia.line_number line_number
3377: , apia.amount line_amount
3378: FROM
3379: ap_invoice_lines_all apia
3380: , jai_ap_invoice_lines jail
3381: WHERE apia.invoice_id = jail.invoice_id (+)
3382: AND apia.line_number = jail.invoice_line_number(+)
3383: AND apia.invoice_id = ln_std_invoice_id
3384: AND apia.line_type_lookup_code = GV_CONSTANT_ITEM

Line 3633: -- delete the taxes ,update related information in jai_ap_invoice_lines

3629: --insert into eric_log values ( 2.15,'GV_LINES_CREATEED :'||GV_LINES_CREATEED,sysdate);
3630: END IF;
3631:
3632: -- vendor site is changed in AP , currency is updated in AP ,
3633: -- delete the taxes ,update related information in jai_ap_invoice_lines
3634: -- and recalculate tax lines
3635:
3636: IF ( ( ln_jai_vndr_site_id <> ln_std_vendor_site_id)
3637: OR ( lv_jai_currency_code <> lv_std_currency_code)

Line 3852: -- jai_ap_invoice_lines

3848: -- program going to this branch
3849: -- 2. A new item line inserted from standard AP form
3850:
3851: -- For the first case, program need to update the item line amount in
3852: -- jai_ap_invoice_lines
3853: --get invoice header information
3854:
3855:
3856: FOR diff_inv_lines_rec IN diff_inv_lines_cur

Line 4161: , p_source_table_name => GV_JAI_AP_INVOICE_LINES --'JAI_AP_INVOICE_LINES'

4157: , p_operation_flag => NULL
4158: --, p_vat_assessable_value => 0
4159: , p_vat_assessable_value => xn_tax_amount --modified by eric ,replace 0 with line amount
4160: , p_source_trx_type => jai_constants.G_AP_STANDALONE_INVOICE
4161: , p_source_table_name => GV_JAI_AP_INVOICE_LINES --'JAI_AP_INVOICE_LINES'
4162: , p_action => jai_constants.default_taxes
4163: --, pn_gst_assessable_value => xn_tax_amount
4164: );
4165:

Line 4417: -- populate in the table jai_ap_invoice_lines.

4413: -- Added a new variable lv_dist_class with value as 'PERMANENT' and used it for the value of distribution_class column while
4414: -- inserting into ap_invoice_distributions_all table.
4415: -- 6. 26-Nov-2009 JMEENA for bug#9098529
4416: -- Added cursor get_service_type and fetched service_type_code to
4417: -- populate in the table jai_ap_invoice_lines.
4418: -- 7. 17-Nov-2009 JMEENA for bug#9206909
4419: -- Modified cursor get_service_type and fetched organization and location id.
4420: -- Passed same values to function Get_Dist_Account_Ccid to fetch the accounts for organization.
4421: --

Line 4719: jai_ap_invoice_lines b

4715: (
4716: SELECT
4717: 'X'
4718: FROM
4719: jai_ap_invoice_lines b
4720: WHERE a.invoice_id = b.invoice_id
4721: AND a.line_number = b.invoice_line_number
4722: );
4723: --Added below cursor for bug#9098529 by JMEENA

Line 4726: FROM jai_ap_invoice_lines

4722: );
4723: --Added below cursor for bug#9098529 by JMEENA
4724: Cursor get_service_type(p_invoice_id NUMBER,p_invoice_line_number NUMBER) IS
4725: SELECT service_type_code,organization_id, location_id -- Added organization_id,location_id from bug#9206909
4726: FROM jai_ap_invoice_lines
4727: WHERE invoice_id = p_invoice_id
4728: AND invoice_line_number = p_invoice_line_number;
4729:
4730: lv_organization_id jai_ap_invoice_lines.ORGANIZATION_ID%type;

Line 4730: lv_organization_id jai_ap_invoice_lines.ORGANIZATION_ID%type;

4726: FROM jai_ap_invoice_lines
4727: WHERE invoice_id = p_invoice_id
4728: AND invoice_line_number = p_invoice_line_number;
4729:
4730: lv_organization_id jai_ap_invoice_lines.ORGANIZATION_ID%type;
4731: lv_location_id jai_ap_invoice_lines.LOCATION_ID%type;
4732:
4733: ap_invoice_dist_rec ap_invoice_dist_cur%ROWTYPE;
4734: tax_rec get_tax_cur%ROWTYPE;

Line 4731: lv_location_id jai_ap_invoice_lines.LOCATION_ID%type;

4727: WHERE invoice_id = p_invoice_id
4728: AND invoice_line_number = p_invoice_line_number;
4729:
4730: lv_organization_id jai_ap_invoice_lines.ORGANIZATION_ID%type;
4731: lv_location_id jai_ap_invoice_lines.LOCATION_ID%type;
4732:
4733: ap_invoice_dist_rec ap_invoice_dist_cur%ROWTYPE;
4734: tax_rec get_tax_cur%ROWTYPE;
4735: lv_account_type gl_code_combinations.account_type%TYPE;

Line 4773: cursor c_exists_jai_ap_invoice_lines (p_invoice_id number, p_invoice_line_number number) is

4769: ld_exp_item_date ap_invoice_lines_all.expenditure_item_date%TYPE;
4770: ln_exp_org_id ap_invoice_lines_all.expenditure_organization_id%TYPE;
4771: ld_sys_date DATE; --Eric added on 18-Feb-2008,for bug#6824857
4772: /* Start bug-13535569 */
4773: cursor c_exists_jai_ap_invoice_lines (p_invoice_id number, p_invoice_line_number number) is
4774: select count(*)
4775: from jai_ap_invoice_lines
4776: where invoice_id=p_invoice_id
4777: and invoice_line_number=p_invoice_line_number;

Line 4775: from jai_ap_invoice_lines

4771: ld_sys_date DATE; --Eric added on 18-Feb-2008,for bug#6824857
4772: /* Start bug-13535569 */
4773: cursor c_exists_jai_ap_invoice_lines (p_invoice_id number, p_invoice_line_number number) is
4774: select count(*)
4775: from jai_ap_invoice_lines
4776: where invoice_id=p_invoice_id
4777: and invoice_line_number=p_invoice_line_number;
4778:
4779: cursor c_exists_ap_invoice_lines (p_invoice_id number, p_invoice_line_number number) is

Line 4937: 'INSERT INTO jai_ap_invoice_lines

4933:
4934: BEGIN
4935:
4936: lv_insert_jai_inv_sql:=
4937: 'INSERT INTO jai_ap_invoice_lines
4938: ( jai_ap_invoice_lines_id
4939: , organization_id
4940: , location_id
4941: , invoice_id

Line 4938: ( jai_ap_invoice_lines_id

4934: BEGIN
4935:
4936: lv_insert_jai_inv_sql:=
4937: 'INSERT INTO jai_ap_invoice_lines
4938: ( jai_ap_invoice_lines_id
4939: , organization_id
4940: , location_id
4941: , invoice_id
4942: , invoice_line_number

Line 5351: --into jai_ap_invoice_lines if item line exists in ap_invoice_lines_all

5347: , pn_tax_category_id => ln_tax_category_id
5348: , pv_tax_modified => lv_tax_modified
5349: );
5350: END IF; --ln_open_source = 0, Added by Xiao for Open Interface ER bug#11683927 on 10-Feb-2011
5351: --into jai_ap_invoice_lines if item line exists in ap_invoice_lines_all
5352: --and not in jai_ap_invoice_lines
5353:
5354: FOR item_line_rec IN
5355: new_invoice_lines_cur (ap_invoice_lines_rec.line_number)

Line 5352: --and not in jai_ap_invoice_lines

5348: , pv_tax_modified => lv_tax_modified
5349: );
5350: END IF; --ln_open_source = 0, Added by Xiao for Open Interface ER bug#11683927 on 10-Feb-2011
5351: --into jai_ap_invoice_lines if item line exists in ap_invoice_lines_all
5352: --and not in jai_ap_invoice_lines
5353:
5354: FOR item_line_rec IN
5355: new_invoice_lines_cur (ap_invoice_lines_rec.line_number)
5356: LOOP

Line 5358: jai_ap_invoice_lines_s.NEXTVAL

5354: FOR item_line_rec IN
5355: new_invoice_lines_cur (ap_invoice_lines_rec.line_number)
5356: LOOP
5357: SELECT
5358: jai_ap_invoice_lines_s.NEXTVAL
5359: INTO
5360: ln_jai_inv_line_id
5361: FROM DUAL;
5362: /* Bug 13535569 -added the below cursor call and the if condition*/

Line 5363: open c_exists_jai_ap_invoice_lines(item_line_rec.invoice_id,item_line_rec.line_number);

5359: INTO
5360: ln_jai_inv_line_id
5361: FROM DUAL;
5362: /* Bug 13535569 -added the below cursor call and the if condition*/
5363: open c_exists_jai_ap_invoice_lines(item_line_rec.invoice_id,item_line_rec.line_number);
5364: fetch c_exists_jai_ap_invoice_lines into ln_exists;
5365: close c_exists_jai_ap_invoice_lines;
5366: if (ln_exists =0)then
5367:

Line 5364: fetch c_exists_jai_ap_invoice_lines into ln_exists;

5360: ln_jai_inv_line_id
5361: FROM DUAL;
5362: /* Bug 13535569 -added the below cursor call and the if condition*/
5363: open c_exists_jai_ap_invoice_lines(item_line_rec.invoice_id,item_line_rec.line_number);
5364: fetch c_exists_jai_ap_invoice_lines into ln_exists;
5365: close c_exists_jai_ap_invoice_lines;
5366: if (ln_exists =0)then
5367:
5368: EXECUTE IMMEDIATE lv_insert_jai_inv_sql

Line 5365: close c_exists_jai_ap_invoice_lines;

5361: FROM DUAL;
5362: /* Bug 13535569 -added the below cursor call and the if condition*/
5363: open c_exists_jai_ap_invoice_lines(item_line_rec.invoice_id,item_line_rec.line_number);
5364: fetch c_exists_jai_ap_invoice_lines into ln_exists;
5365: close c_exists_jai_ap_invoice_lines;
5366: if (ln_exists =0)then
5367:
5368: EXECUTE IMMEDIATE lv_insert_jai_inv_sql
5369: USING ln_jai_inv_line_id

Line 5689: --delete taxes from ap invoice/dist lines,jai_ap_invoice_lines

5685: END IF; -- (default_tax)
5686: END LOOP; -- (jai_default_doc_taxes_cur)
5687: END LOOP; -- (ap_invoice_lines_rec AP INVOICE ITEM LINE LEVEL)
5688:
5689: --delete taxes from ap invoice/dist lines,jai_ap_invoice_lines
5690: IF (pv_tax_modified ='Y')
5691: THEN
5692: Delete_Tax_Lines ( pn_invoice_id => ln_invoice_id
5693: , pn_line_number => ln_line_number

Line 5737: --insert exclusive tax into jai_ap_invoice_lines and standard ap tables

5733: --insert into eric_log values (7.802,'jai_doc_taxes_rec.tax_id = '|| jai_doc_taxes_rec.tax_id,sysdate);
5734:
5735: /*Removed this IF from here by Jia Li for inclusive tax on 2008/01/23
5736: --added by eric for inclusive tax
5737: --insert exclusive tax into jai_ap_invoice_lines and standard ap tables
5738: ----------------------------------------------------------
5739: IF (NVL(jai_doc_taxes_rec.inc_tax_flag,'N')='N')
5740: THEN
5741: ----------------------------------------------------------

Line 5818: --insert exclusive tax into jai_ap_invoice_lines and standard ap tables

5814: END IF; --(lv_tax_type = 'NR')
5815:
5816: --Moved IF to here by Jia Li for inclusive tax on 2008/01/23
5817: --added by eric for inclusive tax
5818: --insert exclusive tax into jai_ap_invoice_lines and standard ap tables
5819: ----------------------------------------------------------
5820: IF (NVL(jai_doc_taxes_rec.inc_tax_flag,'N')='N')
5821: THEN
5822: ----------------------------------------------------------

Line 5824: jai_ap_invoice_lines_s.NEXTVAL

5820: IF (NVL(jai_doc_taxes_rec.inc_tax_flag,'N')='N')
5821: THEN
5822: ----------------------------------------------------------
5823: SELECT
5824: jai_ap_invoice_lines_s.NEXTVAL
5825: INTO
5826: ln_jai_inv_line_id
5827: FROM DUAL;
5828:

Line 5839: --insert into jai_ap_invoice_lines

5835: CLOSE get_service_type;
5836: lv_service_type_code := nvl(lv_service_type_code, lv_service_type_code_tmp);
5837:
5838: --insert into eric_log values (7.81,'jai_doc_taxes_rec.inc_tax_flag =''N'' Branch ',sysdate);
5839: --insert into jai_ap_invoice_lines
5840: /* Bug 13535569 -added the below cursor call and the if condition*/
5841: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,jai_doc_taxes_rec.source_doc_line_id);
5842: fetch c_exists_jai_ap_invoice_lines into ln_exists;
5843: close c_exists_jai_ap_invoice_lines;

Line 5841: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,jai_doc_taxes_rec.source_doc_line_id);

5837:
5838: --insert into eric_log values (7.81,'jai_doc_taxes_rec.inc_tax_flag =''N'' Branch ',sysdate);
5839: --insert into jai_ap_invoice_lines
5840: /* Bug 13535569 -added the below cursor call and the if condition*/
5841: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,jai_doc_taxes_rec.source_doc_line_id);
5842: fetch c_exists_jai_ap_invoice_lines into ln_exists;
5843: close c_exists_jai_ap_invoice_lines;
5844: if (ln_exists =0) then
5845: EXECUTE IMMEDIATE lv_insert_jai_inv_sql

Line 5842: fetch c_exists_jai_ap_invoice_lines into ln_exists;

5838: --insert into eric_log values (7.81,'jai_doc_taxes_rec.inc_tax_flag =''N'' Branch ',sysdate);
5839: --insert into jai_ap_invoice_lines
5840: /* Bug 13535569 -added the below cursor call and the if condition*/
5841: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,jai_doc_taxes_rec.source_doc_line_id);
5842: fetch c_exists_jai_ap_invoice_lines into ln_exists;
5843: close c_exists_jai_ap_invoice_lines;
5844: if (ln_exists =0) then
5845: EXECUTE IMMEDIATE lv_insert_jai_inv_sql
5846: USING ln_jai_inv_line_id

Line 5843: close c_exists_jai_ap_invoice_lines;

5839: --insert into jai_ap_invoice_lines
5840: /* Bug 13535569 -added the below cursor call and the if condition*/
5841: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,jai_doc_taxes_rec.source_doc_line_id);
5842: fetch c_exists_jai_ap_invoice_lines into ln_exists;
5843: close c_exists_jai_ap_invoice_lines;
5844: if (ln_exists =0) then
5845: EXECUTE IMMEDIATE lv_insert_jai_inv_sql
5846: USING ln_jai_inv_line_id
5847: , lv_organization_id --Replaced pn_organization_id with lv_organization_id for bug#9206909

Line 5872: , 'Table jai_ap_invoice_lines inserted '

5868: THEN
5869: FND_LOG.STRING ( ln_proc_level
5870: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
5871: || '.debug Info.'
5872: , 'Table jai_ap_invoice_lines inserted '
5873: );
5874: END IF; --( ln_proc_level >= ln_dbg_level )
5875: end if;
5876: --insert into ap_invoice_lines_all

Line 6169: jai_ap_invoice_lines_s.NEXTVAL

6165: ----------------------------------------------------------------------
6166: --added by eric for fixing the bug of bug#6784111 on 29-JAN,2008,end
6167:
6168: SELECT
6169: jai_ap_invoice_lines_s.NEXTVAL
6170: INTO
6171: ln_jai_inv_line_id
6172: FROM DUAL;
6173:

Line 6183: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,ln_max_pro_line_num);

6179: FETCH get_service_type INTO lv_service_type_code_tmp, lv_organization_id,lv_location_id ; --Added organization location for bug#9206909 by JMEENA
6180: CLOSE get_service_type;
6181: lv_service_type_code := nvl(lv_service_type_code, lv_service_type_code_tmp);
6182: /* Bug 13535569 -added the below cursor call and the if condition*/
6183: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,ln_max_pro_line_num);
6184: fetch c_exists_jai_ap_invoice_lines into ln_exists;
6185: close c_exists_jai_ap_invoice_lines;
6186: if (ln_exists =0) then
6187: EXECUTE IMMEDIATE lv_insert_jai_inv_sql

Line 6184: fetch c_exists_jai_ap_invoice_lines into ln_exists;

6180: CLOSE get_service_type;
6181: lv_service_type_code := nvl(lv_service_type_code, lv_service_type_code_tmp);
6182: /* Bug 13535569 -added the below cursor call and the if condition*/
6183: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,ln_max_pro_line_num);
6184: fetch c_exists_jai_ap_invoice_lines into ln_exists;
6185: close c_exists_jai_ap_invoice_lines;
6186: if (ln_exists =0) then
6187: EXECUTE IMMEDIATE lv_insert_jai_inv_sql
6188: USING ln_jai_inv_line_id

Line 6185: close c_exists_jai_ap_invoice_lines;

6181: lv_service_type_code := nvl(lv_service_type_code, lv_service_type_code_tmp);
6182: /* Bug 13535569 -added the below cursor call and the if condition*/
6183: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,ln_max_pro_line_num);
6184: fetch c_exists_jai_ap_invoice_lines into ln_exists;
6185: close c_exists_jai_ap_invoice_lines;
6186: if (ln_exists =0) then
6187: EXECUTE IMMEDIATE lv_insert_jai_inv_sql
6188: USING ln_jai_inv_line_id
6189: , lv_organization_id --Replaced pn_organization_id with lv_organization_id for bug#9206909

Line 6414: jai_ap_invoice_lines_s.NEXTVAL

6410: -- Insert positive line with no project info
6411: ln_max_pro_line_num := ln_max_pro_line_num + 1;
6412:
6413: SELECT
6414: jai_ap_invoice_lines_s.NEXTVAL
6415: INTO
6416: ln_jai_inv_line_id
6417: FROM DUAL;
6418:

Line 6429: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,ln_max_pro_line_num);

6425: FETCH get_service_type INTO lv_service_type_code_tmp, lv_organization_id,lv_location_id ; --Added organization location for bug#9206909 by JMEENA
6426: CLOSE get_service_type;
6427: lv_service_type_code := nvl(lv_service_type_code, lv_service_type_code_tmp);
6428: /* Bug 13535569 -added the below cursor call and the if condition*/
6429: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,ln_max_pro_line_num);
6430: fetch c_exists_jai_ap_invoice_lines into ln_exists;
6431: close c_exists_jai_ap_invoice_lines;
6432: if (ln_exists =0) then
6433: EXECUTE IMMEDIATE lv_insert_jai_inv_sql

Line 6430: fetch c_exists_jai_ap_invoice_lines into ln_exists;

6426: CLOSE get_service_type;
6427: lv_service_type_code := nvl(lv_service_type_code, lv_service_type_code_tmp);
6428: /* Bug 13535569 -added the below cursor call and the if condition*/
6429: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,ln_max_pro_line_num);
6430: fetch c_exists_jai_ap_invoice_lines into ln_exists;
6431: close c_exists_jai_ap_invoice_lines;
6432: if (ln_exists =0) then
6433: EXECUTE IMMEDIATE lv_insert_jai_inv_sql
6434: USING ln_jai_inv_line_id

Line 6431: close c_exists_jai_ap_invoice_lines;

6427: lv_service_type_code := nvl(lv_service_type_code, lv_service_type_code_tmp);
6428: /* Bug 13535569 -added the below cursor call and the if condition*/
6429: open c_exists_jai_ap_invoice_lines(jai_doc_taxes_rec.source_doc_id,ln_max_pro_line_num);
6430: fetch c_exists_jai_ap_invoice_lines into ln_exists;
6431: close c_exists_jai_ap_invoice_lines;
6432: if (ln_exists =0) then
6433: EXECUTE IMMEDIATE lv_insert_jai_inv_sql
6434: USING ln_jai_inv_line_id
6435: , lv_organization_id --Replaced pn_organization_id with lv_organization_id for bug#9206909