diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index db2627cd1469..406c48540d18 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -200,7 +200,7 @@ class AccountController extends \BaseController { } } - public function doSection($section = ACCOUNT_DETAILS) + public function doSection($section = ACCOUNT_DETAILS, $subSection = false) { if ($section == ACCOUNT_DETAILS) { @@ -257,7 +257,7 @@ class AccountController extends \BaseController { private function saveCustomFields() { - if (!Auth::user()->account->isPro()) + if (Auth::user()->account->isPro()) { $account = Auth::user()->account; $account->custom_label1 = Input::get('custom_label1'); @@ -271,12 +271,12 @@ class AccountController extends \BaseController { Session::flash('message', trans('texts.updated_settings')); } - return Redirect::to('company/advanced_settings'); + return Redirect::to('company/advanced_settings/custom_fields'); } private function saveInvoiceDesign() { - if (!Auth::user()->account->isPro()) + if (Auth::user()->account->isPro()) { $account = Auth::user()->account; $account->primary_color = Input::get('primary_color');// ? Input::get('primary_color') : null; @@ -286,7 +286,7 @@ class AccountController extends \BaseController { Session::flash('message', trans('texts.updated_settings')); } - return Redirect::to('company/advanced_settings'); + return Redirect::to('company/advanced_settings/invoice_design'); } private function export() @@ -679,7 +679,9 @@ class AccountController extends \BaseController { { $path = Input::file('logo')->getRealPath(); File::delete('logo/' . $account->account_key . '.jpg'); - Image::make($path)->resize(200, 120, true, false)->save('logo/' . $account->account_key . '.jpg'); + + $image = Image::make($path)->resize(200, 120, true, false); + Image::canvas($image->width, $image->height, '#FFFFFF')->insert($image)->save($account->getLogoPath()); } Event::fire('user.refresh'); diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php index cc5e5eef3368..8ce11e20ec05 100755 --- a/app/controllers/InvoiceController.php +++ b/app/controllers/InvoiceController.php @@ -342,7 +342,7 @@ class InvoiceController extends \BaseController { } else if ($action == 'convert') { - return $this->convertQuote($publicId); + return $this->convertQuote($publicId); } else if ($action == 'email') { 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 ae3059c321db..5079117d7ba2 100644 --- a/app/database/migrations/2014_05_17_175626_add_quotes.php +++ b/app/database/migrations/2014_05_17_175626_add_quotes.php @@ -14,11 +14,10 @@ class AddQuotes extends Migration { { Schema::table('invoices', function($table) { - $table->boolean('is_quote'); - + $table->boolean('is_quote'); $table->unsignedInteger('quote_id')->nullable(); $table->unsignedInteger('quote_invoice_id')->nullable(); - }); + }); } /** @@ -30,8 +29,7 @@ class AddQuotes extends Migration { { Schema::table('invoices', function($table) { - $table->dropColumn('is_quote'); - + $table->dropColumn('is_quote'); $table->dropColumn('quote_id'); $table->dropColumn('quote_invoice_id'); }); diff --git a/app/database/seeds/ConstantsSeeder.php b/app/database/seeds/ConstantsSeeder.php index f5ef0f6ee0d1..17671a6fbe07 100755 --- a/app/database/seeds/ConstantsSeeder.php +++ b/app/database/seeds/ConstantsSeeder.php @@ -124,7 +124,7 @@ class ConstantsSeeder extends Seeder Currency::create(array('name' => 'Pound Sterling', 'code' => 'GBP', 'symbol' => '£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); Currency::create(array('name' => 'Euro', 'code' => 'EUR', 'symbol' => '€', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.')); Currency::create(array('name' => 'Rand', 'code' => 'ZAR', 'symbol' => 'R', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.')); - + Currency::create(array('name' => 'Danish Krone', 'code' => 'DKK', 'symbol' => 'kr ', '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')); diff --git a/app/models/Invoice.php b/app/models/Invoice.php index 4195e2cacb96..4419c99ad1e4 100755 --- a/app/models/Invoice.php +++ b/app/models/Invoice.php @@ -62,6 +62,7 @@ class Invoice extends EntityModel $this->setVisible([ 'invoice_number', 'discount', + 'shipping', 'po_number', 'invoice_date', 'due_date', diff --git a/app/ninja/repositories/InvoiceRepository.php b/app/ninja/repositories/InvoiceRepository.php index 9da5d0687490..c5abf435e010 100755 --- a/app/ninja/repositories/InvoiceRepository.php +++ b/app/ninja/repositories/InvoiceRepository.php @@ -119,11 +119,12 @@ class InvoiceRepository