DBA Data[Home] [Help]

APPS.JAI_AP_STND_TAX_PROCESS dependencies on JAI_CMN_DOCUMENT_TAXES

Line 1180: , jai_cmn_document_taxes jcdt

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
1184: AND aila.invoice_id = jail.invoice_id

Line 2061: jai_cmn_document_taxes

2057: END IF;
2058:
2059: -- add row level lock to the table
2060: UPDATE
2061: jai_cmn_document_taxes
2062: SET
2063: source_doc_id = pn_invoice_id
2064: WHERE source_doc_id = pn_invoice_id
2065: AND source_doc_type = jai_constants.g_ap_standalone_invoice;

Line 2072: jai_cmn_document_taxes

2068: NVL(MAX(source_doc_line_id), 0)
2069: INTO
2070: ln_max_line_number
2071: FROM
2072: jai_cmn_document_taxes
2073: WHERE source_doc_id = pn_invoice_id
2074: AND source_doc_type = jai_constants.g_ap_standalone_invoice;
2075:
2076:

Line 2154: jai_cmn_document_taxes

2150: END IF;
2151:
2152: --add row level lock on the table to avoid data conflication
2153: UPDATE
2154: jai_cmn_document_taxes
2155: SET
2156: source_doc_parent_line_no = pn_parent_invoice_line_number
2157: WHERE source_doc_id = pn_invoice_id
2158: AND source_doc_parent_line_no = pn_parent_invoice_line_number

Line 2166: jai_cmn_document_taxes

2162: NVL(MAX(tax_line_no),0)
2163: INTO
2164: ln_max_tax_line_num
2165: FROM
2166: jai_cmn_document_taxes
2167: WHERE source_doc_id = pn_invoice_id
2168: AND source_doc_parent_line_no = pn_parent_invoice_line_number
2169: AND source_doc_type = jai_constants.g_ap_standalone_invoice;
2170:

Line 2494: -- jai_ap_invoice_line. Besides, all tax lines in jai_cmn_document_taxes

2490: --
2491: -- DESCRIPTION:
2492: --
2493: -- Delete exclusive taxes from ap invoice/dist lines table and
2494: -- jai_ap_invoice_line. Besides, all tax lines in jai_cmn_document_taxes
2495: -- will be deleted in case of pv_modified_only_flag='N'
2496: -- PARAMETERS:
2497: -- In: pn_invoice_id NUMBER invoice id
2498: -- pn_line_number NUMBER invoice item line number

Line 2552: jai_cmn_document_taxes jcdt

2548: --delete all taxes lines for the specified invoice id and invoice item line
2549: --if invoice line number is null, all lines for the invoice will be deleted
2550: DELETE
2551: FROM
2552: jai_cmn_document_taxes jcdt
2553: WHERE jcdt.source_doc_id = ln_invoice_id
2554: AND jcdt.source_doc_type = jai_constants.g_ap_standalone_invoice
2555: --added by eric for inclusive tax
2556: --------------------------------------------------------------------

Line 2580: || '.Delete from jai_cmn_document_taxes'

2576: IF ( ln_proc_level >= ln_dbg_level)
2577: THEN
2578: FND_LOG.STRING( ln_proc_level
2579: , GV_MODULE_PREFIX ||'.'|| lv_proc_name
2580: || '.Delete from jai_cmn_document_taxes'
2581: , SQL%ROWCOUNT||' ROWS DELETED '
2582: );
2583: END IF;
2584: END IF; --(lv_modified_only_flag = 'N')

Line 2736: --table from jai_cmn_document_taxes

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
2737: DELETE
2738: FROM
2739: jai_cmn_document_taxes jcdt
2740: WHERE jcdt.source_doc_id = ln_invoice_id

Line 2739: jai_cmn_document_taxes jcdt

2735: --delete all tax lines not attached to a item that exists in AP Inv Line
2736: --table from jai_cmn_document_taxes
2737: DELETE
2738: FROM
2739: jai_cmn_document_taxes jcdt
2740: WHERE jcdt.source_doc_id = ln_invoice_id
2741: AND jcdt.source_doc_type = jai_constants.g_ap_standalone_invoice
2742: --modified by eric for inclusive taxes
2743: ----------------------------------------------------------------

Line 3111: CURSOR c_jai_cmn_document_taxes

3107: lv_tax_type VARCHAR2(2);
3108: lv_assets_tracking_flag VARCHAR2(1);
3109:
3110:
3111: CURSOR c_jai_cmn_document_taxes
3112: IS
3113: SELECT *
3114: FROM jai_cmn_document_taxes
3115: WHERE source_doc_type = 'STANDALONE_INVOICE'

Line 3114: FROM jai_cmn_document_taxes

3110:
3111: CURSOR c_jai_cmn_document_taxes
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;

Line 3149: FOR r_jai_cmn_document_taxes IN c_jai_cmn_document_taxes

3145: tax_rec get_tax_cur%ROWTYPE;
3146: BEGIN
3147: IF (pn_org_id IS NOT NULL AND pn_location_id IS NOT NULL)
3148: THEN
3149: FOR r_jai_cmn_document_taxes IN c_jai_cmn_document_taxes
3150: LOOP
3151:
3152: OPEN get_tax_cur (r_jai_cmn_document_taxes.tax_id);
3153: FETCH get_tax_cur INTO tax_rec;

Line 3152: OPEN get_tax_cur (r_jai_cmn_document_taxes.tax_id);

3148: THEN
3149: FOR r_jai_cmn_document_taxes IN c_jai_cmn_document_taxes
3150: LOOP
3151:
3152: OPEN get_tax_cur (r_jai_cmn_document_taxes.tax_id);
3153: FETCH get_tax_cur INTO tax_rec;
3154: CLOSE get_tax_cur;
3155: -- Added by Qiong for reverse charge bug#16001407
3156: ----------------------------------------------------------------------

Line 3163: ( pv_modvat_flag => r_jai_cmn_document_taxes.modvat_flag,

3159: END IF;
3160: ----------------------------------------------------------------------
3161: -- Added by Qiong for reverse charge bug#16001407
3162: lv_tax_type := jai_ap_stnd_tax_process.get_tax_type
3163: ( pv_modvat_flag => r_jai_cmn_document_taxes.modvat_flag,
3164: pn_cr_percentage => tax_rec.mod_cr_percentage
3165: );
3166: ln_dist_acct_ccid :=
3167: jai_ap_stnd_tax_process.get_dist_account_ccid

Line 3204: WHERE invoice_line_number = r_jai_cmn_document_taxes.source_doc_line_id

3200:
3201: UPDATE ap_invoice_distributions_all
3202: SET dist_code_combination_id = ln_dist_acct_ccid
3203: --charge_applicable_to_dist_id = ln_chargeble_acct_ccid /* Bug 13793724 -commented as the charge_applicable_to_dist_id is not dependent on ccid */
3204: WHERE invoice_line_number = r_jai_cmn_document_taxes.source_doc_line_id
3205: AND invoice_id = r_jai_cmn_document_taxes.source_doc_id
3206: AND distribution_line_number = (select min(distribution_line_number) from ap_invoice_distributions_all where
3207: invoice_line_number = r_jai_cmn_document_taxes.source_doc_line_id
3208: AND invoice_id = r_jai_cmn_document_taxes.source_doc_id); /* Bug 13617527 */

Line 3205: AND invoice_id = r_jai_cmn_document_taxes.source_doc_id

3201: UPDATE ap_invoice_distributions_all
3202: SET dist_code_combination_id = ln_dist_acct_ccid
3203: --charge_applicable_to_dist_id = ln_chargeble_acct_ccid /* Bug 13793724 -commented as the charge_applicable_to_dist_id is not dependent on ccid */
3204: WHERE invoice_line_number = r_jai_cmn_document_taxes.source_doc_line_id
3205: AND invoice_id = r_jai_cmn_document_taxes.source_doc_id
3206: AND distribution_line_number = (select min(distribution_line_number) from ap_invoice_distributions_all where
3207: invoice_line_number = r_jai_cmn_document_taxes.source_doc_line_id
3208: AND invoice_id = r_jai_cmn_document_taxes.source_doc_id); /* Bug 13617527 */
3209:

Line 3207: invoice_line_number = r_jai_cmn_document_taxes.source_doc_line_id

3203: --charge_applicable_to_dist_id = ln_chargeble_acct_ccid /* Bug 13793724 -commented as the charge_applicable_to_dist_id is not dependent on ccid */
3204: WHERE invoice_line_number = r_jai_cmn_document_taxes.source_doc_line_id
3205: AND invoice_id = r_jai_cmn_document_taxes.source_doc_id
3206: AND distribution_line_number = (select min(distribution_line_number) from ap_invoice_distributions_all where
3207: invoice_line_number = r_jai_cmn_document_taxes.source_doc_line_id
3208: AND invoice_id = r_jai_cmn_document_taxes.source_doc_id); /* Bug 13617527 */
3209:
3210: END LOOP;
3211: COMMIT;

Line 3208: AND invoice_id = r_jai_cmn_document_taxes.source_doc_id); /* Bug 13617527 */

3204: WHERE invoice_line_number = r_jai_cmn_document_taxes.source_doc_line_id
3205: AND invoice_id = r_jai_cmn_document_taxes.source_doc_id
3206: AND distribution_line_number = (select min(distribution_line_number) from ap_invoice_distributions_all where
3207: invoice_line_number = r_jai_cmn_document_taxes.source_doc_line_id
3208: AND invoice_id = r_jai_cmn_document_taxes.source_doc_id); /* Bug 13617527 */
3209:
3210: END LOOP;
3211: COMMIT;
3212: -- Added by Qiong for reverse charge bug#16001407

Line 3561: jai_cmn_document_taxes jcdt

3557: COUNT(*)
3558: INTO
3559: ln_tax_line_no
3560: FROM
3561: jai_cmn_document_taxes jcdt
3562: WHERE jcdt.source_doc_id = pn_invoice_id
3563: AND jcdt.source_doc_parent_line_no = pn_line_number
3564: AND jcdt.source_doc_type = jai_constants.g_ap_standalone_invoice;
3565:

Line 3819: -- DO NOT DELETE lines from jai_cmn_document_taxes

3815:
3816: END IF;
3817:
3818: -- the tax category remains unchanged but the user enters new taxes
3819: -- DO NOT DELETE lines from jai_cmn_document_taxes
3820: -- delte from other tables and then default
3821: IF ( NVL ( ln_std_tax_category_id, -999) =
3822: NVL ( ln_jai_tax_line_ctg_id, -999)
3823: AND NVL (lv_std_tax_modified, 'N') = 'Y'

Line 3895: update jai_cmn_document_taxes

3891: and line_number = diff_inv_lines_rec.line_number; /* Added and condition for bug 14650698 */
3892:
3893: IF LN_CANCEL_CNT>0
3894: THEN
3895: update jai_cmn_document_taxes
3896: set
3897: tax_amt=0,
3898: --base_tax_amount=0,
3899: func_tax_amt=0

Line 4054: -- into jai_cmn_document_taxes

4050: --
4051: -- DESCRIPTION:
4052: --
4053: -- This procedure is to invoke standard procedure to insert item information
4054: -- into jai_cmn_document_taxes
4055: --
4056: -- PARAMETERS:
4057: -- In: pn_invoice_id IN NUMBER invoice id
4058: -- pn_line_number IN NUMBER item line number

Line 4336: jai_cmn_document_taxes

4332: COUNT(tax_id)
4333: INTO
4334: ln_count
4335: FROM
4336: jai_cmn_document_taxes
4337: WHERE source_doc_id = pn_source_doc_id
4338: AND source_DOC_parent_line_no = pn_source_parent_line_no
4339: AND tax_id = pn_tax_id
4340: AND source_doc_type = jai_constants.g_ap_standalone_invoice;

Line 4539: jai_cmn_document_taxes jcdt

4535: , jcdt.vendor_id
4536: , jcdt.source_doc_parent_line_no
4537: , jcta.inclusive_tax_flag inc_tax_flag --Added by Eric for Inclusive Tax
4538: FROM
4539: jai_cmn_document_taxes jcdt
4540: , jai_cmn_taxes_all jcta --Added by Eric for Inclusive Tax
4541: WHERE jcdt.source_doc_id = pn_invoice_id
4542: AND jcdt.source_doc_parent_line_no = pn_parent_line_number
4543: AND jcdt.tax_id = jcta.tax_id --Added by Eric for Inclusive Tax

Line 4601: jai_cmn_document_taxes jcdt

4597: , jcdt.object_version_number
4598: , jcdt.vendor_id
4599: , jcdt.source_doc_parent_line_no
4600: FROM
4601: jai_cmn_document_taxes jcdt
4602: WHERE jcdt.source_doc_id = pn_invoice_id
4603: AND jcdt.source_doc_line_id = pn_line_number
4604: AND jcdt.source_doc_parent_line_no = pn_line_number
4605: AND jcdt.source_doc_type = jai_constants.g_ap_standalone_invoice

Line 4979: 'INSERT INTO jai_cmn_document_taxes

4975: , :18
4976: )';
4977:
4978: lv_insert_jai_tax_sql :=
4979: 'INSERT INTO jai_cmn_document_taxes
4980: ( doc_tax_id
4981: , tax_line_no
4982: , tax_id
4983: , tax_type

Line 5314: -- inserts taxes into jai_cmn_document_taxes

5310: --insert into eric_log values (7.3,'ap_invoice_lines_rec.line_number :'||ap_invoice_lines_rec.line_number,sysdate);
5311:
5312: ln_tax_amount := ap_invoice_lines_rec.amount;
5313:
5314: -- inserts taxes into jai_cmn_document_taxes
5315:
5316: /*--Comments by zhiwei for Bug#12588962 on 20110610 begin
5317: --Add IF condition by Xiao for Open Interface ER bug#11683927 on 10-Feb-2011, begin
5318: -------------------------------------------------------------------------------------------

Line 5400: --jai_cmn_document_taxes.source_doc_line_id

5396: ( ln_invoice_id
5397: , ap_invoice_lines_rec.line_number
5398: );
5399: --update the tax line number for the filed of
5400: --jai_cmn_document_taxes.source_doc_line_id
5401: --and split each PR taxes into to two lines
5402: FOR jai_default_doc_taxes_rec IN
5403: jai_default_doc_taxes_cur
5404: ( pn_invoice_id =>ln_invoice_id

Line 5487: jai_cmn_document_taxes

5483: IF(NVL(ln_external_flag,0) > 0)THEN
5484:
5485: -- update the source_doc_line_id to the real invoice line number
5486: UPDATE
5487: jai_cmn_document_taxes
5488: SET
5489: source_doc_line_id = ln_source_doc_line_id
5490: WHERE CURRENT OF jai_default_doc_taxes_cur ;
5491:

Line 5506: jai_cmn_document_taxes

5502: IF (lv_tax_type='FR' OR lv_tax_type='NR')
5503: THEN
5504: -- update the source_doc_line_id to the real invoice line number
5505: UPDATE
5506: jai_cmn_document_taxes
5507: SET
5508: --modified by eric for inclusive tax
5509: ----------------------------------------------------------------
5510: source_doc_line_id = ln_source_doc_line_id --ln_max_inv_line_num

Line 5530: -- jai_cmn_document_taxes is required to be splited in two lines

5526: --------------------------------------------------------------------
5527: --added by eric to fix the bug bug#6784111 on Jan 29,2008 ,end
5528:
5529: -- if the tax is partially recoverable tax, the tax line of table
5530: -- jai_cmn_document_taxes is required to be splited in two lines
5531: -- recoverable part and non-recoverable part
5532:
5533: ln_recur_tax_amt :=
5534: NVL(ROUND( ln_tax_amount

Line 5589: jai_cmn_document_taxes

5585: IF (i = 1)
5586: THEN
5587: -- update the source_doc_line_id to the invoice line number
5588: UPDATE
5589: jai_cmn_document_taxes
5590: SET
5591: --modified by eric for inclusive tax
5592: ----------------------------------------------------------------
5593: source_doc_line_id = ln_source_doc_line_id --ln_max_inv_line_num

Line 5632: jai_cmn_document_taxes_s.nextval

5628: ------------------------------------------------------
5629: --Eric Ma added for two records shown in Form,end
5630:
5631: SELECT
5632: jai_cmn_document_taxes_s.nextval
5633: INTO
5634: ln_doc_tax_id
5635: FROM DUAL;
5636:

Line 5708: --jai_cmn_document_taxes to other 3 tables

5704: );
5705: END IF; --( ln_proc_level >= ln_dbg_level )
5706:
5707: --The below 2 loops is to synchronize exclusive taxes information from
5708: --jai_cmn_document_taxes to other 3 tables
5709:
5710: --insert into eric_log values (7.8,'prepare to sync data from jai_cmn_document_taxes to other 3 tables ',sysdate);
5711:
5712: --Loop 1, item level: Loop all item lines in the ap_invoice_lines

Line 5710: --insert into eric_log values (7.8,'prepare to sync data from jai_cmn_document_taxes to other 3 tables ',sysdate);

5706:
5707: --The below 2 loops is to synchronize exclusive taxes information from
5708: --jai_cmn_document_taxes to other 3 tables
5709:
5710: --insert into eric_log values (7.8,'prepare to sync data from jai_cmn_document_taxes to other 3 tables ',sysdate);
5711:
5712: --Loop 1, item level: Loop all item lines in the ap_invoice_lines
5713: FOR ap_invoice_lines_rec IN ap_invoice_lines_cur
5714: LOOP

Line 5716: --Loop 2,tax level:Loop all tax lines in jai_cmn_document_taxes

5712: --Loop 1, item level: Loop all item lines in the ap_invoice_lines
5713: FOR ap_invoice_lines_rec IN ap_invoice_lines_cur
5714: LOOP
5715:
5716: --Loop 2,tax level:Loop all tax lines in jai_cmn_document_taxes
5717: FOR jai_doc_taxes_rec IN
5718: jai_doc_taxes_cur
5719: ( pn_invoice_id => ln_invoice_id
5720: , pn_parent_line_number => ap_invoice_lines_rec.line_number

Line 6136: -- Line number got from max jai_cmn_document_taxes.source_doc_line_id

6132:
6133: --insert into eric_log values (7.91,'jai_doc_taxes_rec.inc_tax_flag =''Y'' AND recoverable with project case ',sysdate);
6134:
6135: -- Insert negative line with project info
6136: -- Line number got from max jai_cmn_document_taxes.source_doc_line_id
6137: -- or max ap_invoice_lines_all.line_number
6138: ln_max_inv_line_num := Get_Max_Invoice_Line_Number(ln_invoice_id);
6139:
6140: -- deleted by eric for fixing the bug of bug#6784111 on 29-JAN,2008,begin

Line 6656: -- For Inclusive tax in jai_cmn_document_taxes, source_doc_line_id should be updated

6652: --Modified by Xiao for Open Interface ER bug#11683927 on 10-Feb-2011, end
6653:
6654: -- Added by Xiao for Open Interface ER bug#11683927 on 10-Feb-2011, begin
6655: -------------------------------------------------------------------------------------
6656: -- For Inclusive tax in jai_cmn_document_taxes, source_doc_line_id should be updated
6657: -- according to real invoice line number
6658:
6659: UPDATE jai_cmn_document_taxes
6660: SET source_doc_line_id = ln_max_pro_line_num

Line 6659: UPDATE jai_cmn_document_taxes

6655: -------------------------------------------------------------------------------------
6656: -- For Inclusive tax in jai_cmn_document_taxes, source_doc_line_id should be updated
6657: -- according to real invoice line number
6658:
6659: UPDATE jai_cmn_document_taxes
6660: SET source_doc_line_id = ln_max_pro_line_num
6661: WHERE CURRENT OF jai_doc_taxes_cur ;
6662: -------------------------------------------------------------------------------------
6663: -- Added by Xiao for Open Interface ER bug#11683927 on 10-Feb-2011, end