Skip to content

Commit

Permalink
calculate and compound fields added
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Nov 5, 2018
1 parent bd94e83 commit 2cb61e2
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
34 changes: 34 additions & 0 deletions database/migrations/2018_11_05_000000_add_tax_columns.php
Original file line number Diff line number Diff line change
@@ -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',
]);
});
}
}
2 changes: 2 additions & 0 deletions resources/lang/en-GB/taxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

'rate' => 'Rate',
'rate_percent' => 'Rate (%)',
'calculate' => 'Calculate as VAT/GST',
'compound' => 'Compound',

];
12 changes: 12 additions & 0 deletions resources/views/settings/taxes/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

{{ 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')) }}
</div>
<!-- /.box-body -->
Expand All @@ -34,6 +38,14 @@
$('#enabled_1').trigger('click');
$('#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>
@endpush
16 changes: 16 additions & 0 deletions resources/views/settings/taxes/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

{{ 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')) }}
</div>
<!-- /.box-body -->
Expand All @@ -36,5 +40,17 @@
<script type="text/javascript">
var text_yes = '{{ trans('general.yes') }}';
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>
@endpush

0 comments on commit 2cb61e2

Please sign in to comment.