[Home] [Help]
999: ----------------------------------------------------------------
1000: -- responsible to check for tax category id whether it is already exists .
1001: cursor cur_get_tax_caegotry is
1002: select tax_category_id
1003: from jai_cmn_document_taxes
1004: where source_doc_id = pn_draft_invoice_id and
1005: source_doc_line_id = pn_draft_invoice_line_id and
1006: source_doc_type = jai_constants.pa_draft_invoice ;
1007:
1014: draft_invoice_id = pn_draft_invoice_id ;
1015:
1016: cursor cur_get_tax_amount is
1017: select sum(tax_amt)
1018: from jai_cmn_document_taxes
1019: where source_doc_id = pn_draft_invoice_id and
1020: source_doc_line_id = pn_draft_invoice_line_id and
1021: source_doc_type = jai_constants.pa_draft_invoice ;
1022: -- for credit invoice generation
1023: begin
1024: ln_tax_amount := 0 ;
1025: -- for credit invoice generation , tax category should be copy from parent to credit memo
1026: if pkg_global_type.ln_draft_invoice_num_credited is not null then
1027: insert into jai_cmn_document_taxes
1028: (
1029: doc_tax_id ,
1030: tax_line_no ,
1031: tax_id ,
1059: last_update_date ,
1060: last_updated_by ,
1061: last_update_login
1062: )
1063: select jai_cmn_document_taxes_s.nextval ,
1064: j1.tax_line_no ,
1065: j1.tax_id ,
1066: j1.tax_type ,
1067: j1.currency_code ,
1090: fnd_global.user_id ,
1091: sysdate ,
1092: fnd_global.user_id ,
1093: fnd_global.login_id
1094: from jai_cmn_document_taxes j1 , JAI_CMN_TAXES_ALL j2
1095: where j1.source_doc_id = pkg_global_type.ln_draft_invoice_id and
1096: j1.source_doc_line_id = pkg_global_type.ln_draft_invoice_line_id and
1097: j1.source_doc_type = jai_constants.pa_draft_invoice and
1098: j1.tax_id = j2.tax_id ;
1130: close cur_get_tax_caegotry ;
1131:
1132: --if tax category id is present and it is different then delete from taxes table
1133: if ln_tax_category_id is not null and ln_tax_category_id <> pn_tax_category_id then
1134: delete from jai_cmn_document_taxes
1135: where source_doc_id = pn_draft_invoice_id and
1136: source_doc_line_id = pn_draft_invoice_line_id and
1137: source_doc_type = jai_constants.pa_draft_invoice ;
1138: end if ;
1209: pv_process_message out nocopy varchar2,
1210: pv_process_flag out nocopy varchar2
1211: ) is
1212: begin
1213: delete from jai_cmn_document_taxes
1214: where ( source_doc_id , source_doc_line_id ) in
1215: ( select draft_invoice_id , draft_invoice_line_id
1216: from jai_pa_draft_invoice_lines
1217: where project_id = pn_project_id and