diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 48ace501f417..02921782e035 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -726,6 +726,8 @@ class AccountController extends BaseController $account = Auth::user()->account; $account->hide_quantity = Input::get('hide_quantity') ? true : false; $account->hide_paid_to_date = Input::get('hide_paid_to_date') ? true : false; + $account->all_pages_header = Input::get('all_pages_header') ? true : false; + $account->all_pages_footer = Input::get('all_pages_footer') ? true : false; $account->header_font_id = Input::get('header_font_id'); $account->body_font_id = Input::get('body_font_id'); $account->primary_color = Input::get('primary_color'); diff --git a/app/Http/Controllers/AppController.php b/app/Http/Controllers/AppController.php index d7fe1d221271..b31259d88fa1 100644 --- a/app/Http/Controllers/AppController.php +++ b/app/Http/Controllers/AppController.php @@ -245,9 +245,14 @@ class AppController extends BaseController Session::flush(); Artisan::call('optimize', array('--force' => true)); Artisan::call('migrate', array('--force' => true)); - Artisan::call('db:seed', array('--force' => true, '--class' => 'PaymentLibrariesSeeder')); - Artisan::call('db:seed', array('--force' => true, '--class' => 'FontsSeeder')); - Artisan::call('db:seed', array('--force' => true, '--class' => 'BanksSeeder')); + foreach ([ + 'PaymentLibraries', + 'Fonts', + 'Banks', + 'InvoiceStatus' + ] as $seeder) { + Artisan::call('db:seed', array('--force' => true, '--class' => "{$seeder}Seeder")); + } Event::fire(new UserSettingsChanged()); Session::flash('message', trans('texts.processed_updates')); } catch (Exception $e) { diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 483b73a6c2ef..1e26fd4a715a 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -112,7 +112,7 @@ class DashboardController extends BaseController ->where('payments.account_id', '=', Auth::user()->account_id) ->where('payments.is_deleted', '=', false) ->where('invoices.is_deleted', '=', false) - ->where('clients.deleted_at', '=', null) + ->where('clients.is_deleted', '=', false) ->where('contacts.deleted_at', '=', null) ->where('contacts.is_primary', '=', true) ->select(['payments.payment_date', 'payments.amount', 'invoices.public_id', 'invoices.invoice_number', 'clients.name as client_name', 'contacts.email', 'contacts.first_name', 'contacts.last_name', 'clients.currency_id', 'clients.public_id as client_public_id']) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 39fedd489731..e93c8d3b07f5 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -429,6 +429,8 @@ class Invoice extends EntityModel implements BalanceAffecting 'secondary_color', 'hide_quantity', 'hide_paid_to_date', + 'all_pages_header', + 'all_pages_footer', 'custom_invoice_label1', 'custom_invoice_label2', 'pdf_email_attachment', diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index f808c5a3802e..8b2949c59360 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -16,9 +16,7 @@ class DatabaseSeeder extends Seeder $this->call('ConstantsSeeder'); $this->call('CountriesSeeder'); $this->call('PaymentLibrariesSeeder'); - $this->call('FontsSeeder'); $this->call('BanksSeeder'); - $this->call('FontsSeeder'); $this->call('InvoiceStatusSeeder'); } } diff --git a/database/seeds/SecurePaymentFormSeeder.php b/database/seeds/SecurePaymentFormSeeder.php deleted file mode 100644 index 77bbe1ba6cf2..000000000000 --- a/database/seeds/SecurePaymentFormSeeder.php +++ /dev/null @@ -1,187 +0,0 @@ -delete(); - DB::table('invoices')->delete(); - DB::table('contacts')->delete(); - DB::table('clients')->delete(); - DB::table('account_gateways')->delete(); - //To reset the auto increment - $statement = " - ALTER TABLE invitations AUTO_INCREMENT = 1; - ALTER TABLE invoices AUTO_INCREMENT = 1; - ALTER TABLE contacts AUTO_INCREMENT = 1; - ALTER TABLE clients AUTO_INCREMENT = 1; - ALTER TABLE account_gateways AUTO_INCREMENT = 1; - "; - - DB::unprepared($statement); - - //$firstName = 'Oscar'; -// $lastName = 'Thompson'; -// $firstName_2 = 'Philip'; -// $lastName_2 = 'Jonsson'; -// -// $user = AccountGateway::create(array( -// 'account_id' => 1, -// 'user_id' => 1, -// 'gateway_id' => 4, -// 'config' => '{"bla":"vla","bli":"cla"}', -// 'public_id' => 1, -// 'accepted_credit_cards' => 8 -// )); -// -// $user2 = AccountGateway::create(array( -// 'account_id' => 2, -// 'user_id' => 2, -// 'gateway_id' => 5, -// 'config' => '{"bla":"vla","bli":"cla"}', -// 'public_id' => 2, -// 'accepted_credit_cards' => 7 -// )); -// -// $client = Client::create(array( -// 'user_id' => 1, -// 'account_id' => 1, -// 'currency_id' => 1, -// 'name' => $firstName.' '.$lastName, -// 'address1' => '2119 Howe Course', -// 'address2' => '2118 Howe Course', -// 'city' => 'West Chazport', -// 'state' => 'Utah', -// 'postal_code' => '31572', -// 'country_id' => 752, -// 'work_phone' => '012-345678', -// 'private_notes' => 'bla bla bla bla bla bla bla', -// 'balance' => 10.4, -// 'paid_to_date' => 10.2, -// 'website' => 'awebsite.com', -// 'industry_id' => 8, -// 'is_deleted' => 0, -// 'payment_terms' => 2, -// 'public_id' => 1, -// 'custom_value1' => $firstName, -// 'custom_value2' => $firstName -// )); -// -// $client2 = Client::create(array( -// 'user_id' => 2, -// 'account_id' => 2, -// 'currency_id' => 1, -// 'name' => $firstName_2.' '.$lastName_2, -// 'address1' => '1118 Muma Road', -// 'address2' => '1118 Muma Road', -// 'city' => 'New Orleans', -// 'state' => 'Arizona', -// 'postal_code' => '31572', -// 'country_id' => 752, -// 'work_phone' => '012-345678', -// 'private_notes' => 'bla bla bla bla bla bla bla', -// 'balance' => 10.4, -// 'paid_to_date' => 10.2, -// 'website' => 'bodosite.com', -// 'industry_id' => 8, -// 'is_deleted' => 0, -// 'payment_terms' => 2, -// 'public_id' => 1, -// 'custom_value1' => $firstName_2, -// 'custom_value2' => $firstName_2 -// )); -// -// $contact = Contact::create(array( -// 'account_id' => 1, -// 'user_id' => 1, -// 'client_id' => 1, -// 'is_primary' => 0, -// 'send_invoice' => 0, -// 'first_name' => $firstName, -// 'last_name' => $lastName, -// 'email' => 'an@email.com', -// 'phone' => '012-345678', -// 'public_id' => 1 -// )); -// -// $contact2 = Contact::create(array( -// 'account_id' => 2, -// 'user_id' => 2, -// 'client_id' => 2, -// 'is_primary' => 0, -// 'send_invoice' => 0, -// 'first_name' => $firstName_2, -// 'last_name' => $lastName_2, -// 'email' => 'the@email.com', -// 'phone' => '012-345678', -// 'public_id' => 2 -// )); -// -// $invoice = Invoice::create(array( -// 'client_id' => 1, -// 'user_id' => 1, -// 'account_id' => 1, -// 'invoice_number' => 1, -// 'discount' => 0.4, -// 'po_number' => $firstName, -// 'terms' => 'bla bla bla bla bla bla bla', -// 'public_notes' => 'bla bla bla bla bla bla bla', -// 'is_deleted' => 0, -// 'is_recurring' => 0, -// 'frequency_id' => 1, -// 'tax_name' => 'moms', -// 'tax_rate' => 33.0, -// 'amount' => 10.0, -// 'balance' => 8.0, -// 'public_id' => 1, -// 'is_quote' => 0 -// )); -// -// $invoice2 = Invoice::create(array( -// 'client_id' => 2, -// 'user_id' => 2, -// 'account_id' => 2, -// 'invoice_number' => 2, -// 'discount' => 0.4, -// 'po_number' => $firstName_2, -// 'terms' => 'bla bla bla bla bla bla bla', -// 'public_notes' => 'bla bla bla bla bla bla bla', -// 'is_deleted' => 0, -// 'is_recurring' => 0, -// 'frequency_id' => 1, -// 'tax_name' => 'moms', -// 'tax_rate' => 33.0, -// 'amount' => 10.0, -// 'balance' => 8.0, -// 'public_id' => 2, -// 'is_quote' => 0 -// )); -// -// $invitation = Invitation::create(array( -// 'account_id' => 1, -// 'user_id' => 1, -// 'contact_id' => 1, -// 'invoice_id' => 1, -// 'invitation_key' => 'aaabbb', -// 'transaction_reference' => 'bla bla bla bla bla bla bla', -// 'public_id' => 1 -// )); -// -// $invitation2 = Invitation::create(array( -// 'account_id' => 2, -// 'user_id' => 2, -// 'contact_id' => 2, -// 'invoice_id' => 2, -// 'invitation_key' => 'cccddd', -// 'transaction_reference' => 'bla bla bla bla bla bla bla', -// 'public_id' => 2 -// )); - } -} \ No newline at end of file diff --git a/public/built.js b/public/built.js index 2e53219e752f..a9d6cdca45d6 100644 --- a/public/built.js +++ b/public/built.js @@ -30963,15 +30963,16 @@ function GetPdfMake(invoice, javascript, callback) { } } - // only show the header on the first page - // and the footer on the last page - if (key === 'header') { - return function(page, pages) { - return page === 1 ? val : ''; - } - } else if (invoice.is_pro && key === 'footer') { - return function(page, pages) { - return page === pages ? val : ''; + // determine whether or not to show the header/footer + if (invoice.is_pro) { + if (key === 'header') { + return function(page, pages) { + return page === 1 || account.all_pages_header ? val : ''; + } + } else if (key === 'footer') { + return function(page, pages) { + return page === pages || account.all_pages_footer ? val : ''; + } } } diff --git a/public/js/pdf.pdfmake.js b/public/js/pdf.pdfmake.js index 832ce28b0622..5524fc3f75c7 100644 --- a/public/js/pdf.pdfmake.js +++ b/public/js/pdf.pdfmake.js @@ -54,15 +54,16 @@ function GetPdfMake(invoice, javascript, callback) { } } - // only show the header on the first page - // and the footer on the last page - if (key === 'header') { - return function(page, pages) { - return page === 1 ? val : ''; - } - } else if (invoice.is_pro && key === 'footer') { - return function(page, pages) { - return page === pages ? val : ''; + // determine whether or not to show the header/footer + if (invoice.is_pro) { + if (key === 'header') { + return function(page, pages) { + return page === 1 || account.all_pages_header ? val : ''; + } + } else if (key === 'footer') { + return function(page, pages) { + return page === pages || account.all_pages_footer ? val : ''; + } } } diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 56cada46c70b..95566e73f00b 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -1133,4 +1133,11 @@ return array( 'iframe_url_help3' => 'Note: if you plan on accepting credit cards we strongly recommend having HTTPS enabled on your site.', 'expense_error_multiple_currencies' => 'The expenses can\'t have different currencies.', 'expense_error_mismatch_currencies' => 'The client\'s currency does not match the expense currency.', + 'trello_roadmap' => 'Trello Roadmap', + 'header_footer' => 'Header/Footer', + 'all_pages_header' => 'Header', + 'all_pages_header_help' => 'Show on all pages', + 'all_pages_footer' => 'Footer', + 'all_pages_footer_help' => 'Show on all pages', + ); diff --git a/resources/views/accounts/invoice_design.blade.php b/resources/views/accounts/invoice_design.blade.php index a16a97efd140..647e9ba4699c 100644 --- a/resources/views/accounts/invoice_design.blade.php +++ b/resources/views/accounts/invoice_design.blade.php @@ -103,6 +103,8 @@ {!! Former::populate($account) !!} {!! Former::populateField('hide_quantity', intval($account->hide_quantity)) !!} {!! Former::populateField('hide_paid_to_date', intval($account->hide_paid_to_date)) !!} + {!! Former::populateField('all_pages_header', intval($account->all_pages_header)) !!} + {!! Former::populateField('all_pages_footer', intval($account->all_pages_footer)) !!} @foreach ($invoiceLabels as $field => $value) {!! Former::populateField("labels_{$field}", $value) !!} @@ -119,6 +121,7 @@
  • {{ trans('texts.invoice_labels') }}
  • {{ trans('texts.invoice_options') }}
  • +
  • {{ trans('texts.header_footer') }}
  • @@ -194,6 +197,14 @@
    +
    +
    + + {!! Former::checkbox('all_pages_header')->text(trans('texts.all_pages_header_help')) !!} + {!! Former::checkbox('all_pages_footer')->text(trans('texts.all_pages_footer_help')) !!} + +
    +
    diff --git a/resources/views/accounts/user_details.blade.php b/resources/views/accounts/user_details.blade.php index 346fc342107a..57bfdb8eb5a4 100644 --- a/resources/views/accounts/user_details.blade.php +++ b/resources/views/accounts/user_details.blade.php @@ -172,7 +172,11 @@ $(['current_password', 'newer_password', 'confirm_password']).each(function(i, field) { var $input = $('form #'+field), val = $.trim($input.val()); - var isValid = val && val.length >= 6; + var isValid = val; + + if (field != 'current_password') { + isValid = val.length >= 6; + } if (isValid && field == 'confirm_password') { isValid = val == $.trim($('#newer_password').val()); diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index 95b36e25c9d8..9409b617a8b0 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -699,8 +699,9 @@

     

    - {{ trans('texts.powered_by') }} InvoiceNinja.com - - {!! link_to(RELEASES_URL, 'v' . NINJA_VERSION, ['target' => '_blank']) !!} | + {{ trans('texts.powered_by') }} + {!! link_to('https://www.invoiceninja.com/?utm_source=powered_by', 'InvoiceNinja.com', ['target' => '_blank', 'title' => 'invoiceninja.com']) !!} - + {!! link_to(RELEASES_URL, 'v' . NINJA_VERSION, ['target' => '_blank', 'title' => trans('texts.trello_roadmap')]) !!} | @if (Auth::user()->account->isWhiteLabel()) {{ trans('texts.white_labeled') }} @else diff --git a/resources/views/vendors/show.blade.php b/resources/views/vendors/show.blade.php index a6ee5cd2cfda..844c61f9b0f8 100644 --- a/resources/views/vendors/show.blade.php +++ b/resources/views/vendors/show.blade.php @@ -40,7 +40,7 @@ )->split() !!} {!! Button::primary(trans("texts.new_expense")) - ->asLinkTo(URL::to("/expenses/create")) + ->asLinkTo(URL::to("/expenses/create/{$vendor->public_id}")) ->appendIcon(Icon::create('plus-sign')) !!} @endif {!! Former::close() !!} diff --git a/storage/templates/modern.js b/storage/templates/modern.js index 9023121aff64..5c1767bb4bab 100644 --- a/storage/templates/modern.js +++ b/storage/templates/modern.js @@ -9,7 +9,7 @@ }, { "stack": "$clientDetails", - "margin": [0, 80, 0, 0] + "margin": [0, 60, 0, 0] } ] }, @@ -246,5 +246,5 @@ "color": "#737373" } }, - "pageMargins": [40, 80, 40, 50] + "pageMargins": [40, 120, 40, 50] } \ No newline at end of file