[Home] [Help]
89: end set_debug_context;
90:
91: /*------------------------------------------------------------------------------------------------------------*/
92: procedure extract_rgm_trxs
93: ( p_regime_code jai_rgm_trx_records.regime_code%type
94: , p_organization_id jai_rgm_trx_records.organization_id%type default null
95: , p_location_id jai_rgm_trx_records.location_id%type default null
96: , p_from_trx_date date default null
97: , p_to_trx_date date default null
90:
91: /*------------------------------------------------------------------------------------------------------------*/
92: procedure extract_rgm_trxs
93: ( p_regime_code jai_rgm_trx_records.regime_code%type
94: , p_organization_id jai_rgm_trx_records.organization_id%type default null
95: , p_location_id jai_rgm_trx_records.location_id%type default null
96: , p_from_trx_date date default null
97: , p_to_trx_date date default null
98: , p_source jai_rgm_trx_records.source%type default null
91: /*------------------------------------------------------------------------------------------------------------*/
92: procedure extract_rgm_trxs
93: ( p_regime_code jai_rgm_trx_records.regime_code%type
94: , p_organization_id jai_rgm_trx_records.organization_id%type default null
95: , p_location_id jai_rgm_trx_records.location_id%type default null
96: , p_from_trx_date date default null
97: , p_to_trx_date date default null
98: , p_source jai_rgm_trx_records.source%type default null
99: , p_query_settled_flag varchar2 default 'N'
94: , p_organization_id jai_rgm_trx_records.organization_id%type default null
95: , p_location_id jai_rgm_trx_records.location_id%type default null
96: , p_from_trx_date date default null
97: , p_to_trx_date date default null
98: , p_source jai_rgm_trx_records.source%type default null
99: , p_query_settled_flag varchar2 default 'N'
100: , p_query_only_null_srvtype varchar2 default 'N'
101: , p_process_message OUT NOCOPY varchar
102: , p_process_flag OUT NOCOPY varchar2
115: , (nvl(trx_credit_amount,0) + nvl(trx_debit_amount,0)) repository_tax_amt
116: , recs.organization_type
117: , recs.source_document_id
118: from jai_rgm_trx_refs refs
119: , jai_rgm_trx_records recs
120: where recs.reference_id = refs.reference_id (+)
121: and ( p_organization_id is null
122: or (recs.organization_id = p_organization_id)
123: )
157: ,cp_line_id jai_rgm_trx_refs.line_id%type
158: )
159: is
160: select recs.service_type_code
161: from jai_rgm_trx_records recs, jai_rgm_trx_refs refs
162: where recs.reference_id = refs.reference_id
163: and refs.invoice_id = cp_invoice_id
164: and refs.line_id = cp_line_id
165: and refs.source = cp_source
256: lv_party_name hz_parties.party_name%type;
257:
258: rec_st_transprt_inv_details c_st_transprt_inv_details%rowtype;/* Changes by nprashar , for bug 7172723 */
259: rec_st_transprt_party_details c_st_transprt_party_details%rowtype;/* Changes by nprashar , for bug bug 7172723 */
260: lv_service_type_code jai_rgm_trx_records.service_type_code%type;
261:
262: lr_trx_repo_extract jai_trx_repo_extract_gt%rowtype;
263: lv_organization_name hr_organization_units.name%type;
264: lv_location_name hr_locations_all.description%type;
1095: --------------------------------------------------------------------------
1096: l_si_details_rec l_get_si_details_csr%ROWTYPE;
1097: --------------------------------------------------------------------------
1098:
1099: lv_service_type jai_rgm_trx_records.service_type_code%type;
1100:
1101: begin
1102:
1103: lv_member_name := 'GET_DOCUMENT_DETAILS';
1583: jai_cmn_vendor_sites
1584: where vendor_id= p_vendor_id
1585: and vendor_site_id=p_vendor_site_id;
1586:
1587: lr_service_type jai_rgm_trx_records.service_type_code%type;
1588: lr_called_from varchar2(20) default null;
1589:
1590: lr_line_number number;
1591: lr_inv_dist_id ap_invoice_distributions_all.INVOICE_DISTRIBUTION_ID%type;
1595: lr_refs_rec c_get_refs_rec%rowtype;
1596:
1597: ln_doc_id number;
1598: ln_doc_line_id number;
1599: lv_trx_src jai_rgm_trx_records.source%type;
1600: lr_source_type ap_invoices_all.source%type;
1601: lr_doc_details c_get_doc_details%rowtype;
1602:
1603:
1814: --
1815: -- Update service type code for SERVICE_DISTRIBUTE_IN type of trx with the same service type
1816: -- code as give in the source (SERVICE_DISTRIBUTE_OUT) --
1817:
1818: update jai_rgm_trx_records
1819: set service_type_code = rec.service_type_code
1820: , last_update_date = sysdate
1821: , last_updated_by = lv_user_id
1822: , last_update_login = lv_login_id
1870: --
1871: -- Update repository records with service type code
1872: --
1873:
1874: update jai_rgm_trx_records
1875: set service_type_code = rec.service_type_code
1876: , last_update_date = sysdate
1877: , last_updated_by = lv_user_id
1878: where repository_id = rec.transaction_repository_id;
1877: , last_updated_by = lv_user_id
1878: where repository_id = rec.transaction_repository_id;
1879:
1880: jai_cmn_debug_contexts_pkg.print (ln_reg_id
1881: ,'No of rows updated in jai_rgm_trx_records table='||sql%rowcount
1882: );
1883: --
1884: -- Mark record in global temp table as PROCESSED
1885: --
2166: return varchar2
2167: is
2168: lv_organization_id number;
2169: lv_location_id number;
2170: lv_service_type_code jai_rgm_trx_records.service_type_code%type;
2171: lv_process_flag varchar2 (2);
2172: lv_process_message varchar2 (2000);
2173:
2174: begin
2194: , p_document_line_id jai_trx_repo_extract_gt.document_line_id%type
2195: )
2196: return varchar2 is
2197:
2198: lv_service_type jai_rgm_trx_records.service_type_code%type;
2199:
2200: cursor c_get_so_settled_srvtyp
2201: is
2202: select recs.service_type_code
2199:
2200: cursor c_get_so_settled_srvtyp
2201: is
2202: select recs.service_type_code
2203: from jai_rgm_trx_records recs
2204: ,jai_rgm_trx_refs refs
2205: ,ra_customer_trx_lines_all ractl
2206: where ractl.interface_line_attribute6 = p_document_line_id
2207: and ractl.interface_line_context = 'ORDER ENTRY'
2215:
2216: cursor c_get_ar_settled_srvtyp
2217: is
2218: select recs.service_type_code
2219: from jai_rgm_trx_records recs
2220: ,jai_rgm_trx_refs refs
2221: where refs.item_line_id = p_document_line_id
2222: and recs.reference_id = refs.reference_id
2223: and recs.settlement_id is not null
2227:
2228: cursor c_get_po_settled_srvtyp
2229: is
2230: select recs.service_type_code
2231: from jai_rgm_trx_records recs
2232: ,jai_rgm_trx_refs refs
2233: ,po_distributions_all pod
2234: ,ap_invoice_distributions_all apd
2235: where pod.po_line_id = p_document_line_id
2244: ------------------------------------------------------------------
2245: cursor c_get_aps_settled_srvtyp
2246: is
2247: select recs.service_type_code
2248: from jai_rgm_trx_records recs
2249: ,jai_rgm_trx_refs refs
2250: where refs.invoice_id = p_document_id
2251: and refs.item_line_id = p_document_line_id
2252: and recs.reference_id = refs.reference_id