From 9dbfe94e959adb4795a77339c67925f89b8b56d0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 4 May 2014 12:11:08 +0300 Subject: [PATCH 1/7] Bug fixes --- app/views/invoices/edit.blade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index 9f2db4ec9626..c5c18414b390 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -505,7 +505,9 @@ }); //.trigger('change'); $('#terms, #public_notes, #invoice_number, #invoice_date, #due_date, #po_number, #discount, #currency_id, #invoice_design_id, #recurring').change(function() { - refreshPDF(); + setTimeout(function() { + refreshPDF(); + }, 1); }); @if ($client || $invoice) From a20ddd1f45ee1ab2812ca8227920a965164be323 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 4 May 2014 16:07:45 +0300 Subject: [PATCH 2/7] Text changes --- app/routes.php | 2 +- app/views/public/plans.blade.php | 50 +++++++++++++++----------------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/app/routes.php b/app/routes.php index d938f6d7f72c..b49577e52ae5 100755 --- a/app/routes.php +++ b/app/routes.php @@ -143,7 +143,7 @@ define('DEFAULT_INVOICE_NUMBER', '0001'); define('RECENTLY_VIEWED_LIMIT', 8); define('LOGGED_ERROR_LIMIT', 100); define('RANDOM_KEY_LENGTH', 32); -define('MAX_NUM_CLIENTS', 1000); +define('MAX_NUM_CLIENTS', 500); define('MAX_NUM_CLIENTS_PRO', 5000); define('INVOICE_STATUS_DRAFT', 1); diff --git a/app/views/public/plans.blade.php b/app/views/public/plans.blade.php index a0436dccae19..69bbb3257488 100644 --- a/app/views/public/plans.blade.php +++ b/app/views/public/plans.blade.php @@ -33,58 +33,54 @@
Number of clients per account
-
Remove "Created by Invoice Ninja"
-
Custom invoice fields
Unlimited client invoices
Add your company logo
Live .PDF invoice creation
4 beatiful invoice templates
Accept credit card payments
-
Multiple currency & language support
-
Open source platform
-
Self-hosting available
-
Customize payment terms
+
Custom invoice fields
+
Priority email support
+
Custom invoice colors
+
Remove "Created by Invoice Ninja"
Pricing
Free
-
Number of clients per account
1000
-
Remove "Created by Invoice Ninja"
-
Custom invoice fields
+
Number of clients per account
500
Unlimited client invoices
Add your company logo
Live .PDF invoice creation
4 beatiful invoice templates
Accept credit card payments
-
Multiple currency & language support
-
Open source platform
-
Self-hosting available
-
Customize payment terms
+
Custom invoice fields
+
Priority email support
+
Custom invoice colors
+
Remove "Created by Invoice Ninja"
Pricing

Free /Always!

Pro Plan
-
Number of clients per account
5000
+
Number of clients per account
5,000
+
Unlimited client invoices
+
Add your company logo
+
Live .PDF invoice creation
+
4 beatiful invoice templates
+
Accept credit card payments
+
Custom invoice fields
+
Priority email support
+
Custom invoice colors
Remove "Created by Invoice Ninja"
-
Custom invoice fields
-
Unlimited client invoices
-
Add your company logo
-
Live .PDF invoice creation
-
4 beatiful invoice templates
-
Accept credit card payments
-
Multiple currency & language support
-
Open source platform
-
Self-hosting available
-
Customize payment terms
-
Pricing

$50 /Year

-
From 9d858f4bfc33012388876c3ad70ca32d1fc44c09 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 4 May 2014 18:49:57 +0300 Subject: [PATCH 3/7] Updating texts and added invoice_now link --- app/controllers/AccountController.php | 4 +- app/controllers/HomeController.php | 12 ++++ app/controllers/InvoiceController.php | 3 +- app/controllers/UserController.php | 4 +- ...014_04_29_174315_add_advanced_settings.php | 6 ++ app/models/Activity.php | 20 +++--- app/routes.php | 1 + app/views/header.blade.php | 71 ++++++++++++++++++- app/views/master.blade.php | 2 + app/views/public/header.blade.php | 12 ++-- app/views/public/splash.blade.php | 2 +- public/built.css | 69 +++++++++++++++++- public/css/style.css | 69 +++++++++++++++++- 13 files changed, 249 insertions(+), 26 deletions(-) diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 00f57f65a819..1e6b4237db06 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -35,7 +35,7 @@ class AccountController extends \BaseController { if ($user && $user->registered) { - exit; + return Redirect::to('/'); } } @@ -49,7 +49,7 @@ class AccountController extends \BaseController { Auth::login($user, true); Event::fire('user.login'); - + return Redirect::to('invoices/create'); } diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php index 9ae6ec456582..c446835840e4 100755 --- a/app/controllers/HomeController.php +++ b/app/controllers/HomeController.php @@ -74,6 +74,18 @@ class HomeController extends BaseController { return View::make('coming_soon'); } + public function invoiceNow() + { + if (Auth::check()) + { + return Redirect::to('invoices/create'); + } + else + { + return View::make('public.header', ['invoiceNow' => true]); + } + } + public function logError() { return Utils::logError(Input::get('error'), 'JavaScript'); diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php index 6c70eba77bac..4570f52f4a9b 100755 --- a/app/controllers/InvoiceController.php +++ b/app/controllers/InvoiceController.php @@ -209,7 +209,7 @@ class InvoiceController extends \BaseController { } public function create($clientPublicId = 0) - { + { $client = null; $invoiceNumber = Auth::user()->account->getNextInvoiceNumber(); $account = Account::with('country')->findOrFail(Auth::user()->account_id); @@ -229,6 +229,7 @@ class InvoiceController extends \BaseController { 'title' => '- New Invoice', 'client' => $client); $data = array_merge($data, self::getViewModel()); + return View::make('invoices.edit', $data); } diff --git a/app/controllers/UserController.php b/app/controllers/UserController.php index 0e04261fa308..f1f45262566f 100755 --- a/app/controllers/UserController.php +++ b/app/controllers/UserController.php @@ -298,8 +298,8 @@ class UserController extends BaseController { } } - Confide::logout(); - + Confide::logout(); + return Redirect::to('/')->with('clearGuestKey', true); } } 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 370cacfb1ee2..589bc6a7450b 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 @@ -17,6 +17,12 @@ class AddAdvancedSettings extends Migration { $table->string('primary_color'); $table->string('secondary_color'); }); + + Schema::table('payments', function($table) + { + $table->dropForeign('payments_invoice_id_foreign'); + $table->foreign('invoice_id')->references('id')->on('invoices')->onDelete('cascade'); + }); } /** diff --git a/app/models/Activity.php b/app/models/Activity.php index 71eca81be24e..e56580a070d6 100755 --- a/app/models/Activity.php +++ b/app/models/Activity.php @@ -129,12 +129,10 @@ class Activity extends Eloquent if (!$invoice->is_deleted) { - if ($invoice->balance > 0) - { - $client = $invoice->client; - $client->balance = $client->balance - $invoice->balance; - $client->save(); - } + $client = $invoice->client; + $client->balance = $client->balance - $invoice->balance; + $client->paid_to_date = $client->paid_to_date - ($invoice->amount - $invoice->balance); + $client->save(); $activity = Activity::getBlank(); $activity->invoice_id = $invoice->id; @@ -167,12 +165,10 @@ class Activity extends Eloquent { if ($invoice->is_deleted && !$invoice->getOriginal('is_deleted')) { - if ($invoice->balance > 0) - { - $client = $invoice->client; - $client->balance = $client->balance - $invoice->balance; - $client->save(); - } + $client = $invoice->client; + $client->balance = $client->balance - $invoice->balance; + $client->paid_to_date = $client->paid_to_date - ($invoice->amount - $invoice->balance); + $client->save(); $activity = Activity::getBlank(); $activity->client_id = $invoice->client_id; diff --git a/app/routes.php b/app/routes.php index b49577e52ae5..d26ab474c544 100755 --- a/app/routes.php +++ b/app/routes.php @@ -35,6 +35,7 @@ Route::get('/faq', 'HomeController@showFaq'); Route::get('/features', 'HomeController@showFeatures'); Route::get('log_error', 'HomeController@logError'); +Route::get('invoice_now', 'HomeController@invoiceNow'); Route::post('get_started', 'AccountController@getStarted'); Route::get('view/{invitation_key}', 'InvoiceController@view'); diff --git a/app/views/header.blade.php b/app/views/header.blade.php index 5cd52f7c0485..b2df39d39957 100755 --- a/app/views/header.blade.php +++ b/app/views/header.blade.php @@ -344,7 +344,7 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice @if (Auth::check() && !Auth::user()->isPro())