Merge pull request #2167 from brkcvn/vendor-show
Show template development done for Vendor page.
This commit is contained in:
commit
e2f29060a2
@ -329,4 +329,11 @@ class Vendors extends Controller
|
||||
|
||||
return redirect()->route('bills.create')->withInput($data);
|
||||
}
|
||||
|
||||
public function createPayment(Contact $vendor)
|
||||
{
|
||||
$data['contact'] = $vendor;
|
||||
|
||||
return redirect()->route('payments.create')->withInput($data);
|
||||
}
|
||||
}
|
||||
|
40
resources/assets/js/views/purchases/vendors.js
vendored
40
resources/assets/js/views/purchases/vendors.js
vendored
@ -4,31 +4,31 @@
|
||||
* building robust, powerful web applications using Vue and Laravel.
|
||||
*/
|
||||
|
||||
require('./../../bootstrap');
|
||||
require('./../../bootstrap');
|
||||
|
||||
import Vue from 'vue';
|
||||
import Vue from 'vue';
|
||||
|
||||
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
||||
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
||||
|
||||
import Global from './../../mixins/global';
|
||||
import Global from './../../mixins/global';
|
||||
|
||||
import Form from './../../plugins/form';
|
||||
import BulkAction from './../../plugins/bulk-action';
|
||||
import Form from './../../plugins/form';
|
||||
import BulkAction from './../../plugins/bulk-action';
|
||||
|
||||
// plugin setup
|
||||
Vue.use(DashboardPlugin);
|
||||
// plugin setup
|
||||
Vue.use(DashboardPlugin);
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
const app = new Vue({
|
||||
el: '#main-body',
|
||||
|
||||
mixins: [
|
||||
Global
|
||||
],
|
||||
mixins: [
|
||||
Global
|
||||
],
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
form: new Form('vendor'),
|
||||
bulk_action: new BulkAction('vendors')
|
||||
}
|
||||
}
|
||||
});
|
||||
data: function () {
|
||||
return {
|
||||
form: new Form('vendor'),
|
||||
bulk_action: new BulkAction('vendors')
|
||||
}
|
||||
}
|
||||
});
|
148
resources/assets/js/views/sales/customers.js
vendored
148
resources/assets/js/views/sales/customers.js
vendored
@ -4,94 +4,94 @@
|
||||
* building robust, powerful web applications using Vue and Laravel.
|
||||
*/
|
||||
|
||||
require('./../../bootstrap');
|
||||
require('./../../bootstrap');
|
||||
|
||||
import Vue from 'vue';
|
||||
import Vue from 'vue';
|
||||
|
||||
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
||||
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
||||
|
||||
import Global from './../../mixins/global';
|
||||
import Global from './../../mixins/global';
|
||||
|
||||
import Form from './../../plugins/form';
|
||||
import BulkAction from './../../plugins/bulk-action';
|
||||
import Form from './../../plugins/form';
|
||||
import BulkAction from './../../plugins/bulk-action';
|
||||
|
||||
// plugin setup
|
||||
Vue.use(DashboardPlugin);
|
||||
// plugin setup
|
||||
Vue.use(DashboardPlugin);
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
const app = new Vue({
|
||||
el: '#main-body',
|
||||
|
||||
mixins: [
|
||||
Global
|
||||
],
|
||||
mixins: [
|
||||
Global
|
||||
],
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
form: new Form('customer'),
|
||||
bulk_action: new BulkAction('customers'),
|
||||
can_login : false
|
||||
}
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
form: new Form('customer'),
|
||||
bulk_action: new BulkAction('customers'),
|
||||
can_login : false
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.form.create_user = false;
|
||||
},
|
||||
mounted() {
|
||||
this.form.create_user = false;
|
||||
},
|
||||
|
||||
methods:{
|
||||
onCanLogin(event) {
|
||||
if (event.target.checked) {
|
||||
if (this.form.email) {
|
||||
axios.get(url + '/auth/users/autocomplete', {
|
||||
params: {
|
||||
column: 'email',
|
||||
value : this.form.email
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
if (response.data.errors) {
|
||||
if (response.data.data) {
|
||||
this.form.errors.set('email', {
|
||||
0: response.data.data
|
||||
});
|
||||
methods:{
|
||||
onCanLogin(event) {
|
||||
if (event.target.checked) {
|
||||
if (this.form.email) {
|
||||
axios.get(url + '/auth/users/autocomplete', {
|
||||
params: {
|
||||
column: 'email',
|
||||
value : this.form.email
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
if (response.data.errors) {
|
||||
if (response.data.data) {
|
||||
this.form.errors.set('email', {
|
||||
0: response.data.data
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
this.can_login = true;
|
||||
this.form.create_user = true;
|
||||
return true;
|
||||
}
|
||||
this.can_login = true;
|
||||
this.form.create_user = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (response.data.success) {
|
||||
this.form.errors.set('email', {
|
||||
0: can_login_errors.email
|
||||
});
|
||||
if (response.data.success) {
|
||||
this.form.errors.set('email', {
|
||||
0: can_login_errors.email
|
||||
});
|
||||
|
||||
this.can_login = false;
|
||||
this.form.create_user = false;
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
});
|
||||
} else {
|
||||
this.form.errors.set('email', {
|
||||
0: can_login_errors.valid
|
||||
});
|
||||
this.can_login = false;
|
||||
this.form.create_user = false;
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
});
|
||||
} else {
|
||||
this.form.errors.set('email', {
|
||||
0: can_login_errors.valid
|
||||
});
|
||||
|
||||
this.can_login = false;
|
||||
this.form.create_user = false;
|
||||
return false;
|
||||
}
|
||||
this.can_login = false;
|
||||
this.form.create_user = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
} else {
|
||||
this.form.errors.clear('email');
|
||||
return false;
|
||||
} else {
|
||||
this.form.errors.clear('email');
|
||||
|
||||
this.can_login = false;
|
||||
this.form.create_user = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.can_login = false;
|
||||
this.form.create_user = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
@ -5,5 +5,6 @@ return [
|
||||
'payment_made' => 'Payment Made',
|
||||
'paid_to' => 'Paid To',
|
||||
'related_bill' => 'Releated Bill',
|
||||
'create_payment' => 'Create Payment',
|
||||
|
||||
];
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
{{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }}
|
||||
|
||||
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, null, ['path' => route('modals.vendors.create'), 'remote_action' => route('vendors.index')]) }}
|
||||
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, old('contact.id', old('contact_id', null)), ['path' => route('modals.vendors.create'), 'remote_action' => route('vendors.index')]) }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
|
||||
|
@ -77,12 +77,17 @@
|
||||
<i class="fa fa-ellipsis-h text-muted"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
|
||||
<a class="dropdown-item" href="{{ route('vendors.show', $item->id) }}">{{ trans('general.show') }}</a>
|
||||
<a class="dropdown-item" href="{{ route('vendors.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
<a class="dropdown-item" href="{{ route('vendors.show', $item->id) }}">{{ trans('general.show') }}</a>
|
||||
|
||||
@can('create-purchases-vendors')
|
||||
<a class="dropdown-item" href="{{ route('vendors.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
@endcan
|
||||
|
||||
@can('create-purchases-vendors')
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="{{ route('vendors.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
|
||||
@endcan
|
||||
|
||||
@can('delete-purchases-vendors')
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::deleteLink($item, 'vendors.destroy') !!}
|
||||
|
196
resources/views/purchases/vendors/show.blade.php
vendored
196
resources/views/purchases/vendors/show.blade.php
vendored
@ -2,6 +2,61 @@
|
||||
|
||||
@section('title', $vendor->name)
|
||||
|
||||
@section('new_button')
|
||||
<div class="dropup header-drop-top">
|
||||
<button type="button" class="btn btn-white btn-sm" data-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa fa-chevron-down"></i> {{ trans('general.more_actions') }}
|
||||
</button>
|
||||
|
||||
<div class="dropdown-menu" role="menu">
|
||||
@stack('button_dropdown_start')
|
||||
|
||||
@stack('duplicate_button_start')
|
||||
@can('create-purchases-vendors')
|
||||
<a class="dropdown-item" href="{{ route('vendors.duplicate', $vendor->id) }}">
|
||||
{{ trans('general.duplicate') }}
|
||||
</a>
|
||||
@endcan
|
||||
@stack('duplicate_button_end')
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
@stack('bill_button_start')
|
||||
@can('create-purchases-bills')
|
||||
<a class="dropdown-item" href="{{ route('vendors.create-bill', $vendor->id) }}">
|
||||
{{ trans('bills.create_bill') }}
|
||||
</a>
|
||||
@endcan
|
||||
@stack('bill_button_end')
|
||||
|
||||
@stack('payment_button_start')
|
||||
@can('create-purchases-payment')
|
||||
<a class="dropdown-item" href="{{ route('vendors.create-payment', $vendor->id) }}">
|
||||
{{ trans('payments.create_payment') }}
|
||||
</a>
|
||||
@endcan
|
||||
@stack('payment_button_end')
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
@stack('delete_button_start')
|
||||
@can('delete-purchases-vendors')
|
||||
{!! Form::deleteLink($vendor, 'vendors.destroy') !!}
|
||||
@endcan
|
||||
@stack('delete_button_end')
|
||||
|
||||
@stack('button_dropdown_end')
|
||||
</div>
|
||||
</div>
|
||||
@stack('edit_button_start')
|
||||
@can('update-purchases-vendors')
|
||||
<a href="{{ route('vendors.edit', $vendor->id) }}" class="btn btn-white btn-sm">
|
||||
{{ trans('general.edit') }}
|
||||
</a>
|
||||
@endcan
|
||||
@stack('edit_button_end')
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xl-3">
|
||||
@ -68,12 +123,7 @@
|
||||
</ul>
|
||||
|
||||
@stack('vendor_edit_button_start')
|
||||
<a href="{{ route('vendors.edit', $vendor->id) }}" class="btn btn-info btn-block"><b>{{ trans('general.edit') }}</b></a>
|
||||
@stack('vendor_edit_button_end')
|
||||
|
||||
@stack('vendor_create_bill_button_start')
|
||||
<a href="{{ route('vendors.create-bill', $vendor->id) }}" class="btn btn-white btn-block"><b>{{ trans('bills.create_bill') }}</b></a>
|
||||
@stack('vendor_create_bill_button_end')
|
||||
</div>
|
||||
|
||||
<div class="col-xl-9">
|
||||
@ -131,86 +181,86 @@
|
||||
<div class="col-md-12">
|
||||
<div class="nav-wrapper">
|
||||
<ul class="nav nav-pills nav-fill flex-column flex-md-row" id="tabs-icons-text" role="tablist">
|
||||
@stack('vendor_transactions_tab_start')
|
||||
@stack('vendor_bills_tab_start')
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-sm-3 mb-md-0 active" id="transactions-tab" data-toggle="tab" href="#transactions-content" role="tab" aria-controls="transactions-content" aria-selected="true">{{ trans_choice('general.transactions', 2) }}</a>
|
||||
</li>
|
||||
@stack('vendor_transactions_tab_end')
|
||||
|
||||
@stack('vendor_bills_tab_start')
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-sm-3 mb-md-0" id="bills-tab" data-toggle="tab" href="#bills-content" role="tab" aria-controls="bills-content" aria-selected="false">{{ trans_choice('general.bills', 2) }}</a>
|
||||
<a class="nav-link mb-sm-3 mb-md-0 active" id="bills-tab" data-toggle="tab" href="#bills-content" role="tab" aria-controls="bills-content" aria-selected="false">{{ trans_choice('general.bills', 2) }}</a>
|
||||
</li>
|
||||
@stack('vendor_bills_tab_end')
|
||||
|
||||
@stack('vendor_transactions_tab_start')
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-sm-3 mb-md-0" id="transactions-tab" data-toggle="tab" href="#transactions-content" role="tab" aria-controls="transactions-content" aria-selected="true">{{ trans_choice('general.transactions', 2) }}</a>
|
||||
</li>
|
||||
@stack('vendor_transactions_tab_end')
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="tab-content" id="myTabContent">
|
||||
@stack('vendor_transactions_content_start')
|
||||
<div class="tab-pane fade show active" id="transactions-content" role="tabpanel" aria-labelledby="transactions-tab">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover" id="tbl-transactions">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-xs-6 col-sm-2">{{ trans('general.date') }}</th>
|
||||
<th class="col-xs-6 col-sm-2 text-right">{{ trans('general.amount') }}</th>
|
||||
<th class="col-sm-4 d-none d-sm-block">{{ trans_choice('general.categories', 1) }}</th>
|
||||
<th class="col-sm-4 d-none d-sm-block">{{ trans_choice('general.accounts', 1) }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($transactions as $item)
|
||||
<tr class="row align-items-center border-top-1 tr-py">
|
||||
<td class="col-xs-6 col-sm-2">@date($item->paid_at)</td>
|
||||
<td class="col-xs-6 col-sm-2 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-sm-4 d-none d-sm-block">{{ $item->category->name }}</td>
|
||||
<td class="col-sm-4 d-none d-sm-block">{{ $item->account->name }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer py-4 table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $transactions, 'type' => 'transactions'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('vendor_transactions_content_end')
|
||||
|
||||
@stack('vendor_bills_content_start')
|
||||
<div class="tab-pane fade" id="bills-content" role="tabpanel" aria-labelledby="bills-tab">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover" id="tbl-bills">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-xs-4 col-sm-1">{{ trans_choice('general.numbers', 1) }}</th>
|
||||
<th class="col-xs-4 col-sm-3 text-right">{{ trans('general.amount') }}</th>
|
||||
<th class="col-sm-3 d-none d-sm-block text-left">{{ trans('bills.bill_date') }}</th>
|
||||
<th class="col-sm-3 d-none d-sm-block text-left">{{ trans('bills.due_date') }}</th>
|
||||
<th class="col-xs-4 col-sm-2">{{ trans_choice('general.statuses', 1) }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($bills as $item)
|
||||
<tr class="row align-items-center border-top-1 tr-py">
|
||||
<td class="col-xs-4 col-sm-1"><a href="{{ route('bills.show', $item->id) }}">{{ $item->document_number }}</a></td>
|
||||
<td class="col-xs-4 col-sm-3 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-sm-3 d-none d-sm-block text-left">@date($item->issued_at)</td>
|
||||
<td class="col-sm-3 d-none d-sm-block text-left">@date($item->due_at)</td>
|
||||
<td class="col-xs-4 col-sm-2"><span class="badge badge-pill badge-{{ $item->status_label }} my--2">{{ trans('documents.statuses.' . $item->status) }}</span></td>
|
||||
<div class="tab-pane fade show active" id="bills-content" role="tabpanel" aria-labelledby="transactions-tab">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover" id="tbl-bills">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-xs-4 col-sm-1">{{ trans_choice('general.numbers', 1) }}</th>
|
||||
<th class="col-xs-4 col-sm-3 text-right">{{ trans('general.amount') }}</th>
|
||||
<th class="col-sm-3 d-none d-sm-block text-left">{{ trans('invoices.invoice_date') }}</th>
|
||||
<th class="col-sm-3 d-none d-sm-block text-left">{{ trans('invoices.due_date') }}</th>
|
||||
<th class="col-xs-4 col-sm-2">{{ trans_choice('general.statuses', 1) }}</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer py-4 table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $bills, 'type' => 'bills'])
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($bills as $item)
|
||||
<tr class="row align-items-center border-top-1 tr-py">
|
||||
<td class="col-xs-4 col-sm-1"><a href="{{ route('bills.show', $item->id) }}">{{ $item->document_number }}</a></td>
|
||||
<td class="col-xs-4 col-sm-3 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-sm-3 d-none d-sm-block text-left">@date($item->issued_at)</td>
|
||||
<td class="col-sm-3 d-none d-sm-block text-left">@date($item->due_at)</td>
|
||||
<td class="col-xs-4 col-sm-2"><span class="badge badge-pill badge-{{ $item->status_label }} my--2">{{ trans('documents.statuses.' . $item->status) }}</span></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer py-4 table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $bills, 'type' => 'bills'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('vendor_bills_content_end')
|
||||
|
||||
@stack('vendor_transactions_content_start')
|
||||
<div class="tab-pane fade" id="transactions-content" role="tabpanel" aria-labelledby="bills-tab">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover" id="tbl-transactions">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-xs-6 col-sm-2">{{ trans('general.date') }}</th>
|
||||
<th class="col-xs-6 col-sm-2 text-right">{{ trans('general.amount') }}</th>
|
||||
<th class="col-sm-4 d-none d-sm-block">{{ trans_choice('general.categories', 1) }}</th>
|
||||
<th class="col-sm-4 d-none d-sm-block">{{ trans_choice('general.accounts', 1) }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($transactions as $item)
|
||||
<tr class="row align-items-center border-top-1 tr-py">
|
||||
<td class="col-xs-6 col-sm-2">@date($item->paid_at)</td>
|
||||
<td class="col-xs-6 col-sm-2 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-sm-4 d-none d-sm-block">{{ $item->category->name }}</td>
|
||||
<td class="col-sm-4 d-none d-sm-block">{{ $item->account->name }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer py-4 table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $transactions, 'type' => 'transactions'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('vendor_transactions_content_end')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user