/* v1.0.1  */
--表结构变更
alter table dbo.asr_loc_detl add mat_status varchar(10);
alter table dbo.asr_wrk_detl add mat_status varchar(10);
/* v1.0.2 2021.03.05 */
--表结构变更
CREATE TABLE [dbo].[asr_loc_normal](
	[matnr] [varchar](50) NOT NULL,
	[maktx] [nvarchar](50) NULL,
	[lgnum] [varchar](255) NULL,
	[type] [varchar](50) NULL,
	[mnemonic] [varchar](255) NULL,
	[supplier] [varchar](255) NULL,
	[warehouse] [varchar](255) NULL,
	[brand] [varchar](255) NULL,
	[anfme] [decimal](24, 9) NULL,
	[altme] [nvarchar](50) NULL,
	[bname] [nvarchar](50) NULL,
	[memo] [varchar](600) NULL,
	[modi_user] [bigint] NULL,
	[modi_time] [datetime] NULL,
	[appe_user] [bigint] NULL,
	[appe_time] [datetime] NULL,
	[state] [varchar](10) NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[asr_loc_area](
	[id] [bigint] IDENTITY(1,1) NOT NULL,
	[uuid] [varchar](50) NULL,
	[name] [varchar](255) NULL,
	[status] [int] NULL,
	[create_by] [bigint] NULL,
	[create_time] [datetime] NULL,
	[update_by] [bigint] NULL,
	[update_time] [datetime] NULL,
	[memo] [varchar](255) NULL
) ON [PRIMARY]

/* v1.0.3 2021.03.11 */
--表结构变更
alter table asr_loc_normal add id int identity(1,1)

/* v1.0.4 2021.03.17 */
USE [xtyasrs]
GO
/****** Object:  Table [dbo].[OutStockbill]    Script Date: 2021/3/17 10:18:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[OutStockbill](
	[FBrNo] [varchar](10) NOT NULL,
	[FInterID] [int] NOT NULL,
	[FBillNo] [nvarchar](255) NOT NULL,
	[FTranType] [smallint] NULL,
	[FSalType] [int] NULL,
	[FCustID] [int] NULL,
	[FDate] [datetime] NULL,
	[FStockID] [int] NULL,
	[FAdd] [char](255) NULL,
	[FNote] [char](255) NULL,
	[FEmpID] [int] NULL,
	[FCheckerID] [int] NULL,
	[FBillerID] [int] NULL,
	[FManagerID] [int] NULL,
	[FClosed] [int] NOT NULL,
	[FInvoiceClosed] [smallint] NULL,
	[FBClosed] [smallint] NOT NULL,
	[FDeptID] [int] NULL,
	[FSettleID] [int] NULL,
	[FTranStatus] [int] NOT NULL,
	[FExchangeRate] [float] NULL,
	[FCurrencyID] [int] NULL,
	[FStatus] [smallint] NOT NULL,
	[FCancellation] [bit] NOT NULL,
	[FMultiCheckLevel1] [int] NULL,
	[FMultiCheckLevel2] [int] NULL,
	[FMultiCheckLevel3] [int] NULL,
	[FMultiCheckLevel4] [int] NULL,
	[FMultiCheckLevel5] [int] NULL,
	[FMultiCheckLevel6] [int] NULL,
	[FMultiCheckDate1] [datetime] NULL,
	[FMultiCheckDate2] [datetime] NULL,
	[FMultiCheckDate3] [datetime] NULL,
	[FMultiCheckDate4] [datetime] NULL,
	[FMultiCheckDate5] [datetime] NULL,
	[FMultiCheckDate6] [datetime] NULL,
	[FCurCheckLevel] [int] NULL,
	[FRelateBrID] [int] NULL,
	[FCheckDate] [datetime] NULL,
	[FExplanation] [nvarchar](255) NOT NULL,
	[FFetchAdd] [nvarchar](255) NOT NULL,
	[FSelTranType] [int] NOT NULL,
	[FChildren] [int] NOT NULL,
	[FBrID] [int] NULL,
	[FAreaPS] [int] NOT NULL,
	[FPOOrdBillNo] [nvarchar](255) NULL,
	[FManageType] [int] NULL,
	[FPrintCount] [smallint] NULL,
	[Fflag_rw] [int] NULL,
	[Fflag_finish] [int] NULL
) ON [PRIMARY]
SET ANSI_PADDING OFF
ALTER TABLE [dbo].[OutStockbill] ADD [FWeiOrder] [varchar](255) NOT NULL
ALTER TABLE [dbo].[OutStockbill] ADD [FWeiOpenID] [nvarchar](255) NOT NULL
ALTER TABLE [dbo].[OutStockbill] ADD [FOrderBillNo] [nvarchar](255) NOT NULL
SET ANSI_PADDING ON
ALTER TABLE [dbo].[OutStockbill] ADD [FWLNumber] [varchar](255) NULL
ALTER TABLE [dbo].[OutStockbill] ADD [FWLCompany] [varchar](255) NULL
SET ANSI_PADDING OFF
ALTER TABLE [dbo].[OutStockbill] ADD [FReturnFundType] [varchar](255) NOT NULL
 CONSTRAINT [pk_OutStockbill_1__16] PRIMARY KEY CLUSTERED
(
	[FBrNo] ASC,
	[FInterID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[OutStockbillEntry]    Script Date: 2021/3/17 10:18:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[OutStockbillEntry](
	[FBrNo] [varchar](10) NOT NULL,
	[FInterID] [int] NOT NULL,
	[FEntryID] [int] NOT NULL,
	[FItemID] [int] NULL,
	[FQty] [decimal](28, 10) NOT NULL,
	[FCommitQty] [decimal](28, 10) NOT NULL,
	[FPrice] [decimal](28, 10) NOT NULL,
	[FAmount] [decimal](20, 2) NOT NULL,
	[FOrderInterID] [int] NOT NULL,
	[FDate] [datetime] NULL,
	[FNote] [varchar](1024) NULL,
	[FInvoiceQty] [decimal](28, 10) NOT NULL,
	[FBCommitQty] [decimal](28, 10) NOT NULL,
	[FUnitID] [int] NOT NULL,
	[FAuxBCommitQty] [decimal](28, 10) NOT NULL,
	[FAuxCommitQty] [decimal](28, 10) NOT NULL,
	[FAuxInvoiceQty] [decimal](28, 10) NOT NULL,
	[FAuxPrice] [decimal](28, 10) NOT NULL,
	[FAuxQty] [decimal](28, 10) NOT NULL,
	[FSourceEntryID] [int] NOT NULL,
	[FMapNumber] [varchar](80) NOT NULL,
	[FMapName] [nvarchar](256) NULL,
	[FAuxPropID] [int] NOT NULL,
	[FBatchNo] [nvarchar](255) NOT NULL,
	[FCheckDate] [datetime] NULL,
	[FExplanation] [nvarchar](255) NOT NULL,
	[FFetchAdd] [nvarchar](255) NOT NULL,
	[FFetchDate] [datetime] NULL,
	[FMultiCheckDate1] [datetime] NULL,
	[FMultiCheckDate2] [datetime] NULL,
	[FMultiCheckDate3] [datetime] NULL,
	[FMultiCheckDate4] [datetime] NULL,
	[FMultiCheckDate5] [datetime] NULL,
	[FMultiCheckDate6] [datetime] NULL,
	[FSecCoefficient] [decimal](28, 10) NOT NULL,
	[FSecQty] [decimal](28, 10) NOT NULL,
	[FSecCommitQty] [decimal](28, 10) NOT NULL,
	[FSourceTranType] [int] NOT NULL,
	[FSourceInterId] [int] NOT NULL,
	[FSourceBillNo] [nvarchar](255) NOT NULL,
	[FContractInterID] [int] NOT NULL,
	[FContractEntryID] [int] NOT NULL,
	[FContractBillNo] [nvarchar](255) NOT NULL,
	[FOrderEntryID] [int] NOT NULL,
	[FOrderBillNo] [nvarchar](255) NOT NULL,
	[FStockID] [int] NOT NULL,
	[FBackQty] [decimal](28, 10) NOT NULL,
	[FAuxBackQty] [decimal](28, 10) NOT NULL,
	[FSecBackQty] [decimal](28, 10) NOT NULL,
	[FStdAmount] [decimal](23, 10) NOT NULL,
	[FPlanMode] [int] NOT NULL,
	[FMTONo] [nvarchar](50) NOT NULL,
	[FDetailID] [int] NOT NULL,
	[FStockQtyOnlyForShow] [decimal](23, 10) NOT NULL,
	[FComplexQty] [varchar](255) NULL,
	[Fmodel] [varchar](80) NULL,
	[Fname] [varchar](80) NULL,
	[Fnumber] [varchar](80) NULL
) ON [PRIMARY]
SET ANSI_PADDING OFF
ALTER TABLE [dbo].[OutStockbillEntry] ADD [FBarCode] [varchar](100) NOT NULL
ALTER TABLE [dbo].[OutStockbillEntry] ADD [FBTPLCommitQty] [decimal](28, 10) NOT NULL
ALTER TABLE [dbo].[OutStockbillEntry] ADD [FTPLCommitQty] [decimal](28, 10) NOT NULL
ALTER TABLE [dbo].[OutStockbillEntry] ADD [fsecinvoiceqty] [decimal](23, 10) NULL
 CONSTRAINT [pk_OutStockbillEntry_1__16] PRIMARY KEY CLUSTERED
(
	[FBrNo] ASC,
	[FInterID] ASC,
	[FEntryID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ((0)) FOR [FClosed]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ((0)) FOR [FInvoiceClosed]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ((0)) FOR [FBClosed]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ((-1)) FOR [FSettleID]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ((0)) FOR [FTranStatus]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ((0)) FOR [FStatus]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ((0)) FOR [FCancellation]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  CONSTRAINT [DF__OutStockbill__FConsig]  DEFAULT ((0)) FOR [FRelateBrID]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ('') FOR [FExplanation]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ('') FOR [FFetchAdd]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ((0)) FOR [FSelTranType]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ((0)) FOR [FChildren]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ((0)) FOR [FAreaPS]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ('') FOR [FWeiOrder]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ('') FOR [FWeiOpenID]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ('') FOR [FOrderBillNo]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ('') FOR [FWLNumber]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ('') FOR [FWLCompany]
GO
ALTER TABLE [dbo].[OutStockbill] ADD  DEFAULT ('') FOR [FReturnFundType]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FCommitQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FPrice]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FAmount]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  CONSTRAINT [DF_OutStockbillEntry_FOrderInterID]  DEFAULT ((0)) FOR [FOrderInterID]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FInvoiceQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FBCommitQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FUnitID]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FAuxBCommitQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FAuxCommitQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FAuxInvoiceQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FAuxPrice]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FAuxQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  CONSTRAINT [DF__SEOutStoc__FSour__558158D4]  DEFAULT ((0)) FOR [FSourceEntryID]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ('') FOR [FMapNumber]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  CONSTRAINT [DF__SEOutStoc__FMapN__5769A146]  DEFAULT ('') FOR [FMapName]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FAuxPropID]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ('') FOR [FBatchNo]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ('') FOR [FExplanation]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ('') FOR [FFetchAdd]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FSecCoefficient]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FSecQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FSecCommitQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FSourceTranType]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FSourceInterId]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ('') FOR [FSourceBillNo]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FContractInterID]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FContractEntryID]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ('') FOR [FContractBillNo]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FOrderEntryID]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ('') FOR [FOrderBillNo]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FStockID]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FBackQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FAuxBackQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FSecBackQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FStdAmount]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((14036)) FOR [FPlanMode]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ('') FOR [FMTONo]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ('0') FOR [FStockQtyOnlyForShow]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ('') FOR [FBarCode]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FBTPLCommitQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [FTPLCommitQty]
GO
ALTER TABLE [dbo].[OutStockbillEntry] ADD  DEFAULT ((0)) FOR [fsecinvoiceqty]
GO
