[Script]Backordered Problematic delivery detail

来源:互联网 发布:php开启伪静态 编辑:程序博客网 时间:2024/05/29 06:28

脚本用于Backorder有问题Delivery Detail(比如关联的Move Order丢失...),可以backorder Delivery后,再重新Pick Release;如果不想要这个订单了,可以Backorder后,Cancel销售订单,并通过NOTE:1322105.1来删除多余的Reservation。

  1. UPDATE wsh_delivery_assignments  
  2. SET    delivery_id               = NULL,  
  3.        parent_delivery_detail_id = NULL,  
  4.        last_updated_by           = -1,  
  5.        last_update_date          = SYSDATE  
  6. WHERE  delivery_detail_id        = xxxx;  
  7.   
  8. UPDATE      wsh_delivery_details  
  9.  SET     released_status         = 'D'  
  10.   ,      source_header_id        = -(source_header_id)  
  11.   ,      source_line_id          = -(source_line_id)  
  12.   ,      source_header_number    = '-'||(source_header_number)  
  13.   ,      source_line_number      = '-'||(source_line_number)  
  14.   ,      src_requested_quantity  = 0  
  15.   ,      src_requested_quantity2 = decode(src_requested_quantity2,NULL,NULL,0)  
  16.   ,      requested_quantity      = 0  
  17.   ,      requested_quantity2     = decode(requested_quantity2,NULL,NULL,0)  
  18.   ,      shipped_quantity        = 0  
  19.   ,      shipped_quantity2       = decode(shipped_quantity2,NULL,NULL,0)  
  20.   ,      picked_quantity         = 0  
  21.   ,      picked_quantity2        = decode(picked_quantity2,NULL,NULL,0)  
  22.   ,      cycle_count_quantity    = 0  
  23.   ,      cycle_count_quantity2   = decode(src_requested_quantity2,NULL,NULL,0)  
  24.   ,      cancelled_quantity      = decode(requested_quantity,0,cancelled_quantity,requested_quantity)  
  25.   ,      cancelled_quantity2     = decode(requested_quantity2,NULL,NULL,0,cancelled_quantity2,requested_quantity2)  
  26.   ,      subinventory            = NULL  
  27.   ,      locator_id              = NULL  
  28.   ,      lot_number              = NULL  
  29.   ,      serial_number           = NULL  
  30.   ,      to_serial_number        = NULL  
  31.   ,      transaction_temp_id     = NULL  
  32.   ,      revision                = NULL  
  33.   ,      ship_set_id             = NULL  
  34.   ,      inv_interfaced_flag     = 'X'  
  35.   ,      oe_interfaced_flag      = 'X'  
  36.   ,      last_updated_by         = -1  
  37.   ,      last_update_date        = SYSDATE  
  38. WHERE  delivery_detail_id        = xxxx;  
  39.   
  40. Prompt COMMIT to save and ROLLBACK to revert the changes.  

转自:http://blog.csdn.net/pan_tian/article/details/7697034
0 0
原创粉丝点击