CREATE TABLE [dbo].[dealer_vehicles] (
   [dealer_vehicle_type] [varchar](10) NOT NULL,
   [dealer_vehicle_number] [int] NOT NULL,
   [vehicle_number] [int] NULL,
   [location] [varchar](50) NULL,
   [buyer_customer_no] [int] NULL,
   [deregistration_date] [datetime] NULL,
   [refinancing_start_date] [datetime] NULL,
   [refinancing_end_date] [datetime] NULL,
   [refinancing_value] [numeric](11,2) NULL,
   [refinancing_refundment] [numeric](11,2) NULL,
   [refinancing_bank_customer_no] [int] NULL,
   [refinanc_interest_free_date] [datetime] NULL,
   [in_subsidiary] [int] NULL,
   [in_buy_salesman_number] [int] NULL,
   [in_buy_order_no] [varchar](50) NULL,
   [in_buy_order_no_date] [datetime] NULL,
   [in_buy_invoice_no] [varchar](50) NULL,
   [in_buy_invoice_no_date] [datetime] NULL,
   [in_buy_edp_order_no] [varchar](50) NULL,
   [in_buy_edp_order_no_date] [datetime] NULL,
   [in_is_trade_in_ken] [varchar](10) NULL,
   [in_is_trade_in_kom] [int] NULL,
   [in_used_vehicle_buy_type] [varchar](10) NULL,
   [in_buy_list_price] [numeric](11,2) NULL,
   [in_arrival_date] [datetime] NULL,
   [in_expected_arrival_date] [datetime] NULL,
   [in_accounting_document_type] [varchar](10) NULL,
   [in_accounting_document_number] [bigint] NULL,
   [in_accounting_document_date] [datetime] NULL,
   [in_acntg_exceptional_group] [varchar](50) NULL,
   [in_acntg_cost_unit_new_vehicle] [numeric](4,0) NULL,
   [in_accounting_make] [numeric](4,0) NULL,
   [in_registration_reference] [varchar](50) NULL,
   [in_expected_repair_cost] [numeric](11,2) NULL,
   [in_order_status] [varchar](10) NULL,
   [out_subsidiary] [int] NULL,
   [out_is_ready_for_sale] [varchar](10) NULL,
   [out_ready_for_sale_date] [datetime] NULL,
   [out_sale_type] [varchar](10) NULL,
   [out_sales_contract_number] [varchar](50) NULL,
   [out_sales_contract_date] [datetime] NULL,
   [out_is_sales_contract_confrmed] [varchar](10) NULL,
   [out_salesman_number_1] [int] NULL,
   [out_salesman_number_2] [int] NULL,
   [out_desired_shipment_date] [datetime] NULL,
   [out_is_registration_included] [varchar](10) NULL,
   [out_recommended_retail_price] [numeric](11,2) NULL,
   [out_extra_expenses] [numeric](11,2) NULL,
   [out_sale_price] [numeric](11,2) NULL,
   [out_sale_price_dealer] [numeric](11,2) NULL,
   [out_sale_price_minimum] [numeric](11,2) NULL,
   [out_sale_price_internet] [numeric](11,2) NULL,
   [out_estimated_invoice_value] [numeric](11,2) NULL,
   [out_discount_percent_vehicle] [numeric](11,5) NULL,
   [out_discount_percent_accessory] [numeric](11,5) NULL,
   [out_order_number] [int] NULL,
   [out_invoice_type] [int] NULL,
   [out_invoice_number] [int] NULL,
   [out_invoice_date] [datetime] NULL,
   [out_deposit_invoice_type] [int] NULL,
   [out_deposit_invoice_number] [int] NULL,
   [out_deposit_value] [numeric](11,2) NULL,
   [out_license_plate] [varchar](50) NULL,
   [out_make_number] [int] NULL,
   [out_model_code] [varchar](100) NULL,
   [out_license_plate_country] [varchar](10) NULL,
   [out_license_plate_season] [varchar](50) NULL,
   [calc_basic_charge] [numeric](11,2) NULL,
   [calc_accessory] [numeric](11,2) NULL,
   [calc_extra_expenses] [numeric](11,2) NULL,
   [calc_usage_value_encr_external] [numeric](11,2) NULL,
   [calc_usage_value_encr_internal] [numeric](11,2) NULL,
   [calc_usage_value_encr_other] [numeric](11,2) NULL,
   [calc_total_writedown] [numeric](11,2) NULL,
   [calc_cost_percent_stockingdays] [numeric](5,0) NULL,
   [calc_interest_percent_stkdays] [numeric](8,3) NULL,
   [calc_actual_payed_interest] [numeric](11,2) NULL,
   [calc_commission_for_arranging] [numeric](11,2) NULL,
   [calc_commission_for_salesman] [numeric](11,2) NULL,
   [calc_cost_internal_invoices] [numeric](11,2) NULL,
   [calc_cost_other] [numeric](11,2) NULL,
   [calc_sales_aid] [numeric](11,2) NULL,
   [calc_sales_aid_finish] [numeric](11,2) NULL,
   [calc_sales_aid_bonus] [numeric](11,2) NULL,
   [calc_returns_workshop] [numeric](11,2) NULL,
   [exclusive_reserved_employee_no] [int] NULL,
   [exclusive_reserved_until] [datetime] NULL,
   [pre_owned_car_code] [varchar](10) NULL,
   [is_sale_internet] [varchar](10) NULL,
   [is_sale_prohibit] [varchar](10) NULL,
   [is_agency_business] [varchar](10) NULL,
   [is_rental_or_school_vehicle] [varchar](10) NULL,
   [previous_owner_number] [int] NULL,
   [mileage_km] [int] NULL,
   [memo] [varchar](255) NULL,
   [keys_box_number] [int] NULL,
   [last_change_date] [datetime] NULL,
   [last_change_employee_no] [int] NULL,
   [created_date] [datetime] NULL,
   [created_employee_no] [int] NULL,
   [has_financing_example] [smallint] NULL,
   [has_leasing_example_ref] [smallint] NULL,
   [deactivated_by_employee_no] [int] NULL,
   [deactivated_date] [datetime] NULL,
   [access_limit] [int] NULL,
   [lock_by_workstation] [int] NULL,
   [lock_time] [datetime] NULL,
   [lock_trace] [varchar](255) NULL,
   [lock_trigger] [varchar](255) NULL,
   [lock_by_employee] [int] NULL,
   [lock_sourcecode] [varchar](255) NULL,
   [client_db] [varchar](20) NOT NULL

   ,CONSTRAINT [dealer_vehicles$0] PRIMARY KEY CLUSTERED ([dealer_vehicle_type], [dealer_vehicle_number], [client_db])
)


GO
