7: g_pkg_name CONSTANT VARCHAR2(30) := 'WMS_Task_Dispatch_Gen';
8: g_pkg_version CONSTANT VARCHAR2(100) := '$Header: WMSTASKB.pls 120.30.12020000.3 2012/09/05 05:38:59 pramadur ship $';
9:
10: --Replenishment Project --6681109
11: g_ordered_psr wms_replenishment_pvt.psrTabTyp;
12:
13: PROCEDURE call_workflow(
14: p_rsn_id IN NUMBER
15: , p_calling_program IN VARCHAR2
10852: 'Standard',
10853: 10,
10854: NULL),
10855: 'INVOICE_VALUE',
10856: wms_replenishment_pvt.GET_SORT_INVOICE_VALUE(WDD.SOURCE_HEADER_ID,
10857: L_INVOICE_VALUE_SORT),
10858: 'SCHEDULE_DATE',
10859: DECODE(L_SCHEDULE_DATE_SORT,
10860: 'ASC',
10866: 'DD-MM-YYYY HH24:MI:SS') -
10867: WDD.DATE_SCHEDULED),
10868: null),
10869: 'TRIP_STOP_DATE',
10870: wms_replenishment_pvt.GET_SORT_TRIP_STOP_DATE(wdd.delivery_detail_id,
10871: L_TRIP_STOP_DATE_SORT),
10872: NULL))) as sort_attribute1,
10873:
10874: -- get for sort_attribute2
10890: 'Standard',
10891: 10,
10892: NULL),
10893: 'INVOICE_VALUE',
10894: wms_replenishment_pvt.GET_SORT_INVOICE_VALUE(WDD.SOURCE_HEADER_ID,
10895: L_INVOICE_VALUE_SORT),
10896: 'SCHEDULE_DATE',
10897: DECODE(L_SCHEDULE_DATE_SORT,
10898: 'ASC',
10904: 'DD-MM-YYYY HH24:MI:SS') -
10905: WDD.DATE_SCHEDULED),
10906: null),
10907: 'TRIP_STOP_DATE',
10908: wms_replenishment_pvt.GET_SORT_TRIP_STOP_DATE(wdd.delivery_detail_id,
10909: L_TRIP_STOP_DATE_SORT),
10910: NULL))) as sort_attribute2,
10911:
10912: -- get for sort_attribute3
10928: 'Standard',
10929: 10,
10930: NULL),
10931: 'INVOICE_VALUE',
10932: wms_replenishment_pvt.GET_SORT_INVOICE_VALUE(WDD.SOURCE_HEADER_ID,
10933: L_INVOICE_VALUE_SORT),
10934: 'SCHEDULE_DATE',
10935: DECODE(L_SCHEDULE_DATE_SORT,
10936: 'ASC',
10942: 'DD-MM-YYYY HH24:MI:SS') -
10943: WDD.DATE_SCHEDULED),
10944: null),
10945: 'TRIP_STOP_DATE',
10946: wms_replenishment_pvt.GET_SORT_TRIP_STOP_DATE(wdd.delivery_detail_id,
10947: L_TRIP_STOP_DATE_SORT),
10948: NULL))) as sort_attribute3,
10949:
10950: -- get for sort_attribute4
10966: 'Standard',
10967: 10,
10968: NULL),
10969: 'INVOICE_VALUE',
10970: wms_replenishment_pvt.GET_SORT_INVOICE_VALUE(WDD.SOURCE_HEADER_ID,
10971: L_INVOICE_VALUE_SORT),
10972: 'SCHEDULE_DATE',
10973: DECODE(L_SCHEDULE_DATE_SORT,
10974: 'ASC',
10980: 'DD-MM-YYYY HH24:MI:SS') -
10981: WDD.DATE_SCHEDULED),
10982: null),
10983: 'TRIP_STOP_DATE',
10984: wms_replenishment_pvt.GET_SORT_TRIP_STOP_DATE(wdd.delivery_detail_id,
10985: L_TRIP_STOP_DATE_SORT),
10986: NULL))) as sort_attribute4,
10987:
10988: -- get for sort_attribute5
11004: 'Standard',
11005: 10,
11006: null),
11007: 'INVOICE_VALUE',
11008: wms_replenishment_pvt.GET_SORT_INVOICE_VALUE(WDD.SOURCE_HEADER_ID,
11009: L_INVOICE_VALUE_SORT),
11010: 'SCHEDULE_DATE',
11011: DECODE(L_SCHEDULE_DATE_SORT,
11012: 'ASC',
11018: 'DD-MM-YYYY HH24:MI:SS') -
11019: WDD.DATE_SCHEDULED),
11020: null),
11021: 'TRIP_STOP_DATE',
11022: wms_replenishment_pvt.GET_SORT_TRIP_STOP_DATE(wdd.delivery_detail_id,
11023: L_TRIP_STOP_DATE_SORT),
11024: NULL))) as sort_attribute5
11025:
11026: FROM
12024:
12025: -- CALL SHIPPING API TO MARK THESE DELIVERY DETAILS AS 'RC' based on
12026: --l_delivery_detail_id
12027:
12028: wms_replenishment_pvt.update_wdd_repl_status
12029: (p_deliv_detail_id => l_delivery_detail_id
12030: , p_repl_status => 'C' -- for completed status
12031: , x_return_status => l_return_status
12032: );
12055:
12056: -- Split the original deamand line
12057: -- the newly created demand line will have qty =(L_DEMAND_PRI_QTY - L_REMAINING_MMTT_QTY)
12058: -- WITH original 'RR" status . The shipping API with 'SPLIT-LINE' action in turn calls
12059: -- the wms_replenishment_pvt.update_delivery_detail() API that insert the newly created
12060: -- record with RR status in the WRD table AND updates the qty to l_remaining_mmtt_qty
12061: -- for the old delivery_detail record in the WRD table
12062:
12063: -- So after calling for the split-line action, I need to call shipping
12101:
12102: -- At this point the new delivery is already inserted in the WRD table.
12103: -- AND the qty for original delivery has been updated
12104: -- TO l_remaining_mmtt_qty IN WRD as above api calls
12105: -- wms_replenishment_pvt.update_delivery_detail() internally.
12106: -- SO JUST MARK original delivery replenishment_status RC
12107: -- and then delete the original record from the WRD table
12108:
12109: wms_replenishment_pvt.update_wdd_repl_status
12105: -- wms_replenishment_pvt.update_delivery_detail() internally.
12106: -- SO JUST MARK original delivery replenishment_status RC
12107: -- and then delete the original record from the WRD table
12108:
12109: wms_replenishment_pvt.update_wdd_repl_status
12110: (p_deliv_detail_id => l_delivery_detail_id
12111: , p_repl_status => 'C' -- for completed status
12112: , x_return_status => l_return_status
12113: );
12208: -- Get the Order By Clause based on Pick Release Rule
12209: --initialize gloabl variables
12210: -- delete old value
12211: g_ordered_psr.DELETE;
12212: wms_replenishment_pvt.init_rules
12213: (p_pick_seq_rule_id => l_release_sequence_rule_id,
12214: x_order_id_sort => l_ORDER_ID_SORT,
12215: x_INVOICE_VALUE_SORT => l_INVOICE_VALUE_SORT,
12216: x_SCHEDULE_DATE_SORT => l_SCHEDULE_DATE_SORT,
12246: IF (l_debug = 1) THEN
12247: mydebug('MO Qty >= Demand Qty; Mark demand as RC ');
12248: END IF;
12249:
12250: wms_replenishment_pvt.update_wdd_repl_status
12251: (p_deliv_detail_id => l_delivery_detail_id
12252: , p_repl_status => 'C' -- for completed status
12253: , x_return_status => l_return_status
12254: );
12273:
12274: -- Split the original deamand line
12275: -- the newly created demand line will have qty =(L_DEMAND_PRI_QTY - L_REMAINING_MMTT_QTY) WITH
12276: -- original status . The shipping API with 'SPLIT-LINE' action in turn calls
12277: -- the wms_replenishment_pvt.update_delivery_detail()
12278: -- API but in this case since original
12279: -- delivery_detial was NOT tracked in the WRD table
12280: -- to start with, nothing happens there. In shipping,
12281: -- we have a new split WDD though
12319:
12320: -- At this point the new delivery is already inserted in the WRD table.
12321: -- AND the qty for original delivery has been updated
12322: -- TO l_remaining_mmtt_qty IN WRD as above api calls
12323: -- wms_replenishment_pvt.update_delivery_detail() internally.
12324: -- SO JUST MARK original delviery replenishment_status RC
12325: -- and then delete the original record from the WRD table
12326:
12327: wms_replenishment_pvt.update_wdd_repl_status
12323: -- wms_replenishment_pvt.update_delivery_detail() internally.
12324: -- SO JUST MARK original delviery replenishment_status RC
12325: -- and then delete the original record from the WRD table
12326:
12327: wms_replenishment_pvt.update_wdd_repl_status
12328: (p_deliv_detail_id => l_delivery_detail_id
12329: , p_repl_status => 'C' -- for completed status
12330: , x_return_status => l_return_status
12331: );
16113: IF (l_debug = 1) THEN
16114: mydebug('Current Fetched record for backordering.. '||l_demand_line_detail_id);
16115: END IF;
16116:
16117: wms_replenishment_pvt.update_wdd_repl_status
16118: (p_deliv_detail_id => l_demand_line_detail_id
16119: , p_repl_status => NULL
16120: , p_deliv_qty => l_bo_qty
16121: , x_return_status => l_return_status );