Invoice/Bill transaction delete issue solved.
This commit is contained in:
parent
d706059884
commit
c37be7c8d6
@ -55,6 +55,7 @@ class Transfers extends Controller
|
|||||||
);
|
);
|
||||||
|
|
||||||
$request = request();
|
$request = request();
|
||||||
|
|
||||||
if (isset($request['sort']) && array_key_exists($request['sort'], $special_key)) {
|
if (isset($request['sort']) && array_key_exists($request['sort'], $special_key)) {
|
||||||
$sort_order = array();
|
$sort_order = array();
|
||||||
|
|
||||||
|
13
resources/assets/js/views/purchases/bills.js
vendored
13
resources/assets/js/views/purchases/bills.js
vendored
@ -81,7 +81,7 @@ const app = new Vue({
|
|||||||
this.form.items = items;
|
this.form.items = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getElementById('taxes').getAttribute('data-value')) {
|
if ((document.getElementById('taxes') != null) && (document.getElementById('taxes').getAttribute('data-value'))) {
|
||||||
this.taxes = JSON.parse(document.getElementById('taxes').getAttribute('data-value'));
|
this.taxes = JSON.parse(document.getElementById('taxes').getAttribute('data-value'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -348,16 +348,5 @@ const app = new Vue({
|
|||||||
.catch(error => {
|
.catch(error => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onDeleteTransaction(form_id) {
|
|
||||||
this.transaction = new Form(form_id);
|
|
||||||
|
|
||||||
this.confirm.url = this.transaction.action;
|
|
||||||
this.confirm.title = this.transaction.title;
|
|
||||||
this.confirm.message = this.transaction.message;
|
|
||||||
this.confirm.button_cancel = this.transaction.cancel;
|
|
||||||
this.confirm.button_delete = this.transaction.delete;
|
|
||||||
this.confirm.show = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
13
resources/assets/js/views/sales/invoices.js
vendored
13
resources/assets/js/views/sales/invoices.js
vendored
@ -81,7 +81,7 @@ const app = new Vue({
|
|||||||
this.form.items = items;
|
this.form.items = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getElementById('taxes').getAttribute('data-value')) {
|
if ((document.getElementById('taxes') != null) && (document.getElementById('taxes').getAttribute('data-value'))) {
|
||||||
this.taxes = JSON.parse(document.getElementById('taxes').getAttribute('data-value'));
|
this.taxes = JSON.parse(document.getElementById('taxes').getAttribute('data-value'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -349,16 +349,5 @@ const app = new Vue({
|
|||||||
.catch(error => {
|
.catch(error => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onDeleteTransaction(form_id) {
|
|
||||||
this.transaction = new Form(form_id);
|
|
||||||
|
|
||||||
this.confirm.url = this.transaction.action;
|
|
||||||
this.confirm.title = this.transaction.title;
|
|
||||||
this.confirm.message = this.transaction.message;
|
|
||||||
this.confirm.button_cancel = this.transaction.cancel;
|
|
||||||
this.confirm.button_delete = this.transaction.delete;
|
|
||||||
this.confirm.show = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -565,7 +565,7 @@
|
|||||||
'type' => 'button',
|
'type' => 'button',
|
||||||
'class' => 'btn btn-danger btn-sm',
|
'class' => 'btn btn-danger btn-sm',
|
||||||
'title' => trans('general.delete'),
|
'title' => trans('general.delete'),
|
||||||
'onclick' => 'confirmDelete("' . '#bill-transaction-' . $transaction->id . '", "' . trans_choice('general.transaction', 2) . '", "' . trans('general.delete_confirm', ['name' => '<strong>' . Date::parse($transaction->paid_at)->format($date_format) . ' - ' . money($transaction->amount, $transaction->currency_code, true) . ' - ' . $transaction->account->name . '</strong>', 'type' => strtolower(trans_choice('general.transactions', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
|
'@click' => 'confirmDelete("' . route('transactions.destroy', $transaction->id) . '", "' . trans_choice('general.transactions', 2) . '", "' . $message. '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
|
||||||
)) !!}
|
)) !!}
|
||||||
{!! Form::close() !!}
|
{!! Form::close() !!}
|
||||||
@endif
|
@endif
|
||||||
|
@ -543,10 +543,10 @@
|
|||||||
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
||||||
<div class="accordion">
|
<div class="accordion">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header" id="headingOne" data-toggle="collapse" data-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
|
<div class="card-header" id="accordion-histories-header" data-toggle="collapse" data-target="#accordion-histories-body" aria-expanded="false" aria-controls="accordion-histories-body">
|
||||||
<h4 class="mb-0">{{ trans('invoices.histories') }}</h4>
|
<h4 class="mb-0">{{ trans('invoices.histories') }}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div id="collapseOne" class="collapse hide" aria-labelledby="headingOne">
|
<div id="accordion-histories-body" class="collapse hide" aria-labelledby="accordion-histories-header">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-flush table-hover">
|
<table class="table table-flush table-hover">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
@ -577,10 +577,10 @@
|
|||||||
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
||||||
<div class="accordion">
|
<div class="accordion">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header" id="headingTwo" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
|
<div class="card-header" id="accordion-transactions-header" data-toggle="collapse" data-target="#accordion-transactions-body" aria-expanded="false" aria-controls="accordion-transactions-body">
|
||||||
<h4 class="mb-0">{{ trans_choice('general.transactions', 2) }}</h4>
|
<h4 class="mb-0">{{ trans_choice('general.transactions', 2) }}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div id="collapseTwo" class="collapse hide" aria-labelledby="headingTwo">
|
<div id="accordion-transactions-body" class="collapse hide" aria-labelledby="accordion-transactions-header">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-flush table-hover">
|
<table class="table table-flush table-hover">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
@ -604,30 +604,18 @@
|
|||||||
{{ trans('reconciliations.reconciled') }}
|
{{ trans('reconciliations.reconciled') }}
|
||||||
</button>
|
</button>
|
||||||
@else
|
@else
|
||||||
{!! Form::open([
|
|
||||||
'id' => 'invoice-transaction-' . $transaction->id,
|
|
||||||
'method' => 'DELETE',
|
|
||||||
'route' => ['transactions.destroy', $transaction->id],
|
|
||||||
'class' => 'd-inline'
|
|
||||||
]) !!}
|
|
||||||
{{ Form::hidden('form_id', '#invoice-transaction-' . $transaction->id, ['id' => 'form_id-' . $transaction->id]) }}
|
|
||||||
{{ Form::hidden('title', trans_choice('general.transactions', 2), ['id' => 'title-' . $transaction->id]) }}
|
|
||||||
@php $message = trans('general.delete_confirm', [
|
@php $message = trans('general.delete_confirm', [
|
||||||
'name' => '<strong>' . Date::parse($transaction->paid_at)->format($date_format) . ' - ' . money($transaction->amount, $transaction->currency_code, true) . ' - ' . $transaction->account->name . '</strong>',
|
'name' => '<strong>' . Date::parse($transaction->paid_at)->format($date_format) . ' - ' . money($transaction->amount, $transaction->currency_code, true) . ' - ' . $transaction->account->name . '</strong>',
|
||||||
'type' => strtolower(trans_choice('general.transactions', 1))
|
'type' => strtolower(trans_choice('general.transactions', 1))
|
||||||
]);
|
]);
|
||||||
@endphp
|
@endphp
|
||||||
{{ Form::hidden('message', $message, ['id' => 'mesage-' . $transaction->id]) }}
|
|
||||||
{{ Form::hidden('cancel', trans('general.cancel'), ['id' => 'cancel-' . $transaction->id]) }}
|
|
||||||
{{ Form::hidden('delete', trans('general.delete'), ['id' => 'delete-' . $transaction->id]) }}
|
|
||||||
|
|
||||||
{!! Form::button('<i class="fa fa-trash-o" aria-hidden="true"></i> ' . trans('general.delete'), array(
|
{!! Form::button('<i class="fa fa-trash-o" aria-hidden="true"></i> ' . trans('general.delete'), array(
|
||||||
'type' => 'button',
|
'type' => 'button',
|
||||||
'class' => 'btn btn-danger btn-sm',
|
'class' => 'btn btn-danger btn-sm',
|
||||||
'title' => trans('general.delete'),
|
'title' => trans('general.delete'),
|
||||||
'@click' => 'onDeleteTransaction("invoice-transaction-' . $transaction->id . '")'
|
'@click' => 'confirmDelete("' . route('transactions.destroy', $transaction->id) . '", "' . trans_choice('general.transactions', 2) . '", "' . $message. '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
|
||||||
)) !!}
|
)) !!}
|
||||||
{!! Form::close() !!}
|
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user