You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DSWMS/DB/SQL_banben/17 仓储项目_仓储费变化日志.sql

1286 lines
110 KiB
MySQL

2 years ago
CREATE TABLE [dbo].[OP_WMS_BASE](
[WMSBASEID] [uniqueidentifier] NOT NULL,
[BSNO] [varchar](50) NULL,
[BILLTYPE] [varchar](50) NULL,
[REMARK] [varchar](50) NULL,
[CORPID] [varchar](50) NULL,
[CreateID] [uniqueidentifier] NULL,
[Creator] [varchar](50) NULL,
[CreateDate] [datetime] NULL,
[CUSTOMERNAME] [varchar](50) NULL,
[MATERIALNO] [varchar](50) NULL,
[GOODSCODE] [varchar](50) NULL,
[GOODSNAME] [varchar](50) NULL,
[GOODSHSCODE] [varchar](50) NULL,
[MBLNO] [varchar](50) NULL,
[CNTRNO] [varchar](50) NULL,
[KGS] [numeric](18, 3) NULL,
[CBM] [numeric](18, 3) NULL,
[PKGS] [numeric](18, 3) NULL,
[KINDPKGS] [varchar](50) NULL,
[STORAGEUNIT] [varchar](50) NULL,
[STORAGEUNITCOUNT] [numeric](22, 6) NULL,
[RULEUNIT] [varchar](50) NULL,
[RULEUNITCOUNT] [numeric](18, 3) NULL,
[FEEENDDATE] [datetime] NULL,
[FEESTARTDATE] [datetime] NULL,
[INDATE] [datetime] NULL,
[STORAGEUNITCOUNT_SINGLE] [numeric](22, 6) NULL,
[RULEUNITCOUNT_SINGLE] [numeric](18, 3) NULL,
[OP] [uniqueidentifier] NULL,
[NETWEIGHT] [decimal](18, 3) NULL,
[CUSTOMNO] [varchar](50) NULL,
[ACCBOOKNO] [varchar](50) NULL,
[GOODSOWNER] [varchar](50) NULL,
[FEERATESTARTDATE] [datetime] NULL,
[WMSINDATE] [datetime] NULL,
[ARCLIENTWMSOUT] [varchar](50) NULL,
[COUNTRY] [varchar](100) NULL,
CONSTRAINT [PK_OP_WMS_BASE] PRIMARY KEY CLUSTERED
(
[WMSBASEID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
alter table OP_WMS add WMSBASEID [uniqueidentifier] null
GO
alter table OP_WMS add APCLIENTWMSOUT [varchar](50) NULL
GO
alter table OP_WMS_IN_PLAN add APCLIENTWMSOUT [varchar](50) NULL
GO
alter table OP_WMS_IN_DO add APCLIENTWMSOUT [varchar](50) NULL
GO
ALTER VIEW [dbo].[Vw_Op_Wms] AS select [WMSID]
,[BSNO]
,[BILLTYPE]
,[REMARK]
,[CORPID]
,[ModifyID]
,[Modifier]
,[ModifyDate]
,[CreateID]
,[Creator]
,[CreateDate]
,[CUSTOMERNAME]
,[MATERIALNO]
,[GOODSCODE]
,[GOODSNAME]
,[GOODSHSCODE]
,[MBLNO]
,[CNTRNO]
,[KGS]
,NETWEIGHT
,[CBM]
,[PKGS]
,[KINDPKGS]
,[STORAGEUNIT]
,[STORAGEUNITCOUNT]
,[RULEUNIT]
,[RULEUNITCOUNT]
,[ISCLEAR]
,[BSSTATUS]
,[FEESTATUS]
,[INDATE]
,[FEESTARTDATE]
,[FEEENDDATE]
,[FEERATESTARTDATE]
,[WMSINDATE]
,KGS_SINGLE,CBM_SINGLE,STORAGEUNITCOUNT_SINGLE,RULEUNITCOUNT_SINGLE,OP,CUSTOMNO,ACCBOOKNO,GOODSOWNER
,ARCLIENTWMSOUT,WMSBASEID
from OP_WMS
GO
ALTER PROCEDURE [dbo].[proc_isClientRepeat]
@oldGID VarChar(36),
@oldCODENAME VarChar(20),
@oldSHORTNAME VarChar(20),
@oldDESCRIPTION VarChar(50),
@newGID VarChar(36),
@newCODENAME VarChar(20),
@newSHORTNAME VarChar(20),
@newDESCRIPTION VarChar(50),
@strUserID VarChar(36),
@strUserName VarChar(150)
AS
BEGIN
SET NOCOUNT ON;
BEGIN TRANSACTION--<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
DECLARE @errorSun INT --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=0 --û<EFBFBD><EFBFBD>Ϊ0
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD>ձ<EFBFBD> ί<EFBFBD>е<EFBFBD>λ
UPDATE [crm_seaeorder] SET [CUSTOMERNAME] = @newSHORTNAME WHERE [CUSTOMERNAME] = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD>ձ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾
UPDATE [crm_seaeorder] SET CARRIER = @newSHORTNAME WHERE CARRIER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD>ձ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD>մ<EFBFBD><EFBFBD><EFBFBD>
UPDATE [crm_seaeorder] SET FORWARDER = @newSHORTNAME WHERE FORWARDER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD>ձ<EFBFBD> <EFBFBD><EFBFBD>վ
UPDATE [crm_seaeorder] SET YARD = @newSHORTNAME WHERE YARD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ί<EFBFBD>е<EFBFBD>λ
UPDATE op_seae SET [CUSTOMERNAME] = @newSHORTNAME WHERE [CUSTOMERNAME] = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>վ
UPDATE op_seae SET YARD = @newSHORTNAME WHERE YARD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾
UPDATE op_seae SET CARRIER = @newSHORTNAME WHERE CARRIER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>մ<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_seae SET FORWARDER = @newSHORTNAME WHERE FORWARDER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_seae SET CUSTOMSER = @newSHORTNAME WHERE CUSTOMSER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_seae SET TRUCKER = @newSHORTNAME WHERE TRUCKER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_seae SET AGENTID= @newSHORTNAME WHERE AGENTID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ֿ<EFBFBD>
UPDATE op_seae SET WAREHOUSE= @newSHORTNAME WHERE WAREHOUSE = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ <EFBFBD><EFBFBD>վ
UPDATE op_seae_billmanage SET YARD = @newSHORTNAME WHERE YARD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--ҵ<EFBFBD>񺯵<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> TO<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λȫ<EFBFBD>ƣ<EFBFBD>
UPDATE op_letter SET HEAD_TO = @newDESCRIPTION WHERE HEAD_TO = @oldDESCRIPTION --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--ҵ<EFBFBD>񺯵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>վ
UPDATE op_letter_yard SET YARD = @newSHORTNAME WHERE YARD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--ҵ<EFBFBD>񺯵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>վ
UPDATE op_letter_yard SET YARD2 = @newSHORTNAME WHERE YARD2 = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--ҵ<EFBFBD>񺯵<EFBFBD><EFBFBD>ɳ<EFBFBD>֪ͨ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_letter_truck SET TRUCK = @newSHORTNAME WHERE TRUCK = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--ҵ<EFBFBD>񺯵<EFBFBD><EFBFBD>ɳ<EFBFBD>֪ͨ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>վ
UPDATE op_letter_truck SET YARD = @newSHORTNAME WHERE YARD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--ҵ<EFBFBD>񺯵<EFBFBD><EFBFBD>ɳ<EFBFBD>֪ͨ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>վ
UPDATE op_letter_truck SET RETURNYARD = @newSHORTNAME WHERE RETURNYARD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ĭ<EFBFBD>ϳ<EFBFBD>վ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD>
UPDATE code_voyno SET YARDID = @newSHORTNAME WHERE YARDID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE ch_fee SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ı<EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE ch_fee_modify SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>ݹ<EFBFBD>˾
UPDATE op_blissue SET EXPRESSCORP = @newSHORTNAME WHERE EXPRESSCORP = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD>˱<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>
UPDATE ch_dui SET CUSTNAME = @newSHORTNAME WHERE CUSTNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--Ԥ<EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>
UPDATE ch_fee_advance_payment SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--Ԥ<EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>
UPDATE ch_fee_advance_payment_detail SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--Ԥ<EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>
UPDATE ch_fee_agentdc SET AGENT = @newSHORTNAME WHERE AGENT = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>
UPDATE CH_FEE_AutoDui SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>
UPDATE ch_fee_settlement SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>
UPDATE ch_fee_do SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>
UPDATE ch_fee_payapplication SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE ch_fee_invoiceapplication SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE ch_fee_invoice SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD>շ<EFBFBD><EFBFBD>ñ<EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE crm_orderfee SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE ch_fee_hexiao SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE ch_fee_jinzhang SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE ch_fee_Mbody SET CUSTOMERSIDE = @newSHORTNAME WHERE CUSTOMERSIDE = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
UPDATE ch_fee_recvapplication SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--֧Ʊ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE ch_fee_cheque SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE code_fee_templatedetail SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>ͻ<EFBFBD><EFBFBD>˼۲<EFBFBD>ѯ<EFBFBD><EFBFBD>־<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE crm_price_carrier_log SET CREATEUSER = @newSHORTNAME WHERE CREATEUSER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
-------------------------------------------------
--<EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ӱ<EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>id
UPDATE info_client_contact SET LINKID = @newGID WHERE LINKID = @oldGID --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>շ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣά<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>id
UPDATE info_shipper SET codename = @newCODENAME WHERE codename = @oldCODENAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--CRM<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>id
UPDATE info_client SET ISSTOP=1,MODIFIEDUSER=@strUserID,MODIFIEDTIME=getdate() WHERE GID = @oldGID --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
INSERT INTO [sys_log]([NAME],[LOGTYPE],[LOGTIME],[LOGCONTENT],[CREATEUSER])
VALUES('<EFBFBD>ظ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ϲ<EFBFBD>','UPDATE <20><><EFBFBD>²<EFBFBD><C2B2><EFBFBD>',getdate(),@strUserName+' <20><> '+@oldSHORTNAME+' ͬ '+@newSHORTNAME+' <20>ϲ<EFBFBD> ',@strUserID)
-------------------------------------------------
--<EFBFBD>ӿ<EFBFBD> cw_vouitems<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CUSTOMERNAME
UPDATE cw_vouitems SET [CUSTOMERNAME] = @newSHORTNAME WHERE [CUSTOMERNAME] = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
-------------------------------------------------
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>cw_vouitems_gl<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ACCALL
UPDATE cw_vouitems_gl SET [ACCALL] = replace(ACCALL,@oldSHORTNAME,@newSHORTNAME) WHERE [ACCALL] like ('%'+@oldSHORTNAME+'%') --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>cw_vouitems_gl<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CUSTOMERNAME
UPDATE cw_vouitems_gl SET [CUSTOMERNAME] = @newSHORTNAME WHERE [CUSTOMERNAME] like ('%'+@oldSHORTNAME+'%') --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>cw_genleg_accitems<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CORPACC
--UPDATE cw_genleg_accitems SET [CORPACC] = @newSHORTNAME WHERE [CORPACC] = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
--SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>cw_genleg_accitems<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CORPACC
UPDATE cw_genleg_accitems SET [AMTYEARDR]=[AMTYEARDR]+ISNULL((SELECT sum([AMTYEARDR]) as [AMTYEARDR] from cw_genleg_accitems as a where [YEAR]=cw_genleg_accitems.[YEAR] and [MONTH]=cw_genleg_accitems.[MONTH] and [LINKGID]=cw_genleg_accitems.[LINKGID] and [DEPTACC]=cw_genleg_accitems.[DEPTACC] and [EMPLACC]=cw_genleg_accitems.[EMPLACC] and [CORPACC]=@oldSHORTNAME and [ITEMACC]=cw_genleg_accitems.[ITEMACC] and [CURRENCY]=cw_genleg_accitems.[CURRENCY] and [STARTGID]=cw_genleg_accitems.[STARTGID] and [ACCDATE]=cw_genleg_accitems.[ACCDATE] and [CORPID]=cw_genleg_accitems.[CORPID]),0),[AMTYEARCR]=[AMTYEARCR]+ISNULL((SELECT sum([AMTYEARCR]) as [AMTYEARCR] from cw_genleg_accitems as a where [YEAR]=cw_genleg_accitems.[YEAR] and [MONTH]=cw_genleg_accitems.[MONTH] and [LINKGID]=cw_genleg_accitems.[LINKGID] and [DEPTACC]=cw_genleg_accitems.[DEPTACC] and [EMPLACC]=cw_genleg_accitems.[EMPLACC] and [CORPACC]=@oldSHORTNAME and [ITEMACC]=cw_genleg_accitems.[ITEMACC] and [CURRENCY]=cw_genleg_accitems.[CURRENCY] and [STARTGID]=cw_genleg_accitems.[STARTGID] and [ACCDATE]=cw_genleg_accitems.[ACCDATE] and [CORPID]=cw_genleg_accitems.[CORPID]),0),[AMTYEARBLC]=[AMTYEARBLC]+ISNULL((SELECT sum([AMTYEARBLC]) as [AMTYEARBLC] from cw_genleg_accitems as a where [YEAR]=cw_genleg_accitems.[YEAR] and [MONTH]=cw_genleg_accitems.[MONTH] and [LINKGID]=cw_genleg_accitems.[LINKGID] and [DEPTACC]=cw_genleg_accitems.[DEPTACC] and [EMPLACC]=cw_genleg_accitems.[EMPLACC] and [CORPACC]=@oldSHORTNAME and [ITEMACC]=cw_genleg_accitems.[ITEMACC] and [CURRENCY]=cw_genleg_accitems.[CURRENCY] and [STARTGID]=cw_genleg_accitems.[STARTGID] and [ACCDATE]=cw_genleg_accitems.[ACCDATE] and [CORPID]=cw_genleg_accitems.[CORPID]),0),[AMTDR]=[AMTDR]+ISNULL((SELECT sum([AMTDR]) as [AMTDR] from cw_genleg_accitems as a where [YEAR]=cw_genleg_accitems.[YEAR] and [MONTH]=cw_genleg_accitems.[MONTH] and [LINKGID]=cw_genleg_accitems.[LINKGID] and [DEPTACC]=cw_genleg_accitems.[DEPTACC] and [EMPLACC]=cw_genleg_accitems.[EMPLACC] and [CORPACC]=@oldSHORTNAME and [ITEMACC]=cw_genleg_accitems.[ITEMACC] and [CURRENCY]=cw_genleg_accitems.[CURRENCY] and [STARTGID]=cw_genleg_accitems.[STARTGID] and [ACCDATE]=cw_genleg_accitems.[ACCDATE] and [CORPID]=cw_genleg_accitems.[CORPID]),0),[AMTCR]=[AMTCR]+ISNULL((SELECT sum([AMTCR]) as [AMTCR] from cw_genleg_accitems as a where [YEAR]=cw_genleg_accitems.[YEAR] and [MONTH]=cw_genleg_accitems.[MONTH] and [LINKGID]=cw_genleg_accitems.[LINKGID] and [DEPTACC]=cw_genleg_accitems.[DEPTACC] and [EMPLACC]=cw_genleg_accitems.[EMPLACC] and [CORPACC]=@oldSHORTNAME and [ITEMACC]=cw_genleg_accitems.[ITEMACC] and [CURRENCY]=cw_genleg_accitems.[CURRENCY] and [STARTGID]=cw_genleg_accitems.[STARTGID] and [ACCDATE]=cw_genleg_accitems.[ACCDATE] and [CORPID]=cw_genleg_accitems.[CORPID]),0),[AMTBLC]=[AMTBLC]+ISNULL((SELECT sum([AMTBLC]) as [AMTBLC] from cw_genleg_accitems as a where [YEAR]=cw_genleg_accitems.[YEAR] and [MONTH]=cw_genleg_accitems.[MONTH] and [LINKGID]=cw_genleg_accitems.[LINKGID] and [DEPTACC]=cw_genleg_accitems.[DEPTACC] and [EMPLACC]=cw_genleg_accitems.[EMPLACC] and [CORPACC]=@oldSHORTNAME and [ITEMACC]=cw_genleg_accitems.[ITEMACC] and [CURRENCY]=cw_genleg_accitems.[CURRENCY] and [STARTGID]=cw_genleg_accitems.[STARTGID] and [ACCDATE]=cw_genleg_accitems.[ACCDATE] and [CORPID]=cw_genleg_accitems.[CORPID]),0),[AMTLASTDR]=[AMTLASTDR]+ISNULL((SELECT sum([AMTLASTDR]) as [AMTLASTDR] from cw_genleg_accitems as a where [YEAR]=cw_genleg_accitems.[YEAR] and [MONTH]=cw_genleg_accitems.[MONTH] and [LINKGID]=cw_genleg_accitems.[LINKGID] and [DEPTACC]=cw_genleg_accitems.[DEPTACC] and [EMPLACC]=cw_genleg_accitems.[EMPLACC] and [CORPACC]=@oldSHORTNAME and [ITEMACC]=cw_genleg_accitems.[ITEMACC] and [CURRENCY]=cw_genleg_accitems.[CURRENCY] and [STARTGID]=cw_genleg_accitems.[STARTGID] and [ACCDATE]=cw_genleg_accitems.[ACCDATE] and [CORPID]=cw_genleg_accitems.[CORPID]),0),[AMTLASTCR]=[AMTLASTCR]+ISNULL((SELECT sum([AMTLASTCR]) as [AMTLASTCR] from cw_genleg_accitems as a where [YEAR]=cw_genleg_accitems.[YEAR] and [MONTH]=cw_genleg_accitems.[MONTH] and [LINKGID]=cw_genleg_accitems.[
--SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
DELETE from cw_genleg_accitems where gid in (SELECT a.gid from cw_genleg_accitems as a,(SELECT * from cw_genleg_accitems where [CORPACC] = @newSHORTNAME) as b where a.[CORPACC] = @oldSHORTNAME and a.[YEAR]=b.[YEAR] and a.[MONTH]=b.[MONTH] and a.[LINKGID]=b.[LINKGID] and a.[DEPTACC]=b.[DEPTACC] and a.[EMPLACC]=b.[EMPLACC] and a.[ITEMACC]=b.[ITEMACC] and a.[CURRENCY]=b.[CURRENCY] and a.[STARTGID]=b.[STARTGID] and a.[ACCDATE]=b.[ACCDATE] and a.[CORPID]=b.[CORPID])
--SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
UPDATE cw_genleg_accitems SET [CORPACC] = @newSHORTNAME WHERE [CORPACC] = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
--SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
-------------------------------------------------
---Begin 2014-02-24 <EFBFBD><EFBFBD><EFBFBD>Ӳִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD>--------------------
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ӧ<EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD>ֿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>
UPDATE wms SET ARCLIENT = @newSHORTNAME WHERE ARCLIENT = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> װж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/Ӧ<EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms SET TRUCKNAME = @newSHORTNAME WHERE TRUCKNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ԭ<EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms SET CLIENTNAMEOLD = @newSHORTNAME WHERE CLIENTNAMEOLD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ֿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms SET STORAGENAME = @newSHORTNAME WHERE STORAGENAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_in SET CLIENTNAME = @newSHORTNAME WHERE CLIENTNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD> <EFBFBD>ֿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_in SET STORAGENAME = @newSHORTNAME WHERE STORAGENAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD> ԭ<EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_in SET CLIENTNAMEOLD = @newSHORTNAME WHERE CLIENTNAMEOLD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_out SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD> <EFBFBD>ֿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_out SET STORAGENAME = @newSHORTNAME WHERE STORAGENAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD> װж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/Ӧ<EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_out SET TRUCKNAME = @newSHORTNAME WHERE TRUCKNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>Ȩת<EFBFBD>ƵĿͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_out SET CLIENTNAMEOLD = @newSHORTNAME WHERE CLIENTNAMEOLD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD> Ӧ<EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD>ֿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD>
UPDATE wms_out SET ARCLIENT = @newSHORTNAME WHERE ARCLIENT = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD> <EFBFBD>ֿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_storage_area SET STORAGENAME = @newSHORTNAME WHERE STORAGENAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_rate SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_rate_detail SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD>ѯʵʱ<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_wmsrate_test SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD>ѯʵʱ<EFBFBD><EFBFBD> <EFBFBD>ֿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_wmsrate_test SET STORAGENAME = @newSHORTNAME WHERE STORAGENAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_fee SET CLIENTNAME = @newSHORTNAME WHERE CLIENTNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ֿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_fee SET STORAGENAME = @newSHORTNAME WHERE STORAGENAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE Import_main SET buyer = @newSHORTNAME WHERE buyer = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE Import_Sales SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE Import_Delivery SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--185. <EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD>(wms_settlement_detail) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE wms_settlement_detail SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--185. <EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD>(wms_settlement_detail) <EFBFBD>ֿ<EFBFBD>
UPDATE wms_settlement_detail SET STORAGENAME = @newSHORTNAME WHERE STORAGENAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--188. <EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(wms_settlement_list) <EFBFBD><EFBFBD><EFBFBD>˿ͻ<EFBFBD>
UPDATE wms_settlement_detail SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
---End
---Begin 2017-01-10 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD>--------------------
--170. <EFBFBD><EFBFBD><EFBFBD>۵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>crm_quotation<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾
UPDATE crm_quotation SET CARRIER = @newSHORTNAME WHERE CARRIER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--171. <EFBFBD><EFBFBD><EFBFBD>۵<EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>crm_quotation_detail<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾
UPDATE crm_quotation SET CARRIER = @newSHORTNAME WHERE CARRIER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ί<EFBFBD>е<EFBFBD>λ
UPDATE op_seai SET [CUSTOMERNAME] = @newSHORTNAME WHERE [CUSTOMERNAME] = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>վ
UPDATE op_seai SET YARD = @newSHORTNAME WHERE YARD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾
UPDATE op_seai SET CARRIER = @newSHORTNAME WHERE CARRIER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>մ<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_seai SET FORWARDER = @newSHORTNAME WHERE FORWARDER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_seai SET CUSTOMSER = @newSHORTNAME WHERE CUSTOMSER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_seai SET TRUCKER = @newSHORTNAME WHERE TRUCKER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_seai SET AGENTID= @newSHORTNAME WHERE AGENTID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ֿ<EFBFBD>
UPDATE op_seai SET WAREHOUSE= @newSHORTNAME WHERE WAREHOUSE = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ͷ
UPDATE op_seai SET matou= @newSHORTNAME WHERE MaTou = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_seai SET SHIPAGENCY= @newSHORTNAME WHERE SHIPAGENCY = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ί<EFBFBD>е<EFBFBD>λ
UPDATE op_InternalTrade SET [CUSTOMERNAME] = @newSHORTNAME WHERE [CUSTOMERNAME] = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>վ
UPDATE op_InternalTrade SET YARD = @newSHORTNAME WHERE YARD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾
UPDATE op_InternalTrade SET CARRIER = @newSHORTNAME WHERE CARRIER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_InternalTrade SET TRUCKER = @newSHORTNAME WHERE TRUCKER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_InternalTrade SET TRUCKER2 = @newSHORTNAME WHERE TRUCKER2 = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--191. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_other <EFBFBD>ۺ<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ί<EFBFBD>е<EFBFBD>λ
UPDATE op_other SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>ۺ<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_other SET CUSTOMSER = @newSHORTNAME WHERE CUSTOMSER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>ۺ<EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ֿ<EFBFBD>
UPDATE op_other SET WAREHOUSE= @newSHORTNAME WHERE WAREHOUSE = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--194. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_sub_seaorder<EFBFBD>ֲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ձ<EFBFBD>
UPDATE op_sub_seaorder SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--208. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_seae_edi<EFBFBD><EFBFBD><EFBFBD><EFBFBD>EDI<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>վ
UPDATE op_seae_edi SET YARD = @newSHORTNAME WHERE YARD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--208. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_seae_edi<EFBFBD><EFBFBD><EFBFBD><EFBFBD>EDI<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
--UPDATE op_seae_edi SET FOWARDER = @newSHORTNAME WHERE FOWARDER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
--SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--208. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_seae_edi<EFBFBD><EFBFBD><EFBFBD><EFBFBD>EDI<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾
UPDATE op_seae_edi SET CARRIER = @newSHORTNAME WHERE CARRIER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--218. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_railway<EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ί<EFBFBD>е<EFBFBD>λ
UPDATE op_railway SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--218. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_railway<EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_railway SET CARRIER = @newSHORTNAME WHERE CARRIER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--218. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_railway<EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_railway SET CUSTOMTRANSITCORP = @newSHORTNAME where CUSTOMTRANSITCORP= @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
UPDATE op_railway SET RETURNCTNCORP = @newSHORTNAME where RETURNCTNCORP= @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
UPDATE op_railway SET RECEIVEYARD = @newSHORTNAME where RECEIVEYARD= @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--219. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_railway_bill <EFBFBD><EFBFBD>·<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>Ϣ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_railway_bill SET SHIPPERID = @newSHORTNAME WHERE SHIPPERID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--219. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_railway_bill <EFBFBD><EFBFBD>·<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>Ϣ <EFBFBD>ջ<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_railway_bill SET CONSIGNEEID = @newSHORTNAME WHERE CONSIGNEEID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--220. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_railway_bill_road <EFBFBD><EFBFBD>·<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_railway_bill_road SET CARRIER = @newSHORTNAME WHERE CARRIER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--221. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_railway_bill_train <EFBFBD><EFBFBD>·<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_railway_bill_train SET CARRIER = @newSHORTNAME WHERE CARRIER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--223. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ί<EFBFBD>е<EFBFBD>λ
UPDATE op_aire SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--223. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_aire SET SHIPPERID = @newSHORTNAME WHERE SHIPPERID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--223. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ջ<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_aire SET CONSIGNEEID = @newSHORTNAME WHERE CONSIGNEEID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--223. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ֪ͨ<EFBFBD><EFBFBD>
UPDATE op_aire SET NOTIFYPARTYID = @newSHORTNAME WHERE NOTIFYPARTYID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--223. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_aire SET AGENTID = @newSHORTNAME WHERE AGENTID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--223. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD>˾
UPDATE op_aire SET AIRLINES = @newSHORTNAME WHERE AIRLINES = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--223. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD>˾
UPDATE op_aire SET FORWARDER = @newSHORTNAME WHERE FORWARDER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--223. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_aire SET CUSTOMSER = @newSHORTNAME WHERE CUSTOMSER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--223. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_aire SET TRUCKER = @newSHORTNAME WHERE TRUCKER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--224. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_airi<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ί<EFBFBD>е<EFBFBD>λ
UPDATE op_airi SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--224. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_airi<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_airi SET SHIPPERID = @newSHORTNAME WHERE SHIPPERID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--224. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_airi<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ջ<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_airi SET CONSIGNEEID = @newSHORTNAME WHERE CONSIGNEEID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--224. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_airi<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ֪ͨ<EFBFBD><EFBFBD>
UPDATE op_airi SET NOTIFYPARTYID = @newSHORTNAME WHERE NOTIFYPARTYID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--224. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_airi<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_airi SET AGENTID = @newSHORTNAME WHERE AGENTID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--224. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_airi<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD>˾
UPDATE op_airi SET AIRLINES = @newSHORTNAME WHERE AIRLINES = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--224. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_airi<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD>˾
UPDATE op_airi SET FORWARDER = @newSHORTNAME WHERE FORWARDER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--224. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_airi<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_airi SET CUSTOMSER = @newSHORTNAME WHERE CUSTOMSER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--224. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_airi<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_airi SET TRUCKER = @newSHORTNAME WHERE TRUCKER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--225. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire_bill<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_aire_bill SET SHIPPERID = @newSHORTNAME WHERE SHIPPERID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--225. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire_bill<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ջ<EFBFBD><EFBFBD><EFBFBD>
UPDATE op_aire_bill SET CONSIGNEEID = @newSHORTNAME WHERE CONSIGNEEID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--225. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire_bill<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD> ֪ͨ<EFBFBD><EFBFBD>
UPDATE op_aire_bill SET NOTIFYPARTYID = @newSHORTNAME WHERE NOTIFYPARTYID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--225. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>op_aire_bill<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE op_aire_bill SET AGENTID = @newSHORTNAME WHERE AGENTID = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
UPDATE op_express SET EXPRESSCORP = @newSHORTNAME WHERE EXPRESSCORP = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
UPDATE op_express SET SENDERCUST = @newSHORTNAME WHERE SENDERCUST = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
UPDATE op_express SET RECEIVECUST = @newSHORTNAME WHERE RECEIVECUST = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
UPDATE op_truck_bulk SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
UPDATE op_truck_bulk SET YARD = @newSHORTNAME WHERE YARD = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
UPDATE op_truck_bulk_pc SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
UPDATE op_truck_bulk_pc SET TRUCKER = @newSHORTNAME WHERE TRUCKER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
UPDATE op_truck_bulk_pc SET YARD = @newSHORTNAME WHERE YARD= @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
---End
---Begin <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
--226. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>tMsWlBsHead <EFBFBD>ɳ<EFBFBD>ҵ<EFBFBD><EFBFBD> ί<EFBFBD>е<EFBFBD>λ
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tMsWlBsHead]') AND type in (N'U'))
UPDATE tMsWlBsHead SET CustName = @newSHORTNAME,CustCode=@newCODENAME WHERE CustName = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--227. <EFBFBD><EFBFBD><EFBFBD><EFBFBD>tMsWlBulkHead <EFBFBD>ɳ<EFBFBD>ҵ<EFBFBD><EFBFBD> ί<EFBFBD>е<EFBFBD>λ
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tMsWlBulkHead]') AND type in (N'U'))
UPDATE tMsWlBulkHead SET CustName = @newSHORTNAME,CustCode=@newCODENAME WHERE CustName = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tMsWlDjHead]') AND type in (N'U'))
UPDATE tMsWlDjHead SET CustName = @newSHORTNAME,CustCode=@newCODENAME WHERE CustName = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tMsWlDjPound]') AND type in (N'U'))
UPDATE tMsWlDjPound SET CustName = @newSHORTNAME,CustCode=@newCODENAME WHERE CustName = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tMsWlPcHead]') AND type in (N'U'))
UPDATE tMsWlPcHead SET CustName = @newSHORTNAME,CustCode=@newCODENAME WHERE CustName = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tMsWlPcHead]') AND type in (N'U'))
UPDATE tMsWlPcHead SET YardName = @newSHORTNAME,YardCode=@newCODENAME WHERE YardName = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tMsWlPcHead]') AND type in (N'U'))
UPDATE tMsWlPcHead SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tMsWlPcHead]') AND type in (N'U'))
UPDATE tMsWlPcHead SET F_CustomerName = @newSHORTNAME WHERE F_CustomerName = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tMsWlPcHead]') AND type in (N'U'))
UPDATE tMsWlPcHead SET DispatchName = @newSHORTNAME WHERE DispatchName = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
--<EFBFBD>²ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS]') AND type in (N'U'))
UPDATE OP_WMS SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD> <EFBFBD>ͻ<EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS]') AND type in (N'U'))
UPDATE OP_WMS SET GOODSOWNER = @newSHORTNAME WHERE GOODSOWNER = @oldSHORTNAME --<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS]') AND type in (N'U'))
UPDATE OP_WMS SET ARCLIENTWMSOUT = @newSHORTNAME WHERE ARCLIENTWMSOUT = @oldSHORTNAME --<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD> <EFBFBD>ִ<EFBFBD><EFBFBD>ѽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_CHECK]') AND type in (N'U'))
UPDATE OP_WMS_CHECK SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_CHECK]') AND type in (N'U'))
UPDATE OP_WMS_CHECK SET GOODSOWNER = @newSHORTNAME WHERE GOODSOWNER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_FEECALENDAR]') AND type in (N'U'))
UPDATE OP_WMS_FEECALENDAR SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_FEEDUI_CUST_DETAIL]') AND type in (N'U'))
UPDATE OP_WMS_FEEDUI_CUST_DETAIL SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_FEEDUI_STORAGE]') AND type in (N'U'))
UPDATE OP_WMS_FEEDUI_STORAGE SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_FEEDUI_STORAGE_DETAIL]') AND type in (N'U'))
UPDATE OP_WMS_FEEDUI_STORAGE_DETAIL SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_FEERATE]') AND type in (N'U'))
UPDATE OP_WMS_FEERATE SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_IN_DO]') AND type in (N'U'))
UPDATE OP_WMS_IN_DO SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_IN_DO]') AND type in (N'U'))
UPDATE OP_WMS_IN_DO SET GOODSOWNER = @newSHORTNAME WHERE GOODSOWNER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_IN_DO]') AND type in (N'U'))
UPDATE OP_WMS_IN_DO SET ARCLIENTWMSOUT = @newSHORTNAME WHERE ARCLIENTWMSOUT = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_IN_PLAN]') AND type in (N'U'))
UPDATE OP_WMS_IN_PLAN SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_IN_PLAN]') AND type in (N'U'))
UPDATE OP_WMS_IN_PLAN SET GOODSOWNER = @newSHORTNAME WHERE GOODSOWNER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_IN_PLAN]') AND type in (N'U'))
UPDATE OP_WMS_IN_PLAN SET ARCLIENTWMSOUT = @newSHORTNAME WHERE ARCLIENTWMSOUT = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_MOVE]') AND type in (N'U'))
UPDATE OP_WMS_MOVE SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_OUT_PLAN]') AND type in (N'U'))
UPDATE OP_WMS_OUT_PLAN SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_OUT_PLAN]') AND type in (N'U'))
UPDATE OP_WMS_OUT_PLAN SET GOODSOWNER = @newSHORTNAME WHERE GOODSOWNER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_OUT_PLAN]') AND type in (N'U'))
UPDATE OP_WMS_OUT_PLAN SET PICKUPNAME = @newSHORTNAME WHERE PICKUPNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_OUT_DO]') AND type in (N'U'))
UPDATE OP_WMS_OUT_DO SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_OUT_DO]') AND type in (N'U'))
UPDATE OP_WMS_OUT_DO SET PICKUPNAME = @newSHORTNAME WHERE PICKUPNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_TRANSFERGOODS]') AND type in (N'U'))
UPDATE OP_WMS_TRANSFERGOODS SET OLDCUSTOMERNAME = @newSHORTNAME WHERE OLDCUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_TRANSFERGOODS]') AND type in (N'U'))
UPDATE OP_WMS_TRANSFERGOODS SET NEWCUSTOMERNAME = @newSHORTNAME WHERE NEWCUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_TRANSFERGOODS]') AND type in (N'U'))
UPDATE OP_WMS_TRANSFERGOODS SET OLD_GOODSOWNER = @newSHORTNAME WHERE OLD_GOODSOWNER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_TRANSFERGOODS]') AND type in (N'U'))
UPDATE OP_WMS_TRANSFERGOODS SET NEW_GOODSOWNER = @newSHORTNAME WHERE NEW_GOODSOWNER = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_TRANSFERGOODS]') AND type in (N'U'))
UPDATE OP_WMS_TRANSFERGOODS SET ARCLIENTWMSOUT = @newSHORTNAME WHERE ARCLIENTWMSOUT = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OP_WMS_WEIGH]') AND type in (N'U'))
UPDATE OP_WMS_WEIGH SET CUSTOMERNAME = @newSHORTNAME WHERE CUSTOMERNAME = @oldSHORTNAME --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SET @errorSun=@errorSun+@@ERROR --<EFBFBD>ۼ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>д<EFBFBD>
insert into sys_log(GID,NAME,LOGTYPE,LOGTIME,LOGCONTENT,CREATEUSER)
values(NEWID(),newid(),'<EFBFBD>ϲ<EFBFBD><EFBFBD>ͻ<EFBFBD>',GETDATE(),@oldSHORTNAME+'<EFBFBD>滻Ϊ'+@newSHORTNAME,@strUserName)
---End
IF @errorSun<>0
BEGIN
ROLLBACK TRANSACTION--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
return 0
END
ELSE
BEGIN
COMMIT TRANSACTION--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
return 1
END
set nocount off
END
GO
ALTER VIEW [dbo].[VW_OP_WMS_IN_PLAN] AS select [WMSPLANID]
,[WMSNO]
,[MBLNO]
,[CONTRACTNO]
,[BILLTYPE]
,[PLANTIME]
,[ACCDATE]
,[CUSTOMERNAME]
,[CORPID]
,[KGS]
,[PKGS]
,[CBM]
,[GOODSNAME]
,[KINDPKGS]
,[STORAGEUNIT]
,[STORAGEUNITCOUNT]
,[RULEUNIT]
,[RULEUNITCOUNT]
,[REMARK]
,[BSSOURCE]
,[Creator]
,[CreateID]
,[CreateDate]
,[FEESTATUS]
,[BSSTATUS]
,[TIMEMARK]
,[ModifyDate]
,[ModifyID]
,[Modifier]
,[ISEND]
,[MASTERBSNO]
,[NETWEIGHT]
,[CUSTOMNO]
,[ETA]
,[CTNNUM]
,[JINJINGBEIANSHENBAORIQI]
,[JINGNEISHOUHUOREN]
,[INSPECTION_NO]
,[PLAN_GETTIME]
,[CUSTOMAMOUNT]
,(select top 1 GOODSFEETYPE from code_goods where GOODNAME=GOODSNAME)GOODSFEETYPE
,GOODSOWNER
,BILLSTATUS,ARCLIENTWMSOUT,APCLIENTWMSOUT,COUNTRY,ISRULECHECK
FROM [OP_WMS_IN_PLAN]
GO
ALTER VIEW [dbo].[VW_OP_WMS_IN_DO] AS select D.[BSNO]
,[WMSDOID]
,[WMS_PLAN_BSNO]
,[BILLTYPE]
,[CUSTOMERNAME]
,[MATERIALNO]
,[GOODSCODE]
,[GOODSNAME]
,[GOODSHSCODE]
,[MBLNO]
,[PAYEDTAXES]
,[BSSTATUS]
,[CreateDate]
,[Creator]
,[CreateID]
,[REMARK]
,[FEESTATUS]
,[BILLSTATUS]
,[DODATE]
,[CORPID]
,[CUSTOMNO]
,[GOODSOWNER]
,[TRUCKNO],dbo.F_INDODETAIL_CNTRNO(d.WMSDOID) CNTRNO,(select top 1 GOODSFEETYPE from code_goods where GOODNAME=GOODSNAME)GOODSFEETYPE,ARCLIENTWMSOUT,APCLIENTWMSOUT,
(select count(CNTRNO) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid) CTNNUM,
isnull((select sum(KGS) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) KGS,
isnull((select sum(NETWEIGHT) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) NETWEIGHT,
isnull((select sum(CBM) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) CBM,
isnull((select sum(PKGS) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) PKGS,
(select top 1 KINDPKGS from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid) KINDPKGS,
(select top 1 STORAGEUNIT from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid) STORAGEUNIT,
(select top 1 RULEUNIT from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid) RULEUNIT,
isnull((select sum(STORAGEUNITCOUNT) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) STORAGEUNITCOUNT,
isnull((select sum(RULEUNITCOUNT) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) RULEUNITCOUNT
from OP_WMS_IN_DO D
GO
ALTER VIEW [dbo].[VW_OP_WMS_IN_DO_ACCEPT] AS select D.[BSNO]
,[WMSDOID]
,[WMS_PLAN_BSNO]
,[BILLTYPE]
,[CUSTOMERNAME]
,[GOODSOWNER]
,[ARCLIENTWMSOUT]
,[APCLIENTWMSOUT]
,[MATERIALNO]
,[GOODSCODE]
,[GOODSNAME]
,[GOODSHSCODE]
,[MBLNO]
,[PAYEDTAXES]
,[BSSTATUS]
,[CreateDate]
,[Creator]
,[CreateID]
,[REMARK]
,[FEESTATUS]
,[BILLSTATUS]
,[DODATE]
,[CORPID]
,[CUSTOMNO]
,dbo.F_INDODETAIL_CNTRNO(d.WMSDOID) CNTRNO,(select top 1 GOODSFEETYPE from code_goods where GOODNAME=GOODSNAME)GOODSFEETYPE,
(select count(CNTRNO) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid) CTNNUM,
isnull((select sum(KGS) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) KGS,
isnull((select sum(NETWEIGHT) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) NETWEIGHT,
isnull((select sum(CBM) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) CBM,
isnull((select sum(PKGS) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) PKGS,
(select top 1 KINDPKGS from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid) KINDPKGS,
(select top 1 STORAGEUNIT from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid) STORAGEUNIT,
(select top 1 RULEUNIT from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid) RULEUNIT,
isnull((select sum(STORAGEUNITCOUNT) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) STORAGEUNITCOUNT,
isnull((select sum(RULEUNITCOUNT) from OP_WMS_IN_DO_GOODS where WMSDOID=d.wmsdoid),0) RULEUNITCOUNT
from OP_WMS_IN_DO D
GO
ALTER VIEW [dbo].[v_op_bs]
as
SELECT BSNO,MASTERNO, 'op_seae' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME, CUSTNO,ORDERNO,MBLNO, HBLNO,dbo.trimtime(ETD) ETD,dbo.trimtime(ETA) ETA
,dbo.trimdate(STLDATE) STLDATE, STLNAME, VESSEL, VOYNO, INPUTBY,BLTYPE,
CREATETIME, BSSTATUS, SALE , OP , DOC, CUSTSERVICE, PORTLOAD, PORTDISCHARGE,CUSTOMNO,
ACCDATE,CARRIER, BSSOURCE,BSSOURCEDETAIL, LANE, FORWARDER, 0 AS NETWEIGHT, KGS,CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN TEU ELSE 0 END TEU, CNTRTOTAL,
CORPID,CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR1 ELSE 0 END CNTR1,CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR2 ELSE 0 END CNTR2,
CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR3 ELSE 0 END CNTR3, CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR4 ELSE 0 END CNTR4,
CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR5 ELSE 0 END CNTR5,CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR6 ELSE 0 END CNTR6,
CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR7 ELSE 0 END CNTR7, CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR8 ELSE 0 END CNTR8,
CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR9 ELSE 0 END CNTR9,CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR10 ELSE 0 END CNTR10,
CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN OTCNTR ELSE 0 END OTCNTR, '' AS TRADETYPE, GOODSNAME,
FEESTATUS,ETD AS OPDATE,CUSTOMDATE,'' ENTERP,PKGS,CBM,BLFRT,SALEDEPT,CUSTOMSNUM,INVNO,'' BSCUSTOMNO,
INSPECTIONDATE,INSPECTIONNO,CONTRACTNO,''BOOKNO,AGENTID,ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,OPERATOR,SERVICECONTRACTNO,ISCANCEL
,APPLYNO,ISSUETYPE,BLISSUESTATUS,REMARK,TRADETERM,PLACERECEIPT,DESTINATION,CNTRSEALNO,BillFeeStatus,ISVOU,VOUNO,DESTINATIONID,SALECORPID,YARD,DELIVERYDATE,FRCUSTSERVICE,SERVICE,OPERATORFAX REMARK2,BILLFEESTATUSTIME,TRUCKER,CUSTOMSER,CLOSINGDATE,KINDPKGS,CARGOID,DCLASS
FROM dbo.op_seae WITH (NOLOCK)
UNION ALL
SELECT BSNO,MASTERNO, 'op_seai' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>' AS BSTYPE,CUSTOMERNAME, CUSTNO,ORDERNO,MBLNO, HBLNO,dbo.trimtime(ETD) ETD,dbo.trimtime(ETA) ETA
,dbo.trimdate(STLDATE) STLDATE,STLNAME STLNAME, VESSEL, VOYNO, INPUTBY,BLTYPE,
CREATETIME, BSSTATUS, SALE ,OP , DOC, CUSTSERVICE, PORTLOAD, PORTDISCHARGE, CUSTOMNO,ACCDATE,
CARRIER, BSSOURCE,BSSOURCEDETAIL, LANE, FORWARDER, NETWEIGHT, KGS,CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN TEU ELSE 0 END TEU, CNTRTOTAL,
CORPID,CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR1 ELSE 0 END CNTR1,CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR2 ELSE 0 END CNTR2,
CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR3 ELSE 0 END CNTR3, CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR4 ELSE 0 END CNTR4,
CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR5 ELSE 0 END CNTR5,CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR6 ELSE 0 END CNTR6,
CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR7 ELSE 0 END CNTR7, CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR8 ELSE 0 END CNTR8,
CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR9 ELSE 0 END CNTR9,CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN CNTR10 ELSE 0 END CNTR10,
CASE WHEN (BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' OR BLTYPE='ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') THEN OTCNTR ELSE 0 END OTCNTR, TRADETYPE, GOODSNAME,
FEESTATUS,ETD AS OPDATE,CUSTOMDATE,ENTERP,PKGS,CBM,BLFRT,SALEDEPT,CUSTOMSNUM,INVNO,'' BSCUSTOMNO,
INSPECTIONDATE,INSPECTIONNO,CONTRACTNO,''BOOKNO,AGENTID,ISPRINTPR,NUMBERPLATE,0 FEEKGS,OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,APPLYNO,ISSUETYPE,BLISSUESTATUS,REMARK,TRADETERM,PLACERECEIPT,DESTINATION,CNTRSEALNO,BillFeeStatus,ISVOU,VOUNO,DESTINATIONID,SALECORPID,YARD,TIHUOTIME DELIVERYDATE,FRCUSTSERVICE,SERVICE,REMARK2,BILLFEESTATUSTIME,TRUCKER,CUSTOMSER,null CLOSINGDATE,KINDPKGS,CARGOID,DCLASS
FROM dbo.op_seai WITH (NOLOCK)
UNION ALL
SELECT BSNO,MASTERNO, 'op_aire' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME, CUSTNO,ORDERNO,MBLNO, HBLNO,dbo.trimtime(ETD) ETD,dbo.trimtime(ETA) ETA
,dbo.trimdate(STLDATE) STLDATE,STLNAME STLNAME, VESSEL,'' VOYNO, INPUTBY,BLTYPE,
CREATETIME, BSSTATUS, SALE , OP ,'' DOC, CUSTSERVICE, PORTLOAD, PORTDISCHARGE, CUSTOMNO,
ACCDATE,AIRLINES CARRIER, BSSOURCE,BSSOURCEDETAIL,LANE, FORWARDER, FEEKGS AS NETWEIGHT, KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE, GOODSNAME,
FEESTATUS,ETD AS OPDATE,CUSTOMDATE,'' ENTERP,PKGS,CBM ,BLFRT,SALEDEPT,CUSTOMSNUM,INVNO,'' BSCUSTOMNO,
INSPECTIONDATE,INSPECTIONNO,CONTRACTNO,'' BOOKNO,AGENTID,ISPRINTPR,'' as NUMBERPLATE,FEEKGS,OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,BillFeeStatus,ISVOU,VOUNO,PORTDISCHARGE DESTINATIONID,SALECORPID,'' YARD,DELIVERYDATE,FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,TRUCKER,CUSTOMSER,null CLOSINGDATE,KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.op_aire WITH (NOLOCK)
UNION ALL
SELECT BSNO, MASTERNO,'op_airi' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME, CUSTNO,ORDERNO,MBLNO, HBLNO,dbo.trimtime(ETA) ETD,dbo.trimtime(ETA) ETA
,dbo.trimdate(STLDATE) STLDATE,STLNAME STLNAME, VESSEL,'' VOYNO, INPUTBY,BLTYPE,
CREATETIME, BSSTATUS, SALE ,OP ,'' DOC, CUSTSERVICE, PORTLOAD, PORTDISCHARGE,CUSTOMNO,
ACCDATE,AIRLINES CARRIER, BSSOURCE,BSSOURCEDETAIL,LANE, FORWARDER, FEEKGS AS NETWEIGHT, KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE, GOODSNAME,
FEESTATUS,ETA AS OPDATE,CUSTOMDATE,'' ENTERP,PKGS,CBM,BLFRT,SALEDEPT,CUSTOMSNUM,INVNO,'' BSCUSTOMNO,
INSPECTIONDATE,INSPECTIONNO,CONTRACTNO,'' BOOKNO,AGENTID,ISPRINTPR,'' as NUMBERPLATE,FEEKGS,OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,BillFeeStatus,ISVOU,VOUNO,PORTDISCHARGE DESTINATIONID,SALECORPID ,'' YARD,DELIVERYDATE,FRCUSTSERVICE,SERVICE,'' REMARK2,BILLFEESTATUSTIME,TRUCKER,CUSTOMSER,null CLOSINGDATE,KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.op_airi WITH (NOLOCK)
UNION ALL
SELECT BSNO, MASTERNO,'op_apply' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>' AS OPLBNAME,(select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=96004 and EnumValueID=OP_APPLY.BsType) as BSTYPE,CUSTOMERNAME, CUSTNO,'' ORDERNO, MBLNO, HBLNO, CUSTOMDATE as ETD,'' ETA
,'' STLDATE,'' STLNAME, VESSEL, VOYNO, INPUTBY,CUSTOMTYPE BLTYPE,
BSDATE AS CREATETIME, BSSTATUS, SALE, OP, OP AS DOC,'' AS CUSTSERVICE, PORTLOAD, PORTDISCHARGE, CUSTOMNO,
ACCDATE,'' CARRIER, BSSOURCE,BSSOURCEDETAIL,'' LANE,'' FORWARDER, NETWEIGHT, KGS,TEU,'' CNTRTOTAL,
CORPID,CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,OPDATE,CUSTOMDATE,ENTERP,PKGS,CBM,'' BLFRT,SALEDEPT,CUSTOMSNUM,INVNO,BSCUSTOMNO,
INSPECTIONDATE,INSPECTIONNO,CONTRACTNO,BOOKNO,'' AGENTID,ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,BillFeeStatus,ISVOU,VOUNO,PORTDISCHARGE DESTINATIONID,SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,'' TRUCKER,CUSTOMSER,null CLOSINGDATE,KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.op_apply WITH (NOLOCK)
UNION ALL
SELECT BSNO, BSNO MASTERNO,'op_other' AS OPLB, '<EFBFBD>ۺ<EFBFBD>ҵ<EFBFBD><EFBFBD>' AS OPLBNAME,TRANSTYPE as BSTYPE,CUSTOMERNAME, CUSTNO,ORDERNO, MBLNO, HBLNO, ETD,'' ETA
,dbo.trimdate(STLDATE) STLDATE,STLNAME STLNAME, VESSEL, VOYNO,OP AS INPUTBY,'' BLTYPE,
BSDATE AS CREATETIME, BSSTATUS, SALE, OP, OP AS DOC,'' AS CUSTSERVICE, PORTLOAD, PORTDISCHARGE,'' CUSTOMNO,
ACCDATE,'' CARRIER, BSSOURCE,BSSOURCEDETAIL,'' LANE,'' FORWARDER, NETWEIGHT, KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,ETD AS OPDATE,'' CUSTOMDATE,ENTERP,PKGS,CBM,'' BLFRT,SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,CONTRACTNO,BOOKNO,'' AGENTID,ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,BillFeeStatus ,ISVOU,VOUNO,PORTDISCHARGE DESTINATIONID,SALECORPID,'' YARD,'' DELIVERYDATE,FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,'' TRUCKER,CUSTOMSER,null CLOSINGDATE,KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.op_other WITH (NOLOCK)
UNION ALL
SELECT BSNO,BSNO MASTERNO, 'op_bulk' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɢ<EFBFBD><EFBFBD>' AS OPLBNAME,TRANSTYPE as BSTYPE,CUSTOMERNAME, CUSTNO,ORDERNO,'' MBLNO,'' HBLNO,dbo.trimtime(ETD) ETD,dbo.trimtime(ETA) ETA
,dbo.trimdate(STLDATE) STLDATE,STLNAME STLNAME,'' VESSEL,'' VOYNO,OP AS INPUTBY,'' BLTYPE,
BSDATE AS CREATETIME, BSSTATUS, SALE, OP, OP AS DOC,'' AS CUSTSERVICE, PORTLOAD, PORTDISCHARGE,'' CUSTOMNO,
ACCDATE,'' CARRIER, BSSOURCE,BSSOURCEDETAIL,'' LANE,'' FORWARDER, 0 AS NETWEIGHT, KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,ETD AS OPDATE,'' CUSTOMDATE,'' ENTERP,PKGS,CBM,'' BLFRT,SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,'' CONTRACTNO,'' BOOKNO,'' AGENTID,ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO ,BillFeeStatus ,ISVOU,VOUNO,'' DESTINATIONID,'' SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.op_bulk WITH (NOLOCK)
UNION ALL
SELECT ContractNo AS BSNO, ContractNo MASTERNO,'import_main' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD>' AS BSTYPE, buyer AS CUSTOMERNAME, HTH AS CUSTNO,Supplier_Billno+' '+Other_Billno ORDERNO, billno as MblNo, M.ContainerNo AS HBLNO, dbo.trimdate(Arrivaldate) AS ETD,dbo.trimtime(M.ArrivalDate) ETA
,'' STLDATE,'' STLNAME, VESSEL,voyage as VOYNO, (select showname from [user] where codename=creator) AS INPUTBY,'' BLTYPE,
CREATTIME as CREATETIME,isnull(BSSTATUS,0) AS BSSTATUS, (select showname from [user] where codename=creator) AS SALE, OP AS OP, op AS DOC, '' AS CUSTSERVICE,'' AS PORTLOAD, (select EnumValueName from tSysEnumValue where LangId=0 and EnumTypeID=10 and EnumValueID=M.port) AS PORTDISCHARGE, '' AS CUSTOMNO,
case when isnull(ACCDATE,'')='' then '' else dbo.trimdate(ACCDATE) end ACCDATE ,
'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,'' LANE,'' FORWARDER, 0 AS NETWEIGHT,0 KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
isnull(FEESTATUS,0) FEESTATUS,Arrivaldate AS OPDATE,'' CUSTOMDATE,'' ENTERP,0 PKGS,0 CBM,'' BLFRT,'' SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,CONTRACTNO,'' BOOKNO,'' AGENTID,'' ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,'',ISVOU,'' VOUNO ,'' DESTINATIONID,M.company SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,null BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.import_main M WITH (NOLOCK)
UNION ALL
SELECT BSNO,MASTERNO, 'op_railway' AS OPLB, '<EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD><EFBFBD>·<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' as BSTYPE,CUSTOMERNAME, CUSTNO,ORDERNO,MBLNO,HBLNO,SETOUTDATE ETD,'' ETA
,dbo.trimdate(STLDATE) STLDATE,STLNAME STLNAME,'' VESSEL,'' VOYNO,OP AS INPUTBY,'' BLTYPE,
BSDATE AS CREATETIME, BSSTATUS, SALE, OP,'' DOC,CUSTSERVICE, PLACELOAD,DESTINATIONENAME AS PORTDISCHARGE,'' CUSTOMNO,
ACCDATE,'' CARRIER, BSSOURCE,BSSOURCEDETAIL,'' LANE,'' FORWARDER, 0 AS NETWEIGHT, KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,SETOUTDATE AS OPDATE,'' CUSTOMDATE,'' ENTERP,PKGS,CBM,'' BLFRT,SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,'' CONTRACTNO,'' BOOKNO ,'' AGENTID,ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,PLACERECEIPT,DESTINATION,'' CNTRSEALNO ,BillFeeStatus,ISVOU,VOUNO,DESTINATIONENAME DESTINATIONID,'' SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.op_railway WITH (NOLOCK)
UNION ALL
SELECT GId BSNO,GId MASTERNO, 'tMsWlPcHead' AS OPLB, '½<EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD><EFBFBD><EFBFBD>' AS OPLBNAME,'½<EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD><EFBFBD><EFBFBD>' as BSTYPE,CUSTOMERNAME,Billno CUSTNO,'' ORDERNO,MBLNO MBLNO,'' HBLNO,dbo.trimdate(ExpDate) ETD,dbo.trimdate(RtnDocTime) ETA
,'' STLDATE,'' STLNAME,TruckNo VESSEL,(select top 1 DrvName from tMsWlDriver where DrvCode=dbo.tMsWlPcHead.DrvCode) VOYNO,(select top 1 showname from [user] where CODENAME=DdCode) INPUTBY, BLTYPE,
'' CREATETIME,BillStatus BSSTATUS,SalesName SALE,case isnull(UserName,'') when '' then (select top 1 showname from [user] where CODENAME=DdCode) else UserName end OP,'' DOC,'' CUSTSERVICE,LoadPlace PLACELOAD,DstArea PORTDISCHARGE,'' CUSTOMNO,
case when dbo.trimdate(ExpDate)<>'' then LEFT(dbo.trimdate(ExpDate),7) else '' end ACCDATE ,'' CARRIER,'' BSSOURCE,'' BSSOURCEDETAIL,'' LANE,'' FORWARDER, 0 AS NETWEIGHT,0 KGS,0 TEU,
(select top 1 Ctn from code_ctn where CtnId=dbo.tMsWlPcHead.ContainerType)+'*'+convert(varchar(20),dbo.tMsWlPcHead.ContainerQty) CNTRTOTAL,
(select top 1 GID from company where codename=dbo.tMsWlPcHead.orgcode) CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,dbo.trimdate(ExpDate) OPDATE,'' CUSTOMDATE,'' ENTERP,0 PKGS,0 CBM,'' BLFRT,'' SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,'' CONTRACTNO,'' BOOKNO,'' AGENTID,ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,RtnDocStatus BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO ,BillFeeStatus ,ISVOU,VOUNO,DstArea DESTINATIONID,'' SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.tMsWlPcHead WITH (NOLOCK)
UNION ALL
SELECT F_NO AS BSNO,F_NO MASTERNO, 'import_finance' AS OPLB, 'ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' AS OPLBNAME,'ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMER AS CUSTOMERNAME, F_NO AS CUSTNO,f.HTH ORDERNO, F.Billno MblNo,'' HBLNO, STARTDATE AS ETD,'' ETA
,'' STLDATE,'' STLNAME,'' VESSEL,'' VOYNO, (select showname from [user] where gid=M.OP) AS INPUTBY,'' BLTYPE,
ENTERDATE as CREATETIME, 0 BSSTATUS, '' AS SALE, (select showname from [user] where gid=M.OP) AS OP, '' DOC, '' AS CUSTSERVICE,'' AS PORTLOAD, '' AS PORTDISCHARGE, '' AS CUSTOMNO,
case when isnull(STARTDATE,'')='' then '' else dbo.trimdate(STARTDATE) end ACCDATE ,
'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,'' LANE,'' FORWARDER, 0 AS NETWEIGHT,0 KGS,0 TEU,'' CNTRTOTAL,
'' CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
0 FEESTATUS,STARTDATE AS OPDATE,'' CUSTOMDATE,'' ENTERP,0 PKGS,0 CBM,'' BLFRT,'' SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,CONTRACTNO,'' BOOKNO,'' AGENTID,'' ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,'' REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO ,'' ,M.ISVOU,'' VOUNO ,'' DESTINATIONID,'' SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,null BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.IMPORT_FINANCE M WITH (NOLOCK)
left join [dbo].[Import_main] f on (f.ContractNo=M.MAINNO)
UNION ALL
SELECT ASSOCIATEDNO AS BSNO,ASSOCIATEDNO MASTERNO, 'WMS' AS OPLB, '<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME, WMSNO AS CUSTNO,WMSNO ORDERNO, BLNO MblNo,'' HBLNO, WMSDATE AS ETD,'' ETA
,'' STLDATE,'' STLNAME,'' VESSEL,'' VOYNO,(select top 1 showname from [user] where gid= createuser) AS INPUTBY,'' BLTYPE,
CREATETIME as CREATETIME, 0 BSSTATUS, '' AS SALE, (select top 1 showname from [user] where gid=MODIFIEDUSER) AS OP, '' DOC, '' AS CUSTSERVICE,'' AS PORTLOAD, '' AS PORTDISCHARGE, '' AS CUSTOMNO,
case when isnull(WMSDATE,'')='' then '' else dbo.trimdate(WMSDATE) end ACCDATE ,
'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,'' LANE,'' FORWARDER, 0 AS NETWEIGHT,0 KGS,0 TEU,'' CNTRTOTAL,
'' CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,WMSDATE AS OPDATE,'' CUSTOMDATE,'' ENTERP,0 PKGS,0 CBM,'' BLFRT,'' SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,CONTRACTNO,'' BOOKNO,'' AGENTID,'' ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,'' REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO ,BillFeeStatus,ISVOU,VOUNO ,'' DESTINATIONID,'' SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.WMS WITH (NOLOCK) where ASSOCIATEDNO=gid
UNION ALL
SELECT GID AS BSNO, GID MASTERNO,'WMS_IN' AS OPLB, '<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME, WMSNO AS CUSTNO,WMSNO ORDERNO, BLNO MblNo,'' HBLNO, WMSDATE AS ETD,'' ETA
,'' STLDATE,'' STLNAME,'' VESSEL,'' VOYNO,WMSOP AS INPUTBY,'' BLTYPE,
CREATETIME as CREATETIME, 0 BSSTATUS, '' AS SALE, (select top 1 showname from [user] where gid=WMS.MODIFIEDUSER) AS OP, '' DOC, '' AS CUSTSERVICE,'' AS PORTLOAD, '' AS PORTDISCHARGE, CUSTOMNO, ACCDATE ,
'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,'' LANE,'' FORWARDER, 0 AS NETWEIGHT,0 KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,GOODSNAME,
FEESTATUS,WMSDATE AS OPDATE,'' CUSTOMDATE,'' ENTERP,0 PKGS,0 CBM,'' BLFRT,'' SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,CONTRACTNO,'' BOOKNO,'' AGENTID,'' ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO ,BillFeeStatus,ISVOU,VOUNO,'' DESTINATIONID,'' SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.WMS WITH (NOLOCK) where ASSOCIATEDNO<>gid
UNION ALL
SELECT GID AS BSNO,GID MASTERNO, 'WMS_OUT' AS OPLB, '<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME, BSNO AS CUSTNO,BSNO as ORDERNO, ISNULL(
(select top 1 BLNO from wms where gid = (select top 1 inbsno from wms_out_detail where outbsno = wms_out.bsno)),
(select top 1 BLNO from wms where gid = (select top 1 ASSOCIATEDNO from wms_in where gid = (select top 1 inbsno from wms_out_detail where outbsno = wms_out.bsno)))) MblNo,'' HBLNO, DODATE AS ETD,'' ETA
,'' STLDATE,'' STLNAME,'' VESSEL,'' VOYNO,WMSOP AS INPUTBY,'' BLTYPE,
CREATETIME as CREATETIME, 0 BSSTATUS, '' AS SALE, (select top 1 showname from [user] where gid=wms_out.MODIFIEDUSER) AS OP, '' DOC, '' AS CUSTSERVICE,'' AS PORTLOAD, '' AS PORTDISCHARGE, CUSTOMNO, ACCDATE ,
'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,'' LANE,'' FORWARDER, 0 AS NETWEIGHT,0 KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,GOODSNAME,
FEESTATUS,DODATE AS OPDATE,'' CUSTOMDATE,'' ENTERP,0 PKGS,0 CBM,'' BLFRT,'' SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,'' CONTRACTNO,'' BOOKNO,'' AGENTID,'' ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO ,BillFeeStatus ,ISVOU,VOUNO ,'' DESTINATIONID,'' SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.wms_out WITH (NOLOCK)
UNION ALL
SELECT b.BSNO,b.BSNO MASTERNO, 'op_airn' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME, CUSTNO,ORDERNO,MBLNO, HBLNO,dbo.trimtime(ETD) ETD,dbo.trimtime(ETA) ETA
,dbo.trimdate(STLDATE) STLDATE,STLNAME STLNAME, VESSEL,'' VOYNO, INPUTBY,BLTYPE,
CREATETIME, BSSTATUS, SALE , OP ,'' DOC, CUSTSERVICE, PORTLOAD, PORTDISCHARGE, '' AS CUSTOMNO,
ACCDATE,AIRLINES CARRIER, BSSOURCE,BSSOURCEDETAIL,'' LANE, FORWARDER
,(case b.BLTYPE when '<EFBFBD><EFBFBD><EFBFBD>ڷֵ<EFBFBD>' then c.[WEIGHT] else d.[WEIGHT] end) AS NETWEIGHT
,(case b.BLTYPE when '<EFBFBD><EFBFBD><EFBFBD>ڷֵ<EFBFBD>' then c.[WEIGHT] else d.[WEIGHT] end) KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE
,c.CARGONAME GOODSNAME,
FEESTATUS,ETD AS OPDATE,'' AS CUSTOMDATE,'' ENTERP
,(case b.BLTYPE when '<EFBFBD><EFBFBD><EFBFBD>ڷֵ<EFBFBD>' then c.BOXCOUNT else d.BOXCOUNT end) PKGS
,(case b.BLTYPE when '<EFBFBD><EFBFBD><EFBFBD>ڷֵ<EFBFBD>' then c.CBM else d.CBM end) CBM
,BLFRT,SALEDEPT,CUSTOMSNUM,INVNO,'' BSCUSTOMNO,
INSPECTIONDATE,INSPECTIONNO,CONTRACTNO,'' BOOKNO,AGENTID,ISPRINTPR,'' as NUMBERPLATE
,(case b.BLTYPE when '<EFBFBD><EFBFBD><EFBFBD>ڷֵ<EFBFBD>' then c.[WEIGHT] else d.[WEIGHT] end) FEEKGS,OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO ,BillFeeStatus ,ISVOU,VOUNO,PORTDISCHARGE DESTINATIONID,'' SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,TRUCKER,CUSTOMSER,null CLOSINGDATE,KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.op_airn b WITH (NOLOCK)
left join OP_AIRN_CARGO C on b.BLTYPE='<EFBFBD><EFBFBD><EFBFBD>ڷֵ<EFBFBD>' and c.bsno = B.bsno
left join OP_AIRN_CARGO D on b.BLTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' and c.bsno =(select top 1 bsno from OP_AIRN where HBLNO=b.HBLNO and BLTYPE='<EFBFBD><EFBFBD><EFBFBD>ڷֵ<EFBFBD>')
UNION ALL
SELECT BSNO, BSNO MASTERNO,'op_truck_bulk' AS OPLB, CASE WHEN TRANSTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' THEN '½<EFBFBD><EFBFBD><EFBFBD>ջ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' ELSE '½<EFBFBD>˼<EFBFBD><EFBFBD>˶<EFBFBD><EFBFBD><EFBFBD>' END AS OPLBNAME,CASE WHEN TRANSTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' THEN '½<EFBFBD><EFBFBD><EFBFBD>ջ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' ELSE '½<EFBFBD>˼<EFBFBD><EFBFBD>˶<EFBFBD><EFBFBD><EFBFBD>' END as BSTYPE,CUSTOMERNAME, CUSTNO,ORDERNO,ORDERNO MBLNO,ORDERNO HBLNO, ETD,ETA
,STLDATE,STLNAME,'' VESSEL,'' VOYNO,OP AS INPUTBY,'' BLTYPE,
CREATETIME, BSSTATUS, SALE, OP, DDOP AS DOC,CUSTSERVICE, PORTLOAD, PORTDISCHARGE,'' CUSTOMNO,
ACCDATE,'' CARRIER, BSSOURCE,BSSOURCEDETAIL,'' LANE,'' FORWARDER, NETWEIGHT, KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,GOODSNAME,
FEESTATUS,ETD AS OPDATE,'' CUSTOMDATE,'' ENTERP,PKGS,CBM,'' BLFRT,'' SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,CONTRACTNO,'' BOOKNO,'' AGENTID,ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,BillFeeStatus ,ISVOU,VOUNO,PORTDISCHARGE DESTINATIONID,SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.op_truck_bulk WITH (NOLOCK)
UNION ALL
SELECT BSNO,BSNO MASTERNO, 'op_truck_bulk_pc' AS OPLB, CASE WHEN TRANSTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' THEN '½<EFBFBD><EFBFBD><EFBFBD>ջ<EFBFBD><EFBFBD>ɳ<EFBFBD>' ELSE '½<EFBFBD>˼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD>' END AS OPLBNAME,CASE WHEN TRANSTYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' THEN '½<EFBFBD><EFBFBD><EFBFBD>ջ<EFBFBD><EFBFBD>ɳ<EFBFBD>' ELSE '½<EFBFBD>˼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD>' END as BSTYPE,CUSTOMERNAME, CUSTNO,'' ORDERNO,'' MBLNO,'' HBLNO, ETD,ETA
,STLDATE,STLNAME,'' VESSEL,'' VOYNO,OP AS INPUTBY,'' BLTYPE,
CREATETIME, BSSTATUS,'' SALE, OP, DDOP AS DOC,'' CUSTSERVICE, PORTLOAD, PORTDISCHARGE,'' CUSTOMNO,
ACCDATE,'' CARRIER, BSSOURCE,BSSOURCEDETAIL,'' LANE,'' FORWARDER, NETWEIGHT, KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,ETD AS OPDATE,'' CUSTOMDATE,'' ENTERP,PKGS,CBM,'' BLFRT,'' SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,CONTRACTNO,'' BOOKNO,'' AGENTID,ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,BillFeeStatus ,ISVOU,VOUNO,PORTDISCHARGE DESTINATIONID,SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.op_truck_bulk_pc WITH (NOLOCK)
UNION ALL
SELECT BSNO,BSNO MASTERNO, 'op_ctnmng' AS OPLB, '<EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' AS OPLBNAME,BLTYPE as BSTYPE,CUSTOMERNAME,CUSTNO,'' ORDERNO, MBLNO,'' HBLNO,BSDATE ETD,ETD ETA
,'' STLDATE,'' STLNAME, VESSEL, VOYNO,OP AS INPUTBY,BLTYPE BLTYPE,
BSDATE AS CREATETIME, BSSTATUS, SALE, OP, OP AS DOC,'' AS CUSTSERVICE, PORTLOAD, PORTDISCHARGE,'' CUSTOMNO,
ACCDATE,'' CARRIER, BSSOURCE,BSSOURCEDETAIL,'' LANE,'' FORWARDER,0 NETWEIGHT,0 KGS,TEU, CNTRTOTAL,
CORPID,CNTR1,CNTR2,CNTR3,CNTR4,CNTR5,CNTR6,CNTR7,CNTR8,CNTR9,CNTR10,OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,ETD AS OPDATE,'' CUSTOMDATE,'' ENTERP,0 PKGS,0 CBM,'' BLFRT,'' SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,'' CONTRACTNO,'' BOOKNO,'' AGENTID,'' ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,BillFeeStatus ,0 ISVOU,'' VOUNO,PORTDISCHARGE DESTINATIONID,SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.op_ctnmng WITH (NOLOCK)
UNION ALL
SELECT BSNO,BSNO MASTERNO, 'op_InternalTrade' AS OPLB, '<EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' as BSTYPE,CUSTOMERNAME,CUSTNO,'' ORDERNO, MBLNO,'' HBLNO,dbo.trimdate(ETD) ETD,dbo.trimdate(ETA) ETA
,dbo.trimdate( STLDATE) STLDATE,STLNAME, VESSEL, VOYNO,OP AS INPUTBY,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' BLTYPE,
BSDATE AS CREATETIME, BSSTATUS,(select showname from [user] where GID=SALE ) SALE, OP, OP AS DOC, CUSTSERVICE, PORTLOADID+'_'+PORTLOAD PORTLOAD, PORTDISCHARGEID+'_'+PORTDISCHARGE PORTDISCHARGE,'' CUSTOMNO,
ACCDATE,CARRIER, BSSOURCE,BSSOURCEDETAIL,'' LANE,'' FORWARDER,0 NETWEIGHT,0 KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,ETD AS OPDATE,'' CUSTOMDATE,'' ENTERP,0 PKGS,0 CBM,'' BLFRT, SALEDEPT,0 CUSTOMSNUM,'' INVNO,'' BSCUSTOMNO,
'' INSPECTIONDATE,'' INSPECTIONNO,'' CONTRACTNO,'' BOOKNO,'' AGENTID,'' ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS, OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,isnull(PORTLOADREMARK,'')+';;'+isnull(VIA_MARK,'') remark,'' TRADETERM,'' PLACERECEIPT,PlACERECEIPT DESTINATION,SEALNO CNTRSEALNO
,BillFeeStatus ,0 ISVOU,'' VOUNO,PORTDISCHARGE DESTINATIONID,CORPID SALECORPID,'' YARD,dbo.trimtime(DELIVERYDATE) DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.op_InternalTrade WITH (NOLOCK)
union all
SELECT Convert(varchar(36),WMSDOID) BSNO,Convert(varchar(36),WMSDOID) MASTERNO, 'OP_WMS_IN_DO' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME,BSNO CUSTNO,BSNO ORDERNO,MBLNO,'' HBLNO,dbo.trimtime(DODATE) ETD,dbo.trimtime(DODATE) ETA
,null STLDATE,null STLNAME,'' VESSEL,'' VOYNO, Creator,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>' BLTYPE,
CreateDate CREATETIME, BSSTATUS,'' SALE ,(select SHOWNAME from vw_user where USERID=CreateID ) OP ,'' DOC,'' CUSTSERVICE,'' PORTLOAD,'' PORTDISCHARGE,'' CUSTOMNO,
CONVERT(VARCHAR(7),DODATE,120) ACCDATE,'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,''LANE,'' FORWARDER, KGS AS NETWEIGHT, KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE, GOODSNAME,
FEESTATUS,DODATE AS OPDATE,DODATE CUSTOMDATE,'' ENTERP,PKGS,CBM ,''BLFRT,''SALEDEPT,''CUSTOMSNUM,''INVNO,'' BSCUSTOMNO,
''INSPECTIONDATE,''INSPECTIONNO,''CONTRACTNO,'' BOOKNO,''AGENTID,''ISPRINTPR,'' as NUMBERPLATE,KGS FEEKGS,Creator OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,FEESTATUS BillFeeStatus,0 ISVOU, '' VOUNO,'' DESTINATIONID,CORPID SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,'' BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.VW_OP_WMS_IN_DO
union all
SELECT Convert(varchar(36),OP_WMS_OUT_DO_BSNO.GID) BSNO,Convert(varchar(36),WMSDOID) MASTERNO, 'OP_WMS_OUT_DO' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ' AS OPLBNAME,'<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME,WMSNO CUSTNO,WMSNO ORDERNO,OP_WMS_OUT_DO.MBLNO,'' HBLNO,dbo.trimtime(DODATE) ETD,dbo.trimtime(DODATE) ETA
,null STLDATE,null STLNAME,'' VESSEL,OP_WMS_OUT_DO.TRUCKNO VOYNO, Creator,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ' BLTYPE,
CreateDate CREATETIME, BSSTATUS,'' SALE ,Creator OP ,'' DOC,'' CUSTSERVICE,'' PORTLOAD,'' PORTDISCHARGE,'' CUSTOMNO,
CONVERT(VARCHAR(7),DODATE,120) ACCDATE,'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,''LANE,'' FORWARDER, isnull((select sum(kgs) from OP_WMS_OUT_DO_GOODS where WMSDOID=OP_WMS_OUT_DO.WMSDOID),0) AS NETWEIGHT, isnull((select sum(kgs) from OP_WMS_OUT_DO_GOODS where WMSDOID=OP_WMS_OUT_DO.WMSDOID),0) KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,DODATE AS OPDATE,DODATE CUSTOMDATE,'' ENTERP, isnull((select sum(PKGS) from OP_WMS_OUT_DO_GOODS where WMSDOID=OP_WMS_OUT_DO.WMSDOID),0)PKGS, isnull((select sum(CBM) from OP_WMS_OUT_DO_GOODS where WMSDOID=OP_WMS_OUT_DO.WMSDOID),0) CBM ,''BLFRT,''SALEDEPT,''CUSTOMSNUM,''INVNO,'' BSCUSTOMNO,
''INSPECTIONDATE,''INSPECTIONNO,''CONTRACTNO,'' BOOKNO,''AGENTID,''ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,Creator OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,FEESTATUS BillFeeStatus,0 ISVOU, '' VOUNO,'' DESTINATIONID,CORPID SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,'' BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.OP_WMS_OUT_DO_BSNO left join dbo.OP_WMS_OUT_DO on OP_WMS_OUT_DO.WMSDOID=OP_WMS_OUT_DO_BSNO.BSNO
union all
SELECT Convert(varchar(36),WMSPLANID) BSNO,Convert(varchar(36),WMSPLANID) MASTERNO, 'VW_OP_WMS_OUT_PLAN' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ' AS OPLBNAME,'<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME,WMSNO CUSTNO,WMSNO ORDERNO,VW_OP_WMS_OUT_PLAN.MBLNO,'' HBLNO,dbo.trimtime(PLANTIME) ETD,dbo.trimtime(PLANTIME) ETA
,null STLDATE,null STLNAME,'' VESSEL,'' VOYNO, Creator,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' BLTYPE,
CreateDate CREATETIME, BSSTATUS,'' SALE ,Creator OP ,'' DOC,'' CUSTSERVICE,'' PORTLOAD,'' PORTDISCHARGE,'' CUSTOMNO,
CONVERT(VARCHAR(7),PLANTIME,120) ACCDATE,'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,''LANE,'' FORWARDER, isnull((select sum(NETWEIGHT) from OP_WMS_OUT_PLAN_DETAIL where WMSPLANID=VW_OP_WMS_OUT_PLAN.WMSPLANID),0) AS NETWEIGHT, isnull((select sum(kgs) from OP_WMS_OUT_PLAN_DETAIL where WMSPLANID=VW_OP_WMS_OUT_PLAN.WMSPLANID),0) KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,PLANTIME AS OPDATE,PLANTIME CUSTOMDATE,'' ENTERP, isnull((select sum(PKGS) from OP_WMS_OUT_PLAN_DETAIL where WMSPLANID=VW_OP_WMS_OUT_PLAN.WMSPLANID),0)PKGS, isnull((select sum(CBM) from OP_WMS_OUT_PLAN_DETAIL where WMSPLANID=VW_OP_WMS_OUT_PLAN.WMSPLANID),0) CBM ,''BLFRT,''SALEDEPT,''CUSTOMSNUM,''INVNO,'' BSCUSTOMNO,
''INSPECTIONDATE,''INSPECTIONNO,''CONTRACTNO,'' BOOKNO,''AGENTID,''ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,Creator OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,FEESTATUS BillFeeStatus,0 ISVOU, '' VOUNO,'' DESTINATIONID,CORPID SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,'' BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.VW_OP_WMS_OUT_PLAN
union all
SELECT Convert(varchar(36),WMSDOID) BSNO,Convert(varchar(36),WMSDOID) MASTERNO, 'OP_WMS_OUT_DO' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ' AS OPLBNAME,'<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME,WMSNO CUSTNO,WMSNO ORDERNO,OP_WMS_OUT_DO.MBLNO,'' HBLNO,dbo.trimtime(DODATE) ETD,dbo.trimtime(DODATE) ETA
,null STLDATE,null STLNAME,'' VESSEL,TRUCKNO VOYNO, Creator,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ' BLTYPE,
CreateDate CREATETIME, BSSTATUS,'' SALE ,Creator OP ,'' DOC,'' CUSTSERVICE,'' PORTLOAD,'' PORTDISCHARGE,'' CUSTOMNO,
CONVERT(VARCHAR(7),DODATE,120) ACCDATE,'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,''LANE,'' FORWARDER, isnull((select sum(NETWEIGHT) from OP_WMS_OUT_DO_GOODS where WMSDOID=OP_WMS_OUT_DO.WMSDOID),0) AS NETWEIGHT, isnull((select sum(kgs) from OP_WMS_OUT_DO_GOODS where WMSDOID=OP_WMS_OUT_DO.WMSDOID),0) KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,DODATE AS OPDATE,DODATE CUSTOMDATE,'' ENTERP, isnull((select sum(PKGS) from OP_WMS_OUT_DO_GOODS where WMSDOID=OP_WMS_OUT_DO.WMSDOID),0)PKGS, isnull((select sum(CBM) from OP_WMS_OUT_DO_GOODS where WMSDOID=OP_WMS_OUT_DO.WMSDOID),0) CBM ,''BLFRT,''SALEDEPT,''CUSTOMSNUM,''INVNO,'' BSCUSTOMNO,
''INSPECTIONDATE,''INSPECTIONNO,''CONTRACTNO,'' BOOKNO,''AGENTID,''ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,Creator OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,FEESTATUS BillFeeStatus,0 ISVOU, '' VOUNO,'' DESTINATIONID,CORPID SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,'' BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.OP_WMS_OUT_DO
union all
SELECT Convert(varchar(36),D.WMSDUIDETAILID) BSNO,Convert(varchar(36),D.WMSDUIID) MASTERNO, 'OP_WMS_FEEDUI' AS OPLB, '<EFBFBD>ִ<EFBFBD><EFBFBD>½<EFBFBD><EFBFBD>˵<EFBFBD>' AS OPLBNAME,'<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD>' AS BSTYPE, D.CUSTOMERNAME,BSNO CUSTNO,BSNO ORDERNO,MBLNO,'' HBLNO,dbo.trimtime(D.STARTDATE) ETD,dbo.trimtime(D.ENDDATE) ETA
,null STLDATE,null STLNAME,'' VESSEL,'' VOYNO, Creator,'<EFBFBD>ִ<EFBFBD><EFBFBD>½<EFBFBD>' BLTYPE,
CreateDate CREATETIME,0 BSSTATUS,'' SALE ,Creator OP ,'' DOC,'' CUSTSERVICE,'' PORTLOAD,'' PORTDISCHARGE,'' CUSTOMNO,
CONVERT(VARCHAR(7),h.ACCDATE,120) ACCDATE,'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,''LANE,'' FORWARDER,0 AS NETWEIGHT, 0 KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
FEESTATUS,D.ACCDATE AS OPDATE,D.ACCDATE CUSTOMDATE,'' ENTERP, 0 PKGS,0 CBM ,''BLFRT,''SALEDEPT,''CUSTOMSNUM,''INVNO,'' BSCUSTOMNO,
''INSPECTIONDATE,''INSPECTIONNO,''CONTRACTNO,'' BOOKNO,''AGENTID,''ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,h.REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,FEESTATUS BillFeeStatus,0 ISVOU, '' VOUNO,'' DESTINATIONID,CORPID SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,'' BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.OP_WMS_FEEDUI_STORAGE_DETAIL D left join OP_WMS_FEEDUI_STORAGE h on D.WMSDUIID=h.WMSDUIID
union all
SELECT Convert(varchar(36),WMSWEIGHID) BSNO,Convert(varchar(36),WMSWEIGHID) MASTERNO, 'OP_WMS_WEIGH' AS OPLB, '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME,BSNO CUSTNO,BSNO ORDERNO,MBLNO,'' HBLNO,DODATE ETD,DODATE ETA
,null STLDATE,null STLNAME,'' VESSEL,'' VOYNO, Creator,'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><EFBFBD>' BLTYPE,
CreateDate CREATETIME,'' BSSTATUS,'' SALE ,Creator OP ,'' DOC,'' CUSTSERVICE,'' PORTLOAD,'' PORTDISCHARGE,'' CUSTOMNO,
CONVERT(VARCHAR(7),DODATE,120) ACCDATE,'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,''LANE,'' FORWARDER,0 AS NETWEIGHT, 0 KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
'' FEESTATUS,DODATE AS OPDATE,DODATE CUSTOMDATE,'' ENTERP, 0 PKGS,0 CBM ,''BLFRT,''SALEDEPT,''CUSTOMSNUM,''INVNO,'' BSCUSTOMNO,
''INSPECTIONDATE,''INSPECTIONNO,''CONTRACTNO,'' BOOKNO,''AGENTID,''ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,'' BillFeeStatus,0 ISVOU, '' VOUNO,'' DESTINATIONID,CORPID SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,'' BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.OP_WMS_WEIGH
union all
SELECT Convert(varchar(36),WMSTRANSFERGOODSID) BSNO,Convert(varchar(36),WMSTRANSFERGOODSID) MASTERNO, 'OP_WMS_TRANSFERGOODS' AS OPLB, '<EFBFBD><EFBFBD>תҵ<EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD>' AS BSTYPE, NEWCUSTOMERNAME CUSTOMERNAME,BSNO CUSTNO,BSNO ORDERNO,(select MBLNO from op_wms where wmsid=(select top 1 WMSID from OP_WMS_TRANSFERGOODS_DETAIL where WMSTRANSFERGOODSID=OP_WMS_TRANSFERGOODS.WMSTRANSFERGOODSID))MBLNO,'' HBLNO,TRANSFERDATE ETD,TRANSFERDATE ETA
,null STLDATE,null STLNAME,'' VESSEL,'' VOYNO, Creator,'<EFBFBD><EFBFBD>תҵ<EFBFBD><EFBFBD>' BLTYPE,
CreateDate CREATETIME,'' BSSTATUS,'' SALE ,Creator OP ,'' DOC,'' CUSTSERVICE,'' PORTLOAD,'' PORTDISCHARGE,'' CUSTOMNO,
CONVERT(VARCHAR(7),TRANSFERDATE,120) ACCDATE,'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,''LANE,'' FORWARDER,0 AS NETWEIGHT, 0 KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
'' FEESTATUS,TRANSFERDATE AS OPDATE,TRANSFERDATE CUSTOMDATE,'' ENTERP, 0 PKGS,0 CBM ,''BLFRT,''SALEDEPT,''CUSTOMSNUM,''INVNO,'' BSCUSTOMNO,
''INSPECTIONDATE,''INSPECTIONNO,''CONTRACTNO,'' BOOKNO,''AGENTID,''ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,'' BillFeeStatus,0 ISVOU, '' VOUNO,'' DESTINATIONID,CORPID SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,'' BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.OP_WMS_TRANSFERGOODS
union all
SELECT Convert(varchar(36),WMSDOID) BSNO,Convert(varchar(36),WMSDOID) MASTERNO, 'OP_WMS_MOVE' AS OPLB, '<EFBFBD>ƿ<EFBFBD>ҵ<EFBFBD><EFBFBD>' AS OPLBNAME,'<EFBFBD>ִ<EFBFBD>ҵ<EFBFBD><EFBFBD>' AS BSTYPE, CUSTOMERNAME,BSNO CUSTNO,BSNO ORDERNO,(select MBLNO from OP_WMS where WMSID=OP_WMS_MOVE.WMSID) MBLNO,'' HBLNO,DODATE ETD,DODATE ETA
,null STLDATE,null STLNAME,'' VESSEL,'' VOYNO, Creator,'<EFBFBD>ƿ<EFBFBD>ҵ<EFBFBD><EFBFBD>' BLTYPE,
CreateDate CREATETIME,'' BSSTATUS,'' SALE ,Creator OP ,'' DOC,'' CUSTSERVICE,'' PORTLOAD,'' PORTDISCHARGE,'' CUSTOMNO,
CONVERT(VARCHAR(7),DODATE,120) ACCDATE,'' CARRIER,'' BSSOURCE,''BSSOURCEDETAIL,''LANE,'' FORWARDER,0 AS NETWEIGHT, 0 KGS,0 TEU,'' CNTRTOTAL,
CORPID,0 CNTR1,0 CNTR2,0 CNTR3,0 CNTR4,0 CNTR5,0 CNTR6,0 CNTR7,0 CNTR8,0 CNTR9,0 CNTR10,0 OTCNTR, '' AS TRADETYPE,'' GOODSNAME,
'' FEESTATUS,DODATE AS OPDATE,DODATE CUSTOMDATE,'' ENTERP, 0 PKGS,0 CBM ,''BLFRT,''SALEDEPT,''CUSTOMSNUM,''INVNO,'' BSCUSTOMNO,
''INSPECTIONDATE,''INSPECTIONNO,''CONTRACTNO,'' BOOKNO,''AGENTID,''ISPRINTPR,'' as NUMBERPLATE,0 FEEKGS,'' OPERATOR,'' SERVICECONTRACTNO,0 ISCANCEL
,'' APPLYNO,'' ISSUETYPE,'' BLISSUESTATUS,REMARK,'' TRADETERM,'' PLACERECEIPT,'' DESTINATION,'' CNTRSEALNO,'' BillFeeStatus,0 ISVOU, '' VOUNO,'' DESTINATIONID,CORPID SALECORPID,'' YARD,'' DELIVERYDATE,'' FRCUSTSERVICE,'' SERVICE,'' REMARK2,'' BILLFEESTATUSTIME,'' TRUCKER,'' CUSTOMSER,null CLOSINGDATE,'' KINDPKGS,'' CARGOID,'' DCLASS
FROM dbo.OP_WMS_MOVE
GO
insert Into code_fee_group values(
'649AACAF-DE14-4E8C-A57B-E763A847AC05','cksl','<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',''
)
GO
ALTER VIEW [dbo].[VW_OP_REP_WMSOUTDO] AS
select wc.WMSLOGID,od.DODATE,w.CORPID, w.CUSTOMERNAME,w.GOODSNAME,w.MBLNO,w.CUSTOMNO,w.CNTRNO,-wc.PKGS PKGS,-wc.KGS KGS,-wc.NETWEIGHT NETWEIGHT,-wc.CBM CBM,wc.PKGS3,wc.KGS3,wc.NETWEIGHT3,wc.CBM3,-wc.STORAGEUNITCOUNT STORAGEUNITCOUNT,wc.STORAGEUNITCOUNT3,odg.STOREHOUSE ,odg.AREACODE,w.OP
,wc.CHANGETYPE,od.WMSNO,cg.GOODSFEETYPE,cg.GoodsTypeGID,w.GOODSOWNER
,od.TRUCKNO,w.INDATE,w.WMSINDATE,w.FEESTARTDATE,od.CUSTOMNO CUSTOMNO_OUT
,od.CreateID DO_CreateID
from OP_WMS_CHANGE wc
left join op_wms w on w.WMSID=wc.WMSID
left join op_wms_OUT_do od on od.WMSDOID=wc.DOBSNO
left join OP_WMS_OUT_DO_GOODS odg on odg.WMSDOID=wc.DOBSNO and odg.WMSDODETAILID=wc.DOGID
left join OP_WMS_PHYSICS p on p.WMSPHYSICSID=odg.WMSPHYSICSID
left join code_goods cg on cg.GOODNAME=w.GOODSNAME
where wc.CHANGETYPE='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
GO
--drop table OP_WMS_FEEPAYINFO
create table OP_WMS_FEEPAYINFO (
[GID] [uniqueidentifier] NOT NULL,
[WMSID] [uniqueidentifier] NOT NULL,
[WMSBASEID] [uniqueidentifier] NOT NULL,
[FEESTARTDATE] datetime NOT NULL,
[FEEENDDATE] datetime NULL,
FEERATEWMSID uniqueidentifier null,
SOURCEDOID uniqueidentifier null,
[ARCLIENTWMSOUT] [varchar](50) NULL,
[APCLIENTWMSOUT] [varchar](50) NULL,
[ARCLIENTWMSIN] [varchar](50) NULL,
[APCLIENTWMSIN] [varchar](50) NULL,
[ARCLIENTWMS_OUTDO] [varchar](50) NULL,
[APCLIENTWMS_OUTDO] [varchar](50) NULL,
STORAGEUNITCOUNT numeric(22,6),
CONSTRAINT [PK_OP_WMS_FEEPAYINFO] PRIMARY KEY CLUSTERED
(
[GID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER VIEW [dbo].[Vw_Op_Wms_FeeBase] AS
select P.gid, w.[WMSID],[BSNO],[BILLTYPE],[REMARK],[CORPID],[CUSTOMERNAME],[MATERIALNO],[GOODSCODE],[GOODSNAME]
,[GOODSHSCODE],[MBLNO],[CNTRNO],[KGS],NETWEIGHT,[CBM],[PKGS],[KINDPKGS],[STORAGEUNIT]
,P.STORAGEUNITCOUNT
,P.FEERATEWMSID
,[ISCLEAR],[INDATE],WMSINDATE
,p.FEESTARTDATE
,(select FEERATESTARTDATE from op_wms where wmsid=p.FEERATEWMSID)FEERATESTARTDATE
,case when p.FEEENDDATE is null then (case when w.FEEENDDATE is null then '3000-12-12' else w.FEEENDDATE end)
else case when isnull(p.FEEENDDATE,'3000-12-12') > isnull(w.FEEENDDATE,'3000-12-12') then w.FEEENDDATE else isnull(p.FEEENDDATE,'3000-12-12') end
end [FEEENDDATE]
,[MBLNO]+[CNTRNO] MBLNOCNTRNO
,OP,CUSTOMNO,ACCBOOKNO,GOODSOWNER
,P.ARCLIENTWMSOUT
from OP_WMS_FEEPAYINFO p
left join OP_WMS w on p.WMSID=w.wmsid
where (case when p.FEEENDDATE is null then (case when w.FEEENDDATE is null then '3000-12-12' else w.FEEENDDATE end)
else case when p.FEEENDDATE > isnull(w.FEEENDDATE,'3000-12-12') then w.FEEENDDATE else p.FEEENDDATE end
end>=p.FEESTARTDATE )