create table SaleOrders (
  "Id" integer not null,
  "DocType" integer not null,
  "UNP" varchar(100) not null,
  "DocNumbers" varchar(250),
  "GuestNum" integer not null,
  "DocDate" date,
  "HotelId" integer not null,
  "StoreName" varchar(200) not null,
  "WorkPlaceId" varchar(200) not null,
  "FiscalDeviceN" integer not null default 0,
  "UserId" integer not null,
  "TotalSumNoVat" numeric(12,4) not null default 0,
  "VatSum" numeric(12,4) not null default 0,
  "TotalSum" numeric(12,4) not null default 0,
  "InsDateTime" timestamp,
  "MarkDateTime" timestamp not null default current timestamp,
  "UserCode" integer not null,
  "PartnerFullName" varchar(250),
  "PartnerAddress" varchar(250),
  "PartnerIdNumber" varchar(250),
  "PartnerAccPerson" varchar(250),
  primary key ("Id")
)

GO

alter table Invoices
  add UNP varchar(100)

