diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index d039a7d05095..ce5323139020 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -789,10 +789,18 @@ class AccountController extends BaseController public function saveEmailSettings(SaveEmailSettings $request) { $account = $request->user()->account; - $account->fill($request->all()); - $account->bcc_email = $request->bcc_email; + $account->pdf_email_attachment = boolval(Input::get('pdf_email_attachment')); + $account->document_email_attachment = boolval(Input::get('document_email_attachment')); + $account->enable_email_markup = boolval(Input::get('enable_email_markup')); + $account->email_design_id = Input::get('email_design_id'); + $account->email_footer = trim(Input::get('email_footer')); $account->save(); + $settings = $account->account_email_settings; + $settings->bcc_email = trim(Input::get('bcc_email')); + $settings->reply_to_email = trim(Input::get('reply_to_email')); + $settings->save(); + return redirect('settings/' . ACCOUNT_EMAIL_SETTINGS) ->with('message', trans('texts.updated_settings')); } @@ -808,11 +816,11 @@ class AccountController extends BaseController foreach ([ENTITY_INVOICE, ENTITY_QUOTE, ENTITY_PAYMENT, REMINDER1, REMINDER2, REMINDER3] as $type) { $subjectField = "email_subject_{$type}"; $subject = Input::get($subjectField, $account->getEmailSubject($type)); - $account->$subjectField = ($subject == $account->getDefaultEmailSubject($type) ? null : $subject); + $account->account_email_settings->$subjectField = ($subject == $account->getDefaultEmailSubject($type) ? null : $subject); $bodyField = "email_template_{$type}"; $body = Input::get($bodyField, $account->getEmailTemplate($type)); - $account->$bodyField = ($body == $account->getDefaultEmailTemplate($type) ? null : $body); + $account->account_email_settings->$bodyField = ($body == $account->getDefaultEmailTemplate($type) ? null : $body); } foreach ([REMINDER1, REMINDER2, REMINDER3] as $type) { @@ -824,6 +832,7 @@ class AccountController extends BaseController } $account->save(); + $account->account_email_settings->save(); Session::flash('message', trans('texts.updated_settings')); } diff --git a/app/Http/Requests/SaveEmailSettings.php b/app/Http/Requests/SaveEmailSettings.php index 25696c6fff5b..1c7d91a3b89b 100644 --- a/app/Http/Requests/SaveEmailSettings.php +++ b/app/Http/Requests/SaveEmailSettings.php @@ -23,6 +23,7 @@ class SaveEmailSettings extends Request { return [ 'bcc_email' => 'email', + 'reply_to_email' => 'email', ]; } } diff --git a/app/Models/Account.php b/app/Models/Account.php index e3573b622190..03ada0d395df 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -173,7 +173,6 @@ class Account extends Eloquent 'payment_type_id', 'gateway_fee_enabled', 'reset_counter_date', - 'reply_to_email', ]; /** @@ -278,6 +277,14 @@ class Account extends Eloquent return $this->hasMany('App\Models\AccountGatewaySettings'); } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function account_email_settings() + { + return $this->hasOne('App\Models\AccountEmailSettings'); + } + /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ diff --git a/app/Models/AccountEmailSettings.php b/app/Models/AccountEmailSettings.php new file mode 100644 index 000000000000..752b2aea1e19 --- /dev/null +++ b/app/Models/AccountEmailSettings.php @@ -0,0 +1,32 @@ +hasFeature(FEATURE_CUSTOM_EMAILS)) { $field = "email_subject_{$entityType}"; - $value = $this->$field; + $value = $this->account_email_settings->$field; if ($value) { return preg_replace("/\r\n|\r|\n/", ' ', $value); @@ -84,7 +84,7 @@ trait SendsEmails if ($this->hasFeature(FEATURE_CUSTOM_EMAILS)) { $field = "email_template_{$entityType}"; - $template = $this->$field; + $template = $this->account_email_settings->$field; } if (! $template) { @@ -158,20 +158,27 @@ trait SendsEmails public function setTemplateDefaults($type, $subject, $body) { + $settings = $this->account_email_settings; + if ($subject) { - $this->{"email_subject_" . $type} = $subject; + $settings->{"email_subject_" . $type} = $subject; } if ($body) { - $this->{"email_template_" . $type} = $body; + $settings->{"email_template_" . $type} = $body; } - $this->save(); + $settings->save(); } public function getBccEmail() { - return $this->isPro() ? $this->bcc_email : false; + return $this->isPro() ? $this->account_email_settings->bcc_email : false; + } + + public function getReplyToEmail() + { + return $this->isPro() ? $this->account_email_settings->reply_to_email : false; } public function getFromEmail() @@ -182,13 +189,4 @@ trait SendsEmails return Domain::getEmailFromId($this->domain_id); } - - public function getReplyToEmail() - { - if (! $this->isPro()) { - return false; - } - - return $this->reply_to_email; - } } diff --git a/app/Ninja/Repositories/AccountRepository.php b/app/Ninja/Repositories/AccountRepository.php index 8129f034f0bb..f67dbb6b8251 100644 --- a/app/Ninja/Repositories/AccountRepository.php +++ b/app/Ninja/Repositories/AccountRepository.php @@ -3,6 +3,7 @@ namespace App\Ninja\Repositories; use App\Models\Account; +use App\Models\AccountEmailSettings; use App\Models\AccountGateway; use App\Models\AccountToken; use App\Models\Client; @@ -82,6 +83,9 @@ class AccountRepository $account->users()->save($user); + $emailSettings = new AccountEmailSettings(); + $account->account_email_settings()->save($emailSettings); + return $account; } diff --git a/app/Ninja/Transformers/AccountEmailSettingsTransformer.php b/app/Ninja/Transformers/AccountEmailSettingsTransformer.php new file mode 100644 index 000000000000..6239c8452939 --- /dev/null +++ b/app/Ninja/Transformers/AccountEmailSettingsTransformer.php @@ -0,0 +1,48 @@ + $settings->reply_to_email, + 'bcc_email' => $settings->bcc_email, + 'email_subject_invoice' => $settings->email_subject_invoice, + 'email_subject_quote' => $settings->email_subject_quote, + 'email_subject_payment' => $settings->email_subject_payment, + 'email_template_invoice' => $settings->email_template_invoice, + 'email_template_quote' => $settings->email_template_quote, + 'email_template_payment' => $settings->email_template_payment, + 'email_subject_reminder1' => $settings->email_subject_reminder1, + 'email_subject_reminder2' => $settings->email_subject_reminder2, + 'email_subject_reminder3' => $settings->email_subject_reminder3, + 'email_template_reminder1' => $settings->email_template_reminder1, + 'email_template_reminder2' => $settings->email_template_reminder2, + 'email_template_reminder3' => $settings->email_template_reminder3, + ]; + } +} diff --git a/app/Ninja/Transformers/AccountTransformer.php b/app/Ninja/Transformers/AccountTransformer.php index a7829b1f0620..7c11d68b834c 100644 --- a/app/Ninja/Transformers/AccountTransformer.php +++ b/app/Ninja/Transformers/AccountTransformer.php @@ -18,6 +18,7 @@ class AccountTransformer extends EntityTransformer 'tax_rates', 'expense_categories', 'projects', + 'account_email_settings', ]; /** @@ -29,6 +30,18 @@ class AccountTransformer extends EntityTransformer 'payments', ]; + /** + * @param Account $account + * + * @return \League\Fractal\Resource\Collection + */ + public function includeAccountEmailSettings(Account $account) + { + $transformer = new AccountEmailSettingsTransformer($account, $this->serializer); + + return $this->includeItem($account->account_email_settings, $transformer, 'account_email_settings'); + } + /** * @param Account $account * @@ -184,9 +197,6 @@ class AccountTransformer extends EntityTransformer 'quote_number_prefix' => $account->quote_number_prefix, 'quote_number_counter' => $account->quote_number_counter, 'share_counter' => (bool) $account->share_counter, - 'email_template_invoice' => $account->email_template_invoice, - 'email_template_quote' => $account->email_template_quote, - 'email_template_payment' => $account->email_template_payment, 'token_billing_type_id' => (int) $account->token_billing_type_id, 'invoice_footer' => $account->invoice_footer, 'pdf_email_attachment' => (bool) $account->pdf_email_attachment, @@ -195,15 +205,6 @@ class AccountTransformer extends EntityTransformer 'custom_design' => $account->custom_design, 'show_item_taxes' => (bool) $account->show_item_taxes, 'military_time' => (bool) $account->military_time, - 'email_subject_invoice' => $account->email_subject_invoice, - 'email_subject_quote' => $account->email_subject_quote, - 'email_subject_payment' => $account->email_subject_payment, - 'email_subject_reminder1' => $account->email_subject_reminder1, - 'email_subject_reminder2' => $account->email_subject_reminder2, - 'email_subject_reminder3' => $account->email_subject_reminder3, - 'email_template_reminder1' => $account->email_template_reminder1, - 'email_template_reminder2' => $account->email_template_reminder2, - 'email_template_reminder3' => $account->email_template_reminder3, 'enable_reminder1' => $account->enable_reminder1, 'enable_reminder2' => $account->enable_reminder2, 'enable_reminder3' => $account->enable_reminder3, @@ -265,7 +266,6 @@ class AccountTransformer extends EntityTransformer 'payment_type_id' => (int) $account->payment_type_id, 'gateway_fee_enabled' => (bool) $account->gateway_fee_enabled, 'reset_counter_date' => $account->reset_counter_date, - 'reply_to_email' => $account->reply_to_email, ]; } } diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php index f25fada776fb..d1e1ee1f7977 100644 --- a/app/Services/ImportService.php +++ b/app/Services/ImportService.php @@ -170,6 +170,10 @@ class ImportService $account = Auth::user()->account; $account->fill($settings); $account->save(); + + $emailSettings = $account->account_email_settings; + $emailSettings->fill($settings['account_email_settings']); + $emailSettings->save(); } if ($includeData) { diff --git a/database/migrations/2017_03_16_085702_add_gateway_fee_location.php b/database/migrations/2017_03_16_085702_add_gateway_fee_location.php index 7d2215cbf5d9..129b30439675 100644 --- a/database/migrations/2017_03_16_085702_add_gateway_fee_location.php +++ b/database/migrations/2017_03_16_085702_add_gateway_fee_location.php @@ -24,7 +24,6 @@ class AddGatewayFeeLocation extends Migration } $table->boolean('gateway_fee_enabled')->default(0); $table->date('reset_counter_date')->nullable(); - $table->string('reply_to_email')->nullable(); }); Schema::table('clients', function ($table) { @@ -41,6 +40,78 @@ class AddGatewayFeeLocation extends Migration left join invoices on invoices.id = invoice_items.invoice_id set invoice_item_type_id = 2 where invoices.has_tasks = 1'); + + Schema::create('account_email_settings', function ($table) { + $table->increments('id'); + $table->unsignedInteger('account_id')->index(); + $table->timestamps(); + + $table->string('reply_to_email')->nullable(); + $table->string('bcc_email')->nullable(); + + $table->string('email_subject_invoice'); + $table->string('email_subject_quote'); + $table->string('email_subject_payment'); + $table->text('email_template_invoice'); + $table->text('email_template_quote'); + $table->text('email_template_payment'); + + $table->string('email_subject_reminder1'); + $table->string('email_subject_reminder2'); + $table->string('email_subject_reminder3'); + $table->text('email_template_reminder1'); + $table->text('email_template_reminder2'); + $table->text('email_template_reminder3'); + + $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); + }); + + DB::statement('insert into account_email_settings (account_id, + bcc_email, + email_subject_invoice, + email_subject_quote, + email_subject_payment, + email_template_invoice, + email_template_quote, + email_template_payment, + email_subject_reminder1, + email_subject_reminder2, + email_subject_reminder3, + email_template_reminder1, + email_template_reminder2, + email_template_reminder3 + ) + select id, + bcc_email, + email_subject_invoice, + email_subject_quote, + email_subject_payment, + email_template_invoice, + email_template_quote, + email_template_payment, + email_subject_reminder1, + email_subject_reminder2, + email_subject_reminder3, + email_template_reminder1, + email_template_reminder2, + email_template_reminder3 + from accounts;'); + + Schema::table('accounts', function ($table) { + $table->dropColumn('email_subject_invoice'); + $table->dropColumn('email_subject_quote'); + $table->dropColumn('email_subject_payment'); + $table->dropColumn('email_template_invoice'); + $table->dropColumn('email_template_quote'); + $table->dropColumn('email_template_payment'); + $table->dropColumn('email_subject_reminder1'); + $table->dropColumn('email_subject_reminder2'); + $table->dropColumn('email_subject_reminder3'); + $table->dropColumn('email_template_reminder1'); + $table->dropColumn('email_template_reminder2'); + $table->dropColumn('email_template_reminder3'); + }); + } /** @@ -53,7 +124,6 @@ class AddGatewayFeeLocation extends Migration Schema::table('accounts', function ($table) { $table->dropColumn('gateway_fee_enabled'); $table->dropColumn('reset_counter_date'); - $table->dropColumn('reply_to_email'); }); Schema::table('clients', function ($table) { diff --git a/database/seeds/UserTableSeeder.php b/database/seeds/UserTableSeeder.php index 05c418a46d72..54cea6d967f9 100644 --- a/database/seeds/UserTableSeeder.php +++ b/database/seeds/UserTableSeeder.php @@ -1,6 +1,7 @@ true, ]); + $emailSettings = AccountEmailSettings::create([ + 'account_id' => $account->id + ]); + $user = User::create([ 'first_name' => $faker->firstName, 'last_name' => $faker->lastName, diff --git a/database/setup.sql b/database/setup.sql index b9dff9435d42..a4b5beeceeaf 100644 --- a/database/setup.sql +++ b/database/setup.sql @@ -15,6 +15,47 @@ /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +-- +-- Table structure for table `account_email_settings` +-- + +DROP TABLE IF EXISTS `account_email_settings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_email_settings` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `account_id` int(10) unsigned NOT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + `reply_to_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `bcc_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `email_subject_invoice` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `email_subject_quote` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `email_subject_payment` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `email_template_invoice` text COLLATE utf8_unicode_ci NOT NULL, + `email_template_quote` text COLLATE utf8_unicode_ci NOT NULL, + `email_template_payment` text COLLATE utf8_unicode_ci NOT NULL, + `email_subject_reminder1` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `email_subject_reminder2` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `email_subject_reminder3` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `email_template_reminder1` text COLLATE utf8_unicode_ci NOT NULL, + `email_template_reminder2` text COLLATE utf8_unicode_ci NOT NULL, + `email_template_reminder3` text COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `account_email_settings_account_id_index` (`account_id`), + CONSTRAINT `account_email_settings_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_email_settings` +-- + +LOCK TABLES `account_email_settings` WRITE; +/*!40000 ALTER TABLE `account_email_settings` DISABLE KEYS */; +/*!40000 ALTER TABLE `account_email_settings` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `account_gateway_settings` -- @@ -232,9 +273,6 @@ CREATE TABLE `accounts` ( `quote_number_counter` int(11) DEFAULT '1', `share_counter` tinyint(1) NOT NULL DEFAULT '1', `id_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `email_template_invoice` text COLLATE utf8_unicode_ci, - `email_template_quote` text COLLATE utf8_unicode_ci, - `email_template_payment` text COLLATE utf8_unicode_ci, `token_billing_type_id` smallint(6) NOT NULL DEFAULT '4', `invoice_footer` text COLLATE utf8_unicode_ci, `pdf_email_attachment` smallint(6) NOT NULL DEFAULT '0', @@ -246,15 +284,6 @@ CREATE TABLE `accounts` ( `iframe_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `military_time` tinyint(1) NOT NULL DEFAULT '0', `referral_user_id` int(10) unsigned DEFAULT NULL, - `email_subject_invoice` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `email_subject_quote` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `email_subject_payment` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `email_subject_reminder1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `email_subject_reminder2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `email_subject_reminder3` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `email_template_reminder1` text COLLATE utf8_unicode_ci, - `email_template_reminder2` text COLLATE utf8_unicode_ci, - `email_template_reminder3` text COLLATE utf8_unicode_ci, `enable_reminder1` tinyint(1) NOT NULL DEFAULT '0', `enable_reminder2` tinyint(1) NOT NULL DEFAULT '0', `enable_reminder3` tinyint(1) NOT NULL DEFAULT '0', @@ -325,7 +354,6 @@ CREATE TABLE `accounts` ( `payment_type_id` smallint(6) DEFAULT NULL, `gateway_fee_enabled` tinyint(1) NOT NULL DEFAULT '0', `reset_counter_date` date DEFAULT NULL, - `reply_to_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `accounts_account_key_unique` (`account_key`), KEY `accounts_timezone_id_foreign` (`timezone_id`), @@ -1149,7 +1177,7 @@ CREATE TABLE `gateways` ( LOCK TABLES `gateways` WRITE; /*!40000 ALTER TABLE `gateways` DISABLE KEYS */; -INSERT INTO `gateways` VALUES (1,'2017-03-30 09:23:51','2017-03-30 09:23:51','Authorize.Net AIM','AuthorizeNet_AIM',1,1,4,0,NULL,0,0),(2,'2017-03-30 09:23:51','2017-03-30 09:23:51','Authorize.Net SIM','AuthorizeNet_SIM',1,2,10000,0,NULL,0,0),(3,'2017-03-30 09:23:51','2017-03-30 09:23:51','CardSave','CardSave',1,1,10000,0,NULL,0,0),(4,'2017-03-30 09:23:51','2017-03-30 09:23:51','Eway Rapid','Eway_RapidShared',1,1,10000,0,NULL,1,0),(5,'2017-03-30 09:23:51','2017-03-30 09:23:51','FirstData Connect','FirstData_Connect',1,1,10000,0,NULL,0,0),(6,'2017-03-30 09:23:51','2017-03-30 09:23:51','GoCardless','GoCardless',1,1,10000,0,NULL,1,0),(7,'2017-03-30 09:23:51','2017-03-30 09:23:51','Migs ThreeParty','Migs_ThreeParty',1,1,10000,0,NULL,0,0),(8,'2017-03-30 09:23:51','2017-03-30 09:23:51','Migs TwoParty','Migs_TwoParty',1,1,10000,0,NULL,0,0),(9,'2017-03-30 09:23:51','2017-03-30 09:23:51','Mollie','Mollie',1,1,7,0,NULL,1,0),(10,'2017-03-30 09:23:51','2017-03-30 09:23:51','MultiSafepay','MultiSafepay',1,1,10000,0,NULL,0,0),(11,'2017-03-30 09:23:51','2017-03-30 09:23:51','Netaxept','Netaxept',1,1,10000,0,NULL,0,0),(12,'2017-03-30 09:23:51','2017-03-30 09:23:51','NetBanx','NetBanx',1,1,10000,0,NULL,0,0),(13,'2017-03-30 09:23:51','2017-03-30 09:23:51','PayFast','PayFast',1,1,10000,0,NULL,1,0),(14,'2017-03-30 09:23:51','2017-03-30 09:23:51','Payflow Pro','Payflow_Pro',1,1,10000,0,NULL,0,0),(15,'2017-03-30 09:23:51','2017-03-30 09:23:51','PaymentExpress PxPay','PaymentExpress_PxPay',1,1,10000,0,NULL,0,0),(16,'2017-03-30 09:23:51','2017-03-30 09:23:51','PaymentExpress PxPost','PaymentExpress_PxPost',1,1,10000,0,NULL,0,0),(17,'2017-03-30 09:23:51','2017-03-30 09:23:51','PayPal Express','PayPal_Express',1,1,3,0,NULL,1,0),(18,'2017-03-30 09:23:51','2017-03-30 09:23:51','PayPal Pro','PayPal_Pro',1,1,10000,0,NULL,0,0),(19,'2017-03-30 09:23:51','2017-03-30 09:23:51','Pin','Pin',1,1,10000,0,NULL,0,0),(20,'2017-03-30 09:23:51','2017-03-30 09:23:51','SagePay Direct','SagePay_Direct',1,1,10000,0,NULL,0,0),(21,'2017-03-30 09:23:51','2017-03-30 09:23:51','SagePay Server','SagePay_Server',1,1,10000,0,NULL,0,0),(22,'2017-03-30 09:23:51','2017-03-30 09:23:51','SecurePay DirectPost','SecurePay_DirectPost',1,1,10000,0,NULL,0,0),(23,'2017-03-30 09:23:51','2017-03-30 09:23:51','Stripe','Stripe',1,1,1,0,NULL,0,0),(24,'2017-03-30 09:23:51','2017-03-30 09:23:51','TargetPay Direct eBanking','TargetPay_Directebanking',1,1,10000,0,NULL,0,0),(25,'2017-03-30 09:23:51','2017-03-30 09:23:51','TargetPay Ideal','TargetPay_Ideal',1,1,10000,0,NULL,0,0),(26,'2017-03-30 09:23:51','2017-03-30 09:23:51','TargetPay Mr Cash','TargetPay_Mrcash',1,1,10000,0,NULL,0,0),(27,'2017-03-30 09:23:51','2017-03-30 09:23:51','TwoCheckout','TwoCheckout',1,1,10000,0,NULL,1,0),(28,'2017-03-30 09:23:51','2017-03-30 09:23:51','WorldPay','WorldPay',1,1,10000,0,NULL,0,0),(29,'2017-03-30 09:23:51','2017-03-30 09:23:51','BeanStream','BeanStream',1,2,10000,0,NULL,0,0),(30,'2017-03-30 09:23:51','2017-03-30 09:23:51','Psigate','Psigate',1,2,10000,0,NULL,0,0),(31,'2017-03-30 09:23:51','2017-03-30 09:23:51','moolah','AuthorizeNet_AIM',1,1,10000,0,NULL,0,0),(32,'2017-03-30 09:23:51','2017-03-30 09:23:51','Alipay','Alipay_Express',1,1,10000,0,NULL,0,0),(33,'2017-03-30 09:23:51','2017-03-30 09:23:51','Buckaroo','Buckaroo_CreditCard',1,1,10000,0,NULL,0,0),(34,'2017-03-30 09:23:51','2017-03-30 09:23:51','Coinbase','Coinbase',1,1,10000,0,NULL,0,0),(35,'2017-03-30 09:23:51','2017-03-30 09:23:51','DataCash','DataCash',1,1,10000,0,NULL,0,0),(36,'2017-03-30 09:23:51','2017-03-30 09:23:51','Neteller','Neteller',1,2,10000,0,NULL,0,0),(37,'2017-03-30 09:23:51','2017-03-30 09:23:51','Pacnet','Pacnet',1,1,10000,0,NULL,0,0),(38,'2017-03-30 09:23:51','2017-03-30 09:23:51','PaymentSense','PaymentSense',1,2,10000,0,NULL,0,0),(39,'2017-03-30 09:23:51','2017-03-30 09:23:51','Realex','Realex_Remote',1,1,10000,0,NULL,0,0),(40,'2017-03-30 09:23:51','2017-03-30 09:23:51','Sisow','Sisow',1,1,10000,0,NULL,0,0),(41,'2017-03-30 09:23:51','2017-03-30 09:23:51','Skrill','Skrill',1,1,10000,0,NULL,1,0),(42,'2017-03-30 09:23:51','2017-03-30 09:23:51','BitPay','BitPay',1,1,6,0,NULL,1,0),(43,'2017-03-30 09:23:51','2017-03-30 09:23:51','Dwolla','Dwolla',1,1,5,0,NULL,1,0),(44,'2017-03-30 09:23:51','2017-03-30 09:23:51','AGMS','Agms',1,1,10000,0,NULL,0,0),(45,'2017-03-30 09:23:51','2017-03-30 09:23:51','Barclays','BarclaysEpdq\\Essential',1,1,10000,0,NULL,0,0),(46,'2017-03-30 09:23:51','2017-03-30 09:23:51','Cardgate','Cardgate',1,1,10000,0,NULL,0,0),(47,'2017-03-30 09:23:51','2017-03-30 09:23:51','Checkout.com','CheckoutCom',1,1,10000,0,NULL,0,0),(48,'2017-03-30 09:23:51','2017-03-30 09:23:51','Creditcall','Creditcall',1,1,10000,0,NULL,0,0),(49,'2017-03-30 09:23:51','2017-03-30 09:23:51','Cybersource','Cybersource',1,1,10000,0,NULL,0,0),(50,'2017-03-30 09:23:51','2017-03-30 09:23:51','ecoPayz','Ecopayz',1,1,10000,0,NULL,0,0),(51,'2017-03-30 09:23:51','2017-03-30 09:23:51','Fasapay','Fasapay',1,1,10000,0,NULL,0,0),(52,'2017-03-30 09:23:51','2017-03-30 09:23:51','Komoju','Komoju',1,1,10000,0,NULL,0,0),(53,'2017-03-30 09:23:51','2017-03-30 09:23:51','Multicards','Multicards',1,1,10000,0,NULL,0,0),(54,'2017-03-30 09:23:51','2017-03-30 09:23:51','Pagar.Me','Pagarme',1,2,10000,0,NULL,0,0),(55,'2017-03-30 09:23:51','2017-03-30 09:23:51','Paysafecard','Paysafecard',1,1,10000,0,NULL,0,0),(56,'2017-03-30 09:23:51','2017-03-30 09:23:51','Paytrace','Paytrace_CreditCard',1,1,10000,0,NULL,0,0),(57,'2017-03-30 09:23:51','2017-03-30 09:23:51','Secure Trading','SecureTrading',1,1,10000,0,NULL,0,0),(58,'2017-03-30 09:23:51','2017-03-30 09:23:51','SecPay','SecPay',1,1,10000,0,NULL,0,0),(59,'2017-03-30 09:23:51','2017-03-30 09:23:51','WeChat Express','WeChat_Express',1,2,10000,0,NULL,0,0),(60,'2017-03-30 09:23:51','2017-03-30 09:23:51','WePay','WePay',1,1,10000,0,NULL,0,0),(61,'2017-03-30 09:23:51','2017-03-30 09:23:51','Braintree','Braintree',1,1,2,0,NULL,0,0),(62,'2017-03-30 09:23:51','2017-03-30 09:23:51','Custom','Custom',1,1,8,0,NULL,1,0); +INSERT INTO `gateways` VALUES (1,'2017-03-31 10:47:59','2017-03-31 10:47:59','Authorize.Net AIM','AuthorizeNet_AIM',1,1,4,0,NULL,0,0),(2,'2017-03-31 10:47:59','2017-03-31 10:47:59','Authorize.Net SIM','AuthorizeNet_SIM',1,2,10000,0,NULL,0,0),(3,'2017-03-31 10:47:59','2017-03-31 10:47:59','CardSave','CardSave',1,1,10000,0,NULL,0,0),(4,'2017-03-31 10:47:59','2017-03-31 10:47:59','Eway Rapid','Eway_RapidShared',1,1,10000,0,NULL,1,0),(5,'2017-03-31 10:47:59','2017-03-31 10:47:59','FirstData Connect','FirstData_Connect',1,1,10000,0,NULL,0,0),(6,'2017-03-31 10:47:59','2017-03-31 10:47:59','GoCardless','GoCardless',1,1,10000,0,NULL,1,0),(7,'2017-03-31 10:47:59','2017-03-31 10:47:59','Migs ThreeParty','Migs_ThreeParty',1,1,10000,0,NULL,0,0),(8,'2017-03-31 10:47:59','2017-03-31 10:47:59','Migs TwoParty','Migs_TwoParty',1,1,10000,0,NULL,0,0),(9,'2017-03-31 10:47:59','2017-03-31 10:47:59','Mollie','Mollie',1,1,7,0,NULL,1,0),(10,'2017-03-31 10:47:59','2017-03-31 10:47:59','MultiSafepay','MultiSafepay',1,1,10000,0,NULL,0,0),(11,'2017-03-31 10:47:59','2017-03-31 10:47:59','Netaxept','Netaxept',1,1,10000,0,NULL,0,0),(12,'2017-03-31 10:47:59','2017-03-31 10:47:59','NetBanx','NetBanx',1,1,10000,0,NULL,0,0),(13,'2017-03-31 10:47:59','2017-03-31 10:47:59','PayFast','PayFast',1,1,10000,0,NULL,1,0),(14,'2017-03-31 10:47:59','2017-03-31 10:47:59','Payflow Pro','Payflow_Pro',1,1,10000,0,NULL,0,0),(15,'2017-03-31 10:47:59','2017-03-31 10:47:59','PaymentExpress PxPay','PaymentExpress_PxPay',1,1,10000,0,NULL,0,0),(16,'2017-03-31 10:47:59','2017-03-31 10:47:59','PaymentExpress PxPost','PaymentExpress_PxPost',1,1,10000,0,NULL,0,0),(17,'2017-03-31 10:47:59','2017-03-31 10:47:59','PayPal Express','PayPal_Express',1,1,3,0,NULL,1,0),(18,'2017-03-31 10:47:59','2017-03-31 10:47:59','PayPal Pro','PayPal_Pro',1,1,10000,0,NULL,0,0),(19,'2017-03-31 10:47:59','2017-03-31 10:47:59','Pin','Pin',1,1,10000,0,NULL,0,0),(20,'2017-03-31 10:47:59','2017-03-31 10:47:59','SagePay Direct','SagePay_Direct',1,1,10000,0,NULL,0,0),(21,'2017-03-31 10:47:59','2017-03-31 10:47:59','SagePay Server','SagePay_Server',1,1,10000,0,NULL,0,0),(22,'2017-03-31 10:47:59','2017-03-31 10:47:59','SecurePay DirectPost','SecurePay_DirectPost',1,1,10000,0,NULL,0,0),(23,'2017-03-31 10:47:59','2017-03-31 10:47:59','Stripe','Stripe',1,1,1,0,NULL,0,0),(24,'2017-03-31 10:47:59','2017-03-31 10:47:59','TargetPay Direct eBanking','TargetPay_Directebanking',1,1,10000,0,NULL,0,0),(25,'2017-03-31 10:47:59','2017-03-31 10:47:59','TargetPay Ideal','TargetPay_Ideal',1,1,10000,0,NULL,0,0),(26,'2017-03-31 10:47:59','2017-03-31 10:47:59','TargetPay Mr Cash','TargetPay_Mrcash',1,1,10000,0,NULL,0,0),(27,'2017-03-31 10:47:59','2017-03-31 10:47:59','TwoCheckout','TwoCheckout',1,1,10000,0,NULL,1,0),(28,'2017-03-31 10:47:59','2017-03-31 10:47:59','WorldPay','WorldPay',1,1,10000,0,NULL,0,0),(29,'2017-03-31 10:47:59','2017-03-31 10:47:59','BeanStream','BeanStream',1,2,10000,0,NULL,0,0),(30,'2017-03-31 10:47:59','2017-03-31 10:47:59','Psigate','Psigate',1,2,10000,0,NULL,0,0),(31,'2017-03-31 10:47:59','2017-03-31 10:47:59','moolah','AuthorizeNet_AIM',1,1,10000,0,NULL,0,0),(32,'2017-03-31 10:47:59','2017-03-31 10:47:59','Alipay','Alipay_Express',1,1,10000,0,NULL,0,0),(33,'2017-03-31 10:47:59','2017-03-31 10:47:59','Buckaroo','Buckaroo_CreditCard',1,1,10000,0,NULL,0,0),(34,'2017-03-31 10:47:59','2017-03-31 10:47:59','Coinbase','Coinbase',1,1,10000,0,NULL,0,0),(35,'2017-03-31 10:47:59','2017-03-31 10:47:59','DataCash','DataCash',1,1,10000,0,NULL,0,0),(36,'2017-03-31 10:47:59','2017-03-31 10:47:59','Neteller','Neteller',1,2,10000,0,NULL,0,0),(37,'2017-03-31 10:47:59','2017-03-31 10:47:59','Pacnet','Pacnet',1,1,10000,0,NULL,0,0),(38,'2017-03-31 10:47:59','2017-03-31 10:47:59','PaymentSense','PaymentSense',1,2,10000,0,NULL,0,0),(39,'2017-03-31 10:47:59','2017-03-31 10:47:59','Realex','Realex_Remote',1,1,10000,0,NULL,0,0),(40,'2017-03-31 10:47:59','2017-03-31 10:47:59','Sisow','Sisow',1,1,10000,0,NULL,0,0),(41,'2017-03-31 10:47:59','2017-03-31 10:47:59','Skrill','Skrill',1,1,10000,0,NULL,1,0),(42,'2017-03-31 10:47:59','2017-03-31 10:47:59','BitPay','BitPay',1,1,6,0,NULL,1,0),(43,'2017-03-31 10:47:59','2017-03-31 10:47:59','Dwolla','Dwolla',1,1,5,0,NULL,1,0),(44,'2017-03-31 10:47:59','2017-03-31 10:47:59','AGMS','Agms',1,1,10000,0,NULL,0,0),(45,'2017-03-31 10:47:59','2017-03-31 10:47:59','Barclays','BarclaysEpdq\\Essential',1,1,10000,0,NULL,0,0),(46,'2017-03-31 10:47:59','2017-03-31 10:47:59','Cardgate','Cardgate',1,1,10000,0,NULL,0,0),(47,'2017-03-31 10:47:59','2017-03-31 10:47:59','Checkout.com','CheckoutCom',1,1,10000,0,NULL,0,0),(48,'2017-03-31 10:47:59','2017-03-31 10:47:59','Creditcall','Creditcall',1,1,10000,0,NULL,0,0),(49,'2017-03-31 10:47:59','2017-03-31 10:47:59','Cybersource','Cybersource',1,1,10000,0,NULL,0,0),(50,'2017-03-31 10:47:59','2017-03-31 10:47:59','ecoPayz','Ecopayz',1,1,10000,0,NULL,0,0),(51,'2017-03-31 10:47:59','2017-03-31 10:47:59','Fasapay','Fasapay',1,1,10000,0,NULL,0,0),(52,'2017-03-31 10:47:59','2017-03-31 10:47:59','Komoju','Komoju',1,1,10000,0,NULL,0,0),(53,'2017-03-31 10:47:59','2017-03-31 10:47:59','Multicards','Multicards',1,1,10000,0,NULL,0,0),(54,'2017-03-31 10:47:59','2017-03-31 10:47:59','Pagar.Me','Pagarme',1,2,10000,0,NULL,0,0),(55,'2017-03-31 10:47:59','2017-03-31 10:47:59','Paysafecard','Paysafecard',1,1,10000,0,NULL,0,0),(56,'2017-03-31 10:47:59','2017-03-31 10:47:59','Paytrace','Paytrace_CreditCard',1,1,10000,0,NULL,0,0),(57,'2017-03-31 10:47:59','2017-03-31 10:47:59','Secure Trading','SecureTrading',1,1,10000,0,NULL,0,0),(58,'2017-03-31 10:47:59','2017-03-31 10:47:59','SecPay','SecPay',1,1,10000,0,NULL,0,0),(59,'2017-03-31 10:47:59','2017-03-31 10:47:59','WeChat Express','WeChat_Express',1,2,10000,0,NULL,0,0),(60,'2017-03-31 10:47:59','2017-03-31 10:47:59','WePay','WePay',1,1,10000,0,NULL,0,0),(61,'2017-03-31 10:47:59','2017-03-31 10:47:59','Braintree','Braintree',1,1,2,0,NULL,0,0),(62,'2017-03-31 10:47:59','2017-03-31 10:47:59','Custom','Custom',1,1,8,0,NULL,1,0); /*!40000 ALTER TABLE `gateways` ENABLE KEYS */; UNLOCK TABLES; @@ -1567,7 +1595,7 @@ CREATE TABLE `payment_libraries` ( LOCK TABLES `payment_libraries` WRITE; /*!40000 ALTER TABLE `payment_libraries` DISABLE KEYS */; -INSERT INTO `payment_libraries` VALUES (1,'2017-03-30 09:23:49','2017-03-30 09:23:49','Omnipay',1),(2,'2017-03-30 09:23:49','2017-03-30 09:23:49','PHP-Payments [Deprecated]',1); +INSERT INTO `payment_libraries` VALUES (1,'2017-03-31 10:47:58','2017-03-31 10:47:58','Omnipay',1),(2,'2017-03-31 10:47:58','2017-03-31 10:47:58','PHP-Payments [Deprecated]',1); /*!40000 ALTER TABLE `payment_libraries` ENABLE KEYS */; UNLOCK TABLES; @@ -1677,7 +1705,7 @@ CREATE TABLE `payment_terms` ( LOCK TABLES `payment_terms` WRITE; /*!40000 ALTER TABLE `payment_terms` DISABLE KEYS */; -INSERT INTO `payment_terms` VALUES (1,7,'Net 7','2017-03-30 09:23:49','2017-03-30 09:23:49',NULL,0,0,1),(2,10,'Net 10','2017-03-30 09:23:49','2017-03-30 09:23:49',NULL,0,0,2),(3,14,'Net 14','2017-03-30 09:23:49','2017-03-30 09:23:49',NULL,0,0,3),(4,15,'Net 15','2017-03-30 09:23:49','2017-03-30 09:23:49',NULL,0,0,4),(5,30,'Net 30','2017-03-30 09:23:49','2017-03-30 09:23:49',NULL,0,0,5),(6,60,'Net 60','2017-03-30 09:23:49','2017-03-30 09:23:49',NULL,0,0,6),(7,90,'Net 90','2017-03-30 09:23:49','2017-03-30 09:23:49',NULL,0,0,7),(8,-1,'Net 0','2017-03-30 09:23:52','2017-03-30 09:23:52',NULL,0,0,0); +INSERT INTO `payment_terms` VALUES (1,7,'Net 7','2017-03-31 10:47:58','2017-03-31 10:47:58',NULL,0,0,1),(2,10,'Net 10','2017-03-31 10:47:58','2017-03-31 10:47:58',NULL,0,0,2),(3,14,'Net 14','2017-03-31 10:47:58','2017-03-31 10:47:58',NULL,0,0,3),(4,15,'Net 15','2017-03-31 10:47:58','2017-03-31 10:47:58',NULL,0,0,4),(5,30,'Net 30','2017-03-31 10:47:58','2017-03-31 10:47:58',NULL,0,0,5),(6,60,'Net 60','2017-03-31 10:47:58','2017-03-31 10:47:58',NULL,0,0,6),(7,90,'Net 90','2017-03-31 10:47:58','2017-03-31 10:47:58',NULL,0,0,7),(8,-1,'Net 0','2017-03-31 10:48:01','2017-03-31 10:48:01',NULL,0,0,0); /*!40000 ALTER TABLE `payment_terms` ENABLE KEYS */; UNLOCK TABLES; @@ -2272,4 +2300,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2017-03-30 15:23:53 +-- Dump completed on 2017-03-31 16:48:02 diff --git a/resources/views/accounts/email_settings.blade.php b/resources/views/accounts/email_settings.blade.php index d86a9467ca89..1d987b937911 100644 --- a/resources/views/accounts/email_settings.blade.php +++ b/resources/views/accounts/email_settings.blade.php @@ -26,6 +26,8 @@ {{ Former::populateField('pdf_email_attachment', intval($account->pdf_email_attachment)) }} {{ Former::populateField('document_email_attachment', intval($account->document_email_attachment)) }} {{ Former::populateField('enable_email_markup', intval($account->enable_email_markup)) }} + {{ Former::populateField('bcc_email', $account->account_email_settings->bcc_email) }} + {{ Former::populateField('reply_to_email', $account->account_email_settings->reply_to_email) }}