--
-- Дамп данных таблицы `Module`
--

INSERT INTO `Module` (`Module_Name`, `Keyword`, `Description`, `Parameters`, `Example_URL`, `Help_URL`, `Installed`, `Number`, `Inside_Admin`, `Checked`) VALUES
('NETCAT_MODULE_BILLS', 'bills', 'NETCAT_MODULE_BILLS_DESCRIPTION', '', '', '', 1, '', 0, 1);

--
-- Дамп данных таблицы `Settings`
--


INSERT INTO `Settings` (`Key`, `Value`, `Module`, `Catalogue_ID`) VALUES
('Vat', '0', 'bills', 0),
('LinkKey', concat(conv(crc32(rand()), 10, 36), conv(crc32(rand()), 10, 36)), 'bills', 0);

--
-- Структура таблицы `Bills_Company`
--

CREATE TABLE IF NOT EXISTS `Bills_Company` (
  `Company_ID` int(11) NOT NULL AUTO_INCREMENT,
  `Owner` tinyint(1) DEFAULT 0,
  `OPF` varchar(10) NOT NULL DEFAULT '',
  `Name` varchar(255) NOT NULL DEFAULT '',
  `Address` varchar(255) NOT NULL DEFAULT '',
  `Phone` varchar(255) NOT NULL DEFAULT '',
  `INN` varchar(20) NOT NULL DEFAULT '',
  `KPP` varchar(20) NOT NULL DEFAULT '',
  `Bank_Name` varchar(255) NOT NULL DEFAULT '',
  `Bank_Account` varchar(100) NOT NULL DEFAULT '',
  `Bank_Corr_Account` varchar(100) NOT NULL DEFAULT '',
  `Bank_INN` varchar(20) NOT NULL DEFAULT '',
  `Bank_BIK` varchar(20) NOT NULL DEFAULT '',
  PRIMARY KEY (`Company_ID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

--
-- Дамп данных таблицы `Bills_Company`
--

INSERT INTO `Bills_Company` (`Owner`) VALUES (1);

--
-- Структура таблицы `Bills_Bill`
--

CREATE TABLE IF NOT EXISTS `Bills_Bill` (
  `Bill_ID` int(11) NOT NULL AUTO_INCREMENT,
  `Type` enum ('juridical', 'physical') NOT NULL,
  `Number` varchar(20) NOT NULL,
  `Date` datetime NOT NULL,
  `Customer_ID` int(11) NOT NULL,
  `Customer_Name` varchar(100) NOT NULL,
  `Customer_Address` varchar(255) NOT NULL,
  `Positions` text NOT NULL,
  `Paid` tinyint(1) NOT NULL DEFAULT 0,
  `Status_Change_Date` datetime NOT NULL,
  PRIMARY KEY (`Bill_ID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

--
-- Структура таблицы `Bills_Act`
--

CREATE TABLE IF NOT EXISTS `Bills_Act` (
  `Act_ID` int(11) NOT NULL AUTO_INCREMENT,
  `Number` varchar(20) NOT NULL,
  `Date` datetime NOT NULL,
  `Bill_ID` int(11) NOT NULL,
  PRIMARY KEY (`Act_ID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;