diff --git a/app/Constants.php b/app/Constants.php index ee974db2ebcb..ff9680a6dfab 100644 --- a/app/Constants.php +++ b/app/Constants.php @@ -207,7 +207,9 @@ if (! defined('APP_NAME')) { define('EXPENSE_STATUS_PAID', 5); define('EXPENSE_STATUS_UNPAID', 6); - define('CUSTOM_DESIGN', 11); + define('CUSTOM_DESIGN1', 11); + define('CUSTOM_DESIGN2', 12); + define('CUSTOM_DESIGN3', 13); define('FREQUENCY_WEEKLY', 1); define('FREQUENCY_TWO_WEEKS', 2); @@ -343,7 +345,6 @@ if (! defined('APP_NAME')) { define('DB_NINJA_2', 'db-ninja-2'); define('COUNT_FREE_DESIGNS', 4); - define('COUNT_FREE_DESIGNS_SELF_HOST', 5); // include the custom design define('PRODUCT_ONE_CLICK_INSTALL', 1); define('PRODUCT_INVOICE_DESIGNS', 2); define('PRODUCT_WHITE_LABEL', 3); diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 7751efcd3f8a..6b30cfb73fff 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -572,7 +572,11 @@ class AccountController extends BaseController } if ($section == ACCOUNT_CUSTOMIZE_DESIGN) { - $data['customDesign'] = ($account->custom_design && ! $design) ? $account->custom_design : $design; + if ($custom = $account->getCustomDesign(request()->design_id)) { + $data['customDesign'] = $custom; + } else { + $data['customDesign'] = $design; + } // sample invoice to help determine variables $invoice = Invoice::scope() @@ -737,16 +741,21 @@ class AccountController extends BaseController */ private function saveCustomizeDesign() { + $designId = intval(Input::get('design_id')) ?: CUSTOM_DESIGN1; + $field = 'custom_design' . ($designId - 10); + if (Auth::user()->account->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN)) { $account = Auth::user()->account; - $account->custom_design = Input::get('custom_design'); - $account->invoice_design_id = CUSTOM_DESIGN; + if (! $account->custom_design1) { + $account->invoice_design_id = CUSTOM_DESIGN1; + } + $account->$field = Input::get('custom_design'); $account->save(); Session::flash('message', trans('texts.updated_settings')); } - return Redirect::to('settings/'.ACCOUNT_CUSTOMIZE_DESIGN); + return Redirect::to('settings/' . ACCOUNT_CUSTOMIZE_DESIGN . '?design_id=' . $designId); } /** @@ -952,6 +961,7 @@ class AccountController extends BaseController $account->primary_color = Input::get('primary_color'); $account->secondary_color = Input::get('secondary_color'); $account->invoice_design_id = Input::get('invoice_design_id'); + $account->quote_design_id = Input::get('quote_design_id'); $account->font_size = intval(Input::get('font_size')); $account->page_size = Input::get('page_size'); diff --git a/app/Http/Controllers/ClientPortalController.php b/app/Http/Controllers/ClientPortalController.php index 803127c2cfa4..66e68cb9d819 100644 --- a/app/Http/Controllers/ClientPortalController.php +++ b/app/Http/Controllers/ClientPortalController.php @@ -91,8 +91,8 @@ class ClientPortalController extends BaseController ]; $invoice->invoice_fonts = $account->getFontsData(); - if ($invoice->invoice_design_id == CUSTOM_DESIGN) { - $invoice->invoice_design->javascript = $account->custom_design; + if ($design = $account->getCustomDesign($invoice->getDesignId())) { + $invoice->invoice_design->javascript = $design; } else { $invoice->invoice_design->javascript = $invoice->invoice_design->pdfmake; } diff --git a/app/Http/Controllers/InvoiceApiController.php b/app/Http/Controllers/InvoiceApiController.php index c8670b055049..c7e8803fdc69 100644 --- a/app/Http/Controllers/InvoiceApiController.php +++ b/app/Http/Controllers/InvoiceApiController.php @@ -251,6 +251,10 @@ class InvoiceApiController extends BaseAPIController $fields['due_date_sql'] = false; } + if (isset($data['is_quote']) && filter_var($data['is_quote'], FILTER_VALIDATE_BOOLEAN)) { + $fields['invoice_design_id'] = $account->quote_design_id; + } + foreach ($fields as $key => $val) { if (! isset($data[$key])) { $data[$key] = $val; diff --git a/app/Listeners/InvoiceListener.php b/app/Listeners/InvoiceListener.php index 4883667cd89d..a4da0c9b7892 100644 --- a/app/Listeners/InvoiceListener.php +++ b/app/Listeners/InvoiceListener.php @@ -35,8 +35,7 @@ class InvoiceListener $invoice = $event->invoice; $account = Auth::user()->account; - if ($invoice->invoice_design_id - && $account->invoice_design_id != $invoice->invoice_design_id) { + if ($invoice->invoice_design_id && $account->invoice_design_id != $invoice->invoice_design_id) { $account->invoice_design_id = $invoice->invoice_design_id; $account->save(); } diff --git a/app/Models/Account.php b/app/Models/Account.php index 0b5f882223fa..46c77aa3c1e6 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -68,6 +68,7 @@ class Account extends Eloquent 'invoice_taxes', 'invoice_item_taxes', 'invoice_design_id', + 'quote_design_id', 'work_phone', 'work_email', 'language_id', @@ -885,6 +886,7 @@ class Account extends Eloquent } else { if ($entityType == ENTITY_QUOTE) { $invoice->invoice_type_id = INVOICE_TYPE_QUOTE; + $invoice->invoice_design_id = $this->quote_design_id; } if ($this->hasClientNumberPattern($invoice) && ! $clientId) { diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 41562725e1d8..a1538f5ae8eb 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -48,6 +48,7 @@ class Invoice extends EntityModel implements BalanceAffecting 'tax_rate2', 'private_notes', 'last_sent_date', + 'invoice_design_id', ]; /** @@ -593,6 +594,11 @@ class Invoice extends EntityModel implements BalanceAffecting return $this->is_recurring ? trans('texts.recurring') : $this->invoice_number; } + public function getDesignId() + { + return $this->isQuote() ? $this->quote_design_id : $this->invoice_design_id; + } + /** * @return string */ diff --git a/app/Models/InvoiceDesign.php b/app/Models/InvoiceDesign.php index a28f35e427b3..7b5558533de9 100644 --- a/app/Models/InvoiceDesign.php +++ b/app/Models/InvoiceDesign.php @@ -83,11 +83,11 @@ class InvoiceDesign extends Eloquent $design->javascript = $design->pdfmake; $design->pdfmake = null; - if ($design->id == CUSTOM_DESIGN) { - if ($account->custom_design) { - $design->javascript = $account->custom_design; + if (in_array($design->id, [CUSTOM_DESIGN1, CUSTOM_DESIGN2, CUSTOM_DESIGN3])) { + if ($javascript = $account->getCustomDesign($design->id)) { + $design->javascript = $javascript; } else { - $designs->pop(); + $designs->forget($design->id - 1); } } } diff --git a/app/Models/Traits/PresentsInvoice.php b/app/Models/Traits/PresentsInvoice.php index 52afd90968e8..cb48c8a5dba2 100644 --- a/app/Models/Traits/PresentsInvoice.php +++ b/app/Models/Traits/PresentsInvoice.php @@ -292,4 +292,16 @@ trait PresentsInvoice return $data; } + + public function getCustomDesign($designId) { + if ($designId == CUSTOM_DESIGN1) { + return $this->custom_design1; + } elseif ($designId == CUSTOM_DESIGN2) { + return $this->custom_design2; + } elseif ($designId == CUSTOM_DESIGN3) { + return $this->custom_design3; + } + + return null; + } } diff --git a/app/Models/User.php b/app/Models/User.php index d987fc2648d2..ad185d3ffdb1 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -147,7 +147,7 @@ class User extends Authenticatable */ public function maxInvoiceDesignId() { - return $this->hasFeature(FEATURE_MORE_INVOICE_DESIGNS) ? 11 : (Utils::isNinja() ? COUNT_FREE_DESIGNS : COUNT_FREE_DESIGNS_SELF_HOST); + return $this->hasFeature(FEATURE_MORE_INVOICE_DESIGNS) ? 13 : COUNT_FREE_DESIGNS; } /** diff --git a/app/Ninja/Presenters/AccountPresenter.php b/app/Ninja/Presenters/AccountPresenter.php index ee64c90a1acb..156aade6237c 100644 --- a/app/Ninja/Presenters/AccountPresenter.php +++ b/app/Ninja/Presenters/AccountPresenter.php @@ -175,4 +175,24 @@ class AccountPresenter extends Presenter return $data; } + + public function customDesigns() + { + $account = $this->entity; + $data = []; + + for ($i=1; $i<=3; $i++) { + $label = trans('texts.custom_design' . $i); + if (! $account->{'custom_design' . $i}) { + $label .= ' - ' . trans('texts.empty'); + } + + $data[] = [ + 'url' => url('/settings/customize_design?design_id=') . ($i + 10), + 'label' => $label + ]; + } + + return $data; + } } diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index 71ad93246d4b..73f09b742a5a 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -470,8 +470,6 @@ class InvoiceRepository extends BaseRepository $invoice->po_number = trim($data['po_number']); } - $invoice->invoice_design_id = isset($data['invoice_design_id']) ? $data['invoice_design_id'] : $account->invoice_design_id; - // provide backwards compatibility if (isset($data['tax_name']) && isset($data['tax_rate'])) { $data['tax_name1'] = $data['tax_name']; diff --git a/app/Ninja/Transformers/AccountTransformer.php b/app/Ninja/Transformers/AccountTransformer.php index f9a0f3a6ebdb..2278c0ff5aca 100644 --- a/app/Ninja/Transformers/AccountTransformer.php +++ b/app/Ninja/Transformers/AccountTransformer.php @@ -171,6 +171,7 @@ class AccountTransformer extends EntityTransformer 'invoice_taxes' => (bool) $account->invoice_taxes, 'invoice_item_taxes' => (bool) $account->invoice_item_taxes, 'invoice_design_id' => (int) $account->invoice_design_id, + 'quote_design_id' => (int) $account->quote_design_id, 'client_view_css' => (string) $account->client_view_css, 'work_phone' => $account->work_phone, 'work_email' => $account->work_email, diff --git a/database/migrations/2015_07_19_081332_add_custom_design.php b/database/migrations/2015_07_19_081332_add_custom_design.php index 31f40e4ec7a8..d4e985d887e2 100644 --- a/database/migrations/2015_07_19_081332_add_custom_design.php +++ b/database/migrations/2015_07_19_081332_add_custom_design.php @@ -15,7 +15,7 @@ class AddCustomDesign extends Migration $table->mediumText('custom_design')->nullable(); }); - DB::table('invoice_designs')->insert(['id' => CUSTOM_DESIGN, 'name' => 'Custom']); + DB::table('invoice_designs')->insert(['id' => CUSTOM_DESIGN1, 'name' => 'Custom']); } /** diff --git a/database/migrations/2017_05_16_101715_add_default_note_to_client.php b/database/migrations/2017_05_16_101715_add_default_note_to_client.php index e1cdd277ca89..a7dd0ccb1127 100644 --- a/database/migrations/2017_05_16_101715_add_default_note_to_client.php +++ b/database/migrations/2017_05_16_101715_add_default_note_to_client.php @@ -63,6 +63,21 @@ class AddDefaultNoteToClient extends Migration $table->unique(['oauth_user_id', 'oauth_provider_id']); }); } + + Schema::table('accounts', function ($table) { + $table->unsignedInteger('quote_design_id')->default(1); + $table->renameColumn('custom_design', 'custom_design1'); + $table->mediumText('custom_design2')->nullable(); + $table->mediumText('custom_design3')->nullable(); + }); + + DB::statement('update accounts + set quote_design_id = invoice_design_id'); + + DB::statement('update invoice_designs + set name = "Custom1" + where id = 11 + and name = "Custom"'); } /** @@ -97,5 +112,12 @@ class AddDefaultNoteToClient extends Migration $table->dropColumn('tax_name2'); $table->dropColumn('tax_rate2'); }); + + Schema::table('accounts', function ($table) { + $table->renameColumn('custom_design1', 'custom_design'); + $table->dropColumn('custom_design2'); + $table->dropColumn('custom_design3'); + }); + } } diff --git a/database/seeds/InvoiceDesignsSeeder.php b/database/seeds/InvoiceDesignsSeeder.php index c8f8366cf668..e117d993266c 100644 --- a/database/seeds/InvoiceDesignsSeeder.php +++ b/database/seeds/InvoiceDesignsSeeder.php @@ -20,7 +20,7 @@ class InvoiceDesignsSeeder extends Seeder 'Playful', 'Photo', ]; - + for ($i = 0; $i < count($designs); $i++) { $design = $designs[$i]; $fileName = storage_path() . '/templates/' . strtolower($design) . '.js'; @@ -38,5 +38,15 @@ class InvoiceDesignsSeeder extends Seeder } } } + + for ($i = 1; $i <= 3; $i++) { + $name = 'Custom' . $i; + if (! InvoiceDesign::whereName($name)->first()) { + InvoiceDesign::create([ + 'id' => $i + 10, + 'name' => $name, + ]); + } + } } } diff --git a/database/seeds/UserTableSeeder.php b/database/seeds/UserTableSeeder.php index 4f769b5ec24c..865940b95123 100644 --- a/database/seeds/UserTableSeeder.php +++ b/database/seeds/UserTableSeeder.php @@ -36,7 +36,7 @@ class UserTableSeeder extends Seeder 'invoice_terms' => $faker->text($faker->numberBetween(50, 300)), 'work_phone' => $faker->phoneNumber, 'work_email' => $faker->safeEmail, - 'invoice_design_id' => InvoiceDesign::where('id', '<', CUSTOM_DESIGN)->get()->random()->id, + 'invoice_design_id' => InvoiceDesign::where('id', '<', CUSTOM_DESIGN1)->get()->random()->id, 'header_font_id' => min(Font::all()->random()->id, 17), 'body_font_id' => min(Font::all()->random()->id, 17), 'primary_color' => $faker->hexcolor, diff --git a/database/setup.sql b/database/setup.sql index 63eee3dd4cfd..f22638ec107f 100644 --- a/database/setup.sql +++ b/database/setup.sql @@ -279,7 +279,7 @@ CREATE TABLE `accounts` ( `subdomain` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `font_size` smallint(6) NOT NULL DEFAULT '9', `invoice_labels` text COLLATE utf8_unicode_ci, - `custom_design` mediumtext COLLATE utf8_unicode_ci, + `custom_design1` mediumtext COLLATE utf8_unicode_ci, `show_item_taxes` tinyint(1) NOT NULL DEFAULT '0', `iframe_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `military_time` tinyint(1) NOT NULL DEFAULT '0', @@ -357,6 +357,9 @@ CREATE TABLE `accounts` ( `tax_rate1` decimal(13,3) NOT NULL, `tax_name2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `tax_rate2` decimal(13,3) NOT NULL, + `quote_design_id` int(10) unsigned NOT NULL DEFAULT '1', + `custom_design2` mediumtext COLLATE utf8_unicode_ci, + `custom_design3` mediumtext COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), UNIQUE KEY `accounts_account_key_unique` (`account_key`), KEY `accounts_timezone_id_foreign` (`timezone_id`), @@ -1214,7 +1217,7 @@ CREATE TABLE `gateways` ( LOCK TABLES `gateways` WRITE; /*!40000 ALTER TABLE `gateways` DISABLE KEYS */; -INSERT INTO `gateways` VALUES (1,'2017-05-17 14:06:16','2017-05-17 14:06:16','Authorize.Net AIM','AuthorizeNet_AIM',1,1,4,0,NULL,0,0),(2,'2017-05-17 14:06:16','2017-05-17 14:06:16','Authorize.Net SIM','AuthorizeNet_SIM',1,2,10000,0,NULL,0,0),(3,'2017-05-17 14:06:16','2017-05-17 14:06:16','CardSave','CardSave',1,1,10000,0,NULL,0,0),(4,'2017-05-17 14:06:16','2017-05-17 14:06:16','Eway Rapid','Eway_RapidShared',1,1,10000,0,NULL,1,0),(5,'2017-05-17 14:06:16','2017-05-17 14:06:16','FirstData Connect','FirstData_Connect',1,1,10000,0,NULL,0,0),(6,'2017-05-17 14:06:16','2017-05-17 14:06:16','GoCardless','GoCardless',1,1,10000,0,NULL,1,0),(7,'2017-05-17 14:06:16','2017-05-17 14:06:16','Migs ThreeParty','Migs_ThreeParty',1,1,10000,0,NULL,0,0),(8,'2017-05-17 14:06:16','2017-05-17 14:06:16','Migs TwoParty','Migs_TwoParty',1,1,10000,0,NULL,0,0),(9,'2017-05-17 14:06:16','2017-05-17 14:06:16','Mollie','Mollie',1,1,7,0,NULL,1,0),(10,'2017-05-17 14:06:16','2017-05-17 14:06:16','MultiSafepay','MultiSafepay',1,1,10000,0,NULL,0,0),(11,'2017-05-17 14:06:16','2017-05-17 14:06:16','Netaxept','Netaxept',1,1,10000,0,NULL,0,0),(12,'2017-05-17 14:06:16','2017-05-17 14:06:16','NetBanx','NetBanx',1,1,10000,0,NULL,0,0),(13,'2017-05-17 14:06:16','2017-05-17 14:06:16','PayFast','PayFast',1,1,10000,0,NULL,1,0),(14,'2017-05-17 14:06:16','2017-05-17 14:06:16','Payflow Pro','Payflow_Pro',1,1,10000,0,NULL,0,0),(15,'2017-05-17 14:06:16','2017-05-17 14:06:16','PaymentExpress PxPay','PaymentExpress_PxPay',1,1,10000,0,NULL,0,0),(16,'2017-05-17 14:06:16','2017-05-17 14:06:16','PaymentExpress PxPost','PaymentExpress_PxPost',1,1,10000,0,NULL,0,0),(17,'2017-05-17 14:06:16','2017-05-17 14:06:16','PayPal Express','PayPal_Express',1,1,3,0,NULL,1,0),(18,'2017-05-17 14:06:16','2017-05-17 14:06:16','PayPal Pro','PayPal_Pro',1,1,10000,0,NULL,0,0),(19,'2017-05-17 14:06:16','2017-05-17 14:06:16','Pin','Pin',1,1,10000,0,NULL,0,0),(20,'2017-05-17 14:06:16','2017-05-17 14:06:16','SagePay Direct','SagePay_Direct',1,1,10000,0,NULL,0,0),(21,'2017-05-17 14:06:16','2017-05-17 14:06:16','SagePay Server','SagePay_Server',1,1,10000,0,NULL,0,0),(22,'2017-05-17 14:06:16','2017-05-17 14:06:16','SecurePay DirectPost','SecurePay_DirectPost',1,1,10000,0,NULL,0,0),(23,'2017-05-17 14:06:16','2017-05-17 14:06:16','Stripe','Stripe',1,1,1,0,NULL,0,0),(24,'2017-05-17 14:06:16','2017-05-17 14:06:16','TargetPay Direct eBanking','TargetPay_Directebanking',1,1,10000,0,NULL,0,0),(25,'2017-05-17 14:06:16','2017-05-17 14:06:16','TargetPay Ideal','TargetPay_Ideal',1,1,10000,0,NULL,0,0),(26,'2017-05-17 14:06:16','2017-05-17 14:06:16','TargetPay Mr Cash','TargetPay_Mrcash',1,1,10000,0,NULL,0,0),(27,'2017-05-17 14:06:16','2017-05-17 14:06:16','TwoCheckout','TwoCheckout',1,1,10000,0,NULL,1,0),(28,'2017-05-17 14:06:16','2017-05-17 14:06:16','WorldPay','WorldPay',1,1,10000,0,NULL,0,0),(29,'2017-05-17 14:06:16','2017-05-17 14:06:16','BeanStream','BeanStream',1,2,10000,0,NULL,0,0),(30,'2017-05-17 14:06:16','2017-05-17 14:06:16','Psigate','Psigate',1,2,10000,0,NULL,0,0),(31,'2017-05-17 14:06:16','2017-05-17 14:06:16','moolah','AuthorizeNet_AIM',1,1,10000,0,NULL,0,0),(32,'2017-05-17 14:06:16','2017-05-17 14:06:16','Alipay','Alipay_Express',1,1,10000,0,NULL,0,0),(33,'2017-05-17 14:06:16','2017-05-17 14:06:16','Buckaroo','Buckaroo_CreditCard',1,1,10000,0,NULL,0,0),(34,'2017-05-17 14:06:16','2017-05-17 14:06:16','Coinbase','Coinbase',1,1,10000,0,NULL,0,0),(35,'2017-05-17 14:06:16','2017-05-17 14:06:16','DataCash','DataCash',1,1,10000,0,NULL,0,0),(36,'2017-05-17 14:06:16','2017-05-17 14:06:16','Neteller','Neteller',1,2,10000,0,NULL,0,0),(37,'2017-05-17 14:06:16','2017-05-17 14:06:16','Pacnet','Pacnet',1,1,10000,0,NULL,0,0),(38,'2017-05-17 14:06:16','2017-05-17 14:06:16','PaymentSense','PaymentSense',1,2,10000,0,NULL,0,0),(39,'2017-05-17 14:06:16','2017-05-17 14:06:16','Realex','Realex_Remote',1,1,10000,0,NULL,0,0),(40,'2017-05-17 14:06:16','2017-05-17 14:06:16','Sisow','Sisow',1,1,10000,0,NULL,0,0),(41,'2017-05-17 14:06:16','2017-05-17 14:06:16','Skrill','Skrill',1,1,10000,0,NULL,1,0),(42,'2017-05-17 14:06:16','2017-05-17 14:06:16','BitPay','BitPay',1,1,6,0,NULL,1,0),(43,'2017-05-17 14:06:16','2017-05-17 14:06:16','Dwolla','Dwolla',1,1,5,0,NULL,1,0),(44,'2017-05-17 14:06:16','2017-05-17 14:06:16','AGMS','Agms',1,1,10000,0,NULL,0,0),(45,'2017-05-17 14:06:16','2017-05-17 14:06:16','Barclays','BarclaysEpdq\\Essential',1,1,10000,0,NULL,0,0),(46,'2017-05-17 14:06:16','2017-05-17 14:06:16','Cardgate','Cardgate',1,1,10000,0,NULL,0,0),(47,'2017-05-17 14:06:16','2017-05-17 14:06:16','Checkout.com','CheckoutCom',1,1,10000,0,NULL,0,0),(48,'2017-05-17 14:06:16','2017-05-17 14:06:16','Creditcall','Creditcall',1,1,10000,0,NULL,0,0),(49,'2017-05-17 14:06:16','2017-05-17 14:06:16','Cybersource','Cybersource',1,1,10000,0,NULL,0,0),(50,'2017-05-17 14:06:16','2017-05-17 14:06:16','ecoPayz','Ecopayz',1,1,10000,0,NULL,0,0),(51,'2017-05-17 14:06:16','2017-05-17 14:06:16','Fasapay','Fasapay',1,1,10000,0,NULL,0,0),(52,'2017-05-17 14:06:16','2017-05-17 14:06:16','Komoju','Komoju',1,1,10000,0,NULL,0,0),(53,'2017-05-17 14:06:16','2017-05-17 14:06:16','Multicards','Multicards',1,1,10000,0,NULL,0,0),(54,'2017-05-17 14:06:16','2017-05-17 14:06:16','Pagar.Me','Pagarme',1,2,10000,0,NULL,0,0),(55,'2017-05-17 14:06:16','2017-05-17 14:06:16','Paysafecard','Paysafecard',1,1,10000,0,NULL,0,0),(56,'2017-05-17 14:06:16','2017-05-17 14:06:16','Paytrace','Paytrace_CreditCard',1,1,10000,0,NULL,0,0),(57,'2017-05-17 14:06:16','2017-05-17 14:06:16','Secure Trading','SecureTrading',1,1,10000,0,NULL,0,0),(58,'2017-05-17 14:06:16','2017-05-17 14:06:16','SecPay','SecPay',1,1,10000,0,NULL,0,0),(59,'2017-05-17 14:06:16','2017-05-17 14:06:16','WeChat Express','WeChat_Express',1,2,10000,0,NULL,0,0),(60,'2017-05-17 14:06:16','2017-05-17 14:06:16','WePay','WePay',1,1,10000,0,NULL,0,0),(61,'2017-05-17 14:06:16','2017-05-17 14:06:16','Braintree','Braintree',1,1,2,0,NULL,0,0),(62,'2017-05-17 14:06:16','2017-05-17 14:06:16','Custom','Custom',1,1,8,0,NULL,1,0); +INSERT INTO `gateways` VALUES (1,'2017-05-30 11:47:22','2017-05-30 11:47:22','Authorize.Net AIM','AuthorizeNet_AIM',1,1,4,0,NULL,0,0),(2,'2017-05-30 11:47:22','2017-05-30 11:47:22','Authorize.Net SIM','AuthorizeNet_SIM',1,2,10000,0,NULL,0,0),(3,'2017-05-30 11:47:22','2017-05-30 11:47:22','CardSave','CardSave',1,1,10000,0,NULL,0,0),(4,'2017-05-30 11:47:22','2017-05-30 11:47:22','Eway Rapid','Eway_RapidShared',1,1,10000,0,NULL,1,0),(5,'2017-05-30 11:47:22','2017-05-30 11:47:22','FirstData Connect','FirstData_Connect',1,1,10000,0,NULL,0,0),(6,'2017-05-30 11:47:22','2017-05-30 11:47:22','GoCardless','GoCardless',1,1,10000,0,NULL,1,0),(7,'2017-05-30 11:47:22','2017-05-30 11:47:22','Migs ThreeParty','Migs_ThreeParty',1,1,10000,0,NULL,0,0),(8,'2017-05-30 11:47:22','2017-05-30 11:47:22','Migs TwoParty','Migs_TwoParty',1,1,10000,0,NULL,0,0),(9,'2017-05-30 11:47:22','2017-05-30 11:47:22','Mollie','Mollie',1,1,7,0,NULL,1,0),(10,'2017-05-30 11:47:22','2017-05-30 11:47:22','MultiSafepay','MultiSafepay',1,1,10000,0,NULL,0,0),(11,'2017-05-30 11:47:22','2017-05-30 11:47:22','Netaxept','Netaxept',1,1,10000,0,NULL,0,0),(12,'2017-05-30 11:47:22','2017-05-30 11:47:22','NetBanx','NetBanx',1,1,10000,0,NULL,0,0),(13,'2017-05-30 11:47:22','2017-05-30 11:47:22','PayFast','PayFast',1,1,10000,0,NULL,1,0),(14,'2017-05-30 11:47:22','2017-05-30 11:47:22','Payflow Pro','Payflow_Pro',1,1,10000,0,NULL,0,0),(15,'2017-05-30 11:47:22','2017-05-30 11:47:22','PaymentExpress PxPay','PaymentExpress_PxPay',1,1,10000,0,NULL,0,0),(16,'2017-05-30 11:47:22','2017-05-30 11:47:22','PaymentExpress PxPost','PaymentExpress_PxPost',1,1,10000,0,NULL,0,0),(17,'2017-05-30 11:47:22','2017-05-30 11:47:22','PayPal Express','PayPal_Express',1,1,3,0,NULL,1,0),(18,'2017-05-30 11:47:22','2017-05-30 11:47:22','PayPal Pro','PayPal_Pro',1,1,10000,0,NULL,0,0),(19,'2017-05-30 11:47:22','2017-05-30 11:47:22','Pin','Pin',1,1,10000,0,NULL,0,0),(20,'2017-05-30 11:47:22','2017-05-30 11:47:22','SagePay Direct','SagePay_Direct',1,1,10000,0,NULL,0,0),(21,'2017-05-30 11:47:22','2017-05-30 11:47:22','SagePay Server','SagePay_Server',1,1,10000,0,NULL,0,0),(22,'2017-05-30 11:47:22','2017-05-30 11:47:22','SecurePay DirectPost','SecurePay_DirectPost',1,1,10000,0,NULL,0,0),(23,'2017-05-30 11:47:22','2017-05-30 11:47:22','Stripe','Stripe',1,1,1,0,NULL,0,0),(24,'2017-05-30 11:47:22','2017-05-30 11:47:22','TargetPay Direct eBanking','TargetPay_Directebanking',1,1,10000,0,NULL,0,0),(25,'2017-05-30 11:47:22','2017-05-30 11:47:22','TargetPay Ideal','TargetPay_Ideal',1,1,10000,0,NULL,0,0),(26,'2017-05-30 11:47:22','2017-05-30 11:47:22','TargetPay Mr Cash','TargetPay_Mrcash',1,1,10000,0,NULL,0,0),(27,'2017-05-30 11:47:22','2017-05-30 11:47:22','TwoCheckout','TwoCheckout',1,1,10000,0,NULL,1,0),(28,'2017-05-30 11:47:22','2017-05-30 11:47:22','WorldPay','WorldPay',1,1,10000,0,NULL,0,0),(29,'2017-05-30 11:47:22','2017-05-30 11:47:22','BeanStream','BeanStream',1,2,10000,0,NULL,0,0),(30,'2017-05-30 11:47:22','2017-05-30 11:47:22','Psigate','Psigate',1,2,10000,0,NULL,0,0),(31,'2017-05-30 11:47:22','2017-05-30 11:47:22','moolah','AuthorizeNet_AIM',1,1,10000,0,NULL,0,0),(32,'2017-05-30 11:47:22','2017-05-30 11:47:22','Alipay','Alipay_Express',1,1,10000,0,NULL,0,0),(33,'2017-05-30 11:47:22','2017-05-30 11:47:22','Buckaroo','Buckaroo_CreditCard',1,1,10000,0,NULL,0,0),(34,'2017-05-30 11:47:22','2017-05-30 11:47:22','Coinbase','Coinbase',1,1,10000,0,NULL,0,0),(35,'2017-05-30 11:47:22','2017-05-30 11:47:22','DataCash','DataCash',1,1,10000,0,NULL,0,0),(36,'2017-05-30 11:47:22','2017-05-30 11:47:22','Neteller','Neteller',1,2,10000,0,NULL,0,0),(37,'2017-05-30 11:47:22','2017-05-30 11:47:22','Pacnet','Pacnet',1,1,10000,0,NULL,0,0),(38,'2017-05-30 11:47:22','2017-05-30 11:47:22','PaymentSense','PaymentSense',1,2,10000,0,NULL,0,0),(39,'2017-05-30 11:47:22','2017-05-30 11:47:22','Realex','Realex_Remote',1,1,10000,0,NULL,0,0),(40,'2017-05-30 11:47:22','2017-05-30 11:47:22','Sisow','Sisow',1,1,10000,0,NULL,0,0),(41,'2017-05-30 11:47:22','2017-05-30 11:47:22','Skrill','Skrill',1,1,10000,0,NULL,1,0),(42,'2017-05-30 11:47:22','2017-05-30 11:47:22','BitPay','BitPay',1,1,6,0,NULL,1,0),(43,'2017-05-30 11:47:22','2017-05-30 11:47:22','Dwolla','Dwolla',1,1,5,0,NULL,1,0),(44,'2017-05-30 11:47:22','2017-05-30 11:47:22','AGMS','Agms',1,1,10000,0,NULL,0,0),(45,'2017-05-30 11:47:22','2017-05-30 11:47:22','Barclays','BarclaysEpdq\\Essential',1,1,10000,0,NULL,0,0),(46,'2017-05-30 11:47:22','2017-05-30 11:47:22','Cardgate','Cardgate',1,1,10000,0,NULL,0,0),(47,'2017-05-30 11:47:22','2017-05-30 11:47:22','Checkout.com','CheckoutCom',1,1,10000,0,NULL,0,0),(48,'2017-05-30 11:47:22','2017-05-30 11:47:22','Creditcall','Creditcall',1,1,10000,0,NULL,0,0),(49,'2017-05-30 11:47:22','2017-05-30 11:47:22','Cybersource','Cybersource',1,1,10000,0,NULL,0,0),(50,'2017-05-30 11:47:22','2017-05-30 11:47:22','ecoPayz','Ecopayz',1,1,10000,0,NULL,0,0),(51,'2017-05-30 11:47:22','2017-05-30 11:47:22','Fasapay','Fasapay',1,1,10000,0,NULL,0,0),(52,'2017-05-30 11:47:22','2017-05-30 11:47:22','Komoju','Komoju',1,1,10000,0,NULL,0,0),(53,'2017-05-30 11:47:22','2017-05-30 11:47:22','Multicards','Multicards',1,1,10000,0,NULL,0,0),(54,'2017-05-30 11:47:22','2017-05-30 11:47:22','Pagar.Me','Pagarme',1,2,10000,0,NULL,0,0),(55,'2017-05-30 11:47:22','2017-05-30 11:47:22','Paysafecard','Paysafecard',1,1,10000,0,NULL,0,0),(56,'2017-05-30 11:47:22','2017-05-30 11:47:22','Paytrace','Paytrace_CreditCard',1,1,10000,0,NULL,0,0),(57,'2017-05-30 11:47:22','2017-05-30 11:47:22','Secure Trading','SecureTrading',1,1,10000,0,NULL,0,0),(58,'2017-05-30 11:47:22','2017-05-30 11:47:22','SecPay','SecPay',1,1,10000,0,NULL,0,0),(59,'2017-05-30 11:47:22','2017-05-30 11:47:22','WeChat Express','WeChat_Express',1,2,10000,0,NULL,0,0),(60,'2017-05-30 11:47:22','2017-05-30 11:47:22','WePay','WePay',1,1,10000,0,NULL,0,0),(61,'2017-05-30 11:47:22','2017-05-30 11:47:22','Braintree','Braintree',1,1,2,0,NULL,0,0),(62,'2017-05-30 11:47:22','2017-05-30 11:47:22','Custom','Custom',1,1,8,0,NULL,1,0); /*!40000 ALTER TABLE `gateways` ENABLE KEYS */; UNLOCK TABLES; @@ -1806,7 +1809,7 @@ CREATE TABLE `payment_libraries` ( LOCK TABLES `payment_libraries` WRITE; /*!40000 ALTER TABLE `payment_libraries` DISABLE KEYS */; -INSERT INTO `payment_libraries` VALUES (1,'2017-05-17 14:06:14','2017-05-17 14:06:14','Omnipay',1),(2,'2017-05-17 14:06:14','2017-05-17 14:06:14','PHP-Payments [Deprecated]',1); +INSERT INTO `payment_libraries` VALUES (1,'2017-05-30 11:47:21','2017-05-30 11:47:21','Omnipay',1),(2,'2017-05-30 11:47:21','2017-05-30 11:47:21','PHP-Payments [Deprecated]',1); /*!40000 ALTER TABLE `payment_libraries` ENABLE KEYS */; UNLOCK TABLES; @@ -1916,7 +1919,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-05-17 14:06:14','2017-05-17 14:06:14',NULL,0,0,1),(2,10,'Net 10','2017-05-17 14:06:14','2017-05-17 14:06:14',NULL,0,0,2),(3,14,'Net 14','2017-05-17 14:06:14','2017-05-17 14:06:14',NULL,0,0,3),(4,15,'Net 15','2017-05-17 14:06:14','2017-05-17 14:06:14',NULL,0,0,4),(5,30,'Net 30','2017-05-17 14:06:14','2017-05-17 14:06:14',NULL,0,0,5),(6,60,'Net 60','2017-05-17 14:06:14','2017-05-17 14:06:14',NULL,0,0,6),(7,90,'Net 90','2017-05-17 14:06:14','2017-05-17 14:06:14',NULL,0,0,7),(8,-1,'Net 0','2017-05-17 14:06:17','2017-05-17 14:06:17',NULL,0,0,0); +INSERT INTO `payment_terms` VALUES (1,7,'Net 7','2017-05-30 11:47:21','2017-05-30 11:47:21',NULL,0,0,1),(2,10,'Net 10','2017-05-30 11:47:21','2017-05-30 11:47:21',NULL,0,0,2),(3,14,'Net 14','2017-05-30 11:47:21','2017-05-30 11:47:21',NULL,0,0,3),(4,15,'Net 15','2017-05-30 11:47:21','2017-05-30 11:47:21',NULL,0,0,4),(5,30,'Net 30','2017-05-30 11:47:21','2017-05-30 11:47:21',NULL,0,0,5),(6,60,'Net 60','2017-05-30 11:47:21','2017-05-30 11:47:21',NULL,0,0,6),(7,90,'Net 90','2017-05-30 11:47:21','2017-05-30 11:47:21',NULL,0,0,7),(8,-1,'Net 0','2017-05-30 11:47:23','2017-05-30 11:47:23',NULL,0,0,0); /*!40000 ALTER TABLE `payment_terms` ENABLE KEYS */; UNLOCK TABLES; @@ -2401,6 +2404,7 @@ CREATE TABLE `users` ( PRIMARY KEY (`id`), UNIQUE KEY `users_username_unique` (`username`), UNIQUE KEY `users_account_id_public_id_unique` (`account_id`,`public_id`), + UNIQUE KEY `users_oauth_user_id_oauth_provider_id_unique` (`oauth_user_id`,`oauth_provider_id`), KEY `users_account_id_index` (`account_id`), CONSTRAINT `users_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -2515,4 +2519,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2017-05-17 20:06:18 +-- Dump completed on 2017-05-30 17:47:24 diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 8422dbc927e3..48c8beb0b77c 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2254,7 +2254,13 @@ $LANG = array( 'expense_link' => 'expense', 'resume_task' => 'Resume Task', 'resumed_task' => 'Successfully resumed task', - + 'quote_design' => 'Quote Design', + 'default_design' => 'Default Design', + 'custom_design1' => 'Custom Design 1', + 'custom_design2' => 'Custom Design 2', + 'custom_design3' => 'Custom Design 3', + 'empty' => 'Empty', + 'select_design' => 'Select Design', ); return $LANG; diff --git a/resources/views/accounts/customize_design.blade.php b/resources/views/accounts/customize_design.blade.php index 128b881b2044..b5189cc01df4 100644 --- a/resources/views/accounts/customize_design.blade.php +++ b/resources/views/accounts/customize_design.blade.php @@ -168,7 +168,6 @@