calculate and compound fields added

This commit is contained in:
cuneytsenturk 2018-11-05 19:51:01 +03:00
parent bd94e8374a
commit 2cb61e2a70
4 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
class AddTaxColumns extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('taxes', function ($table) {
$table->boolean('calculate')->default(0);
$table->boolean('compound')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('taxes', function ($table) {
$table->dropColumn([
'calculate',
'compound',
]);
});
}
}

View File

@ -4,5 +4,7 @@ return [
'rate' => 'Rate', 'rate' => 'Rate',
'rate_percent' => 'Rate (%)', 'rate_percent' => 'Rate (%)',
'calculate' => 'Calculate as VAT/GST',
'compound' => 'Compound',
]; ];

View File

@ -12,6 +12,10 @@
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent') }} {{ Form::textGroup('rate', trans('taxes.rate'), 'percent') }}
{{ Form::selectGroup('calculate', trans('taxes.calculate'), 'calculator', ['0' => trans('general.no'), '1' => trans('general.yes')], null, []) }}
{{ Form::selectGroup('compound', trans('taxes.compound'), 'plus', ['0' => trans('general.no'), '1' => trans('general.yes')], null, []) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }} {{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div> </div>
<!-- /.box-body --> <!-- /.box-body -->
@ -34,6 +38,14 @@
$('#enabled_1').trigger('click'); $('#enabled_1').trigger('click');
$('#name').focus(); $('#name').focus();
$("#calculate").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans('taxes.calculate')]) }}"
});
$("#compound").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans('taxes.compound')]) }}"
});
}); });
</script> </script>
@endpush @endpush

View File

@ -17,6 +17,10 @@
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent') }} {{ Form::textGroup('rate', trans('taxes.rate'), 'percent') }}
{{ Form::selectGroup('calculate', trans('taxes.calculate'), 'calculator', ['0' => trans('general.no'), '1' => trans('general.yes')], null, []) }}
{{ Form::selectGroup('compound', trans('taxes.compound'), 'plus', ['0' => trans('general.no'), '1' => trans('general.yes')], null, []) }}
{{ Form::radioGroup('enabled', trans('general.enabled')) }} {{ Form::radioGroup('enabled', trans('general.enabled')) }}
</div> </div>
<!-- /.box-body --> <!-- /.box-body -->
@ -36,5 +40,17 @@
<script type="text/javascript"> <script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}'; var text_yes = '{{ trans('general.yes') }}';
var text_no = '{{ trans('general.no') }}'; var text_no = '{{ trans('general.no') }}';
$(document).ready(function() {
$('#name').focus();
$("#calculate").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans('taxes.calculate')]) }}"
});
$("#compound").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans('taxes.compound')]) }}"
});
});
</script> </script>
@endpush @endpush