1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-16 16:13:20 +01:00
invoiceninja/resources/views/accounts/invoice_settings.blade.php

553 lines
27 KiB
PHP
Raw Normal View History

2015-10-14 16:15:39 +02:00
@extends('header')
2014-04-18 10:57:31 +02:00
2015-04-01 21:57:02 +02:00
@section('head')
@parent
<style type="text/css">
2015-10-13 09:11:44 +02:00
.iframe_url {
display: none;
}
2015-04-21 13:42:31 +02:00
.input-group-addon div.checkbox {
2015-04-01 21:57:02 +02:00
display: inline;
}
2015-10-22 20:48:12 +02:00
.tab-content .pad-checkbox span.input-group-addon {
2015-04-01 21:57:02 +02:00
padding-right: 30px;
}
</style>
@stop
2016-09-05 20:34:34 +02:00
@section('content')
2014-04-18 10:57:31 +02:00
@parent
2015-10-14 16:15:39 +02:00
@include('accounts.nav', ['selected' => ACCOUNT_INVOICE_SETTINGS, 'advanced' => true])
2014-04-25 15:04:57 +02:00
{!! Former::open()->rules(['iframe_url' => 'url'])->addClass('warn-on-exit') !!}
{{ Former::populate($account) }}
{{ Former::populateField('auto_convert_quote', intval($account->auto_convert_quote)) }}
{{ Former::populateField('custom_invoice_taxes1', intval($account->custom_invoice_taxes1)) }}
{{ Former::populateField('custom_invoice_taxes2', intval($account->custom_invoice_taxes2)) }}
2015-04-21 13:42:31 +02:00
{{ Former::populateField('share_counter', intval($account->share_counter)) }}
2015-04-20 16:34:23 +02:00
<div class="panel panel-default">
2015-10-11 16:41:09 +02:00
<div class="panel-heading">
2017-01-03 20:48:40 +01:00
<h3 class="panel-title">{!! trans('texts.generated_numbers') !!}</h3>
2015-10-11 16:41:09 +02:00
</div>
2015-10-14 19:18:19 +02:00
<div class="panel-body form-padding-right">
2015-10-22 20:48:12 +02:00
2015-10-11 16:41:09 +02:00
<div role="tabpanel">
<ul class="nav nav-tabs" role="tablist" style="border: none">
<li role="presentation" class="active">
2016-09-05 20:34:34 +02:00
<a href="#invoice_number" aria-controls="invoice_number" role="tab" data-toggle="tab">{{ trans('texts.invoice_number') }}</a>
</li>
<li role="presentation">
2016-09-05 20:34:34 +02:00
<a href="#quote_number" aria-controls="quote_number" role="tab" data-toggle="tab">{{ trans('texts.quote_number') }}</a>
</li>
2017-01-03 14:53:49 +01:00
<li role="presentation">
<a href="#client_number" aria-controls="client_number" role="tab" data-toggle="tab">{{ trans('texts.client_number') }}</a>
</li>
<li role="presentation">
<a href="#credit_number" aria-controls="credit_number" role="tab" data-toggle="tab">{{ trans('texts.credit_number') }}</a>
</li>
2017-03-23 10:39:44 +01:00
<li role="presentation">
<a href="#options" aria-controls="options" role="tab" data-toggle="tab">{{ trans('texts.options') }}</a>
2017-03-23 10:39:44 +01:00
</li>
2015-10-11 16:41:09 +02:00
</ul>
</div>
<div class="tab-content">
2016-09-05 20:34:34 +02:00
<div role="tabpanel" class="tab-pane active" id="invoice_number">
2015-10-11 16:41:09 +02:00
<div class="panel-body">
2015-10-22 20:48:12 +02:00
{!! Former::inline_radios('invoice_number_type')
->onchange("onNumberTypeChange('invoice')")
2015-10-22 20:48:12 +02:00
->label(trans('texts.type'))
->radios([
trans('texts.prefix') => ['value' => 'prefix', 'name' => 'invoice_number_type'],
trans('texts.pattern') => ['value' => 'pattern', 'name' => 'invoice_number_type'],
])->check($account->invoice_number_pattern ? 'pattern' : 'prefix') !!}
{!! Former::text('invoice_number_prefix')
->addGroupClass('invoice-prefix')
2016-04-19 13:26:42 +02:00
->label(trans('texts.prefix')) !!}
2015-10-22 20:48:12 +02:00
{!! Former::text('invoice_number_pattern')
->appendIcon('question-sign')
->addGroupClass('invoice-pattern')
2016-04-19 13:26:42 +02:00
->label(trans('texts.pattern'))
2015-10-22 20:48:12 +02:00
->addGroupClass('number-pattern') !!}
{!! Former::text('invoice_number_counter')
2015-12-03 16:35:41 +01:00
->label(trans('texts.counter'))
2016-09-05 20:34:34 +02:00
->help(trans('texts.invoice_number_help') . ' ' .
2015-12-23 12:49:49 +01:00
trans('texts.next_invoice_number', ['number' => $account->previewNextInvoiceNumber()])) !!}
2015-10-11 16:41:09 +02:00
</div>
</div>
2016-09-05 20:34:34 +02:00
<div role="tabpanel" class="tab-pane" id="quote_number">
2015-10-11 16:41:09 +02:00
<div class="panel-body">
2015-10-22 20:48:12 +02:00
{!! Former::inline_radios('quote_number_type')
->onchange("onNumberTypeChange('quote')")
2015-10-22 20:48:12 +02:00
->label(trans('texts.type'))
->radios([
trans('texts.prefix') => ['value' => 'prefix', 'name' => 'quote_number_type'],
trans('texts.pattern') => ['value' => 'pattern', 'name' => 'quote_number_type'],
])->check($account->quote_number_pattern ? 'pattern' : 'prefix') !!}
{!! Former::text('quote_number_prefix')
->addGroupClass('quote-prefix')
2016-04-19 13:26:42 +02:00
->label(trans('texts.prefix')) !!}
2015-10-22 20:48:12 +02:00
{!! Former::text('quote_number_pattern')
->appendIcon('question-sign')
->addGroupClass('quote-pattern')
->addGroupClass('number-pattern')
2016-04-19 13:26:42 +02:00
->label(trans('texts.pattern')) !!}
2015-10-22 20:48:12 +02:00
{!! Former::text('quote_number_counter')
->label(trans('texts.counter'))
->addGroupClass('pad-checkbox')
->append(Former::checkbox('share_counter')->raw()->value(1)
2015-12-03 16:35:41 +01:00
->onclick('setQuoteNumberEnabled()') . ' ' . trans('texts.share_invoice_counter'))
2016-09-05 20:34:34 +02:00
->help(trans('texts.quote_number_help') . ' ' .
2015-12-23 12:49:49 +01:00
trans('texts.next_quote_number', ['number' => $account->previewNextInvoiceNumber(ENTITY_QUOTE)])) !!}
2015-10-22 20:48:12 +02:00
</div>
</div>
2017-01-03 14:53:49 +01:00
<div role="tabpanel" class="tab-pane" id="client_number">
<div class="panel-body">
2017-01-04 11:52:32 +01:00
{!! Former::checkbox('client_number_enabled')
->label('client_number')
->onchange('onClientNumberEnabled()')
->text('enable')
->value(1)
2017-01-04 11:52:32 +01:00
->check($account->client_number_counter > 0) !!}
<div id="clientNumberDiv" style="display:none">
{!! Former::inline_radios('client_number_type')
->onchange("onNumberTypeChange('client')")
2017-01-04 11:52:32 +01:00
->label(trans('texts.type'))
->radios([
trans('texts.prefix') => ['value' => 'prefix', 'name' => 'client_number_type'],
trans('texts.pattern') => ['value' => 'pattern', 'name' => 'client_number_type'],
])->check($account->client_number_pattern ? 'pattern' : 'prefix') !!}
{!! Former::text('client_number_prefix')
->addGroupClass('client-prefix')
->label(trans('texts.prefix')) !!}
{!! Former::text('client_number_pattern')
->appendIcon('question-sign')
->addGroupClass('client-pattern')
2017-03-29 10:46:52 +02:00
->addGroupClass('client-number-pattern')
2017-01-04 11:52:32 +01:00
->label(trans('texts.pattern')) !!}
{!! Former::text('client_number_counter')
->label(trans('texts.counter'))
->addGroupClass('pad-checkbox')
->help(trans('texts.client_number_help') . ' ' .
2017-01-08 22:41:39 +01:00
trans('texts.next_client_number', ['number' => $account->getNextNumber() ?: '0001'])) !!}
2017-01-04 11:52:32 +01:00
</div>
2017-01-03 14:53:49 +01:00
</div>
</div>
<div role="tabpanel" class="tab-pane" id="credit_number">
<div class="panel-body">
{!! Former::checkbox('credit_number_enabled')
->label('credit_number')
->onchange('onCreditNumberEnabled()')
->text('enable')
->value(1)
->check($account->credit_number_counter > 0) !!}
<div id="creditNumberDiv" style="display:none">
{!! Former::inline_radios('credit_number_type')
->onchange("onNumberTypeChange('credit')")
->label(trans('texts.type'))
->radios([
trans('texts.prefix') => ['value' => 'prefix', 'name' => 'credit_number_type'],
trans('texts.pattern') => ['value' => 'pattern', 'name' => 'credit_number_type'],
])->check($account->credit_number_pattern ? 'pattern' : 'prefix') !!}
{!! Former::text('credit_number_prefix')
->addGroupClass('credit-prefix')
->label(trans('texts.prefix')) !!}
{!! Former::text('credit_number_pattern')
->appendIcon('question-sign')
->addGroupClass('credit-pattern')
->addGroupClass('credit-number-pattern')
->label(trans('texts.pattern')) !!}
{!! Former::text('credit_number_counter')
->label(trans('texts.counter'))
->addGroupClass('pad-checkbox')
->help(trans('texts.credit_number_help') . ' ' .
trans('texts.next_credit_number', ['number' => $account->getNextNumber(new \App\Models\Credit()) ?: '0001'])) !!}
</div>
2015-10-11 16:41:09 +02:00
</div>
</div>
<div role="tabpanel" class="tab-pane" id="options">
2017-03-23 10:39:44 +01:00
<div class="panel-body">
{!! Former::text('invoice_number_padding')
->help('padding_help') !!}
{!! Former::text('recurring_invoice_number_prefix')
->label(trans('texts.recurring_prefix'))
->help(trans('texts.recurring_invoice_number_prefix_help')) !!}
2017-03-23 10:39:44 +01:00
{!! Former::select('reset_counter_frequency_id')
->onchange('onResetFrequencyChange()')
->label('reset_counter')
2017-03-23 10:39:44 +01:00
->addOption(trans('texts.never'), '')
2017-03-25 22:35:08 +01:00
->options(\App\Models\Frequency::selectOptions())
2017-03-23 10:39:44 +01:00
->help('reset_counter_help') !!}
{!! Former::text('reset_counter_date')
->label('next_reset')
->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT))
->addGroupClass('reset_counter_date_group')
->append('<i class="glyphicon glyphicon-calendar"></i>') !!}
</div>
</div>
2015-10-11 16:41:09 +02:00
</div>
2015-10-22 20:48:12 +02:00
2015-04-20 16:34:23 +02:00
</div>
</div>
2016-09-05 20:34:34 +02:00
2015-04-20 16:34:23 +02:00
<div class="panel panel-default">
2015-10-11 16:41:09 +02:00
<div class="panel-heading">
<h3 class="panel-title">{!! trans('texts.custom_fields') !!}</h3>
</div>
2015-10-14 19:18:19 +02:00
<div class="panel-body form-padding-right">
2015-04-20 16:34:23 +02:00
2015-10-11 16:41:09 +02:00
<div role="tabpanel">
<ul class="nav nav-tabs" role="tablist" style="border: none">
2016-02-28 12:59:52 +01:00
<li role="presentation" class="active">
2016-09-05 20:34:34 +02:00
<a href="#client_fields" aria-controls="client_fields" role="tab" data-toggle="tab">{{ trans('texts.client_fields') }}</a>
2016-02-28 12:59:52 +01:00
</li>
2017-04-16 13:31:14 +02:00
<li role="presentation">
<a href="#contact_fields" aria-controls="contact_fields" role="tab" data-toggle="tab">{{ trans('texts.contact_fields') }}</a>
</li>
2016-02-28 12:59:52 +01:00
<li role="presentation">
2016-09-05 20:34:34 +02:00
<a href="#company_fields" aria-controls="company_fields" role="tab" data-toggle="tab">{{ trans('texts.company_fields') }}</a>
2016-02-28 12:59:52 +01:00
</li>
<li role="presentation">
<a href="#product_fields" aria-controls="product_fields" role="tab" data-toggle="tab">{{ trans('texts.product_fields') }}</a>
2016-02-28 12:59:52 +01:00
</li>
<li role="presentation">
<a href="#invoice_fields" aria-controls="invoice_fields" role="tab" data-toggle="tab">{{ trans('texts.invoice_fields') }}</a>
2016-02-28 12:59:52 +01:00
</li>
2015-10-11 16:41:09 +02:00
</ul>
</div>
<div class="tab-content">
2016-09-05 20:34:34 +02:00
<div role="tabpanel" class="tab-pane active" id="client_fields">
2015-10-11 16:41:09 +02:00
<div class="panel-body">
2015-12-03 16:35:41 +01:00
{!! Former::text('custom_client_label1')
->label(trans('texts.field_label')) !!}
{!! Former::text('custom_client_label2')
->label(trans('texts.field_label'))
->help(trans('texts.custom_client_fields_helps')) !!}
2015-10-11 16:41:09 +02:00
</div>
</div>
2017-04-16 13:31:14 +02:00
<div role="tabpanel" class="tab-pane" id="contact_fields">
<div class="panel-body">
{!! Former::text('custom_contact_label1')
->label(trans('texts.field_label')) !!}
{!! Former::text('custom_contact_label2')
->label(trans('texts.field_label'))
->help(trans('texts.custom_contact_fields_help')) !!}
</div>
</div>
2016-09-05 20:34:34 +02:00
<div role="tabpanel" class="tab-pane" id="company_fields">
2015-10-11 16:41:09 +02:00
<div class="panel-body">
2015-12-03 16:35:41 +01:00
{!! Former::text('custom_label1')
->label(trans('texts.field_label')) !!}
{!! Former::text('custom_value1')
->label(trans('texts.field_value')) !!}
2015-10-11 16:41:09 +02:00
<p>&nbsp;</p>
2015-12-03 16:35:41 +01:00
{!! Former::text('custom_label2')
->label(trans('texts.field_label')) !!}
{!! Former::text('custom_value2')
->label(trans('texts.field_value'))
->help(trans('texts.custom_account_fields_helps')) !!}
2015-10-11 16:41:09 +02:00
</div>
</div>
<div role="tabpanel" class="tab-pane" id="product_fields">
2015-10-11 16:41:09 +02:00
<div class="panel-body">
{!! Former::text('custom_invoice_item_label1')
2015-12-03 16:35:41 +01:00
->label(trans('texts.field_label')) !!}
{!! Former::text('custom_invoice_item_label2')
2015-12-03 16:35:41 +01:00
->label(trans('texts.field_label'))
->help(trans('texts.custom_product_fields_help')) !!}
2015-10-11 16:41:09 +02:00
</div>
</div>
<div role="tabpanel" class="tab-pane" id="invoice_fields">
2016-02-28 12:59:52 +01:00
<div class="panel-body">
{!! Former::text('custom_invoice_text_label1')
2016-02-28 12:59:52 +01:00
->label(trans('texts.field_label')) !!}
{!! Former::text('custom_invoice_text_label2')
2016-02-28 12:59:52 +01:00
->label(trans('texts.field_label'))
->help(trans('texts.custom_invoice_fields_helps')) !!}
2016-02-28 12:59:52 +01:00
2015-10-22 20:48:12 +02:00
{!! Former::text('custom_invoice_label1')
2017-04-16 13:31:14 +02:00
->label(trans('texts.surcharge_label'))
2015-10-22 20:48:12 +02:00
->addGroupClass('pad-checkbox')
->append(Former::checkbox('custom_invoice_taxes1')
->value(1)
->raw() . trans('texts.charge_taxes')) !!}
2017-03-16 15:15:58 +01:00
2015-10-22 20:48:12 +02:00
{!! Former::text('custom_invoice_label2')
2017-04-16 13:31:14 +02:00
->label(trans('texts.surcharge_label'))
2015-10-22 20:48:12 +02:00
->addGroupClass('pad-checkbox')
->append(Former::checkbox('custom_invoice_taxes2')
->value(1)
->raw() . trans('texts.charge_taxes'))
->help(trans('texts.custom_invoice_charges_helps')) !!}
2015-10-11 16:41:09 +02:00
</div>
</div>
</div>
</div>
2015-04-20 16:34:23 +02:00
</div>
2015-10-11 16:41:09 +02:00
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{!! trans('texts.quote_settings') !!}</h3>
</div>
<div class="panel-body form-padding-right">
{!! Former::checkbox('auto_convert_quote')
->text(trans('texts.enable'))
->blockHelp(trans('texts.auto_convert_quote_help'))
->value(1) !!}
</div>
</div>
2015-10-29 15:42:05 +01:00
<div class="panel panel-default">
<div class="panel-heading">
2017-07-20 21:45:10 +02:00
<h3 class="panel-title">{!! trans('texts.defaults') !!}</h3>
2015-10-29 15:42:05 +01:00
</div>
2017-07-21 16:15:37 +02:00
<div class="panel-body" style="min-height:350px">
2015-10-29 15:42:05 +01:00
<div role="tabpanel">
<ul class="nav nav-tabs" role="tablist" style="border: none">
2016-09-05 20:34:34 +02:00
<li role="presentation" class="active"><a href="#invoice_terms" aria-controls="invoice_terms" role="tab" data-toggle="tab">{{ trans('texts.invoice_terms') }}</a></li>
<li role="presentation"><a href="#invoice_footer" aria-controls="invoice_footer" role="tab" data-toggle="tab">{{ trans('texts.invoice_footer') }}</a></li>
<li role="presentation"><a href="#quote_terms" aria-controls="quote_terms" role="tab" data-toggle="tab">{{ trans('texts.quote_terms') }}</a></li>
2017-07-20 21:45:10 +02:00
@if ($account->hasFeature(FEATURE_DOCUMENTS))
2017-07-21 16:15:37 +02:00
<li role="presentation"><a href="#documents" aria-controls="documents" role="tab" data-toggle="tab">
{{ trans('texts.documents') }}
@if ($count = $account->defaultDocuments->count())
({{ $count }})
@endif
</a></li>
2017-07-20 21:45:10 +02:00
@endif
2015-10-29 15:42:05 +01:00
</ul>
</div>
<div class="tab-content">
2016-09-05 20:34:34 +02:00
<div role="tabpanel" class="tab-pane active" id="invoice_terms">
2015-10-29 15:42:05 +01:00
<div class="panel-body">
{!! Former::textarea('invoice_terms')
->label(trans('texts.default_invoice_terms'))
2017-07-21 16:15:37 +02:00
->rows(8)
->raw() !!}
2015-10-29 15:42:05 +01:00
</div>
</div>
2016-09-05 20:34:34 +02:00
<div role="tabpanel" class="tab-pane" id="invoice_footer">
2015-10-29 15:42:05 +01:00
<div class="panel-body">
{!! Former::textarea('invoice_footer')
->label(trans('texts.default_invoice_footer'))
2017-07-21 16:15:37 +02:00
->rows(8)
->raw() !!}
@if ($account->hasFeature(FEATURE_REMOVE_CREATED_BY) && ! $account->isTrial())
<div class="help-block">
{{ trans('texts.invoice_footer_help')}}
</div>
@endif
2015-10-29 15:42:05 +01:00
</div>
</div>
2016-09-05 20:34:34 +02:00
<div role="tabpanel" class="tab-pane" id="quote_terms">
2015-10-29 15:42:05 +01:00
<div class="panel-body">
{!! Former::textarea('quote_terms')
->label(trans('texts.default_quote_terms'))
2017-07-21 16:15:37 +02:00
->rows(8)
->raw() !!}
2015-10-29 15:42:05 +01:00
</div>
</div>
2017-07-20 21:45:10 +02:00
@if ($account->hasFeature(FEATURE_DOCUMENTS))
<div role="tabpanel" class="tab-pane" id="documents">
<div class="panel-body">
<div class="form-group">
2017-07-21 16:15:37 +02:00
<div class="col-lg-12 col-sm-12">
2017-07-20 21:45:10 +02:00
<div role="tabpanel" class="tab-pane" id="attached-documents" style="position:relative;z-index:9">
<div id="document-upload">
<div class="dropzone">
<!--
<div data-bind="foreach: documents">
<input type="hidden" name="document_ids[]" data-bind="value: public_id"/>
</div>
-->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endif
2015-10-29 15:42:05 +01:00
</div>
</div>
</div>
2016-09-05 20:34:34 +02:00
@if (Auth::user()->hasFeature(FEATURE_INVOICE_SETTINGS))
2015-10-01 22:02:22 +02:00
<center>
{!! Button::success(trans('texts.save'))->large()->submit()->appendIcon(Icon::create('floppy-disk')) !!}
</center>
@endif
2014-04-18 10:57:31 +02:00
2015-10-22 20:48:12 +02:00
<div class="modal fade" id="patternHelpModal" tabindex="-1" role="dialog" aria-labelledby="patternHelpModalLabel" aria-hidden="true">
<div class="modal-dialog" style="min-width:150px">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="patternHelpModalLabel">{{ trans('texts.pattern_help_title') }}</h4>
</div>
2017-02-18 22:20:03 +01:00
<div class="container" style="width: 100%; padding-bottom: 0px !important">
2017-03-26 10:45:17 +02:00
<div class="panel panel-default">
2017-02-18 22:20:03 +01:00
<div class="panel-body">
2015-10-22 20:48:12 +02:00
<p>{{ trans('texts.pattern_help_1') }}</p>
<p>{{ trans('texts.pattern_help_2') }}</p>
<ul>
@foreach (\App\Models\Invoice::$patternFields as $field)
@if ($field == 'date:')
2015-10-25 12:08:11 +01:00
<li>{$date:format} - {!! link_to(PHP_DATE_FORMATS, trans('texts.see_options'), ['target' => '_blank']) !!}</li>
2017-03-29 10:46:52 +02:00
@elseif (strpos($field, 'client') !== false)
<li class="hide-client">{${{ $field }}}</li>
2015-10-22 20:48:12 +02:00
@else
2015-10-25 12:08:11 +01:00
<li>{${{ $field }}}</li>
2015-10-22 20:48:12 +02:00
@endif
@endforeach
</ul>
2017-03-29 10:46:52 +02:00
<p class="hide-client">{{ trans('texts.pattern_help_3', [
2015-10-22 20:48:12 +02:00
'example' => '{$year}-{$counter}',
'value' => date('Y') . '-0001'
]) }}</p>
</div>
2017-02-18 22:20:03 +01:00
</div>
</div>
2015-10-22 20:48:12 +02:00
2017-03-26 10:45:17 +02:00
<div class="modal-footer">
2015-10-22 20:48:12 +02:00
<button type="button" class="btn btn-primary" data-dismiss="modal">{{ trans('texts.close') }}</button>
</div>
</div>
</div>
</div>
2015-04-01 21:57:02 +02:00
{!! Former::close() !!}
2014-04-18 10:57:31 +02:00
<script type="text/javascript">
function setQuoteNumberEnabled() {
var disabled = $('#share_counter').prop('checked');
$('#quote_number_counter').prop('disabled', disabled);
2016-09-05 20:34:34 +02:00
$('#quote_number_counter').val(disabled ? '' : '{!! $account->quote_number_counter !!}');
}
function onNumberTypeChange(entityType) {
var val = $('input[name=' + entityType + '_number_type]:checked').val();
2017-01-03 14:53:49 +01:00
if (val == 'prefix') {
$('.' + entityType + '-prefix').show();
$('.' + entityType + '-pattern').hide();
2017-01-03 14:53:49 +01:00
} else {
$('.' + entityType + '-prefix').hide();
$('.' + entityType + '-pattern').show();
2017-01-03 14:53:49 +01:00
}
}
2017-01-04 11:52:32 +01:00
function onClientNumberEnabled() {
2017-01-03 14:53:49 +01:00
var enabled = $('#client_number_enabled').is(':checked');
if (enabled) {
$('#clientNumberDiv').show();
2017-01-04 11:52:32 +01:00
$('#client_number_counter').val({{ $account->client_number_counter ?: 1 }});
2017-01-03 14:53:49 +01:00
} else {
$('#clientNumberDiv').hide();
$('#client_number_counter').val(0);
}
}
function onCreditNumberEnabled() {
var enabled = $('#credit_number_enabled').is(':checked');
if (enabled) {
$('#creditNumberDiv').show();
$('#credit_number_counter').val({{ $account->credit_number_counter ?: 1 }});
} else {
$('#creditNumberDiv').hide();
$('#credit_number_counter').val(0);
}
}
2017-03-23 10:39:44 +01:00
function onResetFrequencyChange() {
var val = $('#reset_counter_frequency_id').val();
if (val) {
$('.reset_counter_date_group').show();
} else {
$('.reset_counter_date_group').hide();
}
}
2015-10-22 20:48:12 +02:00
$('.number-pattern .input-group-addon').click(function() {
2017-03-29 10:46:52 +02:00
$('.hide-client').show();
$('#patternHelpModal').modal('show');
});
$('.client-number-pattern .input-group-addon').click(function() {
$('.hide-client').hide();
2015-10-22 20:48:12 +02:00
$('#patternHelpModal').modal('show');
});
$('.credit-number-pattern .input-group-addon').click(function() {
$('.hide-client').hide();
$('#patternHelpModal').modal('show');
});
2017-07-20 21:45:10 +02:00
var defaultDocuments = {!! $account->defaultDocuments()->get() !!};
2016-09-05 20:34:34 +02:00
$(function() {
setQuoteNumberEnabled();
onNumberTypeChange('invoice');
onNumberTypeChange('quote');
onNumberTypeChange('client');
onNumberTypeChange('credit');
2017-01-04 11:52:32 +01:00
onClientNumberEnabled();
onCreditNumberEnabled();
2017-03-23 10:39:44 +01:00
onResetFrequencyChange();
$('#reset_counter_date').datepicker('update', '{{ Utils::fromSqlDate($account->reset_counter_date) ?: 'new Date()' }}');
$('.reset_counter_date_group .input-group-addon').click(function() {
toggleDatePicker('reset_counter_date');
});
2017-07-20 21:45:10 +02:00
@if ($account->hasFeature(FEATURE_DOCUMENTS))
@include('partials.dropzone', ['documentSource' => 'defaultDocuments', 'isDefault' => true])
@endif
2015-10-22 20:48:12 +02:00
});
</script>
2015-05-09 20:25:16 +02:00
@stop
@section('onReady')
$('#custom_invoice_label1').focus();
@stop