[Home] [Help]
288: IS
289: SELECT
290: sum(qty_matched)
291: FROM
292: JAI_OM_LC_MATCHINGS
293: WHERE
294: order_header_id = pr_new.source_header_id AND
295: -- order_line_id = pr_new.source_line_id AND --commented by csahoo for bug#5686360
296: delivery_detail_id = v_delivery_detail_id AND
311: where line_id = pr_new.source_line_id;
312:
313: cursor c_lc_mtch_dlry_line is
314: select order_line_id
315: from JAI_OM_LC_MATCHINGS
316: where delivery_detail_id = v_delivery_detail_id;
317: r_order_line c_order_line%rowtype;
318: r_lc_mtch_dlry_line c_lc_mtch_dlry_line%rowtype;
319: ln_lc_update_cnt number;
477: Added another condition in the WHEN Clause of the trigger to check that the trigger
478: fires only when the Released_status field is set to 'C' and does not fire
479: on updates of other fields at which point the releaed_status is 'C'.
480:
481: Also the update statement , which updates the released_flag in the JAI_OM_LC_MATCHINGS table
482: has been commented , because the update should happen after the shipping has completed.
483:
484: Also an error message has to be thrown , when shipping is done , for an order
485: where the tax amounts in the JAI_OM_OE_SO_TAXES and JAI_OM_OE_SO_LINES do not tally.
916: fetch c_lc_mtch_dlry_line into r_lc_mtch_dlry_line;
917: close c_lc_mtch_dlry_line;
918: if pr_new.source_line_id <> r_lc_mtch_dlry_line.order_line_id then
919:
920: update JAI_OM_LC_MATCHINGS
921: set order_line_id = pr_new.source_line_id
922: where delivery_detail_id = v_delivery_detail_id
923: -- and order_line_id = r_order_line.split_from_line_id
924: and release_flag is null;
1448: HEADER_ID = pr_new.SOURCE_HEADER_ID;
1449:
1450: CURSOR C_MATCHED_QTY_CUR IS
1451: SELECT SUM(QTY_MATCHED)
1452: FROM JAI_OM_LC_MATCHINGS
1453: WHERE ORDER_HEADER_ID = pr_new.SOURCE_HEADER_ID
1454: -- AND ORDER_LINE_ID = pr_new.SOURCE_LINE_ID --commented by csahoo for bug#5680459
1455: AND delivery_detail_id = pr_new.delivery_detail_id -- bug# 3541960
1456: AND RELEASE_FLAG IS NULL;
1468: where line_id = pr_new.source_line_id;
1469:
1470: cursor c_lc_mtch_dlry_line is
1471: select order_line_id
1472: from JAI_OM_LC_MATCHINGS
1473: where delivery_detail_id = pr_new.delivery_detail_id;
1474: r_order_line c_order_line%rowtype;
1475: r_lc_mtch_dlry_line c_lc_mtch_dlry_line%rowtype;
1476: ln_lc_update_cnt number;
1791: 19.31/03/2004 ssumaith - bug# 3541960 file version 619.1
1792:
1793: Issue :- when an lc enabled order is split and shipped , interface trip stop was going into error.
1794: The reason for this error is because for a delivery , the sum of matched quantity in the
1795: JAI_OM_LC_MATCHINGS table is compared to the quantity shipped for the delivery detail id being processed.
1796:
1797: Solution :- This issue is solved by comparing the delivery_detail_id also when getting the matched quantity.
1798: By including the delivery detail in the where clause , ensuring that in case of split orders
1799: also the shipment can go through without any errors.
2170: fetch c_lc_mtch_dlry_line into r_lc_mtch_dlry_line;
2171: close c_lc_mtch_dlry_line;
2172: if pr_new.source_line_id <> r_lc_mtch_dlry_line.order_line_id then
2173:
2174: update JAI_OM_LC_MATCHINGS
2175: set order_line_id = pr_new.source_line_id
2176: where delivery_detail_id = pr_new.Delivery_Detail_Id
2177: -- and order_line_id = r_order_line.split_from_line_id
2178: and release_flag is null;
2183:
2184: /* End, bug#5680459 csahoo */
2185:
2186:
2187: UPDATE JAI_OM_LC_MATCHINGS
2188: SET RELEASE_FLAG = 'Y'
2189: WHERE DELIVERY_DETAIL_ID = pr_new.Delivery_Detail_id;
2190: END IF;
2191: /*