﻿CREATE TABLE [dbo].[QuoteFull_S] (
    [Vers]                 VARCHAR (5)     NOT NULL,
    [QuoteType]            CHAR (1)        CONSTRAINT [DF_QuoteFull_S_QuoteType] DEFAULT ('S') NOT NULL,
    [CodQuote]             BIGINT          CONSTRAINT [DF_QuoteFull_S_CodQuote] DEFAULT ((0)) NOT NULL,
    [QuoteRev]             INT             CONSTRAINT [DF_QuoteFull_S_QuoteRev] DEFAULT ((0)) NOT NULL,
    [IdxQState]            INT             CONSTRAINT [DF_QuoteFull_S_IdxQState] DEFAULT ((0)) NOT NULL,
    [CodClient]            NVARCHAR (50)   NOT NULL,
    [ClientName]           NVARCHAR (250)  NOT NULL,
    [CodItem]              NVARCHAR (50)   NOT NULL,
    [CodItemGroup]         NVARCHAR (50)   NOT NULL,
    [RawMat]               NVARCHAR (50)   NOT NULL,
    [UnitWeight]           DECIMAL (9, 3)  CONSTRAINT [DF_QuoteFull_S_UnitWeight] DEFAULT ((0)) NOT NULL,
    [BatchQty]             INT             CONSTRAINT [DF_QuoteFull_S_BatchQty] DEFAULT ((1)) NOT NULL,
    [CodInco]              NVARCHAR (5)    NOT NULL,
    [TranspZone]           NVARCHAR (50)   NOT NULL,
    [KeyAM]                NVARCHAR (101)  NOT NULL,
    [Note]                 NVARCHAR (2500) NOT NULL,
    [PriceOff]             DECIMAL (9, 6)  CONSTRAINT [DF_QuoteFull_S_PriceOff] DEFAULT ((0)) NOT NULL,
    [CodClientAssoc]       NVARCHAR (100)  NULL,
    [ClientNameAssoc]      NVARCHAR (100)  NULL,
    [ItemDescr]            NVARCHAR (100)  NULL,
    [CodifProfilo]         NVARCHAR (100)  NULL,
    [ClasseMerc]           NVARCHAR (100)  NULL,
    [TipoDies]             NVARCHAR (100)  NULL,
    [CodDiesGroup]         NVARCHAR (100)  NULL,
    [DiamDies]             DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_DiamDies] DEFAULT ((0)) NOT NULL,
    [HoleNumDies]          INT             CONSTRAINT [DF_QuoteFull_S_HoleNumDies] DEFAULT ((1)) NOT NULL,
    [DiesPrice_sim]        DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_DiesPrice_avg] DEFAULT ((0)) NOT NULL,
    [DiesPrice]            DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_DiesPrice] DEFAULT ((0)) NOT NULL,
    [SamplePrice]          DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_TestPrice] DEFAULT ((0)) NOT NULL,
    [DiesFullCost]         DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_DiesFullCost] DEFAULT ((0)) NOT NULL,
    [DiesPriceClientQuote] DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_DiesPrice1] DEFAULT ((0)) NOT NULL,
    [DiesExpLife]          DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_DiesExpLife] DEFAULT ((0)) NOT NULL,
    [DiesEOLife]           DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_DiesEOLife] DEFAULT ((0)) NOT NULL,
    [DiesTecLife]          DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_DiesTecLife] DEFAULT ((1)) NOT NULL,
    [DiesCommLife]         DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_DiesCommLife1] DEFAULT ((1)) NOT NULL,
    [MonthSalesPrev]       INT             CONSTRAINT [DF_QuoteFull_S_DiesTecLife1] DEFAULT ((0)) NOT NULL,
    [SalesPrevCost]        DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_SalesPrevCost] DEFAULT ((0)) NOT NULL,
    [DiesFinCost]          DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_DiesFinCost] DEFAULT ((0)) NOT NULL,
    [ClientQuoteReven]     DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_ClientQuoteReven] DEFAULT ((0)) NOT NULL,
    [ExtraDiscountDies]    DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_ExtraDiscountDies] DEFAULT ((0)) NOT NULL,
    [DiesByClass]          BIT             CONSTRAINT [DF_QuoteFull_S_DiesByClass] DEFAULT ((0)) NOT NULL,
    [NumDiesInList]        DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_NumDiesInList] DEFAULT ((0)) NOT NULL,
    [NumDiesExaust]        DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_NumDiesExaust] DEFAULT ((0)) NOT NULL,
    [CodPlant]             NVARCHAR (100)  NULL,
    [KeyAMIL]              NVARCHAR (100)  NULL,
    [KgTeo]                DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_KgTeo] DEFAULT ((0)) NOT NULL,
    [NumSMED]              INT             CONSTRAINT [DF_QuoteFull_S_NumSMED] DEFAULT ((0)) NOT NULL,
    [QuotaMan]             DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_QuotaMan] DEFAULT ((0)) NOT NULL,
    [PRMWeight]            DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_PRMWeight] DEFAULT ((0)) NOT NULL,
    [PWeight]              DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_PWeight] DEFAULT ((0)) NOT NULL,
    [PTare]                DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_PTare] DEFAULT ((0)) NOT NULL,
    [LivPackage]           NVARCHAR (100)  NULL,
    [LivPackageDett]       NVARCHAR (100)  NULL,
    [RawMatCost]           DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_RawMatCost] DEFAULT ((0)) NOT NULL,
    [RawMatExtraCost]      DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_RawMatExtraCost] DEFAULT ((0)) NOT NULL,
    [RawMatFullCost]       DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_RawMatFullCost] DEFAULT ((0)) NOT NULL,
    [CodPackag]            NVARCHAR (50)   NOT NULL,
    [PkgDesc]              NVARCHAR (100)  NULL,
    [FSR]                  DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_FSR] DEFAULT ((0)) NOT NULL,
    [ProvvCost]            DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_ProvvCost] DEFAULT ((0)) NOT NULL,
    [EECost]               DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_EECost] DEFAULT ((0)) NOT NULL,
    [GasCost]              DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_GasCost] DEFAULT ((0)) NOT NULL,
    [DiesCost]             DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_DiesCost] DEFAULT ((0)) NOT NULL,
    [PackCost]             DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_PackCost] DEFAULT ((0)) NOT NULL,
    [TranspCost]           DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_TranspCost] DEFAULT ((0)) NOT NULL,
    [SellCost01]           DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_SellCost01] DEFAULT ((0)) NOT NULL,
    [RefCost01]            DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_RefCost01] DEFAULT ((0)) NOT NULL,
    [SellCost04]           DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_SellCost04] DEFAULT ((0)) NOT NULL,
    [RefCost04]            DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_RefCost04] DEFAULT ((0)) NOT NULL,
    [WSR01_sim]            DECIMAL (9, 8)  CONSTRAINT [DF_QuoteFull_S_WSR01_avg] DEFAULT ((0)) NOT NULL,
    [WSR01]                DECIMAL (9, 8)  CONSTRAINT [DF_QuoteFull_S_WSR01] DEFAULT ((0)) NOT NULL,
    [MSR01_sim]            DECIMAL (9, 8)  CONSTRAINT [DF_QuoteFull_S_MSR01_avg] DEFAULT ((0)) NOT NULL,
    [MSR01]                DECIMAL (9, 8)  CONSTRAINT [DF_QuoteFull_S_MSR01] DEFAULT ((0)) NOT NULL,
    [NetProd01_sim]        DECIMAL (9, 3)  CONSTRAINT [DF_QuoteFull_S_NetProd01_avg] DEFAULT ((0)) NOT NULL,
    [NetProd04_sim]        DECIMAL (9, 3)  CONSTRAINT [DF_QuoteFull_S_NetProd01_sim1] DEFAULT ((0)) NOT NULL,
    [NetProd01]            DECIMAL (9, 3)  CONSTRAINT [DF_QuoteFull_S_NetProd01] DEFAULT ((0)) NOT NULL,
    [FC4UG01]              DECIMAL (9, 6)  CONSTRAINT [DF_QuoteFull_S_FC4UG01] DEFAULT ((0)) NOT NULL,
    [VC4UG01]              DECIMAL (9, 6)  CONSTRAINT [DF_QuoteFull_S_VC4UG01] DEFAULT ((0)) NOT NULL,
    [OH4UG01]              DECIMAL (9, 6)  CONSTRAINT [DF_QuoteFull_S_OH4UG01] DEFAULT ((0)) NOT NULL,
    [SC4UG01]              DECIMAL (9, 6)  CONSTRAINT [DF_QuoteFull_S_SC4UG01] DEFAULT ((0)) NOT NULL,
    [DSR_sim]              DECIMAL (9, 8)  CONSTRAINT [DF_QuoteFull_S_DSR_avg] DEFAULT ((0)) NOT NULL,
    [DSR]                  DECIMAL (9, 8)  CONSTRAINT [DF_QuoteFull_S_DSR] DEFAULT ((0)) NOT NULL,
    [NetProd04]            DECIMAL (9, 3)  CONSTRAINT [DF_QuoteFull_S_NetProd04] DEFAULT ((0)) NOT NULL,
    [FC4UG04]              DECIMAL (9, 6)  CONSTRAINT [DF_QuoteFull_S_FC4UG04] DEFAULT ((0)) NOT NULL,
    [VC4UG04]              DECIMAL (9, 6)  CONSTRAINT [DF_QuoteFull_S_VC4UG04] DEFAULT ((0)) NOT NULL,
    [FVC]                  DECIMAL (18, 6) CONSTRAINT [DF_QuoteFull_S_FVC] DEFAULT ((0)) NOT NULL,
    [Charge]               DECIMAL (9, 6)  CONSTRAINT [DF_QuoteFull_S_Charge] DEFAULT ((0)) NOT NULL,
    [valid]                BIT             NOT NULL,
    [errorScore]           INT             NOT NULL,
    CONSTRAINT [PK_QuoteFull_S] PRIMARY KEY CLUSTERED ([QuoteType] ASC, [CodQuote] ASC, [QuoteRev] ASC)
);




GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'scarto medio AMI', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'DSR';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'scarto medio SIMULAZIONE', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'DSR_sim';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'produttività teorica medio AMIL', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'NetProd01';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'produttività teorica SIMULAZIONE', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'NetProd01_sim';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'scarto cesoia medio AMIL', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'MSR01';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'scarto cesoia SIMULAZIONE', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'MSR01_sim';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'scarto tecnico medio AMIL', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'WSR01';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'scarto tecnico SIMULAZIONE', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'WSR01_sim';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Ricavo quota cliente', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'ExtraDiscountDies';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Ricavo quota cliente', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'ClientQuoteReven';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'oneri finanziari anticipo matrice', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'DiesFinCost';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'costi per durata commerciale', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'SalesPrevCost';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Durata commerciale in mesi prevista', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'MonthSalesPrev';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Durata commerciale in kg', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'DiesCommLife';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Durata tecnica stimata', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'DiesTecLife';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'costo prove', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'DiesFullCost';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'costo prove', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'SamplePrice';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'costo matrice per SIMULAZIONE', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'DiesPrice_sim';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Simulation', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'produttività teorica SIMULAZIONE', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteFull_S', @level2type = N'COLUMN', @level2name = N'NetProd04_sim';

