Skip to content

Commit

Permalink
close #651 Fixed: Invoice/Bill create page, if you add new tax. it mi…
Browse files Browse the repository at this point in the history
…ssing tax type column
  • Loading branch information
cuneytsenturk committed Nov 29, 2018
1 parent 3fac930 commit 1d63b2d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 4 deletions.
8 changes: 7 additions & 1 deletion app/Http/Controllers/Modals/Taxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ public function __construct()
*/
public function create()
{
$html = view('modals.taxes.create')->render();
$types = [
'normal' => trans('taxes.normal'),
'inclusive' => trans('taxes.inclusive'),
'compound' => trans('taxes.compound'),
];

$html = view('modals.taxes.create', compact('types'))->render();

return response()->json([
'success' => true,
Expand Down
2 changes: 2 additions & 0 deletions resources/views/expenses/bills/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@
$(document).on('click', '#tax-add-new', function(e) {
tax_name = $('.select2-search__field').val();
$('body > .select2-container.select2-container--default.select2-container--open').remove();
$('#modal-create-tax').remove();
$.ajax({
Expand Down
2 changes: 2 additions & 0 deletions resources/views/expenses/bills/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@
$(document).on('click', '#tax-add-new', function(e) {
tax_name = $('.select2-search__field').val();
$('body > .select2-container.select2-container--default.select2-container--open').remove();
$('#modal-create-tax').remove();
$.ajax({
Expand Down
2 changes: 2 additions & 0 deletions resources/views/incomes/invoices/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@
$(document).on('click', '#tax-add-new', function(e) {
tax_name = $('.select2-search__field').val();
$('body > .select2-container.select2-container--default.select2-container--open').remove();
$('#modal-create-tax').remove();
$.ajax({
Expand Down
2 changes: 2 additions & 0 deletions resources/views/incomes/invoices/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@
$(document).on('click', '#tax-add-new', function(e) {
tax_name = $('.select2-search__field').val();
$('body > .select2-container.select2-container--default.select2-container--open').remove();
$('#modal-create-tax').remove();
$.ajax({
Expand Down
8 changes: 8 additions & 0 deletions resources/views/modals/taxes/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

{{ Form::textGroup('rate', trans('taxes.rate'), 'percent') }}

{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, 'normal') }}

{!! Form::hidden('enabled', '1', []) !!}
</div>
{!! Form::close() !!}
Expand All @@ -28,6 +30,12 @@
<script type="text/javascript">
$(document).ready(function(){
$('#modal-create-tax').modal('show');
$('#rate').focus();
$("#type").select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.types', 1)]) }}"
});
});
$(document).on('click', '#button-create-tax', function (e) {
Expand Down
6 changes: 3 additions & 3 deletions resources/views/modules/item/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
@foreach($module->screenshots as $screenshot)
@php if (empty($status)) { $status = 5; } else { $status = 1; } @endphp
<div class="item @if($status == 5) {{ 'active' }} @endif">
<a data-toggle="lightbox" href="{{ $screenshot->path_string }}" data-gallery="{{ $module->slug}}">
<a href="{{ $screenshot->path_string }}" data-toggle="lightbox" data-gallery="{{ $module->slug}}">
<img class="img-fluid d-block w-100" src="{{ $screenshot->path_string }}" alt="{{ $screenshot->alt_attribute }}">
</a>

Expand All @@ -86,11 +86,11 @@

<div class="carousel-navigation-message">
@if (($item->module && (count($module->screenshots) > 1)) || (!$item->module && (count($module->screenshots) > 1)))
<a class="left carousel-control" href="#carousel-screenshot-generic" role="button" data-slide="prev">
<a href="#carousel-screenshot-generic" class="left carousel-control" role="button" data-slide="prev">
<i class="fa fa-chevron-left"></i>
<span class="sr-only">{{ trans('pagination.previous') }}</span>
</a>
<a class="right carousel-control" href="#carousel-screenshot-generic" role="button" data-slide="next">
<a href="#carousel-screenshot-generic" class="right carousel-control" role="button" data-slide="next">
<i class="fa fa-chevron-right"></i>
<span class="sr-only">{{ trans('pagination.next') }}</span>
</a>
Expand Down

0 comments on commit 1d63b2d

Please sign in to comment.