1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Working on client numbers

This commit is contained in:
Hillel Coren 2017-01-03 15:53:49 +02:00
parent a3c5b83d2d
commit 8ee451b42f
3 changed files with 69 additions and 1 deletions

View File

@ -30,6 +30,9 @@ class AddInclusiveTaxes extends Migration
{
$table->dropColumn('bluevine_status');
$table->text('bcc_email')->nullable();
$table->text('client_number_prefix')->nullable();
$table->integer('client_number_counter')->default(0)->nullable();
$table->text('client_number_pattern')->nullable();
});
}
@ -55,6 +58,9 @@ class AddInclusiveTaxes extends Migration
{
$table->enum('bluevine_status', ['ignored', 'signed_up'])->nullable();
$table->dropColumn('bcc_email');
$table->dropColumn('client_number_prefix');
$table->dropColumn('client_number_counter');
$table->dropColumn('client_number_pattern');
});
}
}

View File

@ -2297,7 +2297,8 @@ $LANG = array(
'postal_city_state' => 'Postal/City/State',
'phantomjs_help' => 'In certain cases the app uses :link_phantom to generate the PDF, install :link_docs to generate it locally.',
'phantomjs_local' => 'Using local PhantomJS',
'client_number' => 'Client Number',
);
return $LANG;

View File

@ -41,6 +41,9 @@
<li role="presentation">
<a href="#quote_number" aria-controls="quote_number" role="tab" data-toggle="tab">{{ trans('texts.quote_number') }}</a>
</li>
<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="#recurring_invoice_number" aria-controls="recurring_invoice_number" role="tab" data-toggle="tab">{{ trans('texts.recurring_invoice_number') }}</a>
</li>
@ -102,6 +105,41 @@
</div>
</div>
<div role="tabpanel" class="tab-pane" id="client_number">
<div class="panel-body">
@if ( ! $account->client_number_counter)
{!! Former::checkbox('client_number_enabled')
->label('client_number')
->onchange('onClientNumberChange()')
->text('enable')!!}
<div id="clientNumberDiv" style="display:none">
@endif
{!! Former::inline_radios('client_number_type')
->onchange('onClientNumberTypeChange()')
->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')
->addGroupClass('number-pattern')
->label(trans('texts.pattern')) !!}
{!! Former::text('client_number_counter')
->label(trans('texts.counter'))
->addGroupClass('pad-checkbox') !!}
@if ( ! $account->client_number_counter)
</div>
@endif
</div>
</div>
<div role="tabpanel" class="tab-pane" id="recurring_invoice_number">
<div class="panel-body">
@ -339,6 +377,28 @@
}
}
function onClientNumberTypeChange() {
var val = $('input[name=client_number_type]:checked').val()
if (val == 'prefix') {
$('.client-prefix').show();
$('.client-pattern').hide();
} else {
$('.client-prefix').hide();
$('.client-pattern').show();
}
}
function onClientNumberChange() {
var enabled = $('#client_number_enabled').is(':checked');
if (enabled) {
$('#clientNumberDiv').show();
$('#client_number_counter').val(1);
} else {
$('#clientNumberDiv').hide();
$('#client_number_counter').val(0);
}
}
$('.number-pattern .input-group-addon').click(function() {
$('#patternHelpModal').modal('show');
});
@ -347,6 +407,7 @@
setQuoteNumberEnabled();
onInvoiceNumberTypeChange();
onQuoteNumberTypeChange();
onClientNumberTypeChange();
});
</script>