ALTER TABLE `invoice_item_template` ADD `setup_fee` DOUBLE NOT NULL DEFAULT '0' AFTER `price`;
ALTER TABLE `invoice_recurring_item` ADD `setup_fee` DOUBLE NOT NULL DEFAULT '0' AFTER `price`;
ALTER TABLE `invoice_recurring_item` ADD `cancellation_period` INT NOT NULL DEFAULT '30' AFTER `advance_payment`;
ALTER TABLE `invoice_item_template` ADD `cancellation_period` INT NOT NULL DEFAULT '30' AFTER `recur_months`;
ALTER TABLE `invoice_payment_term` ADD `invoice_explanation` TEXT NULL;
ALTER TABLE `invoice` ADD `annotation` TEXT NULL DEFAULT NULL;
ALTER TABLE `invoice_client_settings` ADD `last_invoice_number` INT NOT NULL DEFAULT '0',
ADD `last_refund_number` INT NOT NULL DEFAULT '0',
ADD `last_proforma_number` INT NOT NULL DEFAULT '0';
ALTER TABLE `invoice` ADD `status_refunded` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n' AFTER `status_paid`;
ALTER TABLE `invoice_company` ADD `bcc_email` VARCHAR( 255 ) NULL DEFAULT NULL;
ALTER TABLE `invoice_settings` ADD `recurring_invoices_cron_active` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n',
ADD `recurring_invoices_cron_test` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n',
ADD `recurring_invoices_cron_finalize_invoices` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'y',
ADD `recurring_invoices_cron_send_invoices` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'y',
ADD `recurring_invoices_cron_email_template_id` BIGINT NOT NULL DEFAULT '0',
ADD `recurring_invoices_cron_proforma_invoice` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n';
ALTER TABLE `invoice_item_template` ADD `offer_in_shop` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n';
ALTER TABLE `invoice_item_template` ADD `is_standalone` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'y';
ALTER TABLE `invoice_item_template` ADD `is_addon` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n';
ALTER TABLE `invoice_item_template` ADD `is_updowngradable` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n';
ALTER TABLE `invoice_item_template` ADD `addon_of` TEXT;
ALTER TABLE `invoice_item_template` ADD `updowngradable_to` TEXT;
UPDATE invoice_settings SET revnum = 4 WHERE invoice_settings_id = 1;