自主開發的編排箱號由工廠導入原拋入廠時,無法完整導入的應對處理

設有兩個公司.由a公司接customer的訂單,然後轉給b公司生產,b完工後出給a公司,a公司再出給customer.

透過otc功能,把a公司建好的訂單拋到b公司的om interfaced中.b公司到om interfaced中撈成b公司的訂單.

[@more@]

這樣就避免了再次輸入與a公司一樣的訂單明細,提高了工作效率.

但由於訂單變更等原因,a公司拋到b公司時往往沒有完整拋到b公司.

這時b公司就會手工再key到訂單明細里.

a公司出貨給b公司後,b公司做編排箱號時,就可以把a公司做好的資料導入.b公司就不用再次編排資料,只要稍微修改即可.

由於b公司存在部分沒有完整拋到a公司的訂單line.在導入a公司的編排資料時,就無法導入.因為兩者缺少聯系.

對此,寫以下sql來補導入b公司.

/*

SELECT * FROM GOBO_OM_SHIP_HEADER_ALL WHERE SHIP_no=:ship_no
and org_id=118

SELECT * FROM GOBO_OM_SHIP_LINE_ALL WHERE SHIP_HEADER_ID=:sh

SELECT * FROM GOBO_SHIP_INTO_ONE WHERE SHIP_HEADER_ID=:sh

select * from oe_order_lines_all
where line_id=2800448

select * from otc_orders_all
where dest_header_id=744971

select * from otc_orders_all
where header_id=744902

select * from oe_order_lines_all
where header_id=744971 --744902
and inventory_item_id=566964

select * from gobo_om_ship_line_all
where ship_line_id=691481
--A206150C-GEE1

select * from gobo_om_ship_line_all
where ship_header_id=37883

*/

--desc GOBO_OM_header_SEQ1

drop table re_import_ship_line

create table re_import_ship_line as
select *
from gobo_om_ship_line_all
where ship_line_id=691481 --:fac_ship_line_id --691481 --2800448 fac_line_id

select * from re_import_ship_line

update re_import_ship_line
set ship_header_id=37883, --:guic_ship_header, --37883
org_id=118, --:guic_org,
ship_line_id=GOBO_OM_LINE_SEQ2.NEXTVAL,
order_lined_id=null,
order_no=null,
delivery_id=null,
delivery_detail_id=null,
created_by=-1,
creation_date=sysdate,
last_update_login=-1,
last_update_date=sysdate,
last_updated_by=-1,
from_org_id=org_id,
from_org='OBM GERBER廠',
from_ship_header_id=ship_header_id,
from_ship_line_id=ship_line_id,
from_ship_no=070100005 --:fac_ship_no

INSERT INTO GOBO.GOBO_OM_SHIP_LINE_ALL
select * from re_import_ship_line

commit

请使用浏览器的分享功能分享到微信等