⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yearinit.sql

📁 这是用PB6开发的一个POS管理系统
💻 SQL
📖 第 1 页 / 共 5 页
字号:
    UD1                VARCHAR(5)            null    ,
    UD2                VARCHAR(5)            null    ,
    UD3                TUDF                  null    ,
    UD4                TUDF                  null    ,
    constraint PK_POSRETAIL primary key (ID)
)
go

/* ============================================================ */
/*   Index: index_of_spdm22                                     */
/* ============================================================ */
create index index_of_spdm22 on PosRetail (GoodsNo)
go

/* ============================================================ */
/*   Table: ChecksFlow                                          */
/* ============================================================ */
create table ChecksFlow
(
    GoodsNO            TGOODS                null    ,
    PosNo              CHAR(4)               null    ,
    GoodsShelf         VARCHAR(8)            null    ,
    Operator           TSTAFF                null    ,
    InputDate          TDATE                 null    
        default getdate(),
    RetailPrice        TPRICE                null    ,
    Qty                TQTY                  null    ,
    ReceiptNo          CHAR(12)              null    ,
    id                 Int Identity          not null,
    constraint PK_CHECKSFLOW primary key (id)
)
go

/* ============================================================ */
/*   Table: InvoiceFlow                                         */
/* ============================================================ */
create table InvoiceFlow
(
    Root               CHAR(12)              null    ,
    CurrentNO          CHAR(12)              null    ,
    ReceiptNO          char(12)              null    ,
    InputDate          TDATE                 null    
        default getdate(),
    Casher             TSTAFF                null    ,
    PosNo              CHAR(4)               null    ,
    InvoiceType        CHAR(1)               null    ,
    InvoiceCopy        INT                   null    ,
    RetailCount        INT                   null    ,
    Amt                TAMT                  null    ,
    POINTS             NUMERIC(12,2)         null    ,
    ID                 INT Identity          not null,
    constraint PK_INVOICEFLOW primary key (ID)
)
go

/* ============================================================ */
/*   Table: RootFlow                                            */
/* ============================================================ */
create table RootFlow
(
    RootDate           TDATE                 null    ,
    RootNo             char(12)              null    ,
    StartNo            char(12)              null    ,
    EndNo              char(12)              null    ,
    StartTime          char(17)              null    ,
    EndTime            char(17)              null    ,
    PosNo              char(4)               null    ,
    Casher             TSTAFF                null    ,
    RootCopy           integer               null    ,
    ValidCopy          integer               null    ,
    RetailCopy         integer               null    ,
    Adjustcopy         integer               null    ,
    InvalidCopy        Integer               null    ,
    ValidAmt           TAmt                  null    ,
    RetailAmt          TAmt                  null    ,
    AdjustAmt          TAmt                  null    ,
    InvalidAmt         TAmt                  null    ,
    Id                 Int Identity          not null,
    constraint PK_ROOTFLOW primary key (Id)
)
go

/* ============================================================ */
/*   Table: DayStock                                            */
/* ============================================================ */
create table DayStock
(
    Date               char(8)               not null,
    DeptNo             TDEPT                 not null,
    GoodsNo            TGOODS                not null,
    CurQty             TQTY                  null    ,
    RetailPrice        TPRICE                null    ,
    CurAmt             TAMT                  null    ,
    constraint PK_DAYSTOCK primary key (Date, DeptNo, GoodsNo)
)
go

/* ============================================================ */
/*   Table: Reqreturn                                           */
/* ============================================================ */
create table Reqreturn
(
    ReceiptNO          TReceipt              null    ,
    GoodsNo            TGoods                null    ,
    OrderQty           TQty                  null    ,
    Qty                TQty                  null    ,
    ReturnText         Varchar(50)           null    ,
    ReturnDate         TDate                 null    ,
    ReturnFlag         char(1)               null    
        default '1'
)
go

/* ============================================================ */
/*   Table: PriceChange                                         */
/* ============================================================ */
create table PriceChange
(
    GoodsNo            TGoods                null    ,
    VendorNo           TVendor               null    ,
    OldPrice           TPrice                null    ,
    NewPrice           TPrice                null    ,
    ModifyDate         TDate                 null    
)
go

/* ============================================================ */
/*   Index: index_of_pricechange_goodsno                        */
/* ============================================================ */
create index index_of_pricechange_goodsno on PriceChange (GoodsNo)
go

/* ============================================================ */
/*   Index: index_of_pricechange_vendor                         */
/* ============================================================ */
create index index_of_pricechange_vendor on PriceChange (VendorNo)
go

/* ============================================================ */
/*   Index: index_of_pricechange_date                           */
/* ============================================================ */
create index index_of_pricechange_date on PriceChange (ModifyDate)
go

/* ============================================================ */
/*   Table: CasherReport                                        */
/* ============================================================ */
create table CasherReport
(
    Casher             TStaff                not null,
    RetailDate         Tdate                 not null,
    PayMode            TPayMode              not null,
    Amt                TAmt                  null    ,
    DisAmt             TAmt                  null    ,
    constraint PK_CASHERREPORT primary key (Casher, RetailDate, PayMode)
)
go


/* ============================================================ */
/*   Table: hRetail                                             */
/* ============================================================ */
create table hRetail
(
    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_HRETAIL primary key (ID)
)
go

/* ============================================================ */
/*   Index: index_of_spdm23                                     */
/* ============================================================ */
create index index_of_spdm23 on hRetail (GoodsNo)
go

/* ============================================================ */
/*   Index: index_of_casher22                                   */
/* ============================================================ */
create index index_of_casher22 on hRetail (Casher)
go

/* ============================================================ */
/*   Index: index_of_saleman22                                  */
/* ============================================================ */
create index index_of_saleman22 on hRetail (Saleman)
go

/* ============================================================ */
/*   Index: index_of_inputdate22                                */
/* ============================================================ */
create index index_of_inputdate22 on hRetail (InputDate)
go

/* ============================================================ */
/*   Index: index_of_paymode22                                  */
/* ============================================================ */
create index index_of_paymode22 on hRetail (PayMode)
go

/* ============================================================ */
/*   Index: index_of_dept22                                     */
/* ============================================================ */
create index index_of_dept22 on hRetail (DeptNo)
go

/* ============================================================ */
/*   Index: index_of_posno22                                    */
/* ============================================================ */
create index index_of_posno22 on hRetail (POSNO)
go


/* ============================================================ */
/*   Table: PackGoodsRetail                                     */
/* ============================================================ */
create table PackGoodsRetail
(
    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,
    UD1           VARCHAR(5)            null    ,
    UD2           VARCHAR(5)            null    ,
    UD3           TUDF                  null    ,
    UD4           TUDF                  null    ,
    constraint PK_PACKGOODSRETAIL primary key (ID)
)
go

/* ============================================================ */
/*   Index: index_of_spdm24                                     */
/* ============================================================ */
create index index_of_spdm24 on PackGoodsRetail (GoodsNo)
go

/* ============================================================ */
/*   Index: index_of_casher23                                   */
/* ============================================================ */
create index index_of_casher23 on PackGoodsRetail (Casher)
go

/* ============================================================ */
/*   Index: index_of_saleman23                                  */
/* ============================================================ */
create index index_of_saleman23 on PackGoodsRetail (Saleman)
go

/* ============================================================ */
/*   Index: index_of_inputdate23                                */
/* ============================================================ */
create index index_of_inputdate23 on PackGoodsRetail (InputDate)
go

/* ============================================================ */
/*   Index: index_of_paymode23                                  */
/* ============================================================ */
create index index_of_paymode23 on PackGoodsRetail (PayMode)
go

/* ============================================================ */
/*   Index: index_of_dept23                                     */
/* ============================================================ */
create index index_of_dept23 on PackGoodsRetail (DeptNo)
go

/* ============================================================ */
/*   Index: index_of_posno23                                    */
/* ============================================================ */
create index index_of_posno23 on PackGoodsRetail (POSNO)
go




/*供货商进货_结算_销售关联表*/
if (select count(*) from  sysobjects  where name= 'import_to_check') > 0
   drop table import_to_check
go

create table Import_To_Check
(
 VendorNo Tvendor not null, /*供货商代码*/
 ImportNo TRECEIPT not null, /*进货流水*/
 ImportDate datetime not null,/*进货日期*/
 GoodsNo TGoods not null,/*商品代码*/
 NTaxPrice numeric(12,4) null,/*无税进价*/
 TaxPrice numeric(12,4) null, /*含税进价*/
 RetailPrice numeric(12,2) null, /*零售单价*/
 ImportQty TQty null, /*进货数量*/
 ExportQty TQty null, /*退货数量*/
 CheckDate datetime null,/*结算日期*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -