From 3f1891fa3bdf28ef68a1cb18a583c638757ee005 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 23 Dec 2015 13:49:49 +0200 Subject: [PATCH] Bug fixes --- app/Http/Controllers/PaymentController.php | 17 ++++++------ app/Http/routes.php | 4 +-- app/Models/Account.php | 6 +++++ app/Ninja/Repositories/InvoiceRepository.php | 5 +++- app/Services/PaymentService.php | 5 ++-- .../2015_07_19_081332_add_custom_design.php | 2 +- database/seeds/PaymentLibrariesSeeder.php | 2 ++ readme.md | 2 ++ resources/lang/da/texts.php | 5 +++- resources/lang/de/texts.php | 7 +++-- resources/lang/en/texts.php | 5 ++-- resources/lang/es/texts.php | 7 +++-- resources/lang/es_ES/texts.php | 6 +++-- resources/lang/fr/texts.php | 6 +++-- resources/lang/fr_CA/texts.php | 6 +++-- resources/lang/it/texts.php | 6 +++-- resources/lang/lt/texts.php | 6 +++-- resources/lang/nb_NO/texts.php | 7 +++-- resources/lang/nl/texts.php | 5 +++- resources/lang/pt_BR/texts.php | 5 +++- resources/lang/sv/texts.php | 5 +++- .../views/accounts/email_settings.blade.php | 27 ++++++++++++------- .../views/accounts/invoice_settings.blade.php | 6 +++-- resources/views/invoices/edit.blade.php | 4 +-- 24 files changed, 106 insertions(+), 50 deletions(-) diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index 6476d1af98c7..87bb1fc59666 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -134,13 +134,14 @@ class PaymentController extends BaseController if ($paymentType) { $paymentType = 'PAYMENT_TYPE_' . strtoupper($paymentType); } else { - $paymentType = Session::get('payment_type', $account->account_gateways[0]->getPaymentType()); + $paymentType = Session::get($invitation->id . 'payment_type') ?: + $account->account_gateways[0]->getPaymentType(); } if ($paymentType == PAYMENT_TYPE_TOKEN) { $useToken = true; $paymentType = PAYMENT_TYPE_CREDIT_CARD; } - Session::put('payment_type', $paymentType); + Session::put($invitation->id . 'payment_type', $paymentType); $accountGateway = $invoice->client->account->getGatewayByType($paymentType); $gateway = $accountGateway->gateway; @@ -210,7 +211,7 @@ class PaymentController extends BaseController $account = $this->accountRepo->getNinjaAccount(); $account->load('account_gateways.gateway'); - $accountGateway = $account->getGatewayByType(Session::get('payment_type')); + $accountGateway = $account->getGatewayByType(PAYMENT_TYPE_CREDIT_CARD); $gateway = $accountGateway->gateway; $acceptedCreditCardTypes = $accountGateway->getCreditcardTypes(); @@ -345,7 +346,7 @@ class PaymentController extends BaseController $invoice = $invitation->invoice; $client = $invoice->client; $account = $client->account; - $accountGateway = $account->getGatewayByType(Session::get('payment_type')); + $accountGateway = $account->getGatewayByType(Session::get($invitation->id . 'payment_type')); $rules = [ 'first_name' => 'required', @@ -449,7 +450,7 @@ class PaymentController extends BaseController } if ($response->isSuccessful()) { - $payment = $this->paymentService->createPayment($invitation, $ref); + $payment = $this->paymentService->createPayment($invitation, $accountGateway, $ref); Session::flash('message', trans('texts.applied_payment')); if ($account->account_key == NINJA_ACCOUNT_KEY) { @@ -496,7 +497,7 @@ class PaymentController extends BaseController $client = $invoice->client; $account = $client->account; - $accountGateway = $account->getGatewayByType(Session::get('payment_type')); + $accountGateway = $account->getGatewayByType(Session::get($invitation->id . 'payment_type')); $gateway = $this->paymentService->createGateway($accountGateway); // Check for Dwolla payment error @@ -520,14 +521,14 @@ class PaymentController extends BaseController if ($response->isCancelled()) { // do nothing } elseif ($response->isSuccessful()) { - $payment = $this->paymentService->createPayment($invitation, $ref, $payerId); + $payment = $this->paymentService->createPayment($invitation, $accountGateway, $ref, $payerId); Session::flash('message', trans('texts.applied_payment')); } else { $this->error('offsite', $response->getMessage(), $accountGateway); } return Redirect::to($invitation->getLink()); } else { - $payment = $this->paymentService->createPayment($invitation, $token, $payerId); + $payment = $this->paymentService->createPayment($invitation, $accountGateway, $token, $payerId); Session::flash('message', trans('texts.applied_payment')); return Redirect::to($invitation->getLink()); diff --git a/app/Http/routes.php b/app/Http/routes.php index 0bab329d247c..1cfbcd478da6 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -11,7 +11,7 @@ | */ -//Cache::flush(); +//Crypt::decrypt(); //apc_clear_cache(); //dd(DB::getQueryLog()); //dd(Client::getPrivateId(1)); @@ -433,7 +433,7 @@ if (!defined('CONTACT_EMAIL')) { define('NINJA_GATEWAY_CONFIG', 'NINJA_GATEWAY_CONFIG'); define('NINJA_WEB_URL', 'https://www.invoiceninja.com'); define('NINJA_APP_URL', 'https://app.invoiceninja.com'); - define('NINJA_VERSION', '2.4.7'); + define('NINJA_VERSION', '2.4.8'); define('NINJA_DATE', '2000-01-01'); define('SOCIAL_LINK_FACEBOOK', 'https://www.facebook.com/invoiceninja'); diff --git a/app/Models/Account.php b/app/Models/Account.php index fc5a21edcf0e..b9021d039143 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -459,6 +459,12 @@ class Account extends Eloquent return $isQuote && !$this->share_counter ? $this->quote_number_counter : $this->invoice_number_counter; } + public function previewNextInvoiceNumber($entityType = ENTITY_INVOICE) + { + $invoice = $this->createInvoice($entityType); + return $this->getNextInvoiceNumber($invoice); + } + public function getNextInvoiceNumber($invoice) { if ($this->hasNumberPattern($invoice->is_quote)) { diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index 763a539c8061..4f36e48e510d 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -440,7 +440,10 @@ class InvoiceRepository extends BaseRepository $invoiceNumber = substr($invoiceNumber, strlen($account->quote_number_prefix)); } $invoiceNumber = $account->invoice_number_prefix.$invoiceNumber; - if (Invoice::scope()->withTrashed()->whereInvoiceNumber($invoiceNumber)->first()) { + if (Invoice::scope(false, $account->id) + ->withTrashed() + ->whereInvoiceNumber($invoiceNumber) + ->first()) { $invoiceNumber = false; } } diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php index d09f30683c2b..90c116502ba2 100644 --- a/app/Services/PaymentService.php +++ b/app/Services/PaymentService.php @@ -184,10 +184,9 @@ class PaymentService extends BaseService return $cardReference; } - public function createPayment($invitation, $ref, $payerId = null) + public function createPayment($invitation, $accountGateway, $ref, $payerId = null) { $invoice = $invitation->invoice; - $accountGateway = $invoice->client->account->getGatewayByType(Session::get('payment_type')); // sync pro accounts if ($invoice->account->account_key == NINJA_ACCOUNT_KEY @@ -257,7 +256,7 @@ class PaymentService extends BaseService $ref = $response->getTransactionReference(); // create payment record - return $this->createPayment($invitation, $ref); + return $this->createPayment($invitation, $accountGateway, $ref); } public function getDatatable($clientPublicId, $search) 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 d1cb7d27b162..ea237594ac35 100644 --- a/database/migrations/2015_07_19_081332_add_custom_design.php +++ b/database/migrations/2015_07_19_081332_add_custom_design.php @@ -14,7 +14,7 @@ class AddCustomDesign extends Migration { { Schema::table('accounts', function($table) { - $table->text('custom_design')->nullable(); + $table->mediumText('custom_design')->nullable(); }); DB::table('invoice_designs')->insert(['id' => CUSTOM_DESIGN, 'name' => 'Custom']); diff --git a/database/seeds/PaymentLibrariesSeeder.php b/database/seeds/PaymentLibrariesSeeder.php index ff16708fa13d..c2a66591be6c 100644 --- a/database/seeds/PaymentLibrariesSeeder.php +++ b/database/seeds/PaymentLibrariesSeeder.php @@ -119,12 +119,14 @@ class PaymentLibrariesSeeder extends Seeder ['name' => 'Chinese Renminbi', 'code' => 'CNY', 'symbol' => 'RMB ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['name' => 'Rwandan Franc', 'code' => 'RWF', 'symbol' => 'RF ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['name' => 'Tanzanian Shilling', 'code' => 'TZS', 'symbol' => 'TSh ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['name' => 'Netherlands Antillean Guilder', 'code' => 'ANG', 'symbol' => 'ANG ', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ]; foreach ($currencies as $currency) { $record = Currency::whereCode($currency['code'])->first(); if ($record) { $record->name = $currency['name']; + $record->symbol = $currency['symbol']; $record->thousand_separator = $currency['thousand_separator']; $record->decimal_separator = $currency['decimal_separator']; $record->save(); diff --git a/readme.md b/readme.md index 762f1bd69870..4ec54427971f 100644 --- a/readme.md +++ b/readme.md @@ -5,6 +5,8 @@ # Invoice Ninja ### [https://www.invoiceninja.com](https://www.invoiceninja.com) +We're starting to work on our expenses, vendors and receipts module. If you'd like to help us design it please send us an email to join the discussion. + [![Join the chat at https://gitter.im/hillelcoren/invoice-ninja](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hillelcoren/invoice-ninja?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ### Referral Program diff --git a/resources/lang/da/texts.php b/resources/lang/da/texts.php index 530b0bb541cb..bf8770e55cc4 100644 --- a/resources/lang/da/texts.php +++ b/resources/lang/da/texts.php @@ -967,7 +967,7 @@ 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -977,6 +977,9 @@ 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', + 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', ); diff --git a/resources/lang/de/texts.php b/resources/lang/de/texts.php index 01929a933480..2a2d9f3473ef 100644 --- a/resources/lang/de/texts.php +++ b/resources/lang/de/texts.php @@ -969,7 +969,7 @@ return array( 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -979,5 +979,8 @@ return array( 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', - + 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', + ); diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 637258ceaa00..aa6067c841cc 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -970,7 +970,7 @@ return array( 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -980,7 +980,8 @@ return array( 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', - 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', ); diff --git a/resources/lang/es/texts.php b/resources/lang/es/texts.php index 33f2b1136625..f95e86ce2bc5 100644 --- a/resources/lang/es/texts.php +++ b/resources/lang/es/texts.php @@ -945,7 +945,7 @@ return array( 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -955,5 +955,8 @@ return array( 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', - + 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', + ); diff --git a/resources/lang/es_ES/texts.php b/resources/lang/es_ES/texts.php index d2ba5cf96682..06ca13b7f349 100644 --- a/resources/lang/es_ES/texts.php +++ b/resources/lang/es_ES/texts.php @@ -966,7 +966,7 @@ return array( 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -976,6 +976,8 @@ return array( 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', - + 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', ); diff --git a/resources/lang/fr/texts.php b/resources/lang/fr/texts.php index e904e0654a7a..10f154d89300 100644 --- a/resources/lang/fr/texts.php +++ b/resources/lang/fr/texts.php @@ -960,7 +960,7 @@ return array( 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -970,6 +970,8 @@ return array( 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', - + 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', ); diff --git a/resources/lang/fr_CA/texts.php b/resources/lang/fr_CA/texts.php index 5356e6aa791d..0907f2be3cb3 100644 --- a/resources/lang/fr_CA/texts.php +++ b/resources/lang/fr_CA/texts.php @@ -960,7 +960,7 @@ return array( 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -970,6 +970,8 @@ return array( 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', - + 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', ); diff --git a/resources/lang/it/texts.php b/resources/lang/it/texts.php index 4766bfa746fe..23632f650e4f 100644 --- a/resources/lang/it/texts.php +++ b/resources/lang/it/texts.php @@ -962,7 +962,7 @@ return array( 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -972,6 +972,8 @@ return array( 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', - + 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', ); diff --git a/resources/lang/lt/texts.php b/resources/lang/lt/texts.php index 9199ccbd3208..851653ca9e12 100644 --- a/resources/lang/lt/texts.php +++ b/resources/lang/lt/texts.php @@ -969,7 +969,7 @@ return array( 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -979,7 +979,9 @@ return array( 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', - + 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', ); diff --git a/resources/lang/nb_NO/texts.php b/resources/lang/nb_NO/texts.php index bd33c31d613a..17c7fb66c573 100644 --- a/resources/lang/nb_NO/texts.php +++ b/resources/lang/nb_NO/texts.php @@ -967,7 +967,7 @@ return array( 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -977,5 +977,8 @@ return array( 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', - + 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', + ); diff --git a/resources/lang/nl/texts.php b/resources/lang/nl/texts.php index 3787f2f65a52..80c02bd1a856 100644 --- a/resources/lang/nl/texts.php +++ b/resources/lang/nl/texts.php @@ -963,7 +963,7 @@ return array( 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -973,5 +973,8 @@ return array( 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', + 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', ); diff --git a/resources/lang/pt_BR/texts.php b/resources/lang/pt_BR/texts.php index 288eaa868274..8550c1fbd599 100644 --- a/resources/lang/pt_BR/texts.php +++ b/resources/lang/pt_BR/texts.php @@ -959,7 +959,7 @@ return array( 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -969,5 +969,8 @@ return array( 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', + 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', ); diff --git a/resources/lang/sv/texts.php b/resources/lang/sv/texts.php index 2a3685d5c36e..63009b79e4cc 100644 --- a/resources/lang/sv/texts.php +++ b/resources/lang/sv/texts.php @@ -964,7 +964,7 @@ return array( 'invoice_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the invoice number.', 'quote_number_help' => 'Specify a prefix or use a custom pattern to dynamically set the quote number.', 'custom_client_fields_helps' => 'Add a text input to the client create/edit page and display the label and value on the PDF.', - 'custom_account_fields_helps' => 'Add the label and value to the company details section of the PDF.', + 'custom_account_fields_helps' => 'Add a label and value to the company details section of the PDF.', 'custom_invoice_fields_helps' => 'Add a text input to the invoice create/edit page and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a text input to the invoice create/edit page and include the charge in the invoice subtotals.', 'color_help' => 'Note: the primary color is also used in the client portal and custom email designs.', @@ -974,5 +974,8 @@ return array( 'button_confirmation_message' => 'Click to confirm your email address.', 'confirm' => 'Confirm', 'email_preferences' => 'Email Preferences', + 'created_invoices' => 'Successfully created :count invoice(s)', + 'next_invoice_number' => 'The next invoice number is :number.', + 'next_quote_number' => 'The next quote number is :number.', ); diff --git a/resources/views/accounts/email_settings.blade.php b/resources/views/accounts/email_settings.blade.php index 01269a4bb808..03a597f6fc82 100644 --- a/resources/views/accounts/email_settings.blade.php +++ b/resources/views/accounts/email_settings.blade.php @@ -19,16 +19,7 @@   {{-- Former::select('recurring_hour')->options($recurringHours) --}} - - {!! Former::select('email_design_id') - ->style('width: 200px') - ->addOption(trans('texts.plain'), 1) - ->addOption(trans('texts.light'), 2) - ->addOption(trans('texts.dark'), 3) - ->help(trans('texts.email_design_help')) !!} -   - {!! Former::inline_radios('custom_invoice_link') ->onchange('onCustomLinkChange()') ->label(trans('texts.invoice_link')) @@ -51,7 +42,25 @@ ->addGroupClass('iframe_url') ->label(' ') ->help(trans('texts.subdomain_help')) !!} + + + + +
+
+

{!! trans('texts.email_design') !!}

+
+
+ + {!! Former::select('email_design_id') + ->style('width: 200px') + ->addOption(trans('texts.plain'), 1) + ->addOption(trans('texts.light'), 2) + ->addOption(trans('texts.dark'), 3) + ->help(trans('texts.email_design_help')) !!} +   + @if (Utils::isNinja()) {!! Former::checkbox('enable_email_markup') ->text(trans('texts.enable') . diff --git a/resources/views/accounts/invoice_settings.blade.php b/resources/views/accounts/invoice_settings.blade.php index 6ff35bd4feca..6a8e18e8a38f 100644 --- a/resources/views/accounts/invoice_settings.blade.php +++ b/resources/views/accounts/invoice_settings.blade.php @@ -59,7 +59,8 @@ ->addGroupClass('number-pattern') !!} {!! Former::text('invoice_number_counter') ->label(trans('texts.counter')) - ->help(trans('texts.invoice_number_help')) !!} + ->help(trans('texts.invoice_number_help') . ' ' . + trans('texts.next_invoice_number', ['number' => $account->previewNextInvoiceNumber()])) !!}
@@ -86,7 +87,8 @@ ->addGroupClass('pad-checkbox') ->append(Former::checkbox('share_counter')->raw() ->onclick('setQuoteNumberEnabled()') . ' ' . trans('texts.share_invoice_counter')) - ->help(trans('texts.quote_number_help')) !!} + ->help(trans('texts.quote_number_help') . ' ' . + trans('texts.next_quote_number', ['number' => $account->previewNextInvoiceNumber(ENTITY_QUOTE)])) !!} diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index bb670858c317..de51575b4e7d 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -1132,8 +1132,8 @@ return; @endif var number = '{{ $account->getNumberPattern($invoice) }}'; - number = number.replace('{$custom1}', client.custom_value1); - number = number.replace('{$custom2}', client.custom_value2); + number = number.replace('{$custom1}', client.custom_value1 ? client.custom_value1 : ''); + number = number.replace('{$custom2}', client.custom_value2 ? client.custom_value1 : ''); model.invoice().invoice_number(number); }