|
|
invoiceitem -- 账面数子表(进销存)
jangogo @ 2009-9-2 7:03:00
- CREATE TABLE [invoiceitem] (
- [id] integer identity(1,1) not null CONSTRAINT [invoiceitem_pkid] PRIMARY KEY,
- [iid] int not NULL,
- [iit] int not null,
- [idx] int not NULL,
- [ca] int not null,
- [GoodsID] varchar(50) not null,
- [CompanyID] varchar(50) not null,
- [DeptStaffID] varchar(50) not null,
- [PrjID] varchar(50) not null,
- [StorageID] varchar(50) not null,
- [poid] varchar(50) not null,
- [HGoodsID] varchar(50) not null,
- [Amounti] money NOT NULL,
- [Amountbi] money NOT NULL,
- [Amounto] money NOT NULL,
- [Amountbo] money NOT NULL,
- [Qtyi] float not NULL,
- [Qtyo] float not NULL,
- [Qtyvi] float not NULL,
- [Qtyvo] float not NULL,
- [FCur] varchar(30) NOT null,
- [ExRate] float not null,
- [priceStd] float not NULL,
- [priceTax] float not NULL,
- [priceDst] float not NULL,
- [discount] float NOT NULL,
- [totali] money NOT NULL,
- [totalbi] money NOT NULL,
- [totalo] money NOT NULL,
- [totalbo] money NOT NULL,
- [costi] money NOT NULL default 0,
- [costo] money NOT NULL default 0,
- [iscost] int not null default 1,
- [isfeecost] int not null default 1,
- [iimemo] varchar(200) NULL,
- [batchno] varchar(50) not NULL,
- [gPrd] datetime null,
- [taxrate] float NOT NULL,
- [tax] money NOT NULL,
- [taxb] money NOT NULL,
- [Qtyd] float not NULL,
- [rno] varchar(20) null,
- [PriceTransfer] float null,
- [PriceTransferTax] float null,
- [TransferTaxRate] float null,
- [TransferTax] money NULL,
- [TransferTaxb] money NULL,
- [PriceFee] float null,
- [FeeTaxRate] float null,
- [FeeTax] money NULL,
- [FeeTaxb] money NULL,
- [Fee] money NOT NULL,
- [Feeb] money NOT NULL,
- [MGoodsID] varchar(50) null,
- [MUnit] varchar(20) null,
- [MQty] float null,
- [MPrice] float null,
- [MAmount] float null,
- [MPricec] float null,
- [KFeeTaxRate] float null,
- [KFeeTax] money NULL,[KFeeTaxb] money NULL,
- [KFee] money NULL,[KFeeb] money NULL,
- [BarCode] varchar(30) null,
- [Unit] varchar(20) null,
- [UnitB] varchar(20) null,
- [UnitRate] float null,
- [relaapp] varchar(20) null,
- [relaid] varchar(20) null,
- [ACID_fee] varchar(50) NOT NULL,
- [ACID_kfee] varchar(50) NOT NULL,
- [lo] int null,
- [qtyc] float null default 0,
- [s1] varchar(50) null,
- [s2] varchar(50) null,
- [s3] varchar(50) null,
- [s4] varchar(20) null,
- [s5] varchar(100) null,
- [s6] varchar(200) null,
- [d1] datetime NULL,
- [d2] datetime NULL,
- [L1] int null,
- [L2] int null,
- [L3] int null,
- [i1] int null,
- [i2] int null,
- [i3] int null,
- [c1] money NULL,
- [c2] money NULL,
- [c3] money NULL
- );
-
说明:
1.iid、iit、idx 构成一个唯一的“键”,必须注意唯一性,否则不能插入多行记录
2.“收入"和"发出"开头的字段只能按你的单据类型填一种,要么“收入”要么“发出”,不能两种都填,一种填了,另一种就必须填0,例如销售单就填“发出”开头的字段,“收入”开头字段填0
|