CREATE TABLE [dbo].[FACT_O2C_SalesOrders](
[WID_SalesOrder] [varchar](139) NOT NULL,
[DefaultLedgerDimensionDisplayValue] [varchar](500) NULL,
[MainAccountIDDisplayValue] [varchar](500) NULL,
[IsDeliveryAddressOrderSpecific] [varchar](3) NULL,
[OrderLineReference] [varchar](30) NULL,
[SalesOrderNumber] [varchar](20) NULL,
[WID_InventoryLotID] [varchar](121) NULL,
[SalesOrderLineStatus] [varchar](100) NULL,
[IsLineStopped] [varchar](3) NULL,
[CustomersLineNumber] [int] NULL,
[CustomsDocumentDate] [datetime2](6) NULL,
[CustomsDocumentNumber] [varchar](21) NULL,
[CustomsDocumentName] [varchar](60) NULL,
[SalesOrderPromisingMethod] [int] NULL,
[DeliveryAddressName] [varchar](100) NULL,
[DeliveryModeCode] [varchar](10) NULL,
[DeliveryMode] [varchar](60) NULL,
[DeliveryTermsID] [varchar](10) NULL,
[DeliveryTerms] [varchar](60) NULL,
[ExternalItemNumber] [varchar](20) NULL,
[WID_BomID] [varchar](121) NULL,
[WID_ItemNumber] [varchar](121) NULL,
[WID_RouteID] [varchar](121) NULL,
[LineAmount] [numeric](32, 6) NULL,
[LineDiscountAmount] [numeric](32, 6) NULL,
[LineDiscountPercentage] [numeric](32, 6) NULL,
[MultiLineDiscountAmount] [numeric](32, 6) NULL,
[MultiLineDiscountPercentage] [numeric](32, 6) NULL,
[LineDescription] [varchar](1000) NULL,
[AllowedOverDeliveryPercentage] [numeric](32, 6) NULL,
[PackingUnitSymbol] [varchar](10) NULL,
[WillAutomaticInventoryReservationConsiderBatchAttributes] [varchar](3) NULL,
[WillRebateCalculationExcludeLine] [varchar](3) NULL,
[SalesRebateProductGroupID] [varchar](10) NULL,
[SalesPriceQuantity] [numeric](32, 12) NULL,
[EinvoicePropertyNumber] [varchar](20) NULL,
[CustomerRequisitionNumber] [varchar](20) NULL,
[ConfirmedReceiptDate] [datetime2](6) NULL,
[RequestedReceiptDate] [datetime2](6) NULL,
[InventoryReservationMethod] [int] NULL,
[CommissionSalesRepresentativeGroupID] [varchar](10) NULL,
[CommissionSalesRepresentativeGroup] [varchar](60) NULL,
[FixedPriceCharges] [numeric](32, 6) NULL,
[SalesPrice] [numeric](32, 6) NULL,
[OrderedSalesQuantity] [numeric](32, 6) NULL,
[OrderedCatchWeightQuantity] [numeric](32, 6) NULL,
[SalesUnitSymbol] [varchar](10) NULL,
[ServiceOrderNumber] [varchar](10) NULL,
[ConfirmedShippingDate] [datetime2](6) NULL,
[RequestedShippingDate] [datetime2](6) NULL,
[SalesTaxGroupCode] [varchar](10) NULL,
[SalesTaxGroup] [varchar](60) NULL,
[SalesTaxItemGroupCode] [varchar](10) NULL,
[AllowedUnderDeliveryPercentage] [numeric](32, 6) NULL,
[SalesProductCategoryName] [varchar](254) NULL,
[NGPCode] [bigint] NULL,
[BID_ProductConfigurationID] [varchar](50) NULL,
[ItemBatchNumber] [varchar](20) NULL,
[WID_ProductColorID] [varchar](111) NULL,
[WID_WarehouseID] [varchar](111) NULL,
[WID_ShippingSiteID] [varchar](111) NULL,
[WID_ProductSizeID] [varchar](111) NULL,
[OrderedInventoryStatusID] [varchar](10) NULL,
[ProductStyleID] [varchar](10) NULL,
[ProductVersionID] [varchar](10) NULL,
[FormattedDelveryAddress] [varchar](250) NULL,
[DeliveryBuildingCompliment] [varchar](60) NULL,
[EinvoiceDimensionAccountCode] [varchar](35) NULL,
[WithholdingTaxGroupCode] [varchar](10) NULL,
[ItemWithholdingTaxcodeGroupCode] [varchar](10) NULL,
[DeliverySalesTaxGroupCode] [varchar](10) NULL,
[DeliverySalesTaxItemGroupCode] [varchar](10) NULL,
[DeliveryCFOPCcode] [varchar](5) NULL,
[CFOPCode] [varchar](5) NULL,
[LineNumber] [int] NULL,
[LineCreationSequenceNumber] [int] NULL,
[SkipCreateAutoCharges] [int] NULL,
[WID_ProjectID] [varchar](121) NULL,
[ProjectLinepropertyID] [varchar](10) NULL,
[CurrencyCode] [varchar](3) NULL,
[WID_ShippingWarehouseLocationID] [varchar](111) NULL,
[ItemSerialNumber] [varchar](20) NULL,
[RetailCalculatedLineDiscountAmount] [numeric](32, 6) NULL,
[RetailCalculatedLineDiscountPercentage] [numeric](32, 6) NULL,
[RetailCalculatedManualLineDiscountAmount] [numeric](32, 6) NULL,
[RetailCalculatedManualLineDiscountPercentage] [numeric](32, 6) NULL,
[RetailCalculatedPeriodicDiscountAmount] [numeric](32, 6) NULL,
[RetailCalculatedPeriodicDiscountPercentage] [numeric](32, 6) NULL,
[RetailCalculatedTotalDiscountAmount] [numeric](32, 6) NULL,
[RetailCalculatedTotalDiscountPercentage] [numeric](32, 6) NULL,
[RetailCalculatedTenderDiscountAmount] [numeric](32, 6) NULL,
[RetailCalculatedTenderDiscountPercentage] [numeric](32, 6) NULL,
[IsPriceLocked] [varchar](3) NULL,
[FulfillmentStatus] [int] NULL,
[FulfillmentsSoreID] [varchar](10) NULL,
[PlanningPriority] [numeric](32, 2) NULL,
[SalesOrderLineCreationMethod] [int] NULL,
[OverrideSalesTax] [int] NULL,
[SalesDeliverNow] [numeric](32, 6) NULL,
[SubBillRevenueSplit] [int] NULL,
[IsSoftReservedExternally] [varchar](3) NULL,
[ExcludeFromMasterPlanning] [varchar](3) NULL,
[DataAreaID] [varchar](4) NULL,
[WID_Company] [varchar](105) NULL,
[WID_MainAccount] [varchar](351) NULL,
[WID_Division] [varchar](351) NULL,
[WID_Department] [varchar](351) NULL,
[WID_Site] [varchar](351) NULL,
[WID_ItemGroup] [varchar](351) NULL,
[WID_Customer] [varchar](351) NULL,
[WID_Interco] [varchar](351) NULL,
[WID_Project] [varchar](351) NULL,
[WID_BusinessUnit] [varchar](1102) NULL,
[DeliveryAddressCountryRegionISOCode] [varchar](2) NULL,
[IsExportSale] [varchar](3) NULL,
[SalesOrderProcessingStatus] [int] NULL,
[AreTotalsCalculated] [varchar](3) NULL,
[TransportationDocumentLineID] [uniqueidentifier] NULL,
[OrderCreationDateTime] [datetime2](6) NULL,
[DefinitionGroup] [varchar](60) NULL,
[WID_OrderingCustomerccountNumber] [varchar](121) NULL,
[WID_Invoicecustomeraccountnumber] [varchar](121) NULL,
[LineDiscountCustomerGroupCode] [varchar](10) NULL,
[CashDiscountCode] [varchar](10) NULL,
[PaymentTermsBaseDate] [datetime2](6) NULL,
[CommissionCustomerGroupID] [varchar](10) NULL,
[WID_ContactPersonID] [varchar](121) NULL,
[CustomersOrderReference] [varchar](60) NULL,
[TotalDiscountPercentage] [numeric](32, 6) NULL,
[Email] [varchar](80) NULL,
[TotalDiscountCustomerGroupCode] [varchar](10) NULL,
[ExportReason] [varchar](30) NULL,
[FixedDueDate] [datetime2](6) NULL,
[FixedExchangeRate] [numeric](32, 16) NULL,
[InvoicePaymentAttachmentType] [int] NULL,
[ArePricesIncludingSalesTax] [varchar](3) NULL,
[LanguageID] [varchar](7) NULL,
[ChargeCustomerGroupID] [varchar](10) NULL,
[ChargeCustomerGroup] [varchar](30) NULL,
[IsSalesProcessingStopped] [varchar](3) NULL,
[MultiLineDiscountCustomerGroupCode] [varchar](10) NULL,
[IsOneTimeCustomer] [varchar](3) NULL,
[PaymentTermsName] [varchar](100) NULL,
[PaymentScheduleName] [varchar](30) NULL,
[CustomerPaymentMethodName] [varchar](10) NULL,
[CustomerPaymentMethodSpecificationName] [varchar](10) NULL,
[SalesRebateCustomerGroupID] [varchar](20) NULL,
[SalesRebateCustomerGroup] [varchar](60) NULL,
[PriceCustomerGroupCode] [varchar](10) NULL,
[PriceCustomerGroup] [varchar](60) NULL,
[PriceCustomerGroupOricingPriority] [int] NULL,
[QuotationNumber] [varchar](20) NULL,
[SalesOrderName] [varchar](60) NULL,
[SalesOrderOriginCode] [varchar](10) NULL,
[SalesOrderPoolID] [varchar](10) NULL,
[SalesOrderPool] [varchar](60) NULL,
[WID_SalesUnitID] [varchar](121) NULL,
[CustomerTransactionSettlementType] [int] NULL,
[CampaignID] [varchar](10) NULL,
[WID_OrderResponsiblePersonnelNumber] [varchar](126) NULL,
[WID_OrderTakerPersonnelNumber] [varchar](126) NULL,
[IsEntryCertificateRequired] [varchar](3) NULL,
[InvoiceType] [int] NULL,
[TransportationBrokerID] [varchar](20) NULL,
[Isconsolidatedinvoicetarget] [varchar](3) NULL,
[CreditNoteReasonCode] [varchar](10) NULL,
[CFPSCode] [varchar](4) NULL,
[IsFinalUser] [varchar](3) NULL,
[OrderTotalAmount] [numeric](32, 6) NULL,
[OrderTotalChargesAmount] [numeric](32, 6) NULL,
[OrderTotalDiscountAmount] [numeric](32, 6) NULL,
[OrderTotalTaxAmount] [numeric](32, 6) NULL,
[OrderHeaderTaxAmount] [numeric](32, 6) NULL,
[TotalDiscountAmount] [numeric](32, 6) NULL,
[InvoiceAddressCountryRegionISOCode] [varchar](2) NULL,
[OrderOrAgreementCode] [varchar](100) NULL,
[ReportingCurrencyFixedExchangeRate] [numeric](32, 6) NULL,
[DataSourceId] [varchar](100) NULL
)
GO