CREATE TABLE [dbo].[invoices_import] (
   [invoice_type] [int] NOT NULL,
   [invoice_number] [int] NOT NULL,
   [subsidiary] [int] NULL,
   [order_number] [int] NULL,
   [paying_customer] [int] NULL,
   [invoice_date] [datetime] NULL,
   [service_date] [datetime] NULL,
   [is_canceled] [smallint] NULL,
   [cancelation_number] [int] NULL,
   [cancelation_date] [datetime] NULL,
   [cancelation_employee] [int] NULL,
   [is_own_vehicle] [smallint] NULL,
   [is_credit] [smallint] NULL,
   [credit_invoice_type] [int] NULL,
   [credit_invoice_number] [int] NULL,
   [odometer_reading] [int] NULL,
   [creating_employee] [int] NULL,
   [internal_cost_account] [int] NULL,
   [vehicle_number] [int] NULL,
   [full_vat_basevalue] [numeric](11,2) NULL,
   [full_vat_percentage] [numeric](6,2) NULL,
   [full_vat_value] [numeric](20,2) NULL,
   [reduced_vat_basevalue] [numeric](11,2) NULL,
   [reduced_vat_percentage] [numeric](6,2) NULL,
   [reduced_vat_value] [numeric](20,2) NULL,
   [used_part_vat_value] [numeric](11,2) NULL,
   [job_amount_net] [numeric](20,2) NULL,
   [job_amount_gross] [numeric](20,2) NULL,
   [job_rebate] [numeric](11,2) NULL,
   [part_amount_net] [numeric](20,2) NULL,
   [part_amount_gross] [numeric](20,2) NULL,
   [part_rebate] [numeric](11,2) NULL,
   [part_disposal] [numeric](11,2) NULL,
   [total_gross] [numeric](20,2) NULL,
   [total_net] [numeric](20,2) NULL,
   [parts_rebate_group_sell] [varchar](20) NULL,
   [internal_created_time] [datetime] NULL,
   [internal_canceled_time] [datetime] NULL,
   [order_classification_flag] [varchar](10) NULL,
   [client_db] [varchar](20) NOT NULL

   ,CONSTRAINT [invoices$0] PRIMARY KEY CLUSTERED ([invoice_type], [invoice_number], [client_db])
)


GO
