USE [LOGO_BAKI2018]
GO

/****** Object:  Table [dbo].[MS_B2B_ORDERINVOICES]    Script Date: 17.01.2026 01:03:26 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[MS_B2B_ORDERINVOICES](
	[LOGICALREF] [int] IDENTITY(1,1) NOT NULL,
	[DATE_] [datetime] NULL,
	[INVOICENO] [varchar](16) NULL,
	[INVOICETITLEREF] [int] NULL,
	[ORDERNO] [varchar](20) NULL,
	[CLIENTREF] [nchar](10) NULL,
	[PAYMENTMETHOD] [int] NULL,
	[TOTALPRICE] [float] NULL,
	[STATE] [int] NULL,
	[CANCELLED] [int] NULL,
	[ADDUSER] [varchar](50) NULL,
	[ADDDATE] [datetime] NULL,
	[CHECKUSER] [varchar](50) NULL,
	[CHECKDATE] [datetime] NULL,
	[DUEDATE_] [datetime] NULL,
	[PAID] [int] NULL,
 CONSTRAINT [PK_MS_B2B_ORDERINVOICES] PRIMARY KEY CLUSTERED 
(
	[LOGICALREF] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[MS_B2B_ORDERINVOICES] ADD  CONSTRAINT [DF_MS_B2B_ORDERINVOICES_STATE]  DEFAULT ((0)) FOR [STATE]
GO

ALTER TABLE [dbo].[MS_B2B_ORDERINVOICES] ADD  CONSTRAINT [DF_MS_B2B_ORDERINVOICES_CANCELLED]  DEFAULT ((0)) FOR [CANCELLED]
GO


