[Home] [Help]
335: p_vat_assessable_value NUMBER DEFAULT 0
336: /** bgowrava for forward porting bug#5631784,Following parameters are added for TCS enh.*/
337: , p_thhold_cat_base_tax_typ JAI_CMN_TAXES_ALL.tax_type%type default null -- tax type to be considered as base when calculating threshold taxes
338: , p_threshold_tax_cat_id JAI_AP_TDS_THHOLD_TAXES.tax_category_id%type default null
339: , p_source_trx_type jai_cmn_document_taxes.source_doc_type%type default null
340: , p_source_table_name jai_cmn_document_taxes.source_table_name%type default null
341: , p_action varchar2 default null
342: /** End bug 5631784 */
343: , pv_retroprice_changed IN VARCHAR2 DEFAULT 'N' --Added by Kevin Cheng for Retroactive Price 2008/01/13
336: /** bgowrava for forward porting bug#5631784,Following parameters are added for TCS enh.*/
337: , p_thhold_cat_base_tax_typ JAI_CMN_TAXES_ALL.tax_type%type default null -- tax type to be considered as base when calculating threshold taxes
338: , p_threshold_tax_cat_id JAI_AP_TDS_THHOLD_TAXES.tax_category_id%type default null
339: , p_source_trx_type jai_cmn_document_taxes.source_doc_type%type default null
340: , p_source_table_name jai_cmn_document_taxes.source_table_name%type default null
341: , p_action varchar2 default null
342: /** End bug 5631784 */
343: , pv_retroprice_changed IN VARCHAR2 DEFAULT 'N' --Added by Kevin Cheng for Retroactive Price 2008/01/13
344: ) IS
616:
617: Issue:
618: 1. As a part of TCS enh. there was a requirement to default taxes using the tax category attached to
619: threshold setup for TCS regime in the India-Threshold setup UI.
620: 2. Package should provide an API for inserting taxes in to new table jai_cmn_document_taxes
621:
622: Fix:
623: To support above functionalities the following approach is used.
624: 1. New parameters are added to this procedure to get the tax category defined for threshold limit.
901:
902: lv_recalculation_sql :=
903: replace ( lv_recalculation_sql
904: , '$$TAX_SOURCE_TABLE$$'
905: , 'JAI_CMN_DOCUMENT_TAXES'
906: );
907: /** replace join condition */
908: lv_recalculation_sql :=
909: replace ( lv_recalculation_sql
925:
926: lv_recalculation_sql :=
927: REPLACE( lv_recalculation_sql
928: , '$$TAX_SOURCE_TABLE$$'
929: , 'JAI_CMN_DOCUMENT_TAXES'
930: );
931: -- replace join condition
932: lv_recalculation_sql :=
933: REPLACE( lv_recalculation_sql
1817:
1818: lv_recalculation_sql :=
1819: replace ( lv_recalculation_sql
1820: , '$$TAX_SOURCE_TABLE$$'
1821: , 'JAI_CMN_DOCUMENT_TAXES'
1822: );
1823: /** replace join condition */
1824: lv_recalculation_sql :=
1825: replace ( lv_recalculation_sql
1841:
1842: lv_recalculation_sql :=
1843: REPLACE( lv_recalculation_sql
1844: , '$$TAX_SOURCE_TABLE$$'
1845: , 'JAI_CMN_DOCUMENT_TAXES'
1846: );
1847: -- replace join condition
1848: lv_recalculation_sql :=
1849: REPLACE( lv_recalculation_sql
2496: JAI_CONSTANTS.TAX_TYPE_CUSTOMS_EDU_CESS,
2497: 'CVD_EDUCATION_CESS', JAI_CONSTANTS.TAX_TYPE_SH_CVD_EDU_CESS,
2498: 'Customs', 'CVD', 'ADDITIONAL_CVD' ,'TDS' , 'Modvat Recovery') THEN
2499:
2500: INSERT INTO jai_cmn_document_taxes(
2501: DOC_TAX_ID,
2502: tax_line_no,
2503: tax_id ,
2504: tax_type,
2531: last_update_date ,
2532: last_updated_by ,
2533: last_update_login )
2534: VALUES (
2535: jai_cmn_document_taxes_s.nextval ,
2536: v_line_num,
2537: rec.tax_id,
2538: rec.tax_type,
2539: p_currency,
3025: end if;
3026:
3027: /* jai_cmn_debug_contexts_pkg.print
3028: (ln_reg_id
3029: ,'Values before insert into jai_cmn_document_taxes' ||chr(10)
3030: || ',tax_line_no -> '||row_count ||CHR(10)
3031: || ',tax_id -> '||rec.tax_id ||CHR(10)
3032: || ',tax_type -> '||rec.tax_type ||CHR(10)
3033: || ',currency_code -> '||p_currency ||CHR(10)
3063: -- Added by Eric Ma for standalone invoice on 2007/09/27
3064: ----------------------------------------------------------------------
3065: IF (p_source_trx_type = jai_constants.G_AP_STANDALONE_INVOICE )
3066: THEN
3067: INSERT INTO jai_cmn_document_taxes
3068: ( doc_tax_id
3069: , tax_line_no
3070: , tax_id
3071: , tax_type
3100: , last_updated_by
3101: , last_update_login
3102: )
3103: VALUES
3104: ( jai_cmn_document_taxes_s.nextval -- doc_tax_id
3105: , row_count -- tax_line_no
3106: , rec.tax_id -- tax_id
3107: , rec.tax_type -- tax_type
3108: , p_currency -- currency
3141: , p_last_update_login -- last_update_login
3142: );
3143: ELSE --(p_source_trx_type <>jai_constants.G_AP_STANDALONE_INVOICE );
3144: ------------------------------------------------------------------
3145: insert into jai_cmn_document_taxes
3146: ( doc_tax_id
3147: , tax_line_no
3148: , tax_id
3149: , tax_type
3178: , last_update_login
3179: )
3180: values
3181: (
3182: jai_cmn_document_taxes_s.nextval -- doc_tax_id
3183: , row_count -- tax_line_no
3184: , rec.tax_id -- tax_id
3185: , rec.tax_type -- tax_type
3186: , p_currency -- currency
3216: , p_last_updated_by -- last_updated_by
3217: , p_last_update_login -- last_update_login
3218: );
3219: END IF; --(p_source_trx_type = jai_constants.G_AP_STANDALONE_INVOICE )
3220: /* jai_cmn_debug_contexts_pkg.print (ln_reg_id, 'Record inserted into jai_cmn_document_taxes');*/ --commented by bgowrava for bug#5631784
3221:
3222: /* Date 22-feb-2007 Added by SACSETHI for bug 6012570 (5876390)
3223: in This , Recalculation will be happen in Draft invoice */
3224: elsif
3225: p_source_trx_type = jai_constants.pa_draft_invoice
3226: and p_action = jai_constants.recalculate_taxes
3227: then
3228:
3229: update jai_cmn_document_taxes
3230: set tax_amt = tax_amt_tab(row_count)
3231: ,func_tax_amt = nvl(func_tax_amt_tab(row_count),0) * nvl(v_currency_conv_factor ,1)
3232: ,last_update_date = p_last_update_date
3233: ,last_updated_by = p_last_updated_by