[Home] [Help]
5287: pc_to_currency_code,
5288: pc_to_curr_conversion_type,
5289: pc_to_curr_conversion_date
5290: )) matched_amt
5291: FROM inl_corr_matches_v mat
5292: WHERE mat.to_parent_table_name = 'INL_SHIP_LINES'
5293: AND mat.match_type_code = 'ITEM'
5294: AND mat.to_parent_table_id = pc_ship_line_id
5295: AND NOT EXISTS
5294: AND mat.to_parent_table_id = pc_ship_line_id
5295: AND NOT EXISTS
5296: (
5297: SELECT 1
5298: FROM inl_corr_matches_v m2
5299: WHERE m2.from_parent_table_name = mat.from_parent_table_name
5300: AND m2.from_parent_table_id = mat.from_parent_table_id
5301: AND m2.match_id > mat.match_id
5302: )
5475: l_ori_unit_price , /* 18 */
5476: l_from_parent_table_name , /* 19 */
5477: l_from_parent_table_id , /* 20 */
5478: l_curr_match_id /* 21 */
5479: FROM inl_corr_matches_v mat,
5480: inl_ship_lines sl ,
5481: inl_ship_lines sl0 ,
5482: inl_ship_headers sh
5483: WHERE mat.match_id = p_match_id
5497: AND sl0.ship_line_num = sl2.ship_line_num
5498: )
5499: AND (mat.correction_match_id is null OR
5500: mat.correction_match_id = (select min(mat2.correction_match_id)
5501: FROM inl_corr_matches_v mat2
5502: WHERE mat2.match_id = p_match_id
5503: AND mat2.to_parent_table_name = 'INL_SHIP_LINES'
5504: AND mat2.adj_already_generated_flag = 'N'
5505: ));
6284: WHERE assoc.from_parent_table_name = 'INL_CHARGE_LINES'
6285: AND assoc.from_parent_table_id = cl.charge_line_id
6286: AND assoc.ship_header_id
6287: IN (select m1.ship_header_id
6288: from inl_corr_matches_v m1
6289: where m1.match_amount_id = p_ChLn_Assoc.match_amount_id
6290: )
6291: )
6292: ;
8073: l_matched_curr_code , /* 13 */
8074: l_matched_curr_conversion_type, /* 14 */
8075: l_matched_curr_conversion_date, /* 15 */
8076: l_matched_curr_conversion_rate /* 16 */
8077: FROM inl_corr_matches_v m
8078: WHERE match_id = p_match_id;
8079: -- Getting the Ship information
8080: l_debug_info := 'Getting the ship line information';
8081: INL_LOGGING_PVT.Log_Statement (
8421: m.from_parent_table_name,
8422: m.from_parent_table_id ,
8423: m.to_parent_table_name ,
8424: m.to_parent_table_id
8425: FROM inl_corr_matches_v m
8426: WHERE m.match_amount_id = p_match_amount_id
8427: ORDER BY m.match_id;
8428: TYPE c_matches_type
8429: IS
8507: a.matched_curr_code,
8508: ma.matched_curr_code,
8509: ma.matched_curr_conversion_type,
8510: ma.matched_curr_conversion_date))
8511: FROM inl_corr_matches_v a
8512: WHERE a.match_amount_id = ma.match_amount_id ) matched_amt,
8513: m.party_id ,
8514: m.party_site_id ,
8515: ma.charge_line_type_id ,
8539: l_matched_curr_conversion_rate,
8540: l_allocation_basis ,
8541: l_allocation_uom_code
8542: FROM inl_match_amounts ma, -- Bug #9179775
8543: inl_corr_matches_v m ,
8544: inl_charge_line_types_vl clt ,
8545: inl_allocation_basis_vl abv
8546: WHERE abv.allocation_basis_code = clt.allocation_basis
8547: AND clt.charge_line_type_id = m.charge_line_type_id
8547: AND clt.charge_line_type_id = m.charge_line_type_id
8548: AND m.match_amount_id = ma.match_amount_id
8549: AND ma.match_amount_id = p_match_amount_id
8550: AND m.match_id in (select min(match_id) -- BUG#8411594
8551: FROM inl_corr_matches_v m
8552: WHERE m.match_amount_id = p_match_amount_id);
8553:
8554: INL_LOGGING_PVT.Log_Variable (
8555: p_module_name => g_module_name,
9111: l_matched_curr_conversion_type,
9112: l_matched_curr_conversion_date,
9113: l_matched_curr_conversion_rate,
9114: l_ship_header_id
9115: FROM inl_corr_matches_v m
9116: WHERE match_id = p_match_id;
9117: -- Handling estimated tax Line and getting the parent_tax_line_id
9118: l_debug_info := 'Handling estimated tax Line and getting the parent_tax_line_id';
9119: INL_LOGGING_PVT.Log_Statement (
9307: SELECT distinct
9308: m.ship_header_id , --BUG#8198498
9309: m.to_parent_table_name,
9310: m.to_parent_table_id
9311: FROM inl_corr_matches_v m
9312: WHERE m.match_amount_id = p_match_amount_id;
9313: TYPE c_matches_type
9314: IS
9315: TABLE OF c_matches_tl%ROWTYPE;
9348: a.matched_curr_code,
9349: ma.matched_curr_code,
9350: ma.matched_curr_conversion_type,
9351: ma.matched_curr_conversion_date))
9352: FROM inl_corr_matches_v a
9353: WHERE a.match_amount_id = ma.match_amount_id ) tax_amt,
9354: ma.matched_curr_code currency_code,
9355: ma.matched_curr_conversion_type currency_conversion_type,
9356: ma.matched_curr_conversion_date currency_conversion_date,
9395: AND clt.charge_line_type_id = m.charge_line_type_id
9396: AND m.match_amount_id = ma.match_amount_id
9397: AND ma.match_amount_id = p_match_amount_id
9398: AND m.match_id in (select min(match_id) -- BUG#8411594
9399: FROM inl_corr_matches_v m
9400: WHERE m.match_amount_id = p_match_amount_id);
9401:
9402: INL_LOGGING_PVT.Log_Variable (
9403: p_module_name => g_module_name,
9730: FROM
9731: --Bug#14044298 inl_charge_lines cl ,
9732: --Bug#14044298 inl_ship_lines sl ,
9733: inl_ship_headers sh ,
9734: inl_corr_matches_v m
9735: --Bug#14044298 org_organization_definitions ood, --BUG#8468830
9736: --Bug#14044298 gl_sets_of_books gsb --BUG#8468830
9737: WHERE
9738: sh.ship_header_id = p_ship_header_id
9761: --Bug#14044298 gsb.currency_code AS func_currency_code --BUG#8468830
9762: FROM
9763: inl_ship_headers sh,
9764: inl_match_amounts ma,
9765: inl_corr_matches_v m
9766: --Bug#14044298 org_organization_definitions ood, --BUG#8468830
9767: --Bug#14044298 gl_sets_of_books gsb --BUG#8468830
9768: WHERE
9769: sh.ship_header_id = p_ship_header_id
9858: INTO
9859: l_match_amt_proc_same_adj_num
9860: FROM
9861: inl_match_amounts ma,
9862: inl_corr_matches_v m,
9863: inl_corr_matches_v mFromMA
9864: WHERE m.ship_header_id = p_ship_header_id
9865: AND m.match_amount_id = ma.match_amount_id
9866: AND m.match_type_code <> 'CORRECTION'
9859: l_match_amt_proc_same_adj_num
9860: FROM
9861: inl_match_amounts ma,
9862: inl_corr_matches_v m,
9863: inl_corr_matches_v mFromMA
9864: WHERE m.ship_header_id = p_ship_header_id
9865: AND m.match_amount_id = ma.match_amount_id
9866: AND m.match_type_code <> 'CORRECTION'
9867: AND NVL (m.adj_already_generated_flag, 'N') = 'N'
9953: INTO l_adjustment_num
9954: FROM inl_ship_headers sh
9955: WHERE sh.ship_header_id
9956: IN (select m1.ship_header_id
9957: from inl_corr_matches_v m1
9958: where m1.match_amount_id
9959: IN (select DISTINCT(ma.match_amount_id)
9960: from inl_match_amounts ma, -- Bug #9179775
9961: inl_corr_matches_v m2
9957: from inl_corr_matches_v m1
9958: where m1.match_amount_id
9959: IN (select DISTINCT(ma.match_amount_id)
9960: from inl_match_amounts ma, -- Bug #9179775
9961: inl_corr_matches_v m2
9962: WHERE m2.match_amount_id = ma.match_amount_id
9963: AND m2.ship_header_id = p_SHIP_HEADER_ID
9964: AND m2.match_type_code <> 'CORRECTION'
9965: AND NVL(m2.adj_already_generated_flag, 'N') = 'N')
9979: -- then, in the outer select, we don't need verify the type and we can use the table
9980: -- rather than the view
9981: /*--Bug#14044298 BEGIN
9982: FOR C_CUR_HEAD IN (select m1.ship_header_id
9983: from inl_corr_matches_v m1
9984: where m1.match_amount_id
9985: IN (select DISTINCT(ma.match_amount_id)
9986: from inl_match_amounts ma, -- Bug #9188553
9987: inl_corr_matches_v m2
9983: from inl_corr_matches_v m1
9984: where m1.match_amount_id
9985: IN (select DISTINCT(ma.match_amount_id)
9986: from inl_match_amounts ma, -- Bug #9188553
9987: inl_corr_matches_v m2
9988: WHERE m2.match_amount_id = ma.match_amount_id
9989: AND m2.ship_header_id = p_SHIP_HEADER_ID
9990: AND m2.match_type_code <> 'CORRECTION'
9991: AND NVL(m2.adj_already_generated_flag, 'N') = 'N')
9995: from inl_matches m1
9996: where m1.match_amount_id
9997: IN (select DISTINCT(ma.match_amount_id)
9998: from inl_match_amounts ma, -- Bug #9188553
9999: inl_corr_matches_v m2
10000: WHERE m2.match_amount_id = ma.match_amount_id
10001: AND m2.ship_header_id = p_SHIP_HEADER_ID
10002: AND m2.match_type_code <> 'CORRECTION'
10003: AND NVL(m2.adj_already_generated_flag, 'N') = 'N')) LOOP
10036: INTO l_adjustment_num_tmp
10037: FROM inl_ship_headers sh
10038: WHERE sh.ship_header_id
10039: IN (SELECT m1.ship_header_id
10040: FROM inl_corr_matches_v m1
10041: WHERE m1.match_type_code <> 'CORRECTION'
10042: AND m1.match_amount_id = r_match(i).match_amount_id)
10043: ;
10044:
10056: DISTINCT(m.adj_group_date)
10057: INTO
10058: l_adj_group_date
10059: FROM
10060: inl_corr_matches_v m
10061: WHERE m.match_amount_id = r_match(i).match_amount_id
10062: AND m.match_type_code <> 'CORRECTION'
10063: AND NVL (m.adj_already_generated_flag, 'N') = 'N';
10064: EXCEPTION
10091: );
10092:
10093: -- Getting the ship_header_ids that will be impact for this matches in order to record the new adjustment_num
10094: FOR C_CUR_HEAD IN (select m1.ship_header_id
10095: from inl_corr_matches_v m1
10096: where m1.match_amount_id
10097: IN (SELECT m2.match_amount_id
10098: FROM inl_corr_matches_v m2
10099: WHERE m2.match_type_code <> 'CORRECTION'
10094: FOR C_CUR_HEAD IN (select m1.ship_header_id
10095: from inl_corr_matches_v m1
10096: where m1.match_amount_id
10097: IN (SELECT m2.match_amount_id
10098: FROM inl_corr_matches_v m2
10099: WHERE m2.match_type_code <> 'CORRECTION'
10100: AND m2.match_amount_id = r_match(i).match_amount_id)) LOOP
10101:
10102: l_match_ship_header_id_ind:=l_match_ship_header_id_ind+1;