From 620b09ccc868472f628e0c169b500b7f8f194a5d Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Mon, 25 Aug 2014 21:56:43 +0200 Subject: [PATCH 01/33] Seeding ok with MySQL STRICT_TRANS_TABLE, fixes #157 --- ...2014_03_25_102200_add_sort_and_recommended_to_gateways.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/database/migrations/2014_03_25_102200_add_sort_and_recommended_to_gateways.php b/app/database/migrations/2014_03_25_102200_add_sort_and_recommended_to_gateways.php index 535636f90e6a..a49fe8f855ef 100644 --- a/app/database/migrations/2014_03_25_102200_add_sort_and_recommended_to_gateways.php +++ b/app/database/migrations/2014_03_25_102200_add_sort_and_recommended_to_gateways.php @@ -15,8 +15,8 @@ class AddSortAndRecommendedToGateways extends Migration { Schema::table('gateways', function($table) { $table->unsignedInteger('sort_order')->default(10000); - $table->boolean('recommended'); - $table->string('site_url', 200); + $table->boolean('recommended')->default(0); + $table->string('site_url', 200)->nullable(); }); } From 17ab45014adee807a9b4ba7e7b2e8e414f239fbb Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Mon, 25 Aug 2014 22:31:45 +0200 Subject: [PATCH 02/33] Migrations for accounts and users tables Now when clicking on INVOICE NOW, we can reach first step of a new invoice creation even with MySQL 5.6 default STRICT_TRANS_TABLE. --- ...11_05_180133_confide_setup_users_table.php | 30 +++++++++---------- ...2014_03_03_155556_add_phone_to_account.php | 4 +-- .../2014_04_03_191105_add_pro_plan.php | 2 +- .../2014_04_17_145108_add_custom_fields.php | 12 ++++---- ...014_04_29_174315_add_advanced_settings.php | 4 +-- ...4_07_17_205900_support_hiding_quantity.php | 12 ++++---- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php index 3ddc66d16b89..e0411ca525fa 100755 --- a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php +++ b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php @@ -132,19 +132,19 @@ class ConfideSetupUsersTable extends Migration { $t->timestamps(); $t->softDeletes(); - $t->string('name'); + $t->string('name')->nullable(); $t->string('ip'); $t->string('account_key')->unique(); $t->timestamp('last_login'); - $t->string('address1'); - $t->string('address2'); - $t->string('city'); - $t->string('state'); - $t->string('postal_code'); + $t->string('address1')->nullable(); + $t->string('address2')->nullable(); + $t->string('city')->nullable(); + $t->string('state')->nullable(); + $t->string('postal_code')->nullable(); $t->unsignedInteger('country_id')->nullable(); - $t->text('invoice_terms'); - $t->text('email_footer'); + $t->text('invoice_terms')->nullable(); + $t->text('email_footer')->nullable(); $t->unsignedInteger('industry_id')->nullable(); $t->unsignedInteger('size_id')->nullable(); @@ -177,16 +177,16 @@ class ConfideSetupUsersTable extends Migration { $t->timestamps(); $t->softDeletes(); - $t->string('first_name'); - $t->string('last_name'); - $t->string('phone'); + $t->string('first_name')->nullable(); + $t->string('last_name')->nullable(); + $t->string('phone')->nullable(); $t->string('username')->unique(); - $t->string('email'); + $t->string('email')->nullable(); $t->string('password'); $t->string('confirmation_code'); $t->boolean('registered')->default(false); $t->boolean('confirmed')->default(false); - $t->integer('theme_id'); + $t->integer('theme_id')->nullable(); $t->boolean('notify_sent')->default(true); $t->boolean('notify_viewed')->default(false); @@ -194,7 +194,7 @@ class ConfideSetupUsersTable extends Migration { $t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); - $t->unsignedInteger('public_id'); + $t->unsignedInteger('public_id')->nullable(); $t->unique( array('account_id','public_id') ); }); @@ -202,7 +202,7 @@ class ConfideSetupUsersTable extends Migration { { $t->increments('id'); $t->unsignedInteger('account_id'); - $t->unsignedInteger('user_id'); + $t->unsignedInteger('user_id'); $t->unsignedInteger('gateway_id'); $t->timestamps(); $t->softDeletes(); diff --git a/app/database/migrations/2014_03_03_155556_add_phone_to_account.php b/app/database/migrations/2014_03_03_155556_add_phone_to_account.php index 1de12fb34e3b..79e03e9d183a 100644 --- a/app/database/migrations/2014_03_03_155556_add_phone_to_account.php +++ b/app/database/migrations/2014_03_03_155556_add_phone_to_account.php @@ -14,8 +14,8 @@ class AddPhoneToAccount extends Migration { { Schema::table('accounts', function($table) { - $table->string('work_phone'); - $table->string('work_email'); + $table->string('work_phone')->nullable(); + $table->string('work_email')->nullable(); }); } diff --git a/app/database/migrations/2014_04_03_191105_add_pro_plan.php b/app/database/migrations/2014_04_03_191105_add_pro_plan.php index 05f74ebdf40b..cbc714971f1d 100644 --- a/app/database/migrations/2014_04_03_191105_add_pro_plan.php +++ b/app/database/migrations/2014_04_03_191105_add_pro_plan.php @@ -14,7 +14,7 @@ class AddProPlan extends Migration { { Schema::table('accounts', function($table) { - $table->date('pro_plan_paid'); + $table->date('pro_plan_paid')->nullable(); }); } diff --git a/app/database/migrations/2014_04_17_145108_add_custom_fields.php b/app/database/migrations/2014_04_17_145108_add_custom_fields.php index ac88c4012b70..c6c1360823ae 100644 --- a/app/database/migrations/2014_04_17_145108_add_custom_fields.php +++ b/app/database/migrations/2014_04_17_145108_add_custom_fields.php @@ -14,14 +14,14 @@ class AddCustomFields extends Migration { { Schema::table('accounts', function($table) { - $table->string('custom_label1'); - $table->string('custom_value1'); + $table->string('custom_label1')->nullable(); + $table->string('custom_value1')->nullable(); - $table->string('custom_label2'); - $table->string('custom_value2'); + $table->string('custom_label2')->nullable(); + $table->string('custom_value2')->nullable(); - $table->string('custom_client_label1'); - $table->string('custom_client_label2'); + $table->string('custom_client_label1')->nullable(); + $table->string('custom_client_label2')->nullable(); }); Schema::table('clients', function($table) diff --git a/app/database/migrations/2014_04_29_174315_add_advanced_settings.php b/app/database/migrations/2014_04_29_174315_add_advanced_settings.php index 589bc6a7450b..ae91740d21f3 100644 --- a/app/database/migrations/2014_04_29_174315_add_advanced_settings.php +++ b/app/database/migrations/2014_04_29_174315_add_advanced_settings.php @@ -14,8 +14,8 @@ class AddAdvancedSettings extends Migration { { Schema::table('accounts', function($table) { - $table->string('primary_color'); - $table->string('secondary_color'); + $table->string('primary_color')->nullable(); + $table->string('secondary_color')->nullable(); }); Schema::table('payments', function($table) diff --git a/app/database/migrations/2014_07_17_205900_support_hiding_quantity.php b/app/database/migrations/2014_07_17_205900_support_hiding_quantity.php index d055e4e908cb..5a8ed681bc8b 100644 --- a/app/database/migrations/2014_07_17_205900_support_hiding_quantity.php +++ b/app/database/migrations/2014_07_17_205900_support_hiding_quantity.php @@ -14,14 +14,14 @@ class SupportHidingQuantity extends Migration { { Schema::table('accounts', function($table) { - $table->boolean('hide_quantity'); - $table->boolean('hide_paid_to_date'); + $table->boolean('hide_quantity')->default(0); + $table->boolean('hide_paid_to_date')->default(0); - $table->string('custom_invoice_label1'); - $table->string('custom_invoice_label2'); + $table->string('custom_invoice_label1')->nullable(); + $table->string('custom_invoice_label2')->nullable(); - $table->boolean('custom_invoice_taxes1'); - $table->boolean('custom_invoice_taxes2'); + $table->boolean('custom_invoice_taxes1')->nullable(); + $table->boolean('custom_invoice_taxes2')->nullable(); }); Schema::table('invoices', function($table) From bb4b14e49c71c0880f9b6f3ce2f76d92d03f9531 Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Mon, 25 Aug 2014 23:26:17 +0200 Subject: [PATCH 03/33] Client import, create invoice with STRICT_TRANS_TABLE --- ...11_05_180133_confide_setup_users_table.php | 66 +++++++++---------- .../2014_04_17_145108_add_custom_fields.php | 4 +- .../2014_05_17_175626_add_quotes.php | 2 +- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php index e0411ca525fa..a5d50635c8c4 100755 --- a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php +++ b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php @@ -235,23 +235,23 @@ class ConfideSetupUsersTable extends Migration { $t->timestamps(); $t->softDeletes(); - $t->string('name'); - $t->string('address1'); - $t->string('address2'); - $t->string('city'); - $t->string('state'); - $t->string('postal_code'); + $t->string('name')->nullable(); + $t->string('address1')->nullable(); + $t->string('address2')->nullable(); + $t->string('city')->nullable(); + $t->string('state')->nullable(); + $t->string('postal_code')->nullable(); $t->unsignedInteger('country_id')->nullable(); - $t->string('work_phone'); - $t->text('private_notes'); - $t->decimal('balance', 13, 2); - $t->decimal('paid_to_date', 13, 2); + $t->string('work_phone')->nullable(); + $t->text('private_notes')->nullable(); + $t->decimal('balance', 13, 2)->nullable(); + $t->decimal('paid_to_date', 13, 2)->nullable(); $t->timestamp('last_login')->nullable(); - $t->string('website'); + $t->string('website')->nullable(); $t->unsignedInteger('industry_id')->nullable(); $t->unsignedInteger('size_id')->nullable(); - $t->boolean('is_deleted'); - $t->integer('payment_terms'); + $t->boolean('is_deleted')->default(false); + $t->integer('payment_terms')->nullable(); $t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); $t->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); @@ -273,18 +273,18 @@ class ConfideSetupUsersTable extends Migration { $t->timestamps(); $t->softDeletes(); - $t->boolean('is_primary'); - $t->boolean('send_invoice'); - $t->string('first_name'); - $t->string('last_name'); - $t->string('email'); - $t->string('phone'); + $t->boolean('is_primary')->default(0); + $t->boolean('send_invoice')->default(0); + $t->string('first_name')->nullable(); + $t->string('last_name')->nullable(); + $t->string('email')->nullable(); + $t->string('phone')->nullable(); $t->timestamp('last_login'); $t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade'); $t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');; - $t->unsignedInteger('public_id'); + $t->unsignedInteger('public_id')->nullable(); $t->unique( array('account_id','public_id') ); }); @@ -317,7 +317,7 @@ class ConfideSetupUsersTable extends Migration { $t->date('due_date')->nullable(); $t->text('terms'); $t->text('public_notes'); - $t->boolean('is_deleted'); + $t->boolean('is_deleted')->default(false); $t->boolean('is_recurring'); $t->unsignedInteger('frequency_id'); $t->date('start_date')->nullable(); @@ -354,7 +354,7 @@ class ConfideSetupUsersTable extends Migration { $t->timestamps(); $t->softDeletes(); - $t->string('transaction_reference'); + $t->string('transaction_reference')->nullable(); $t->timestamp('sent_date'); $t->timestamp('viewed_date'); @@ -445,7 +445,7 @@ class ConfideSetupUsersTable extends Migration { $t->timestamps(); $t->softDeletes(); - $t->boolean('is_deleted'); + $t->boolean('is_deleted')->default(false); $t->decimal('amount', 13, 2); $t->date('payment_date'); $t->string('transaction_reference'); @@ -472,7 +472,7 @@ class ConfideSetupUsersTable extends Migration { $t->timestamps(); $t->softDeletes(); - $t->boolean('is_deleted'); + $t->boolean('is_deleted')->default(false); $t->decimal('amount', 13, 2); $t->decimal('balance', 13, 2); $t->date('credit_date')->nullable(); @@ -495,17 +495,17 @@ class ConfideSetupUsersTable extends Migration { $t->unsignedInteger('account_id'); $t->unsignedInteger('client_id'); $t->unsignedInteger('user_id'); - $t->unsignedInteger('contact_id'); - $t->unsignedInteger('payment_id'); - $t->unsignedInteger('invoice_id'); - $t->unsignedInteger('credit_id'); - $t->unsignedInteger('invitation_id'); + $t->unsignedInteger('contact_id')->nullable(); + $t->unsignedInteger('payment_id')->nullable(); + $t->unsignedInteger('invoice_id')->nullable(); + $t->unsignedInteger('credit_id')->nullable(); + $t->unsignedInteger('invitation_id')->nullable(); - $t->text('message'); - $t->text('json_backup'); + $t->text('message')->nullable(); + $t->text('json_backup')->nullable(); $t->integer('activity_type_id'); - $t->decimal('adjustment', 13, 2); - $t->decimal('balance', 13, 2); + $t->decimal('adjustment', 13, 2)->nullable(); + $t->decimal('balance', 13, 2)->nullable(); $t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); $t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade'); diff --git a/app/database/migrations/2014_04_17_145108_add_custom_fields.php b/app/database/migrations/2014_04_17_145108_add_custom_fields.php index c6c1360823ae..f6ff7c8f45a1 100644 --- a/app/database/migrations/2014_04_17_145108_add_custom_fields.php +++ b/app/database/migrations/2014_04_17_145108_add_custom_fields.php @@ -26,8 +26,8 @@ class AddCustomFields extends Migration { Schema::table('clients', function($table) { - $table->string('custom_value1'); - $table->string('custom_value2'); + $table->string('custom_value1')->nullable(); + $table->string('custom_value2')->nullable(); }); } diff --git a/app/database/migrations/2014_05_17_175626_add_quotes.php b/app/database/migrations/2014_05_17_175626_add_quotes.php index 5079117d7ba2..6299ad124dc0 100644 --- a/app/database/migrations/2014_05_17_175626_add_quotes.php +++ b/app/database/migrations/2014_05_17_175626_add_quotes.php @@ -14,7 +14,7 @@ class AddQuotes extends Migration { { Schema::table('invoices', function($table) { - $table->boolean('is_quote'); + $table->boolean('is_quote')->default(0); $table->unsignedInteger('quote_id')->nullable(); $table->unsignedInteger('quote_invoice_id')->nullable(); }); From 686be0852b7c735c207f3403827dceccd719b0dc Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Tue, 26 Aug 2014 10:30:45 +0200 Subject: [PATCH 04/33] nullable added to some fields --- ...13_11_05_180133_confide_setup_users_table.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php index a5d50635c8c4..65326c575b82 100755 --- a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php +++ b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php @@ -395,7 +395,7 @@ class ConfideSetupUsersTable extends Migration { $t->string('product_key'); $t->text('notes'); $t->decimal('cost', 13, 2); - $t->decimal('qty', 13, 2); + $t->decimal('qty', 13, 2)->nullable(); $t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); $t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');; @@ -418,10 +418,10 @@ class ConfideSetupUsersTable extends Migration { $t->string('product_key'); $t->text('notes'); $t->decimal('cost', 13, 2); - $t->decimal('qty', 13, 2); + $t->decimal('qty', 13, 2)->nullable(); - $t->string('tax_name'); - $t->decimal('tax_rate', 13, 2); + $t->string('tax_name')->nullable(); + $t->decimal('tax_rate', 13, 2)->nullable(); $t->foreign('invoice_id')->references('id')->on('invoices')->onDelete('cascade'); $t->foreign('product_id')->references('id')->on('products'); @@ -447,9 +447,9 @@ class ConfideSetupUsersTable extends Migration { $t->boolean('is_deleted')->default(false); $t->decimal('amount', 13, 2); - $t->date('payment_date'); - $t->string('transaction_reference'); - $t->string('payer_id'); + $t->date('payment_date')->nullable(); + $t->string('transaction_reference')->nullable(); + $t->string('payer_id')->nullable(); $t->foreign('invoice_id')->references('id')->on('invoices'); $t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); @@ -476,7 +476,7 @@ class ConfideSetupUsersTable extends Migration { $t->decimal('amount', 13, 2); $t->decimal('balance', 13, 2); $t->date('credit_date')->nullable(); - $t->string('credit_number'); + $t->string('credit_number')->nullable(); $t->text('private_notes'); $t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); From 8edb063b30e82dcb56650e24aa4b1cbb49ff3fc7 Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Tue, 26 Aug 2014 10:32:14 +0200 Subject: [PATCH 05/33] default integer value for payment_terms Because sending an empty string to a integer column is not allowed with MySQL in STRICT_TRANS_TABLE mode. --- app/controllers/ClientController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/ClientController.php b/app/controllers/ClientController.php index 6acbb50c80b4..10f427c1010a 100755 --- a/app/controllers/ClientController.php +++ b/app/controllers/ClientController.php @@ -212,7 +212,7 @@ class ClientController extends \BaseController { $client->size_id = Input::get('size_id') ? Input::get('size_id') : null; $client->industry_id = Input::get('industry_id') ? Input::get('industry_id') : null; $client->currency_id = Input::get('currency_id') ? Input::get('currency_id') : 1; - $client->payment_terms = Input::get('payment_terms'); + $client->payment_terms = Input::get('payment_terms') ? : 0; $client->website = trim(Input::get('website')); $client->save(); From 30c65f4a23ddbe9bd753d221068b8f300454cc5a Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Tue, 26 Aug 2014 10:36:53 +0200 Subject: [PATCH 06/33] simpler short conditionnal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “Since PHP 5.3, it is possible to leave out the middle part of the ternary operator. Expression expr1 ?: expr3 returns expr1 if expr1 evaluates to TRUE, and expr3 otherwise.” http://php.net/manual/en/language.operators.comparison.php --- app/controllers/ClientController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/ClientController.php b/app/controllers/ClientController.php index 10f427c1010a..a01c93d40e6a 100755 --- a/app/controllers/ClientController.php +++ b/app/controllers/ClientController.php @@ -207,11 +207,11 @@ class ClientController extends \BaseController { $client->city = trim(Input::get('city')); $client->state = trim(Input::get('state')); $client->postal_code = trim(Input::get('postal_code')); - $client->country_id = Input::get('country_id') ? Input::get('country_id') : null; + $client->country_id = Input::get('country_id') ? : null; $client->private_notes = trim(Input::get('private_notes')); - $client->size_id = Input::get('size_id') ? Input::get('size_id') : null; - $client->industry_id = Input::get('industry_id') ? Input::get('industry_id') : null; - $client->currency_id = Input::get('currency_id') ? Input::get('currency_id') : 1; + $client->size_id = Input::get('size_id') ? : null; + $client->industry_id = Input::get('industry_id') ? : null; + $client->currency_id = Input::get('currency_id') ? : 1; $client->payment_terms = Input::get('payment_terms') ? : 0; $client->website = trim(Input::get('website')); From 3273eea39f09b47e5aad6d0dac0ddb86f8b1b345 Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Tue, 26 Aug 2014 10:37:47 +0200 Subject: [PATCH 07/33] 3 constants taken from config --- app/routes.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/routes.php b/app/routes.php index e5685f90fbb8..5fee13bc0776 100755 --- a/app/routes.php +++ b/app/routes.php @@ -136,9 +136,9 @@ Route::group(array('prefix' => 'api/v1', 'before' => 'auth.basic'), function() Route::post('api/hooks', 'IntegrationController@subscribe'); }); -define('CONTACT_EMAIL', 'contact@invoiceninja.com'); -define('CONTACT_NAME', 'Invoice Ninja'); -define('SITE_URL', 'https://www.invoiceninja.com'); +define('CONTACT_EMAIL', Config::get('mail.from.address')); +define('CONTACT_NAME', Config::get('mail.from.name')); +define('SITE_URL', Config::get('app.url')); define('ENV_DEVELOPMENT', 'local'); define('ENV_STAGING', 'staging'); From 47455dc058b2d9668ef7f606307f2f121d19359b Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Tue, 26 Aug 2014 10:39:17 +0200 Subject: [PATCH 08/33] Hardcoded urls removed in mail templates --- app/views/emails/invoice_html.blade.php | 4 ++-- app/views/emails/invoice_text.blade.php | 4 ++-- app/views/emails/payment_confirmation_html.blade.php | 4 ++-- app/views/emails/payment_confirmation_text.blade.php | 4 ++-- app/views/master.blade.php | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/views/emails/invoice_html.blade.php b/app/views/emails/invoice_html.blade.php index 8c32f6bfab12..bb36f663bd02 100755 --- a/app/views/emails/invoice_html.blade.php +++ b/app/views/emails/invoice_html.blade.php @@ -19,8 +19,8 @@ @if ($showNinjaFooter)

- {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} + {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} @endif - \ No newline at end of file + diff --git a/app/views/emails/invoice_text.blade.php b/app/views/emails/invoice_text.blade.php index 954cfcf925ef..24b797e48e2e 100755 --- a/app/views/emails/invoice_text.blade.php +++ b/app/views/emails/invoice_text.blade.php @@ -12,5 +12,5 @@ @if ($showNinjaFooter) {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} -https://www.invoiceninja.com -@endif \ No newline at end of file +{{ SITE_URL }} +@endif diff --git a/app/views/emails/payment_confirmation_html.blade.php b/app/views/emails/payment_confirmation_html.blade.php index 9f224df389d7..aabca1ac0d5d 100644 --- a/app/views/emails/payment_confirmation_html.blade.php +++ b/app/views/emails/payment_confirmation_html.blade.php @@ -18,8 +18,8 @@ @if ($showNinjaFooter)

- {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} + {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} @endif - \ No newline at end of file + diff --git a/app/views/emails/payment_confirmation_text.blade.php b/app/views/emails/payment_confirmation_text.blade.php index 9b6b7384812b..92191ad8a0ba 100644 --- a/app/views/emails/payment_confirmation_text.blade.php +++ b/app/views/emails/payment_confirmation_text.blade.php @@ -11,5 +11,5 @@ @if ($showNinjaFooter) {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} -https://www.invoiceninja.com -@endif \ No newline at end of file +{{ SITE_URL }} +@endif diff --git a/app/views/master.blade.php b/app/views/master.blade.php index 92c802cc6476..707b8f4e9f1f 100755 --- a/app/views/master.blade.php +++ b/app/views/master.blade.php @@ -9,9 +9,9 @@ - + - + @@ -20,7 +20,7 @@ - + From 9ca974e49e91fd71a8328cea44039ab5dbf7c056 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 31 Aug 2014 21:18:42 +0300 Subject: [PATCH 09/33] Changed url constant for footers --- app/views/emails/invoice_html.blade.php | 2 +- app/views/emails/invoice_text.blade.php | 2 +- app/views/emails/payment_confirmation_html.blade.php | 2 +- app/views/emails/payment_confirmation_text.blade.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/emails/invoice_html.blade.php b/app/views/emails/invoice_html.blade.php index bb36f663bd02..2db78c6e72cb 100755 --- a/app/views/emails/invoice_html.blade.php +++ b/app/views/emails/invoice_html.blade.php @@ -19,7 +19,7 @@ @if ($showNinjaFooter)

- {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} + {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} @endif diff --git a/app/views/emails/invoice_text.blade.php b/app/views/emails/invoice_text.blade.php index 24b797e48e2e..4797df81badc 100755 --- a/app/views/emails/invoice_text.blade.php +++ b/app/views/emails/invoice_text.blade.php @@ -12,5 +12,5 @@ @if ($showNinjaFooter) {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} -{{ SITE_URL }} +{{ NINJA_URL }} @endif diff --git a/app/views/emails/payment_confirmation_html.blade.php b/app/views/emails/payment_confirmation_html.blade.php index aabca1ac0d5d..c1dffbac19a0 100644 --- a/app/views/emails/payment_confirmation_html.blade.php +++ b/app/views/emails/payment_confirmation_html.blade.php @@ -18,7 +18,7 @@ @if ($showNinjaFooter)

- {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} + {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} @endif diff --git a/app/views/emails/payment_confirmation_text.blade.php b/app/views/emails/payment_confirmation_text.blade.php index 92191ad8a0ba..0d2b7a1c5438 100644 --- a/app/views/emails/payment_confirmation_text.blade.php +++ b/app/views/emails/payment_confirmation_text.blade.php @@ -11,5 +11,5 @@ @if ($showNinjaFooter) {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} -{{ SITE_URL }} +{{ NINJA_URL }} @endif From 77b055aff87ffd7730d71769193a14628305ec28 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 31 Aug 2014 22:01:20 +0300 Subject: [PATCH 10/33] Fixed recurring invoices client balance --- app/models/Activity.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/models/Activity.php b/app/models/Activity.php index f177e9dada8e..f9e17fa05e4b 100755 --- a/app/models/Activity.php +++ b/app/models/Activity.php @@ -119,7 +119,7 @@ class Activity extends Eloquent $adjustment = 0; $client = $invoice->client; - if (!$invoice->is_quote) + if (!$invoice->is_quote && !$invoice->is_recurring) { $adjustment = $invoice->amount; $client->balance = $client->balance + $adjustment; @@ -170,11 +170,12 @@ class Activity extends Eloquent public static function updateInvoice($invoice) { + $client = $invoice->client; + if ($invoice->is_deleted && !$invoice->getOriginal('is_deleted')) { - if (!$invoice->is_quote) + if (!$invoice->is_quote && !$invoice->is_recurring) { - $client = $invoice->client; $client->balance = $client->balance - $invoice->balance; $client->paid_to_date = $client->paid_to_date - ($invoice->amount - $invoice->balance); $client->save(); @@ -198,11 +199,13 @@ class Activity extends Eloquent return; } - $backupInvoice = Invoice::with('invoice_items', 'client.account', 'client.contacts')->find($invoice->id); + $backupInvoice = Invoice::with('invoice_items', 'client.account', 'client.contacts')->find($invoice->id); - $client = $invoice->client; - $client->balance = $client->balance + $diff; - $client->save(); + if (!$invoice->is_quote && !$invoice->is_recurring) + { + $client->balance = $client->balance + $diff; + $client->save(); + } $activity = Activity::getBlank($invoice); $activity->client_id = $invoice->client_id; @@ -210,7 +213,7 @@ class Activity extends Eloquent $activity->activity_type_id = $invoice->is_quote ? ACTIVITY_TYPE_UPDATE_QUOTE : ACTIVITY_TYPE_UPDATE_INVOICE; $activity->message = Utils::encodeActivity(Auth::user(), 'updated', $invoice); $activity->balance = $client->balance; - $activity->adjustment = $invoice->is_quote ? 0 : $diff; + $activity->adjustment = $invoice->is_quote || $invoice->is_recurring ? 0 : $diff; $activity->json_backup = $backupInvoice->hidePrivateFields()->toJSON(); $activity->save(); } From 6716f8a3ab62fc0773691998eff3d400d246245c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 31 Aug 2014 22:39:22 +0300 Subject: [PATCH 11/33] Version and text changes --- app/routes.php | 2 +- app/views/public/compare.blade.php | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/app/routes.php b/app/routes.php index f939dc2c7d02..ea60a74de693 100755 --- a/app/routes.php +++ b/app/routes.php @@ -231,7 +231,7 @@ define('NINJA_ACCOUNT_KEY', 'zg4ylmzDkdkPOT8yoKQw9LTWaoZJx79h'); define('NINJA_GATEWAY_ID', GATEWAY_AUTHORIZE_NET); define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}'); define('NINJA_URL', 'https://www.invoiceninja.com'); -define('NINJA_VERSION', '1.3.1'); +define('NINJA_VERSION', '1.3.2'); define('PRO_PLAN_PRICE', 50); define('LICENSE_PRICE', 30.00); diff --git a/app/views/public/compare.blade.php b/app/views/public/compare.blade.php index 73c279601b0f..362d262996bc 100644 --- a/app/views/public/compare.blade.php +++ b/app/views/public/compare.blade.php @@ -26,6 +26,7 @@ Custom Logo Multiple Templates Recurring Payments + Open Source @@ -38,6 +39,7 @@ + FreshBooks @@ -48,6 +50,7 @@ + Wave @@ -58,6 +61,7 @@ + NutCache @@ -68,6 +72,7 @@ + CurdBee @@ -78,6 +83,7 @@ + Zoho Invoice @@ -88,6 +94,7 @@ + Ronin @@ -98,6 +105,7 @@ + Invoiceable @@ -108,6 +116,7 @@ + Harvest @@ -118,6 +127,7 @@ + InvoiceOcean @@ -128,6 +138,7 @@ + @@ -147,6 +158,7 @@ Custom Logo Multiple Templates Recurring Payments + Open Source @@ -159,6 +171,7 @@ + FreeAgent @@ -169,6 +182,7 @@ + Xero @@ -179,6 +193,7 @@ + Invoice2go @@ -189,6 +204,7 @@ + Invoice Machine @@ -199,6 +215,7 @@ + FreshBooks @@ -209,6 +226,7 @@ + CurdBee @@ -219,6 +237,7 @@ + Zoho Invoice @@ -229,6 +248,7 @@ + Ronin @@ -239,6 +259,7 @@ + Harvest @@ -249,6 +270,7 @@ + Invoice Ocean @@ -259,6 +281,7 @@ + Apptivo @@ -269,6 +292,7 @@ + From 5c7d0a159a5e9b7f78b50dbf9cf6d319d2840596 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 31 Aug 2014 23:22:47 +0300 Subject: [PATCH 12/33] Adding Norwegian to lang table --- .../migrations/2014_03_19_201454_add_language_support.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/database/migrations/2014_03_19_201454_add_language_support.php b/app/database/migrations/2014_03_19_201454_add_language_support.php index 6acc56e2d478..cdb092a9a498 100644 --- a/app/database/migrations/2014_03_19_201454_add_language_support.php +++ b/app/database/migrations/2014_03_19_201454_add_language_support.php @@ -26,6 +26,7 @@ class AddLanguageSupport extends Migration { DB::table('languages')->insert(['name' => 'Brazilian Portuguese', 'locale' => 'pt_BR']); DB::table('languages')->insert(['name' => 'Dutch', 'locale' => 'nl']); DB::table('languages')->insert(['name' => 'Spanish', 'locale' => 'es']); + DB::table('languages')->insert(['name' => 'Norwegian', 'locale' => 'nb_NO']); Schema::table('accounts', function($table) { From f5b16c82ad248a6a2f1562aa5ef14d84fc0abdfc Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sat, 6 Sep 2014 23:40:51 +0300 Subject: [PATCH 13/33] Text changes --- README.md | 43 ++++++++++++++++++++++---------------- app/config/app.php | 2 +- app/views/master.blade.php | 1 - 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 4e7501b1920f..0c7a954403b4 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Most online invoicing sites are expensive. They shouldn't be. The aim of this project is to provide a free, open-source alternative. Additionally, the hope is the codebase will serve as a sample site for Laravel as well as other JavaScript technologies. -[This guide](http://hillelcoren.com/invoice-ninja/self-hosting/) is the simplest way to setup the site. The high level instructions for setting up the site using Git are below but there's also a more detailed [setup guide](http://hillelcoren.com/invoice-ninja/laravel-ubuntu-virtualbox/). To deploy the app with [Docker](http://www.docker.com/) you can use [this project](https://github.com/rollbrettler/Dockerfiles/tree/master/invoice-ninja). +To setup the site you can either use this [zip file](http://hillelcoren.com/invoice-ninja/self-hosting/) (easier to setup) or checkout the code from GitHub following the instructions below (easier to stay up to date). There's also a more detailed setup guide [available here](http://hillelcoren.com/invoice-ninja/laravel-ubuntu-virtualbox/). To deploy the app with [Docker](http://www.docker.com/) you can use [this project](https://github.com/rollbrettler/Dockerfiles/tree/master/invoice-ninja). To connect follow [@invoiceninja](https://twitter.com/invoiceninja) or join the [Facebook Group](https://www.facebook.com/invoiceninja). For discussion of the code please use the [Google Group](https://groups.google.com/d/forum/invoiceninja). @@ -18,6 +18,7 @@ If you'd like to translate the site please use [caouecs/Laravel4-long](https://g Site design by [kantorp-wegl.in](http://kantorp-wegl.in/) ### Features + * Core application built using Laravel 4.1 * Invoice PDF generation directly in the browser * Integrates with many payment providers @@ -62,6 +63,27 @@ Configure development/config/database.php and development/config/mail.php and in Add public/ to your web server root +### Deleveloper Notes + +* If you make any changes to the JavaScript files you need to run grunt to create the built files. See Gruntfile.js for more details. +* The lookup tables are cached in memory (ie, Currencies, Timezones, Languages, etc). If you a record to the database you need to clear the cache by uncommenting Cache::flush() in app/routes.php. +* If you run into any composer errors try running composer dump-autoload. + +### Ubuntu Notes + + # Install php-mcrypt + apt-get install php5-mcrypt + sudo php5enmod mcrypt + + # Install Composer + curl -sS https://getcomposer.org/installer | php + sudo mv composer.phar /usr/local/bin/composer + + # Install Bower + sudo apt-get install npm nodejs-legacy + sudo npm install -g bower + sudo ln -s /usr/local/lib/node_modules/bower/bin/bower /usr/local/bin/bower + ### Frameworks/Libraries * [laravel/laravel](https://github.com/laravel/laravel) - A PHP Framework For Web Artisans * [twbs/bootstrap](https://github.com/twbs/bootstrap) - Sleek, intuitive, and powerful front-end framework for faster and easier web development. @@ -86,24 +108,9 @@ Add public/ to your web server root * [briannesbitt/Carbon](https://github.com/briannesbitt/Carbon) - A simple API extension for DateTime with PHP 5.3+ * [thomaspark/bootswatch](https://github.com/thomaspark/bootswatch) - Themes for Bootstrap * [mozilla/pdf.js](https://github.com/mozilla/pdf.js) - PDF Reader in JavaScript -* [nnnick/Chart.js](https://github.com/nnnick/Chart.js) - Simple HTML5 Charts using the tag +* [nnnick/Chart.js](https://github.com/nnnick/Chart.js) - Simple HTML5 Charts using the canvas tag * [josscrowcroft/accounting.js](https://github.com/josscrowcroft/accounting.js) - A lightweight JavaScript library for number, money and currency formatting * [jashkenas/underscore](https://github.com/jashkenas/underscore) - JavaScript's utility _ belt * [caouecs/Laravel4-long](https://github.com/caouecs/Laravel4-lang) - List of languages ​​for Laravel4 * [calvinfroedge/PHP-Payments](https://github.com/calvinfroedge/PHP-Payments) - A uniform payments interface for PHP -* [bgrins/spectrum](https://github.com/bgrins/spectrum) - The No Hassle JavaScript Colorpicker - -### Ubuntu Notes - - # Install php-mcrypt - apt-get install php5-mcrypt - sudo php5enmod mcrypt - - # Install Composer - curl -sS https://getcomposer.org/installer | php - sudo mv composer.phar /usr/local/bin/composer - - # Install Bower - sudo apt-get install npm nodejs-legacy - sudo npm install -g bower - sudo ln -s /usr/local/lib/node_modules/bower/bin/bower /usr/local/bin/bower +* [bgrins/spectrum](https://github.com/bgrins/spectrum) - The No Hassle JavaScript Colorpicker \ No newline at end of file diff --git a/app/config/app.php b/app/config/app.php index 3148501412d4..601f4ed202ad 100755 --- a/app/config/app.php +++ b/app/config/app.php @@ -26,7 +26,7 @@ return array( | */ - 'url' => 'http://www.invoiceninja.com', + 'url' => 'https://www.invoiceninja.com', /* |-------------------------------------------------------------------------- diff --git a/app/views/master.blade.php b/app/views/master.blade.php index 707b8f4e9f1f..668cdacded22 100755 --- a/app/views/master.blade.php +++ b/app/views/master.blade.php @@ -20,7 +20,6 @@ - From c7309d13a719c345910c0e61762f07df55280699 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sat, 6 Sep 2014 23:42:31 +0300 Subject: [PATCH 14/33] Text changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c7a954403b4..06520970e328 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Add public/ to your web server root ### Deleveloper Notes * If you make any changes to the JavaScript files you need to run grunt to create the built files. See Gruntfile.js for more details. -* The lookup tables are cached in memory (ie, Currencies, Timezones, Languages, etc). If you a record to the database you need to clear the cache by uncommenting Cache::flush() in app/routes.php. +* The lookup tables are cached in memory (ie, Currencies, Timezones, Languages, etc). If you add a record to the database you need to clear the cache by uncommenting Cache::flush() in app/routes.php. * If you run into any composer errors try running composer dump-autoload. ### Ubuntu Notes From 8bc065cd74d21b686d6f862f8a157a93a3ae5f4e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sat, 6 Sep 2014 23:43:47 +0300 Subject: [PATCH 15/33] Text changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06520970e328..862362004e69 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ### [https://www.invoiceninja.com](https://www.invoiceninja.com) -**If you'd like to use our code to sell your own invoicing app get in touch.** +If you'd like to use our code to sell your own invoicing app get in touch. ### Introduction From 84cf760785d7d56ef96199230f7eb6e3bbed92ed Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 12 Sep 2014 00:28:36 +0300 Subject: [PATCH 16/33] Added confirm when saving recurring invoice --- ..._03_20_200300_create_payment_libraries.php | 21 ++++++++----------- app/database/seeds/ConstantsSeeder.php | 8 +++++-- app/lang/de/texts.php | 3 +++ app/lang/en/texts.php | 4 ++++ app/lang/es/texts.php | 3 +++ app/lang/fr/texts.php | 3 +++ app/lang/it/texts.php | 3 +++ app/lang/lt/texts.php | 3 +++ app/lang/nb_NO/texts.php | 3 +++ app/lang/nl/texts.php | 3 +++ app/lang/pt_BR/texts.php | 3 +++ app/models/PaymentLibrary.php | 1 + app/routes.php | 2 +- app/views/invoices/edit.blade.php | 14 +++++++------ app/views/master.blade.php | 2 +- app/views/public/header.blade.php | 2 ++ public/built.js | 7 +++---- public/js/script.js | 7 +++---- 18 files changed, 62 insertions(+), 30 deletions(-) diff --git a/app/database/migrations/2014_03_20_200300_create_payment_libraries.php b/app/database/migrations/2014_03_20_200300_create_payment_libraries.php index d4c7855a706e..dc8074c913bd 100644 --- a/app/database/migrations/2014_03_20_200300_create_payment_libraries.php +++ b/app/database/migrations/2014_03_20_200300_create_payment_libraries.php @@ -12,19 +12,16 @@ class CreatePaymentLibraries extends Migration { */ public function up() { - Schema::dropIfExists('payment_libraries'); + Schema::dropIfExists('payment_libraries'); - Schema::create('payment_libraries', function($t) - { - $t->increments('id'); - $t->timestamps(); + Schema::create('payment_libraries', function($t) + { + $t->increments('id'); + $t->timestamps(); - $t->string('name'); - $t->boolean('visible')->default(true); - }); - - DB::table('payment_libraries')->insert(['name' => 'Omnipay']); - DB::table('payment_libraries')->insert(['name' => 'PHP-Payments']); + $t->string('name'); + $t->boolean('visible')->default(true); + }); Schema::table('gateways', function($table) { @@ -35,7 +32,7 @@ class CreatePaymentLibraries extends Migration { Schema::table('gateways', function($table) { - $table->foreign('payment_library_id')->references('id')->on('payment_libraries')->onDelete('cascade'); + $table->foreign('payment_library_id')->references('id')->on('payment_libraries')->onDelete('cascade'); }); } diff --git a/app/database/seeds/ConstantsSeeder.php b/app/database/seeds/ConstantsSeeder.php index 7ebe2a382de9..365312a79c3c 100755 --- a/app/database/seeds/ConstantsSeeder.php +++ b/app/database/seeds/ConstantsSeeder.php @@ -129,8 +129,9 @@ class ConstantsSeeder extends Seeder Currency::create(array('name' => 'Danish Krone', 'code' => 'DKK', 'symbol' => 'kr ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); Currency::create(array('name' => 'Israeli Shekel', 'code' => 'ILS', 'symbol' => 'NIS ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); Currency::create(array('name' => 'Singapore Dollar', 'code' => 'SGD', 'symbol' => 'SGD ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); - Currency::create(array('name' => 'Swedish Krona', 'code' => 'SEK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); - Currency::create(array('name' => 'Norske Kroner', 'code' => 'NOK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); + Currency::create(array('name' => 'Swedish Krona', 'code' => 'SEK', 'symbol' => 'kr ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); + Currency::create(array('name' => 'Norske Kroner', 'code' => 'NOK', 'symbol' => 'kr ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); + Currency::create(array('name' => 'Kenyan Shilling', 'code' => 'KES', 'symbol' => 'KSh ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); DatetimeFormat::create(array('format' => 'd/M/Y g:i a', 'label' => '10/Mar/2013')); DatetimeFormat::create(array('format' => 'd-M-Yk g:i a', 'label' => '10-Mar-2013')); @@ -148,6 +149,9 @@ class ConstantsSeeder extends Seeder DateFormat::create(array('format' => 'F j, Y', 'picker_format' => 'MM d, yyyy', 'label' => 'March 10, 2013')); DateFormat::create(array('format' => 'D M j, Y', 'picker_format' => 'D MM d, yyyy', 'label' => 'Mon March 10, 2013')); + PaymentLibrary::create(['name' => 'Omnipay']); + PaymentLibrary::create(['name' => 'PHP-Payments']); + /* d, dd: Numeric date, no leading zero and leading zero, respectively. Eg, 5, 05. D, DD: Abbreviated and full weekday names, respectively. Eg, Mon, Monday. diff --git a/app/lang/de/texts.php b/app/lang/de/texts.php index 19e3da3aae1a..77fc2f781a89 100644 --- a/app/lang/de/texts.php +++ b/app/lang/de/texts.php @@ -404,5 +404,8 @@ return array( 'pending' => 'Pending', 'deleted_user' => 'Successfully deleted user', 'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users', + + 'confirm_email_invoice' => 'Confirm emailing this invoice', + 'confirm_email_quote' => 'Confirm emailing this quote', ); diff --git a/app/lang/en/texts.php b/app/lang/en/texts.php index a5b919fff342..a3ee84c2aa6d 100644 --- a/app/lang/en/texts.php +++ b/app/lang/en/texts.php @@ -420,4 +420,8 @@ return array( 'deleted_user' => 'Successfully deleted user', 'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users', + 'confirm_email_invoice' => 'Confirm emailing this invoice', + 'confirm_email_quote' => 'Confirm emailing this quote', + + ); \ No newline at end of file diff --git a/app/lang/es/texts.php b/app/lang/es/texts.php index af1ee8f9e90d..466d11ff783a 100644 --- a/app/lang/es/texts.php +++ b/app/lang/es/texts.php @@ -402,5 +402,8 @@ return array( 'pending' => 'Pending', 'deleted_user' => 'Successfully deleted user', 'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users', + + 'confirm_email_invoice' => 'Confirm emailing this invoice', + 'confirm_email_quote' => 'Confirm emailing this quote', ); diff --git a/app/lang/fr/texts.php b/app/lang/fr/texts.php index 881ac3f5a746..ea725a138084 100644 --- a/app/lang/fr/texts.php +++ b/app/lang/fr/texts.php @@ -404,5 +404,8 @@ return array( 'pending' => 'Pending', 'deleted_user' => 'Successfully deleted user', 'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users', + + 'confirm_email_invoice' => 'Confirm emailing this invoice', + 'confirm_email_quote' => 'Confirm emailing this quote', ); diff --git a/app/lang/it/texts.php b/app/lang/it/texts.php index 66a7aa5968d5..f1d958b94712 100644 --- a/app/lang/it/texts.php +++ b/app/lang/it/texts.php @@ -404,5 +404,8 @@ return array( 'pending' => 'Pending', 'deleted_user' => 'Successfully deleted user', 'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users', + + 'confirm_email_invoice' => 'Confirm emailing this invoice', + 'confirm_email_quote' => 'Confirm emailing this quote', ); diff --git a/app/lang/lt/texts.php b/app/lang/lt/texts.php index f349196f630f..109f66f804eb 100644 --- a/app/lang/lt/texts.php +++ b/app/lang/lt/texts.php @@ -420,6 +420,9 @@ return array( 'deleted_user' => 'Successfully deleted user', 'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users', + 'confirm_email_invoice' => 'Confirm emailing this invoice', + 'confirm_email_quote' => 'Confirm emailing this quote', + ); diff --git a/app/lang/nb_NO/texts.php b/app/lang/nb_NO/texts.php index 4e9983b765e1..d62734c9fbf8 100644 --- a/app/lang/nb_NO/texts.php +++ b/app/lang/nb_NO/texts.php @@ -420,4 +420,7 @@ return array( 'deleted_user' => 'Bruker slettet', 'limit_users' => 'Dessverre, vil dette overstiger grensen på ' . MAX_NUM_USERS . ' brukere', + 'confirm_email_invoice' => 'Confirm emailing this invoice', + 'confirm_email_quote' => 'Confirm emailing this quote', + ); \ No newline at end of file diff --git a/app/lang/nl/texts.php b/app/lang/nl/texts.php index 28f4d8302492..8f9ea67de15a 100644 --- a/app/lang/nl/texts.php +++ b/app/lang/nl/texts.php @@ -405,5 +405,8 @@ return array( 'pending' => 'Pending', 'deleted_user' => 'Successfully deleted user', 'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users', + + 'confirm_email_invoice' => 'Confirm emailing this invoice', + 'confirm_email_quote' => 'Confirm emailing this quote', ); diff --git a/app/lang/pt_BR/texts.php b/app/lang/pt_BR/texts.php index d941e9926b35..738a73b7d1ac 100644 --- a/app/lang/pt_BR/texts.php +++ b/app/lang/pt_BR/texts.php @@ -393,5 +393,8 @@ return array( 'pending' => 'Pending', 'deleted_user' => 'Successfully deleted user', 'limit_users' => 'Sorry, this will exceed the limit of ' . MAX_NUM_USERS . ' users', + + 'confirm_email_invoice' => 'Confirm emailing this invoice', + 'confirm_email_quote' => 'Confirm emailing this quote', ); diff --git a/app/models/PaymentLibrary.php b/app/models/PaymentLibrary.php index b8550c212aee..4e790713a096 100644 --- a/app/models/PaymentLibrary.php +++ b/app/models/PaymentLibrary.php @@ -3,6 +3,7 @@ class PaymentLibrary extends Eloquent { protected $table = 'payment_libraries'; + public $timestamps = true; public function gateways() { diff --git a/app/routes.php b/app/routes.php index ea60a74de693..e7271bf1f429 100755 --- a/app/routes.php +++ b/app/routes.php @@ -33,7 +33,7 @@ Route::post('/contact_submit', 'HomeController@doContactUs'); Route::get('/faq', 'HomeController@showFaq'); Route::get('/features', 'HomeController@showFeatures'); Route::get('/testimonials', 'HomeController@showTestimonials'); -Route::get('/compare-online-invoicing-sites', 'HomeController@showCompare'); +Route::get('/compare-online-invoicing', 'HomeController@showCompare'); Route::get('log_error', 'HomeController@logError'); Route::get('invoice_now', 'HomeController@invoiceNow'); diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index 094bb7d728ed..2d634a7687f9 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -723,17 +723,19 @@ } function onEmailClick() { - @if (Auth::user()->confirmed) - if (confirm('Are you sure you want to email this {{ $entityType }}?')) { + if (confirm('{{ trans("texts.confirm_email_$entityType") }}')) { submitAction('email'); } - @else - submitAction('email'); - @endif } function onSaveClick() { - submitAction(''); + if (model.invoice().is_recurring()) { + if (confirm('{{ trans("texts.confirm_email_$entityType") }}')) { + submitAction(''); + } + } else { + submitAction(''); + } } function submitAction(value) { diff --git a/app/views/master.blade.php b/app/views/master.blade.php index 668cdacded22..371b1f7e84d0 100755 --- a/app/views/master.blade.php +++ b/app/views/master.blade.php @@ -32,7 +32,7 @@ $.ajax({ type: 'GET', url: '{{ URL::to('log_error') }}', - data: 'error='+encodeURIComponent(e)+'&url='+encodeURIComponent(window.location) + data: 'error='+encodeURIComponent(e.message + ' - ' + e.filename + ': ' + e.lineno)+'&url='+encodeURIComponent(window.location) }); } catch(err) {} return false; diff --git a/app/views/public/header.blade.php b/app/views/public/header.blade.php index cdde1bffae56..7f6d1c171b20 100644 --- a/app/views/public/header.blade.php +++ b/app/views/public/header.blade.php @@ -135,6 +135,7 @@

  • {{ link_to('https://www.invoiceninja.com/contact', 'Contact Us' ) }}
  • {{ link_to('https://www.invoiceninja.com/features', 'Features' ) }}
  • {{ link_to('https://www.invoiceninja.com/plans', 'Plans' ) }}
  • +
  • {{ link_to('https://www.invoiceninja.com/compare-online-invoicing', 'Compare' ) }}
  • {{ link_to('https://www.invoiceninja.com/testimonials', 'Testimonials' ) }}
  • {{ link_to('https://www.invoiceninja.com/faq', 'FAQ' ) }}
  • @@ -214,6 +215,7 @@