-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 28, 2011 at 05:21 PM
-- Server version: 5.1.37
-- PHP Version: 5.3.0

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `ispconfig3_pro`
--

-- --------------------------------------------------------

--
-- Table structure for table `invoice`
--

CREATE TABLE IF NOT EXISTS `invoice` (
  `invoice_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `sys_userid` int(11) NOT NULL DEFAULT '0',
  `sys_groupid` int(11) NOT NULL DEFAULT '0',
  `sys_perm_user` varchar(5) DEFAULT NULL,
  `sys_perm_group` varchar(5) DEFAULT NULL,
  `sys_perm_other` varchar(5) DEFAULT NULL,
  `idhash` varchar(64) NOT NULL,
  `invoice_type` enum('invoice','refund','proforma','reminder') NOT NULL DEFAULT 'invoice',
  `reminder_step` tinyint(1) NOT NULL DEFAULT '0',
  `invoice_company_id` int(10) unsigned NOT NULL DEFAULT '0',
  `client_id` int(11) NOT NULL DEFAULT '0',
  `invoice_number` varchar(255) DEFAULT NULL,
  `invoice_date` date NOT NULL,
  `payment_date` date NOT NULL,
  `company_name` varchar(255) DEFAULT NULL,
  `contact_name` varchar(255) DEFAULT NULL,
  `street` varchar(255) DEFAULT NULL,
  `zip` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `state` varchar(255) DEFAULT NULL,
  `country` varchar(255) NOT NULL DEFAULT 'DE',
  `email` varchar(255) DEFAULT NULL,
  `vat_id` varchar(255) NOT NULL,
  `payment_terms` int(11) NOT NULL DEFAULT '0',
  `payment_gateway` varchar(255) NOT NULL,
  `status_printed` varchar(255) NOT NULL DEFAULT 'n',
  `status_sent` varchar(255) NOT NULL DEFAULT 'n',
  `status_paid` varchar(255) NOT NULL DEFAULT 'n',
  `status_reminded` enum('n','y') NOT NULL DEFAULT 'n',
  `status_refunded` enum('n','y') NOT NULL DEFAULT 'n',
  `invoice_amount` double NOT NULL DEFAULT '0',
  `notes` text,
  `annotation` text,
  PRIMARY KEY (`invoice_id`)
) ENGINE=MyISAM;

--
-- Dumping data for table `invoice`
--

-- --------------------------------------------------------

--
-- Table structure for table `invoice_client_settings`
--

CREATE TABLE IF NOT EXISTS `invoice_client_settings` (
  `client_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `sys_userid` int(11) NOT NULL DEFAULT '0',
  `sys_groupid` int(11) NOT NULL DEFAULT '0',
  `sys_perm_user` varchar(5) DEFAULT NULL,
  `sys_perm_group` varchar(5) DEFAULT NULL,
  `sys_perm_other` varchar(5) DEFAULT NULL,
  `invoice_company_id` int(11) NOT NULL DEFAULT '0',
  `payment_email` varchar(255) DEFAULT NULL,
  `payment_terms` varchar(255) DEFAULT NULL,
  `payment_gateway` varchar(255) DEFAULT NULL,
  `no_invoice_sending` varchar(255) NOT NULL DEFAULT 'n',
  `last_invoice_number` int(11) NOT NULL DEFAULT '0',
  `last_refund_number` int(11) NOT NULL DEFAULT '0',
  `last_proforma_number` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`client_id`)
) ENGINE=MyISAM ;

-- --------------------------------------------------------

--
-- Table structure for table `invoice_company`
--

CREATE TABLE IF NOT EXISTS `invoice_company` (
  `invoice_company_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `sys_userid` int(11) NOT NULL DEFAULT '0',
  `sys_groupid` int(11) NOT NULL DEFAULT '0',
  `sys_perm_user` varchar(5) DEFAULT NULL,
  `sys_perm_group` varchar(5) DEFAULT NULL,
  `sys_perm_other` varchar(5) DEFAULT NULL,
  `company_name` varchar(255) DEFAULT NULL,
  `company_name_short` varchar(255) DEFAULT NULL,
  `contact_name` varchar(255) DEFAULT NULL,
  `street` varchar(255) DEFAULT NULL,
  `zip` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `state` varchar(255) DEFAULT NULL,
  `country` varchar(255) NOT NULL DEFAULT 'DE',
  `email` varchar(255) DEFAULT NULL,
  `internet` varchar(255) DEFAULT NULL,
  `telephone` varchar(255) DEFAULT NULL,
  `fax` varchar(255) DEFAULT NULL,
  `company_logo` varchar(255) DEFAULT NULL,
  `ceo_name` varchar(255) DEFAULT NULL,
  `vat_id` varchar(255) DEFAULT NULL,
  `tax_id` varchar(255) DEFAULT NULL,
  `company_register` varchar(255) DEFAULT NULL,
  `bank_account_owner` varchar(255) DEFAULT NULL,
  `bank_account_number` varchar(255) DEFAULT NULL,
  `bank_code` varchar(255) DEFAULT NULL,
  `bank_name` varchar(255) DEFAULT NULL,
  `bank_account_iban` varchar(255) DEFAULT NULL,
  `bank_account_swift` varchar(255) DEFAULT NULL,
  `last_invoice_number` varchar(255) DEFAULT NULL,
  `invoice_number_prefix` varchar(255) DEFAULT NULL,
  `last_refund_number` int(11) NOT NULL,
  `refund_number_prefix` varchar(255) NOT NULL,
  `last_proforma_number` int(11) NOT NULL,
  `proforma_number_prefix` varchar(255) NOT NULL,
  `invoice_pdf_template` VARCHAR( 255 ) NOT NULL DEFAULT  'default',
  `reminder_pdf` enum( 'n', 'y' ) NOT NULL DEFAULT 'n',
  `reminder_fee` double NOT NULL DEFAULT '0',
  `reminder_fee_step` tinyint(2) UNSIGNED NOT NULL DEFAULT '1',
  `reminder_steps` tinyint(2) UNSIGNED NOT NULL DEFAULT '3',
  `chargeback_fee` double NOT NULL DEFAULT '0',
  `reminder_payment_terms` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  `reminder_last_payment_terms` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  `chargeback_payment_terms` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  `sender_name` varchar(255) NOT NULL DEFAULT '',
  `sender_email` varchar(255) NOT NULL DEFAULT '',
  `bcc_email` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`invoice_company_id`)
) ENGINE=MyISAM;

--
-- Dumping data for table `invoice_company`
--

INSERT INTO `invoice_company` (`invoice_company_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `company_name`, `contact_name`, `street`, `zip`, `city`, `state`, `country`, `email`, `internet`, `telephone`, `fax`, `company_logo`, `ceo_name`, `vat_id`, `tax_id`, `company_register`, `bank_account_number`, `bank_code`, `bank_name`, `bank_account_iban`, `bank_account_swift`, `last_invoice_number`, `invoice_number_prefix`, `last_refund_number`, `refund_number_prefix`, `last_proforma_number`, `proforma_number_prefix`) VALUES(1, 1, 1, 'riud', 'riud', '', 'test corp', 'John Doe', 'Mainstreet 12', '12345', 'The City', 'MyState', 'DE', 'info@test.tld', 'www.test.tld', '1234-5678', '1234-5678', '', 'John Doe', 'DE00000000', '', 'HRB0000', '12345', '1234567', 'Bank', '12345', '12345', '1', 'IV2011', 1, 'RF2011', 1, 'PR2011');

-- --------------------------------------------------------

--
-- Table structure for table `invoice_item`
--

CREATE TABLE IF NOT EXISTS `invoice_item` (
  `invoice_item_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `invoice_id` int(10) unsigned NOT NULL,
  `invoice_item_template_id` int(10) unsigned NOT NULL,
  `quantity` int(11) NOT NULL,
  `price` double NOT NULL,
  `vat` DECIMAL( 5, 2 ) NOT NULL,
  `description` text NOT NULL,
  PRIMARY KEY (`invoice_item_id`)
) ENGINE=MyISAM;

--
-- Dumping data for table `invoice_item`
--

-- --------------------------------------------------------

--
-- Table structure for table `invoice_item_template`
--

CREATE TABLE IF NOT EXISTS `invoice_item_template` (
  `invoice_item_template_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `sys_userid` int(11) NOT NULL DEFAULT '0',
  `sys_groupid` int(11) NOT NULL DEFAULT '0',
  `sys_perm_user` varchar(5) DEFAULT NULL,
  `sys_perm_group` varchar(5) DEFAULT NULL,
  `sys_perm_other` varchar(5) DEFAULT NULL,
  `type` varchar(255) NOT NULL DEFAULT 'default',
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `price` double NOT NULL DEFAULT '0',
  `setup_fee` double NOT NULL DEFAULT '0',
  `vat` DECIMAL( 5, 2 ) NOT NULL DEFAULT '0',
  `unit` varchar(255) NOT NULL DEFAULT 'default',
  `recur_months` int(11) NOT NULL DEFAULT '0',
  `cancellation_period` int(11) NOT NULL DEFAULT '30',
  `client_template_id` int(11) NOT NULL DEFAULT '0',
  `offer_in_shop` enum('n','y') NOT NULL DEFAULT 'n',
  `is_standalone` enum('n','y') NOT NULL DEFAULT 'y',
  `is_addon` enum('n','y') NOT NULL DEFAULT 'n',
  `is_updowngradable` enum('n','y') NOT NULL DEFAULT 'n',
  `addon_of` text,
  `updowngradable_to` text,
  PRIMARY KEY (`invoice_item_template_id`)
) ENGINE=MyISAM;

--
-- Dumping data for table `invoice_item_template`
--

-- --------------------------------------------------------

--
-- Table structure for table `invoice_message`
--

CREATE TABLE IF NOT EXISTS `invoice_message` (
  `invoice_message_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `sys_userid` int(11) NOT NULL DEFAULT '0',
  `sys_groupid` int(11) NOT NULL DEFAULT '0',
  `sys_perm_user` varchar(5) DEFAULT NULL,
  `sys_perm_group` varchar(5) DEFAULT NULL,
  `sys_perm_other` varchar(5) DEFAULT NULL,
  `invoice_company_id` int(11) NOT NULL DEFAULT '0',
  `client_id` int(11) NOT NULL DEFAULT '0',
  `message_template_id` int(11) NOT NULL DEFAULT '0',
  `message_type` varchar(255) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `message` longtext,
  `invoice_id` int(11) NOT NULL DEFAULT '0',
  `message_sent_date` date NOT NULL,
  `message_status` varchar(255) NOT NULL DEFAULT 'draft',
  PRIMARY KEY (`invoice_message_id`)
) ENGINE=MyISAM;

--
-- Dumping data for table `invoice_message`
--


-- --------------------------------------------------------

--
-- Table structure for table `invoice_message_template`
--

CREATE TABLE IF NOT EXISTS `invoice_message_template` (
  `invoice_message_template_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `sys_userid` int(11) NOT NULL DEFAULT '0',
  `sys_groupid` int(11) NOT NULL DEFAULT '0',
  `sys_perm_user` varchar(5) DEFAULT NULL,
  `sys_perm_group` varchar(5) DEFAULT NULL,
  `sys_perm_other` varchar(5) DEFAULT NULL,
  `template_type` varchar(255) DEFAULT NULL,
  `template_name` varchar(255) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `message` text,
  PRIMARY KEY (`invoice_message_template_id`)
) ENGINE=MyISAM;

--
-- Dumping data for table `invoice_message_template`
--

INSERT INTO `invoice_message_template` (`invoice_message_template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `template_type`, `template_name`, `subject`, `message`) VALUES(1, 1, 1, 'riud', 'riud', '', 'invoice', 'Standard invoice email', 'Your invoice', 'Please find attached your invoice.\n\nBest Regards\n\nyour hosting company');
INSERT INTO `invoice_message_template` (`invoice_message_template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `template_type`, `template_name`, `subject`, `message`) VALUES(2, 1, 1, 'riud', 'riud', '', 'reminder', 'Standard invoice email reminder', 'Unpaid invoice reminder', 'Please check if you paid the invoice.\n\nBest Regards\n\nyour hosting company');

-- --------------------------------------------------------

--
-- Table structure for table `invoice_payment_term`
--

CREATE TABLE IF NOT EXISTS `invoice_payment_term` (
  `invoice_payment_term_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `sys_userid` int(11) NOT NULL DEFAULT '0',
  `sys_groupid` int(11) NOT NULL DEFAULT '0',
  `sys_perm_user` varchar(5) DEFAULT NULL,
  `sys_perm_group` varchar(5) DEFAULT NULL,
  `sys_perm_other` varchar(5) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `due_days` int(11) NOT NULL DEFAULT '0',
  `invoice_explanation` text,
  PRIMARY KEY (`invoice_payment_term_id`)
) ENGINE=MyISAM;

--
-- Dumping data for table `invoice_payment_term`
--

INSERT INTO `invoice_payment_term` (`invoice_payment_term_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `description`, `due_days`) VALUES(1, 1, 1, 'riud', 'riud', '', '30 Tage netto', 'Netto 30 Tg', 30);
INSERT INTO `invoice_payment_term` (`invoice_payment_term_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `description`, `due_days`) VALUES(2, 1, 1, 'riud', 'riud', '', '15 tg', '15 tg', 15);
INSERT INTO `invoice_payment_term` (`invoice_payment_term_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `description`, `due_days`) VALUES(3, 1, 1, 'riud', 'riud', '', '60 tg', '60 tg', 60);

-- --------------------------------------------------------

--
-- Table structure for table `invoice_payment_log`
--

CREATE TABLE IF NOT EXISTS `invoice_payment_log` (
  `payment_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL,
  `invoice_number` varchar(255) NOT NULL,
  `gateway` varchar(255) NOT NULL,
  `status` varchar(255) NOT NULL,
  `verification` varchar(255) NOT NULL,
  `received_date` datetime NOT NULL,
  `message` text NOT NULL,
  `rawdata` longtext NOT NULL,
  PRIMARY KEY (`payment_id`),
  UNIQUE KEY `payment_id` (`payment_id`)
) ENGINE=MyISAM ;

-- --------------------------------------------------------

--
-- Table structure for table `invoice_recurring_item`
--

CREATE TABLE IF NOT EXISTS `invoice_recurring_item` (
  `invoice_recurring_item_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `sys_userid` int(11) NOT NULL DEFAULT '0',
  `sys_groupid` int(11) NOT NULL DEFAULT '0',
  `sys_perm_user` varchar(5) DEFAULT NULL,
  `sys_perm_group` varchar(5) DEFAULT NULL,
  `sys_perm_other` varchar(5) DEFAULT NULL,
  `invoice_item_template_id` int(11) NOT NULL DEFAULT '0',
  `invoice_company_id` int(10) unsigned NOT NULL DEFAULT '1',
  `client_id` int(10) unsigned NOT NULL DEFAULT '0',
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `quantity` int(11) NOT NULL DEFAULT '1',
  `price` double NOT NULL DEFAULT '0',
  `setup_fee` double NOT NULL DEFAULT '0',
  `vat` DECIMAL( 5, 2 ) NOT NULL DEFAULT '0',
  `recur_months` int(11) NOT NULL DEFAULT '0',
  `next_payment_date` date NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `advance_payment` enum('n','y') NOT NULL DEFAULT 'y',
  `cancellation_period` int(11) NOT NULL DEFAULT '30',
  `send_reminder` varchar(255) NOT NULL DEFAULT '',
  `active` enum('n','y') NOT NULL DEFAULT 'y',
  PRIMARY KEY (`invoice_recurring_item_id`)
) ENGINE=MyISAM;

--
-- Dumping data for table `invoice_recurring_item`
--

-- --------------------------------------------------------

--
-- Table structure for table `invoice_settings`
--

CREATE TABLE IF NOT EXISTS `invoice_settings` (
  `invoice_settings_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `sys_userid` int(11) NOT NULL DEFAULT '0',
  `sys_groupid` int(11) NOT NULL DEFAULT '0',
  `sys_perm_user` varchar(5) DEFAULT NULL,
  `sys_perm_group` varchar(5) DEFAULT NULL,
  `sys_perm_other` varchar(5) DEFAULT NULL,
  `date_format` varchar(255) DEFAULT NULL,
  `invoice_dir` varchar(255) NOT NULL,
  `invoice_pay_link` varchar(255) NOT NULL,
  `currency` varchar(64) NOT NULL DEFAULT 'EUR',
  `paypal_business` varchar(255) NOT NULL,
  `paypal_url` varchar(255) NOT NULL DEFAULT 'https://www.paypal.com/cgi-bin/webscr',
  `paypal_ipn_url` varchar(255) NOT NULL,
  `paypal_active` varchar(1) NOT NULL DEFAULT 'n',
  `invoice_item_list_with_vat` VARCHAR( 1 ) NOT NULL,
  `revnum` int(11) NOT NULL DEFAULT '3',
  `recurring_invoices_cron_active` enum('n','y') NOT NULL DEFAULT 'n',
  `recurring_invoices_cron_test` enum('n','y') NOT NULL DEFAULT 'n',
  `recurring_invoices_cron_finalize_invoices` enum('n','y') NOT NULL DEFAULT 'y',
  `recurring_invoices_cron_send_invoices` enum('n','y') NOT NULL DEFAULT 'y',
  `recurring_invoices_cron_email_template_id` bigint(20) NOT NULL DEFAULT '0',
  `recurring_invoices_cron_proforma_invoice` enum('n','y') NOT NULL DEFAULT 'n',
  PRIMARY KEY (`invoice_settings_id`)
) ENGINE=MyISAM;

--
-- Dumping data for table `invoice_settings`
--

INSERT INTO `invoice_settings` (`invoice_settings_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `date_format`, `invoice_dir`, `invoice_pay_link`, `currency`, `paypal_business`, `paypal_url`, `paypal_active`, `revnum`) VALUES(1, 1, 1, 'riud', 'riud', NULL, 'd.m.Y', '', '', 'EUR', 'ispconfig@test.tld', 'https://www.paypal.com/cgi-bin/webscr', 'y', 5);

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
