-
Notifications
You must be signed in to change notification settings - Fork 8
Manually Add Domain
apmuthu edited this page Dec 8, 2014
·
4 revisions
The multi domain feature needs an extension to add a new domain - this is not yet available.
To manually add a domain into SI, edit the initial 3 variable values in the following sql and execute them on the SI database:
/* New Domain Addition */
SET @domainname:='simpleinvoices.org'; -- second domain will now be domain2@simpleinvoices.org
SET @domainpwd:='simpleinvoices'; -- new domain admin password
SET @domainnum:=2;
INSERT INTO `si_custom_fields` (`cf_id`, `cf_custom_field`, `cf_custom_label`, `cf_display`, `domain_id`) VALUES
( 1, 'biller_cf1', NULL, '0', @domainnum)
,( 2, 'biller_cf2', NULL, '0', @domainnum)
,( 3, 'biller_cf3', NULL, '0', @domainnum)
,( 4, 'biller_cf4', NULL, '0', @domainnum)
,( 5, 'customer_cf1', NULL, '0', @domainnum)
,( 6, 'customer_cf2', NULL, '0', @domainnum)
,( 7, 'customer_cf3', NULL, '0', @domainnum)
,( 8, 'customer_cf4', NULL, '0', @domainnum)
,( 9, 'product_cf1', NULL, '0', @domainnum)
,(10, 'product_cf2', NULL, '0', @domainnum)
,(11, 'product_cf3', NULL, '0', @domainnum)
,(12, 'product_cf4', NULL, '0', @domainnum)
,(13, 'invoice_cf1', NULL, '0', @domainnum)
,(14, 'invoice_cf2', NULL, '0', @domainnum)
,(15, 'invoice_cf3', NULL, '0', @domainnum)
,(16, 'invoice_cf4', NULL, '0', @domainnum);
INSERT INTO `si_payment_types` (`pt_id`, `domain_id`, `pt_description`, `pt_enabled`) VALUES
(1, @domainnum, 'Cash', '1')
,(2, @domainnum, 'Credit Card', '1');
INSERT INTO `si_preferences` (`pref_id`, `domain_id`, `pref_description`, `pref_currency_sign`, `pref_inv_heading`, `pref_inv_wording`, `pref_inv_detail_heading`, `pref_inv_detail_line`, `pref_inv_payment_method`, `pref_inv_payment_line1_name`, `pref_inv_payment_line1_value`, `pref_inv_payment_line2_name`, `pref_inv_payment_line2_value`, `pref_enabled`, `status`, `locale`, `language`, `index_group`, `currency_code`, `include_online_payment`, `currency_position`) VALUES
(1, @domainnum, 'AltInvoice', '$', 'Invoice', 'Invoice', 'Details', 'Payment is to be made within 14 days of the invoice being sent', 'Electronic Funds Transfer', 'Account name', 'H. & M. Simpson', 'Account number:', '0123-4567-7890', '1', 1, 'en_GB', 'en_GB', 1, 'USD', NULL, 'left')
,(2, @domainnum, 'AltReceipt', '$', 'Receipt', 'Receipt', 'Details', '<br />This transaction has been paid in full, please keep this receipt as proof of purchase.<br /> Thank you', '', '', '', '', '', '1', 1, 'en_GB', 'en_GB', 1, 'USD', NULL, 'left')
,(3, @domainnum, 'AltEstimate', '$', 'Estimate', 'Estimate', 'Details', '<br />This is an estimate of the final value of services rendered.<br />Thank you', '', '', '', '', '', '1', 1, 'en_GB', 'en_GB', 1, 'USD', NULL, 'left')
,(4, @domainnum, 'AltQuote', '$', 'Quote', 'Quote', 'Details', '<br />This is a quote of the final value of services rendered.<br />Thank you', '', '', '', '', '', '1', 1, 'en_GB', 'en_GB', 1, 'USD', NULL, 'left');
INSERT INTO `si_system_defaults` SELECT * FROM (
SELECT NULL AS id, a.name, a.value, @domainnum AS domain_id, extension_id
FROM `si_system_defaults` a
WHERE a.domain_id = 1
AND a.name NOT IN (SELECT b.name FROM `si_system_defaults` b WHERE b.domain_id = @domainnum)) c;
INSERT INTO `si_tax` (`tax_id`, `tax_description`, `tax_percentage`, `type`, `tax_enabled`, `domain_id`) VALUES
(1, 'No Tax', 0.000000, '%', '1', @domainnum)
,(2, 'GST', 7.000000, '%', '1', @domainnum)
,(3, 'VAT', 10.000000, '%', '1', @domainnum)
,(4, 'Sales Tax', 10.000000, '%', '1', @domainnum)
,(5, 'Postage', 20.000000, '$', '1', @domainnum);
INSERT INTO `si_user` (`id`, `email`, `role_id`, `domain_id`, `password`, `enabled`, `user_id`) VALUES
(1, CONCAT('domain', @domainnum, '@', @domainname), 1, @domainnum, MD5(@domainpwd), 1, 0);
INSERT INTO `si_user_domain` (`id`, `name`) VALUES
(@domainnum, CONCAT('domain', @domainnum));