本帖最后由 ligenwin 于 2012-04-16 06:51:37 编辑

解决方案 »

  1.   

    GatheringVouch 收款单主表结构
    USE [DRP]
    GO
    /****** 对象:  Table [dbo].[GatheringVouch]    脚本日期: 04/16/2012 08:55:34 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[GatheringVouch](
    [fchrGatheringVouchID] [uniqueidentifier] NOT NULL,
    [fdtmDate] [datetime] NULL,
    [fchrDepartmentID] [uniqueidentifier] NULL,
    [fchrEmployeeID] [uniqueidentifier] NULL,
    [fchrSquadID] [uniqueidentifier] NULL,
    [fbitExport] [bit] NULL DEFAULT (0),
    [fbitNegative] [bit] NULL DEFAULT (0),
    [fchrCode] [nvarchar](30) NULL,
    [fchrExchangeItemID] [uniqueidentifier] NULL,
    [flotChangeMoney] [decimal](28, 2) NULL,
    [flotGatheringMoney] [decimal](28, 2) NULL,
    [fchrMaker] [nvarchar](50) NULL,
    [fchrMemo] [nvarchar](200) NULL,
    [fbitSettle] [bit] NULL,
    [fchrGatheringReportID] [uniqueidentifier] NULL,
    [ftinSource] [tinyint] NULL DEFAULT (0),
    [fchrRetailVouchID] [uniqueidentifier] NULL,
    [fbitHaveGiftToken] [bit] NULL,
    [fbitHaveStoredCard] [bit] NULL,
    [fintPresellStyle] [tinyint] NULL DEFAULT (0),
     CONSTRAINT [PK_GATHERINGVOUCH] PRIMARY KEY CLUSTERED 
    (
    [fchrGatheringVouchID] 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 [dbo].[GatheringVouch]  WITH NOCHECK ADD  CONSTRAINT [CKC_FBITEXPORT_GATHERIN] CHECK  (([fbitExport] is null or ([fbitExport] = 1 or [fbitExport] = 0)))
    GO
    ALTER TABLE [dbo].[GatheringVouch] CHECK CONSTRAINT [CKC_FBITEXPORT_GATHERIN]
    GO
    ALTER TABLE [dbo].[GatheringVouch]  WITH NOCHECK ADD  CONSTRAINT [CKC_FBITNEGATIVE_GATHERIN] CHECK  (([fbitNegative] is null or ([fbitNegative] = 1 or [fbitNegative] = 0)))
    GO
    ALTER TABLE [dbo].[GatheringVouch] CHECK CONSTRAINT [CKC_FBITNEGATIVE_GATHERIN]
    GatheringVouchDetail 收款单子表结构
    USE [DRP]
    GO
    /****** 对象:  Table [dbo].[GatheringVouchDetail]    脚本日期: 04/16/2012 08:59:38 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[GatheringVouchDetail](
    [fchrGatheringVouchDetailID] [uniqueidentifier] NOT NULL,
    [fchrSettleID] [uniqueidentifier] NULL,
    [fchrGatheringVouchID] [uniqueidentifier] NULL,
    [flotMoney] [decimal](28, 6) NULL,
    [ftinOrder] [int] NULL,
    [fchrBankName] [nvarchar](100) NULL,
    [fchrBankAccNo] [nvarchar](50) NULL,
    [fchrNotesNo] [nvarchar](50) NULL,
    [fbitVipNoPoint] [bit] NULL DEFAULT (0),
    [fbitIsGiftToken] [bit] NULL DEFAULT (0),
    [flotOverflowMoney] [decimal](28, 6) NULL,
    [fbitIsStoredCard] [bit] NULL DEFAULT (0),
     CONSTRAINT [PK_GATHERINGVOUCHDETAIL] PRIMARY KEY CLUSTERED 
    (
    [fchrGatheringVouchDetailID] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY]RetailVouch 零售单主表结构
    USE [DRP]
    GO
    /****** 对象:  Table [dbo].[RetailVouch]    脚本日期: 04/16/2012 09:06:58 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[RetailVouch](
    [fchrRetailVouchID] [uniqueidentifier] NOT NULL,
    [fchrDepartmentID] [uniqueidentifier] NULL,
    [fdtmDate] [datetime] NULL,
    [fchrSquadID] [uniqueidentifier] NULL,
    [fchrBackID] [uniqueidentifier] NULL,
    [fchrRetailReportID] [uniqueidentifier] NULL,
    [fchrVerifier] [nvarchar](50) NULL,
    [fbitExport] [bit] NULL CONSTRAINT [DF_RetailVouch_fbitExport]  DEFAULT (0),
    [fchrCode] [nvarchar](30) NULL,
    [fbitNegative] [tinyint] NULL CONSTRAINT [DF__RetailVou__fbitN__6D0D32F4]  DEFAULT (0),
    [fchrDiscountCardCode] [nvarchar](20) NULL,
    [fchrMaker] [nvarchar](50) NULL,
    [fchrGatheringVouchID] [uniqueidentifier] NULL,
    [flotGatheringMoney] [decimal](28, 2) NULL,
    [fchrCoRetailVouchID] [uniqueidentifier] NULL,
    [flotDiscountCardRate] [decimal](20, 9) NULL,
    [fchrWholeDiscountCode] [nvarchar](50) NULL,
    [flotWholeDiscountRate] [decimal](20, 9) NULL,
    [flotWholeDiscount] [decimal](28, 2) NULL,
    [fnarvipcardcode] [nvarchar](30) NULL,
    [fdecvipdiscountrate] [decimal](26, 9) NULL,
    [ftinItemModel] [tinyint] NULL DEFAULT (0),
    [fintVipLevel] [int] NULL DEFAULT (0),
    [flotEffaceMoney] [decimal](28, 6) NULL DEFAULT (0),
    [fchrSaleTypeCode] [nvarchar](50) NULL,
    [fchrRetailVouchRelatingID] [uniqueidentifier] NULL,
    [fchrPromotionPloyID] [uniqueidentifier] NULL,
    [fdtmMakeDate] [datetime] NULL DEFAULT (getdate()),
    [fbitSettle] [bit] NULL,
    [fchrVIPCardClassID] [uniqueidentifier] NULL,
    [fchrVipConsumerID] [uniqueidentifier] NULL,
    [flotCurrentPoint] [decimal](28, 6) NULL,
    [flotPointBalance] [decimal](28, 6) NULL,
    [fchrAddPointRuleID] [uniqueidentifier] NULL,
    [fchrPromotionPloyIDList] [varchar](800) NULL,
    [fdtmPlanShipmentDate] [datetime] NULL,
    [fdtmShipmentDate] [datetime] NULL,
    [fchrRe] [nvarchar](200) NULL,
    [fintPresellState] [tinyint] NULL DEFAULT (0),
    [flotVipDiscountMoneySum] [decimal](28, 6) NULL,
    [flotDiscountCardMoneySum] [decimal](28, 6) NULL,
    [flotPromotionPloyMoneySum] [decimal](28, 6) NULL,
    [flotLocaleDiscountSum] [decimal](28, 6) NULL,
    [ftinSource] [tinyint] NULL DEFAULT (0),
    [ftinState] [tinyint] NULL DEFAULT (0),
    [ftinPayment] [tinyint] NULL DEFAULT (0),
    [flotSaleMoney] [decimal](28, 6) NULL,
    [flotMoneySum] [float] NULL,
    [flotQuantitySum] [float] NULL,
    [flotDiscountSum] [decimal](28, 6) NULL,
    [fdtmLunarDate] [nvarchar](30) NULL,
    [fbitCarryForward] [bit] NULL DEFAULT (0),
    [fchrMainEmployeeID] [uniqueidentifier] NULL,
    [fchrShipmentStoreID] [uniqueidentifier] NULL,
    [ftinPreSellType] [int] NULL,
    [fchrPreSellStoreID] [uniqueidentifier] NULL,
    [fbitRestore] [bit] NULL,
    [fbitAllowGiftToken] [bit] NULL,
    [fbitAllowStoreCard] [bit] NULL,
    [fbitStartReport] [bit] NULL DEFAULT (0),
    [fintPresellStyle] [tinyint] NULL DEFAULT (0),
    [fbitCalcVIP] [int] NULL DEFAULT (0),
     CONSTRAINT [PK_RETAILVOUCH] PRIMARY KEY CLUSTERED 
    (
    [fchrRetailVouchID] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
     CONSTRAINT [UQ_RetailVouch_fchrCode] UNIQUE NONCLUSTERED 
    (
    [fchrCode] 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
    SET ANSI_PADDING OFFRetailVouchDetail 零售单子表结构
    USE [DRP]
    GO
    /****** 对象:  Table [dbo].[RetailVouchDetail]    脚本日期: 04/16/2012 09:08:00 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[RetailVouchDetail](
    [fchrRetailVouchDetailId] [uniqueidentifier] NOT NULL,
    [fchrRetailVouchID] [uniqueidentifier] NULL,
    [fchrItemID] [uniqueidentifier] NULL,
    [fchrBatchCode] [nvarchar](40) NULL,
    [fdtmProduceDate] [datetime] NULL,
    [flotQuantity] [decimal](28, 6) NULL,
    [flotMoney] [decimal](28, 6) NULL,
    [fchrMemo] [nvarchar](200) NULL,
    [flotPrice] [decimal](28, 6) NULL,
    [flotDiscountRate] [decimal](20, 9) NULL,
    [flotDiscount] [decimal](28, 6) NULL,
    [fchrFree1] [nvarchar](50) NULL,
    [fchrFree2] [nvarchar](50) NULL,
    [fchrFree3] [nvarchar](50) NULL,
    [fchrFree4] [nvarchar](50) NULL,
    [fchrFree5] [nvarchar](50) NULL,
    [fchrFree6] [nvarchar](50) NULL,
    [fchrFree7] [nvarchar](50) NULL,
    [fchrFree8] [nvarchar](50) NULL,
    [fdtmInvalidDate] [datetime] NULL,
    [fchrFree9] [nvarchar](50) NULL,
    [fchrFree10] [nvarchar](50) NULL,
    [flotQuotePrice] [decimal](28, 6) NULL,
    [ftinOrder] [int] NULL,
    [fchrBarCode] [nvarchar](40) NULL,
    [flotRetQuantity] [decimal](28, 6) NULL,
    [flotRetMoney] [decimal](28, 6) NULL,
    [flotRetDiscount] [decimal](28, 6) NULL,
    [fchrEmployeeID] [uniqueidentifier] NULL,
    [flotDenoQuantity] [decimal](28, 6) NULL,
    [fchrCoRetailDetailID] [uniqueidentifier] NULL,
    [flotlocalediscountrate] [decimal](26, 9) NULL DEFAULT (100),
    [flotmoneydiscount] [decimal](28, 6) NULL DEFAULT (0),
    [fbitspecial] [nvarchar](10) NULL,
    [fchrPromotionID] [uniqueidentifier] NULL,
    [flotRealPrice] [decimal](28, 6) NULL,
    [fintTeamNum] [int] NULL,
    [fbitEndPromotion] [bit] NULL,
    [ftinPromotionType] [tinyint] NULL,
    [fchrDiscountCardCode] [nvarchar](20) NULL,
    [fintVipLevel] [int] NOT NULL DEFAULT (0),
    [fintVipCardCode] [nvarchar](30) NULL,
    [ftinItemModel] [tinyint] NULL DEFAULT (0),
    [fbitUse] [bit] NULL DEFAULT (0),
    [flotLocaleDiscount] [decimal](28, 6) NULL DEFAULT (0),
    [fintLocaleDiscountType] [decimal](28, 6) NULL DEFAULT (0),
    [fintLocaleDiscountPrice] [decimal](28, 6) NULL DEFAULT (0),
    [flotDiscountMoney] [decimal](28, 6) NULL DEFAULT (0),
    [flotSaleNumber] [decimal](28, 6) NULL DEFAULT (0),
    [flotEffaceMoney] [decimal](28, 6) NULL DEFAULT (0),
    [fchrBackID] [uniqueidentifier] NULL,
    [fchrOtherOperator] [nvarchar](50) NULL,
    [flotPromotionPloyPrice] [decimal](28, 6) NULL,
    [flotPromotionPloyMoney] [decimal](28, 6) NULL,
    [ftinPresentType] [tinyint] NULL,
    [flotVipDiscountMoney] [decimal](28, 6) NULL,
    [fchrPromotionPloyID] [varchar](800) NULL,
    [fchrPromotionUnitGroupID] [varchar](800) NULL,
    [fchrPPDetailIDs] [text] NULL,
    [flotDiscountCardMoney] [decimal](26, 6) NULL,
    [fchrPromotionPriceSpecial] [varchar](10) NULL,
    [fdtmOldSellDate] [datetime] NULL,
    [fchrLargessID] [uniqueidentifier] NULL,
    [flotVipDiscountRate] [decimal](28, 6) NULL,
    [fchrPosID] [uniqueidentifier] NULL,
     CONSTRAINT [PK_RETAILVOUCHDETAIL] PRIMARY KEY CLUSTERED 
    (
    [fchrRetailVouchDetailId] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]GO
    SET ANSI_PADDING OFF