diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index a3ba45a5ccb6..7d141e8cb215 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -694,6 +694,7 @@ class AccountController extends BaseController $account->invoice_footer = Input::get('invoice_footer'); $account->quote_terms = Input::get('quote_terms'); $account->auto_convert_quote = Input::get('auto_convert_quote'); + $account->recurring_invoice_number_prefix = Input::get('recurring_invoice_number_prefix'); if (Input::has('recurring_hour')) { $account->recurring_hour = Input::get('recurring_hour'); diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index aa0e09f632b1..52b47998b5a6 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -610,7 +610,7 @@ class InvoiceRepository extends BaseRepository $invoice = Invoice::createNew($recurInvoice); $invoice->client_id = $recurInvoice->client_id; $invoice->recurring_invoice_id = $recurInvoice->id; - $invoice->invoice_number = 'R'.$recurInvoice->account->getNextInvoiceNumber($recurInvoice); + $invoice->invoice_number = $recurInvoice->account->recurring_invoice_number_prefix . $recurInvoice->account->getNextInvoiceNumber($recurInvoice); $invoice->amount = $recurInvoice->amount; $invoice->balance = $recurInvoice->amount; $invoice->invoice_date = date_create()->format('Y-m-d'); diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 5032cf1c5375..9c9c8e9a5912 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -845,7 +845,7 @@ $LANG = array( 'subdomain_help' => 'Customize the invoice link subdomain or display the invoice on your own website.', '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 field when creating/editing a client and display the label and value on the PDF.', + 'custom_client_fields_helps' => 'Add a field when creating a client and display the label and value on 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 field when creating an invoice and display the label and value on the PDF.', 'custom_invoice_charges_helps' => 'Add a field when creating an invoice and include the charge in the invoice subtotals.', @@ -1047,7 +1047,8 @@ $LANG = array( 'invoiced_amount' => 'Invoiced Amount', 'invoice_item_fields' => 'Invoice Item Fields', 'custom_invoice_item_fields_help' => 'Add a field when creating an invoice item and display the label and value on the PDF.', - + 'recurring_invoice_number' => 'Recurring Invoice Number', + 'recurring_invoice_number_prefix_help' => 'Speciy a prefix to be added to the invoice number for recurring invoices. The default value is \'R\'.' ); return $LANG; diff --git a/resources/views/accounts/invoice_settings.blade.php b/resources/views/accounts/invoice_settings.blade.php index e0194dcd0f84..09b730737e0d 100644 --- a/resources/views/accounts/invoice_settings.blade.php +++ b/resources/views/accounts/invoice_settings.blade.php @@ -35,8 +35,15 @@