DBA Data[Home] [Help]

APPS.JAI_AP_STND_TAX_PROCESS dependencies on JAI_AP_INVOICE_LINES

Line 991: jai_ap_invoice_lines jail

987: , jcdt.tax_id tax_id
988: , NVL(jcdt.modvat_flag,'N') modvat_flag
989: , aila.base_amount base_amount
990: FROM
991: jai_ap_invoice_lines jail
992: , jai_cmn_document_taxes jcdt
993: , ap_invoice_lines_all aila
994: WHERE jcdt.source_doc_id = jail.invoice_id
995: AND jcdt.source_doc_line_id = jail.invoice_line_number

Line 2243: jai_ap_invoice_lines jail

2239: AND EXISTS
2240: ( SELECT
2241: 'X'
2242: FROM
2243: jai_ap_invoice_lines jail
2244: WHERE jail.invoice_line_number = jcdt.source_doc_line_id
2245: AND jail.invoice_id = ln_invoice_id
2246: AND NVL(jail.parent_invoice_line_number,-1) =
2247: NVL(NVL( ln_invoice_line_number

Line 2273: jai_ap_invoice_lines jail

2269: (
2270: SELECT
2271: 'X'
2272: FROM
2273: jai_ap_invoice_lines jail
2274: WHERE jail.invoice_id = ln_invoice_id
2275: AND jail.invoice_line_number = aila.line_number
2276: AND jail.parent_invoice_line_number =
2277: NVL ( ln_invoice_line_number

Line 2304: jai_ap_invoice_lines jail

2300: (
2301: SELECT
2302: 'X'
2303: FROM
2304: jai_ap_invoice_lines jail
2305: WHERE jail.invoice_id = ln_invoice_id
2306: AND jail.invoice_line_number = aida.invoice_line_number
2307: AND jail.parent_invoice_line_number =
2308: NVL (ln_invoice_line_number, parent_invoice_line_number)

Line 2324: --invoice will be deleted from jai_ap_invoice_lines

2320:
2321:
2322: --Delete all exclusive taxes lines for the specified invoice id and item line
2323: --number. If invoice line number is null, all exclusive tax lines for the
2324: --invoice will be deleted from jai_ap_invoice_lines
2325:
2326:
2327: DELETE
2328: FROM

Line 2329: jai_ap_invoice_lines

2325:
2326:
2327: DELETE
2328: FROM
2329: jai_ap_invoice_lines
2330: WHERE invoice_id = ln_invoice_id
2331: AND parent_invoice_line_number =
2332: NVL(ln_invoice_line_number,parent_invoice_line_number)
2333: AND line_type_lookup_code = GV_CONSTANT_MISCELLANEOUS;

Line 2339: || '.Delete from jai_ap_invoice_lines'

2335: IF ( ln_proc_level >= ln_dbg_level)
2336: THEN
2337: FND_LOG.STRING( ln_proc_level
2338: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
2339: || '.Delete from jai_ap_invoice_lines'
2340: , SQL%ROWCOUNT||' ROWS DELETED '
2341: );
2342: FND_LOG.STRING ( ln_proc_level
2343: , GV_MODULE_PREFIX ||'.'|| lv_proc_name || '.end'

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

2403: END IF; --( ln_proc_level >= ln_dbg_level )
2404:
2405: -- when a item line is deleted from the Ap invoice work bench,
2406: -- the related tax rows have to be deleted from other 4 tables as well
2407: -- and the corresoponding item row in jai_ap_invoice_lines need to be erased
2408: -- either
2409:
2410: --delete all tax lines not attached to a item that exists in AP Inv Line
2411: --table from jai_cmn_document_taxes

Line 2437: jai_ap_invoice_lines jail

2433: (
2434: SELECT
2435: 'X'
2436: FROM
2437: jai_ap_invoice_lines jail
2438: WHERE jail.invoice_id = ln_invoice_id
2439: AND jail.invoice_line_number = jcdt.source_doc_line_id
2440: AND NOT EXISTS
2441: (

Line 2463: jai_ap_invoice_lines jail

2459: (
2460: SELECT
2461: 'X'
2462: FROM
2463: jai_ap_invoice_lines jail
2464: WHERE invoice_id = ln_invoice_id
2465: AND jail.invoice_line_number = aida.invoice_line_number
2466: AND NOT EXISTS
2467: (

Line 2488: jai_ap_invoice_lines jail

2484: (
2485: SELECT
2486: 'X'
2487: FROM
2488: jai_ap_invoice_lines jail
2489: WHERE jail.invoice_id = ln_invoice_id
2490: AND jail.invoice_line_number = aila.line_number
2491: AND NOT EXISTS
2492: (

Line 2503: -- delete ITEM lines from jai_ap_invoice_lines

2499: )
2500: )
2501: AND line_type_lookup_code = GV_CONSTANT_MISCELLANEOUS;
2502:
2503: -- delete ITEM lines from jai_ap_invoice_lines
2504: DELETE
2505: FROM
2506: jai_ap_invoice_lines jail
2507: WHERE jail.invoice_id = ln_invoice_id

Line 2506: jai_ap_invoice_lines jail

2502:
2503: -- delete ITEM lines from jai_ap_invoice_lines
2504: DELETE
2505: FROM
2506: jai_ap_invoice_lines jail
2507: WHERE jail.invoice_id = ln_invoice_id
2508: AND NOT EXISTS
2509: (
2510: SELECT

Line 2519: -- delete miscelleaneous line from jai_ap_invoice_lines

2515: AND aila.line_number = jail.invoice_line_number
2516: )
2517: AND line_type_lookup_code = GV_CONSTANT_ITEM;
2518:
2519: -- delete miscelleaneous line from jai_ap_invoice_lines
2520: DELETE
2521: FROM
2522: jai_ap_invoice_lines jail
2523: WHERE

Line 2522: jai_ap_invoice_lines jail

2518:
2519: -- delete miscelleaneous line from jai_ap_invoice_lines
2520: DELETE
2521: FROM
2522: jai_ap_invoice_lines jail
2523: WHERE
2524: jail.invoice_id = ln_invoice_id
2525: AND NOT EXISTS
2526: (

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

2559: -- Update_Jai_Line_Amount Private
2560: --
2561: -- DESCRIPTION:
2562: --
2563: -- update item lines in jai_ap_invoice_lines table,tax category,
2564: -- location_id, can be changed from IL form while line amount, currency,
2565: -- vendor_site_id, are only allowed to be modified from AP invoice work
2566: -- bench.
2567: --

Line 2615: jai_ap_invoice_lines

2611: );
2612: END IF; --( ln_proc_level >= ln_dbg_level )
2613:
2614: UPDATE
2615: jai_ap_invoice_lines
2616: SET
2617: line_amount = pn_line_amount
2618: where invoice_id = pn_invoice_id
2619: AND invoice_line_number = pn_line_number ;

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

2622: IF ( ln_proc_level >= ln_dbg_level)
2623: THEN
2624: FND_LOG.STRING ( ln_proc_level
2625: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
2626: || '.DML (UPDATE jai_ap_invoice_lines)'
2627: ,SQL%ROWCOUNT || ' ROWS UPDATED.'
2628: );
2629: FND_LOG.STRING ( ln_proc_level
2630: , GV_MODULE_PREFIX ||'.'|| lv_proc_name || '.end'

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

2650: -- Update_Jai_Item_Info Private
2651: --
2652: -- DESCRIPTION:
2653: --
2654: -- update item lines in jai_ap_invoice_lines table,tax category,
2655: -- location_id, can be changed from IL form while line amount, currency,
2656: -- vendor_site_id, are only allowed to be modified from AP invoice work
2657: -- bench.
2658: --

Line 2712: jai_ap_invoice_lines

2708: END IF; --( ln_proc_level >= ln_dbg_level )
2709:
2710:
2711: UPDATE
2712: jai_ap_invoice_lines
2713: SET
2714: supplier_site_id = pn_vndr_site_id
2715: , currency_code = pn_currency_code
2716: , tax_category_id = pn_tax_category_id

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

2721: IF ( ln_proc_level >= ln_dbg_level)
2722: THEN
2723: FND_LOG.STRING ( ln_proc_level
2724: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
2725: || '.DML (UPDATE jai_ap_invoice_lines)'
2726: ,SQL%ROWCOUNT || ' ROWS UPDATED.'
2727: );
2728: FND_LOG.STRING ( ln_proc_level
2729: , GV_MODULE_PREFIX ||'.'|| lv_proc_name || '.end'

Line 2824: jai_ap_invoice_lines

2820: , currency_code
2821: , tax_category_id
2822: , line_amount
2823: FROM
2824: jai_ap_invoice_lines
2825: WHERE invoice_id = pn_invoice_id
2826: AND invoice_line_number = NVL (pn_line_number, invoice_line_number)
2827: AND line_type_lookup_code = GV_CONSTANT_ITEM;
2828:

Line 2833: jai_ap_invoice_lines

2829: CURSOR jai_tax_line_ctg_cur IS
2830: SELECT
2831: tax_category_id
2832: FROM
2833: jai_ap_invoice_lines
2834: WHERE invoice_id = pn_invoice_id
2835: AND parent_invoice_line_number = pn_line_number;
2836:
2837:

Line 2862: , jai_ap_invoice_lines jail

2858: apia.line_number line_number
2859: , apia.amount line_amount
2860: FROM
2861: ap_invoice_lines_all apia
2862: , jai_ap_invoice_lines jail
2863: WHERE apia.invoice_id = jail.invoice_id
2864: AND apia.line_number = jail.invoice_line_number
2865: AND apia.invoice_id = ln_std_invoice_id
2866: AND apia.amount <> jail.line_amount

Line 2877: , jai_ap_invoice_lines jail

2873: apia.line_number line_number
2874: , apia.amount line_amount
2875: FROM
2876: ap_invoice_lines_all apia
2877: , jai_ap_invoice_lines jail
2878: WHERE apia.invoice_id = jail.invoice_id (+)
2879: AND apia.line_number = jail.invoice_line_number(+)
2880: AND apia.invoice_id = ln_std_invoice_id
2881: AND apia.line_type_lookup_code = GV_CONSTANT_ITEM

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

3060: --insert into eric_log values ( 2.15,'GV_LINES_CREATEED :'||GV_LINES_CREATEED,sysdate);
3061: END IF;
3062:
3063: -- vendor site is changed in AP , currency is updated in AP ,
3064: -- delete the taxes ,update related information in jai_ap_invoice_lines
3065: -- and recalculate tax lines
3066:
3067: IF ( ( ln_jai_vndr_site_id <> ln_std_vendor_site_id)
3068: OR ( lv_jai_currency_code <> lv_std_currency_code)

Line 3283: -- jai_ap_invoice_lines

3279: -- program going to this branch
3280: -- 2. A new item line inserted from standard AP form
3281:
3282: -- For the first case, program need to update the item line amount in
3283: -- jai_ap_invoice_lines
3284: --get invoice header information
3285:
3286:
3287: FOR diff_inv_lines_rec IN diff_inv_lines_cur

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

3503: , p_operation_flag => NULL
3504: --, p_vat_assessable_value => 0
3505: , p_vat_assessable_value => xn_tax_amount --modified by eric ,replace 0 with line amount
3506: , p_source_trx_type => jai_constants.G_AP_STANDALONE_INVOICE
3507: , p_source_table_name => GV_JAI_AP_INVOICE_LINES --'JAI_AP_INVOICE_LINES'
3508: , p_action => jai_constants.default_taxes
3509: );
3510:
3511: --log for debug

Line 4023: jai_ap_invoice_lines b

4019: (
4020: SELECT
4021: 'X'
4022: FROM
4023: jai_ap_invoice_lines b
4024: WHERE a.invoice_id = b.invoice_id
4025: AND a.line_number = b.invoice_line_number
4026: );
4027:

Line 4101: 'INSERT INTO jai_ap_invoice_lines

4097: ln_jai_inv_line_id NUMBER;
4098: BEGIN
4099:
4100: lv_insert_jai_inv_sql:=
4101: 'INSERT INTO jai_ap_invoice_lines
4102: ( jai_ap_invoice_lines_id
4103: , organization_id
4104: , location_id
4105: , invoice_id

Line 4102: ( jai_ap_invoice_lines_id

4098: BEGIN
4099:
4100: lv_insert_jai_inv_sql:=
4101: 'INSERT INTO jai_ap_invoice_lines
4102: ( jai_ap_invoice_lines_id
4103: , organization_id
4104: , location_id
4105: , invoice_id
4106: , invoice_line_number

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

4486: , pn_tax_category_id => ln_tax_category_id
4487: , pv_tax_modified => lv_tax_modified
4488: );
4489:
4490: --into jai_ap_invoice_lines if item line exists in ap_invoice_lines_all
4491: --and not in jai_ap_invoice_lines
4492:
4493: FOR item_line_rec IN
4494: new_invoice_lines_cur (ap_invoice_lines_rec.line_number)

Line 4491: --and not in jai_ap_invoice_lines

4487: , pv_tax_modified => lv_tax_modified
4488: );
4489:
4490: --into jai_ap_invoice_lines if item line exists in ap_invoice_lines_all
4491: --and not in jai_ap_invoice_lines
4492:
4493: FOR item_line_rec IN
4494: new_invoice_lines_cur (ap_invoice_lines_rec.line_number)
4495: LOOP

Line 4497: jai_ap_invoice_lines_s.NEXTVAL

4493: FOR item_line_rec IN
4494: new_invoice_lines_cur (ap_invoice_lines_rec.line_number)
4495: LOOP
4496: SELECT
4497: jai_ap_invoice_lines_s.NEXTVAL
4498: INTO
4499: ln_jai_inv_line_id
4500: FROM DUAL;
4501:

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

4788: END IF; -- (default_tax)
4789: END LOOP; -- (jai_default_doc_taxes_cur)
4790: END LOOP; -- (ap_invoice_lines_rec AP INVOICE ITEM LINE LEVEL)
4791:
4792: --delete taxes from ap invoice/dist lines,jai_ap_invoice_lines
4793: IF (pv_tax_modified ='Y')
4794: THEN
4795: Delete_Tax_Lines ( pn_invoice_id => ln_invoice_id
4796: , pn_line_number => ln_line_number

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

4827: --insert into eric_log values (7.802,'jai_doc_taxes_rec.tax_id = '|| jai_doc_taxes_rec.tax_id,sysdate);
4828:
4829: /*Removed this IF from here by Jia Li for inclusive tax on 2008/01/23
4830: --added by eric for inclusive tax
4831: --insert exclusive tax into jai_ap_invoice_lines and standard ap tables
4832: ----------------------------------------------------------
4833: IF (NVL(jai_doc_taxes_rec.inc_tax_flag,'N')='N')
4834: THEN
4835: ----------------------------------------------------------

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

4900: END IF; --(lv_tax_type = 'NR')
4901:
4902: --Moved IF to here by Jia Li for inclusive tax on 2008/01/23
4903: --added by eric for inclusive tax
4904: --insert exclusive tax into jai_ap_invoice_lines and standard ap tables
4905: ----------------------------------------------------------
4906: IF (NVL(jai_doc_taxes_rec.inc_tax_flag,'N')='N')
4907: THEN
4908: ----------------------------------------------------------

Line 4910: jai_ap_invoice_lines_s.NEXTVAL

4906: IF (NVL(jai_doc_taxes_rec.inc_tax_flag,'N')='N')
4907: THEN
4908: ----------------------------------------------------------
4909: SELECT
4910: jai_ap_invoice_lines_s.NEXTVAL
4911: INTO
4912: ln_jai_inv_line_id
4913: FROM DUAL;
4914:

Line 4916: --insert into jai_ap_invoice_lines

4912: ln_jai_inv_line_id
4913: FROM DUAL;
4914:
4915: --insert into eric_log values (7.81,'jai_doc_taxes_rec.inc_tax_flag =''N'' Branch ',sysdate);
4916: --insert into jai_ap_invoice_lines
4917: EXECUTE IMMEDIATE lv_insert_jai_inv_sql
4918: USING ln_jai_inv_line_id
4919: , pn_organization_id
4920: , pn_location_id

Line 4944: , 'Table jai_ap_invoice_lines inserted '

4940: THEN
4941: FND_LOG.STRING ( ln_proc_level
4942: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
4943: || '.debug Info.'
4944: , 'Table jai_ap_invoice_lines inserted '
4945: );
4946: END IF; --( ln_proc_level >= ln_dbg_level )
4947:
4948: --insert into ap_invoice_lines_all

Line 5132: jai_ap_invoice_lines_s.NEXTVAL

5128: ----------------------------------------------------------------------
5129: --added by eric for fixing the bug of bug#6784111 on 29-JAN,2008,end
5130:
5131: SELECT
5132: jai_ap_invoice_lines_s.NEXTVAL
5133: INTO
5134: ln_jai_inv_line_id
5135: FROM DUAL;
5136:

Line 5277: jai_ap_invoice_lines_s.NEXTVAL

5273: -- Insert positive line with no project info
5274: ln_max_pro_line_num := ln_max_pro_line_num + 1;
5275:
5276: SELECT
5277: jai_ap_invoice_lines_s.NEXTVAL
5278: INTO
5279: ln_jai_inv_line_id
5280: FROM DUAL;
5281: