ALTER TABLE `tbltax` ADD `level` INT( 1 ) NOT NULL AFTER `id` ;
UPDATE tbltax SET level='1';
ALTER TABLE `tblinvoices` ADD `tax2` DECIMAL( 10, 2 ) NOT NULL AFTER `tax` ;
ALTER TABLE `tblinvoices` ADD `taxrate2` DECIMAL( 10, 2 ) NOT NULL AFTER `taxrate` ;
INSERT INTO `tblconfiguration` (`setting`,`value` ) VALUES ('TaxL2Compound','');
INSERT INTO `tblemailtemplates` (`type`, `name`, `subject`, `message`, `fromname`, `fromemail`, `disabled`, `custom`, `language`, `copyto`, `plaintext`) VALUES ('support', 'Support Ticket Auto Close Notification', 'Support Ticket Resolved', '<p>[CustomerName],</p><p>This is a notification to let you know that we are changing the status of your ticket #[TicketID] to Closed as we have not received a response from you in over [AutoCloseTime] hours.</p><p>Subject: [Subject]<br>Department: [Department]<br>Priority: [Priority]<br>Status: [Status]</p><p>If you have any further questions then please just reply to re-open the ticket.</p><p>[Signature]</p>', '', '', '', '', '', '', '0');
INSERT INTO `tblemailtemplates` (`type`, `name`, `subject`, `message`, `fromname`, `fromemail`, `disabled`, `custom`, `language`, `copyto`, `plaintext`) VALUES ('invoice', 'Credit Card Payment Due', 'Invoice Payment Reminder', '<p>Dear [CustomerName],</p><p>This is a notice to remind you that you have an invoice due on [DueDate]. We tried to bill you automatically but were unable to because we don\'t have your credit card details on file.</p><p>Invoice Date: [InvoiceDate]<br>Invoice #[InvoiceNo]<br>Amount Due: [AmountDue]<br>Due Date: [DueDate]</p><p>Please login to our client area at the link below to submit your card details or make payment using a different method.</p><p>[InvoiceLink]</p><p>[Signature]</p>', '', '', '', '', '', '', '0');
ALTER TABLE `tblclients` ADD `latefeeoveride` TEXT NOT NULL AFTER `taxexempt` ;
ALTER TABLE `tblclients` ADD `overideduenotices` TEXT NOT NULL AFTER `latefeeoveride` ;
UPDATE tblproductconfigoptions SET optiontype='1';
ALTER TABLE `tblhostingconfigoptions` ADD `qty` INT( 10 ) NOT NULL ;
ALTER TABLE `tblpromotions` DROP `item`, DROP `addons`;
ALTER TABLE `tblpromotions` CHANGE `code` `code` TEXT NOT NULL AFTER id, CHANGE `type` `recurring` INT(1) AFTER code, CHANGE `discount` `type` TEXT NOT NULL AFTER code, CHANGE `appliesto` `cycles` TEXT NOT NULL AFTER value, CHANGE `packages` `appliesto` TEXT NOT NULL AFTER cycles;
UPDATE tblpromotions SET recurring='1' WHERE type='Recurring';
ALTER TABLE `tblpromotions` ADD `applyonce` INT( 1 ) NOT NULL, ADD `newsignups` INT( 1 ) NOT NULL ;
UPDATE tblpromotions SET type='Fixed Amount' WHERE type='Money Value';
INSERT INTO `tblemailtemplates` (`id`, `type`, `name`, `subject`, `message`, `fromname`, `fromemail`, `disabled`, `custom`, `language`, `copyto`, `plaintext`) VALUES (NULL, 'product', 'Cancellation Request Confirmation', 'Cancellation Request Confirmation', '<p>Dear {$client_name},</p><p>This email is to confirm that we have received your cancellation request for the service listed below.</p><p>Product/Service: {$service_product_name}<br />Domain: {$service_domain}</p><p>If you requested immediate cancellation then the service will be terminated within the next 24 hours. If however you chose end of billing cycle, it will not be cancelled until {$service_next_due_date}.</p><p>Thank you for using {$company_name} and we hope to see you again in the future.</p><p>{$signature}</p>', '', '', '', '', '', '', '0');
ALTER TABLE `tbltickets` ADD `service` TEXT NOT NULL ;
ALTER TABLE `tblaffiliatesaccounts`  DROP `domain`,  DROP `package`,  DROP `billingcycle`,  DROP `regdate`,  DROP `amount`,  DROP `commission`;
ALTER TABLE `tblaffiliatesaccounts` CHANGE `id` `id` INT( 10 ) NOT NULL AUTO_INCREMENT , CHANGE `relid` `relid` INT( 10 ) NOT NULL AFTER affiliateid;
DROP TABLE IF EXISTS `tblaffiliateswithdrawals`;
CREATE TABLE IF NOT EXISTS `tblaffiliateswithdrawals` (  `id` int(10) NOT NULL auto_increment,  `affiliateid` int(10) NOT NULL,  `date` date NOT NULL,  `amount` decimal(10,2) NOT NULL,  PRIMARY KEY  (`id`),  KEY `affiliateid` (`affiliateid`)) DEFAULT CHARSET=utf8;
ALTER TABLE `tblservers` ADD `hostname` TEXT NOT NULL AFTER `ipaddress` ;
