?? yearinit.sql
字號:
AllDepart char(1) null ,
constraint PK_TJLSMX primary key (ID)
)
go
/* ============================================================ */
/* Index: index_of_adjustdetail_goodsno */
/* ============================================================ */
create index index_of_adjustdetail_goodsno on AdjustDetail (GoodsNo)
go
/* ============================================================ */
/* Index: index_of_adjustdetail_adjustno */
/* ============================================================ */
create index index_of_adjustdetail_adjustno on AdjustDetail (AdjustNo)
go
/* ============================================================ */
/* Index: index_of_adjustdetail_startdate */
/* ============================================================ */
create index index_of_adjustdetail_startdate on AdjustDetail (StartDate)
go
/* ============================================================ */
/* Table: Tally */
/* ============================================================ */
create table Tally
(
DeptNo TDEPT not null,
TallyDate TDATE null ,
BusinessDate TDATE not null,
Staff TSTAFF null ,
Flag CHAR(1) null
)
go
/* ============================================================ */
/* Table: DeptRetail */
/* ============================================================ */
create table DeptRetail
(
DeptNo TDEPT not null,
RetailDate TDATE not null,
GoodsNo TGOODS not null,
Qty TQTY null ,
Amt TAMT null ,
DisAmt TAMT null ,
CostAmt TAMT null ,
constraint PK_DEPTRETAIL primary key (DeptNo, RetailDate, GoodsNo)
)
go
/* ============================================================ */
/* Table: CheckLog */
/* ============================================================ */
create table CheckLog
(
DeptNo TDEPT not null,
GroupNo TGROUP not null,
StartDate TDATE not null
default getdate(),
EndDate TDATE null ,
CheckWay char(1) not null,
constraint PK_CHECKLOG primary key (DeptNo, GroupNo, StartDate)
)
go
/* ============================================================ */
/* Table: DeptStock */
/* ============================================================ */
create table DeptStock
(
year int not null,
Month int not null,
GoodsNo TGOODS not null,
DeptNO TDEPT not null,
RetailPrice TPRICE null ,
InitQty TQTY null ,
InitRetailPrice TPRICE null ,
InitCostPrice TPRICE null ,
InitCostAmt TAMT null ,
LastCostPrice TPRICE null ,
CurQty TQTY null ,
CurCostPrice TPRICE null ,
CurCostAmt TAMT null ,
ImportQty TQTY null ,
ImportAmt TAMT null ,
ImportRetailAmt TAMT null ,
AllocInQty TQTY null ,
AllocInAmt TAMT null ,
AllocInRetailAmt TAMT null ,
AllocOutQty TQTY null ,
AllocOutAmt TAMT null ,
AllocOutRetailAmt TAMT null ,
AllocOutCost TAMT null ,
RetailQty TQTY null ,
RetailAmt TAMT null ,
RetailCost TAMT null ,
RetailDisAmt TAMT null ,
AdjustAmt TAMT null ,
AdjustCost TAMT null ,
SaleQty TQTY null ,
SaleAmt TAMT null ,
SaleCost TAMT null ,
SaleDisAmt TAMT null ,
LossQty TQTY null ,
LossAmt TAMT null ,
LossRetailAmt TAMT null ,
CheckQty TQTY null ,
CheckAmt TAMT null ,
CheckRetailAmt TAMT null ,
ModifyDate TDate not null
default getdate(),
constraint PK_DEPTSTOCK primary key (year, Month, GoodsNo, DeptNO)
)
go
/* ============================================================ */
/* Table: TotalStock */
/* ============================================================ */
create table TotalStock
(
Year Int not null,
Month Int not null,
GoodsNo TGOODS not null,
RetailPrice TPRICE null ,
InitQty TQTY null ,
InitRetailPrice TPRICE null ,
InitCostPrice TPRICE null ,
InitCostAmt TAMT null ,
LastCostPrice TPRICE null ,
CurQty TQTY null ,
CurCostPrice TPRICE null ,
CurCostAmt TAMT null ,
ImportQty TQTY null ,
ImportAmt TAMT null ,
ImportRetailAmt TAMT null ,
AllocInQty TQTY null ,
AllocInAmt TAMT null ,
AllocInRetailAmt TAMT null ,
AllocOutQty TQTY null ,
AllocOutAmt TAMT null ,
AllocOutRetailAmt TAMT null ,
AllocOutCost TAMT null ,
RetailQty TQTY null ,
RetailAmt TAMT null ,
RetailCost TAMT null ,
RetailDisAmt TAMT null ,
AdjustAmt TAMT null ,
AdjustCost TAMT null ,
SaleQty TQTY null ,
SaleAmt TAMT null ,
SaleCost TAMT null ,
SaleDisAmt TAMT null ,
LossQty TQTY null ,
LossAmt TAMT null ,
LossRetailAmt TAMT null ,
CheckQty TQTY null ,
CheckAmt TAMT null ,
CheckRetailAmt TAMT null ,
constraint PK_TOTALSTOCK primary key (Year, Month, GoodsNo)
)
go
/* ============================================================ */
/* Table: checksBackup */
/* ============================================================ */
create table checksBackup
(
EndDate TDATE not null,
DeptNo TDEPT not null,
GoodsNo TGOODS not null,
AcctQty TQTY null ,
RealQty TQTY null ,
AcctAmt TAMT null ,
RealAmt TAMT null ,
RetailPrice TAMT null ,
Operator TSTAFF null
default '00000',
CostPrice TPrice null ,
constraint PK_verify primary key (EndDate, DeptNo, GoodsNo)
)
go
/* ============================================================ */
/* Table: DayReport */
/* ============================================================ */
create table DayReport
(
DeptNo TDEPT not null,
GroupNo TGROUP not null,
BusinessDate CHAR(8) not null,
InitAmt TAMT null ,
NinitAmt TAMT null ,
InitRetailAmt TAMT null ,
CurAmt TAMT null ,
NCurAmt TAMT null ,
CurRetailAmt TAMT null ,
RetailAmt TAMT null ,
RetailCost TAMT null ,
NRetailCost TAMT null ,
RetailDisAmt TAMT null ,
ImportAmt TAMT null ,
NimportAmt TAMT null ,
ImportRetailAmt TAMT null ,
SaleAmt TAMT null ,
SaleCost TAMT null ,
NSaleCost TAMT null ,
SaleDisAmt TAMT null ,
SaleRetailAmt TAMT null ,
AllocInAmt TAMT null ,
NAllocInAmt TAMT null,
AllocInRetailAmt TAMT null ,
AllocoutAmt TAMT null ,
AllocOutCost TAMT null ,
NAllocOutCost TAMT null ,
AllocOutRetailAmt TAMT null ,
LossAmt TAMT null ,
NLossAmt TAMT null ,
LossRetailAmt TAMT null ,
CheckAmt TAMT null ,
NCheckAmt TAMT null ,
CheckRetailAmt TAMT null ,
AdjustAmt TAMT null ,
AdjustCost TAMT null ,
NAdjustCost TAMT null ,
constraint PK_DAYREPORT primary key (DeptNo, GroupNo, BusinessDate)
)
go
/* ============================================================ */
/* Table: Retail */
/* ============================================================ */
create table Retail
(
GoodsNo TGOODS not null,
DeptNo TDEPT not null,
Saleman TSTAFF null ,
Casher TSTAFF null ,
POSNO CHAR(4) null ,
InvoiceNO TInvoice null ,
ReceiptNo CHAR(12) not null,
BusinessFlag CHAR(1) not null,
PayMode TPAYMODE null ,
CustNo VARCHAR(16) null ,
Qty TQTY not null,
Amt TAMT not null,
Discount TDISCOUNT null ,
RetailPrice TPRICE null ,
CostPrice TPRICE null ,
DisAmt TAMT null ,
InputDate TDATE null
default getdate(),
BatchNo TBATCH null ,
ID INT IDENTITY not null,
UD1 VARCHAR(5) null ,
UD2 VARCHAR(5) null ,
UD3 TUDF null ,
UD4 TUDF null ,
constraint PK_RETAIL primary key (ID)
)
go
/* ============================================================ */
/* Index: index_of_spdm2 */
/* ============================================================ */
create index index_of_spdm2 on Retail (GoodsNo)
go
/* ============================================================ */
/* Index: index_of_casher2 */
/* ============================================================ */
create index index_of_casher2 on Retail (Casher)
go
/* ============================================================ */
/* Index: index_of_saleman2 */
/* ============================================================ */
create index index_of_saleman2 on Retail (Saleman)
go
/* ============================================================ */
/* Index: index_of_inputdate2 */
/* ============================================================ */
create index index_of_inputdate2 on Retail (InputDate)
go
/* ============================================================ */
/* Index: index_of_paymode2 */
/* ============================================================ */
create index index_of_paymode2 on Retail (PayMode)
go
/* ============================================================ */
/* Index: index_of_dept2 */
/* ============================================================ */
create index index_of_dept2 on Retail (DeptNo)
go
/* ============================================================ */
/* Index: index_of_posno2 */
/* ============================================================ */
create index index_of_posno2 on Retail (POSNO)
go
/* ============================================================ */
/* Table: PosRetail */
/* ============================================================ */
create table PosRetail
(
GoodsNo TGOODS not null,
DeptNo TDEPT not null,
Saleman TSTAFF null ,
Casher TSTAFF null ,
POSNO CHAR(4) null ,
InvoiceNo TInvoice null ,
ReceiptNo CHAR(12) not null,
BusinessFlag CHAR(1) not null,
PayMode TPAYMODE null ,
CustNo VARCHAR(16) null ,
Qty TQTY not null,
Amt TAMT not null,
Discount TDISCOUNT null ,
RetailPrice TPRICE null ,
CostPrice TPRICE null ,
DisAmt TAMT null ,
InputDate TDATE null
default getdate(),
Points Numeric(12,3) null ,
BatchNo TBATCH null ,
ID INT IDENTITY not null,
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -