renamed income/expense
This commit is contained in:
195
resources/views/purchases/bills/create.blade.php
Normal file
195
resources/views/purchases/bills/create.blade.php
Normal file
@ -0,0 +1,195 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.bills', 1)]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'route' => 'bills.store',
|
||||
'id' => 'bill',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, config('general.vendors'), ['required' => 'required', 'change' => 'onChangeContact']) }}
|
||||
|
||||
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'change' => 'onChangeCurrency']) }}
|
||||
|
||||
{{ Form::dateGroup('billed_at', trans('bills.bill_date'), 'calendar', ['id' => 'billed_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
|
||||
|
||||
{{ Form::dateGroup('due_at', trans('bills.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
|
||||
|
||||
{{ Form::textGroup('bill_number', trans('bills.bill_number'), 'file') }}
|
||||
|
||||
{{ Form::textGroup('order_number', trans('bills.order_number'), 'shopping-cart',[]) }}
|
||||
|
||||
<div class="col-md-12 mb-4">
|
||||
{!! Form::label('items', trans_choice('general.items', 2), ['class' => 'form-control-label']) !!}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered" id="items">
|
||||
<thead class="thead-light">
|
||||
<tr class="row">
|
||||
@stack('actions_th_start')
|
||||
<th class="col-md-1 action-column border-right-0 border-bottom-0">{{ trans('general.actions') }}</th>
|
||||
@stack('actions_th_end')
|
||||
|
||||
@stack('name_th_start')
|
||||
<th class="col-md-3 text-left border-right-0 border-bottom-0">{{ trans('general.name') }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="col-md-2 text-center border-right-0 border-bottom-0">{{ trans('bills.quantity') }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans('bills.price') }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@stack('taxes_th_start')
|
||||
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans_choice('general.taxes', 1) }}</th>
|
||||
@stack('taxes_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="col-md-2 text-right border-bottom-0">{{ trans('bills.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="bill-item-rows">
|
||||
@include('purchases.bills.item')
|
||||
|
||||
@stack('add_item_td_start')
|
||||
<tr class="row" id="addItem">
|
||||
<td class="col-md-1 action-column border-right-0 border-bottom-0"><button type="button" @click="onAddItem" id="button-add-item" data-toggle="tooltip" title="{{ trans('general.add') }}" class="btn btn-icon btn-outline-success btn-lg" data-original-title="{{ trans('general.add') }}"><i class="fa fa-plus"></i></button></td>
|
||||
<td class="col-md-11 text-right border-bottom-0"></td>
|
||||
</tr>
|
||||
@stack('add_item_td_end')
|
||||
|
||||
@stack('sub_total_td_start')
|
||||
<tr class="row" id="tr-subtotal">
|
||||
<td class="col-md-10 text-right border-right-0 border-bottom-0">
|
||||
<strong>{{ trans('bills.sub_total') }}</strong>
|
||||
</td>
|
||||
<td class="col-md-2 text-right border-bottom-0 long-texts">
|
||||
<span id="sub-total" v-html="totals.sub">0</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('sub_total_td_end')
|
||||
|
||||
@stack('add_discount_td_start')
|
||||
<tr class="row" id="tr-discount">
|
||||
<td class="col-md-10 text-right border-right-0 border-bottom-0">
|
||||
<el-popover
|
||||
popper-class="p-0 h-0"
|
||||
placement="bottom"
|
||||
width="300"
|
||||
v-model="discount">
|
||||
<div class="card">
|
||||
<div class="discount card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-6">
|
||||
<div class="input-group input-group-merge">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" id="input-discount">
|
||||
<i class="fa fa-percent"></i>
|
||||
</span>
|
||||
</div>
|
||||
{!! Form::number('pre_discount', null, ['id' => 'pre-discount', 'class' => 'form-control text-right']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="discount-description">
|
||||
<strong>{{ trans('invoices.discount_desc') }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="discount card-footer">
|
||||
<div class="row text-center">
|
||||
<div class="col-md-12">
|
||||
<a href="javascript:void(0)" @click="discount = false" class="btn btn-icon btn-outline-secondary">
|
||||
<span class="btn-inner--icon"><i class="fas fa-times"></i></span>
|
||||
<span class="btn-inner--text">{{ trans('general.cancel') }}</span>
|
||||
</a>
|
||||
{!! Form::button('<span class="fa fa-save"></span> ' . trans('general.save'), ['type' => 'button', 'id' => 'save-discount', '@click' => 'onAddDiscount', 'class' => 'btn btn-success']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-link slot="reference" type="primary" v-if="!totals.discount_text">{{ trans('invoices.add_discount') }}</el-link>
|
||||
<el-link slot="reference" type="primary" v-if="totals.discount_text" v-html="totals.discount_text"></el-link>
|
||||
</el-popover>
|
||||
</td>
|
||||
<td class="col-md-2 text-right border-bottom-0">
|
||||
<span id="discount-total" v-html="totals.discount"></span>
|
||||
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
|
||||
</td>
|
||||
</tr>
|
||||
@stack('add_discount_td_end')
|
||||
|
||||
@stack('tax_total_td_start')
|
||||
<tr class="row" id="tr-tax">
|
||||
<td class="col-md-10 text-right border-right-0 border-bottom-0">
|
||||
<strong>{{ trans_choice('general.taxes', 1) }}</strong>
|
||||
</td>
|
||||
<td class="col-md-2 text-right border-bottom-0 long-texts">
|
||||
<span id="tax-total" v-html="totals.tax">0</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('tax_total_td_end')
|
||||
|
||||
@stack('grand_total_td_start')
|
||||
<tr class="row" id="tr-total">
|
||||
<td class="col-md-10 text-right border-right-0">
|
||||
<strong>{{ trans('bills.total') }}</strong>
|
||||
</td>
|
||||
<td class="col-md-2 text-right long-texts">
|
||||
<span id="grand-total" v-html="totals.total">0</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('grand_total_td_end')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category'), []) }}
|
||||
|
||||
{{ Form::recurring('create') }}
|
||||
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
|
||||
|
||||
{{ Form::hidden('contact_name', old('contact_name'), ['id' => 'contact_name', 'v-model' => 'form.contact_name']) }}
|
||||
{{ Form::hidden('contact_email', old('contact_email'), ['id' => 'contact_email', 'v-model' => 'form.contact_email']) }}
|
||||
{{ Form::hidden('contact_tax_number', old('contact_tax_number'), ['id' => 'contact_tax_number', 'v-model' => 'form.contact_tax_number']) }}
|
||||
{{ Form::hidden('contact_phone', old('contact_phone'), ['id' => 'contact_phone', 'v-model' => 'form.contact_phone']) }}
|
||||
{{ Form::hidden('contact_address', old('contact_address'), ['id' => 'contact_address', 'v-model' => 'form.contact_address']) }}
|
||||
{{ Form::hidden('currency_rate', old('currency_rate', 1), ['id' => 'currency_rate', 'v-model' => 'form.contact_rate']) }}
|
||||
{{ Form::hidden('bill_status_code', old('bill_status_code', 'draft'), ['id' => 'bill_status_code', 'v-model' => 'form.bill_status_code']) }}
|
||||
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('purchases/bills') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script type="text/javascript">
|
||||
var bill_items = false;
|
||||
</script>
|
||||
|
||||
<script src="{{ asset('public/js/purchases/bills.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
198
resources/views/purchases/bills/edit.blade.php
Normal file
198
resources/views/purchases/bills/edit.blade.php
Normal file
@ -0,0 +1,198 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.bills', 1)]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::model($bill, [
|
||||
'id' => 'bill',
|
||||
'method' => 'PATCH',
|
||||
'route' => ['bills.update', $bill->id],
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $bill->contact_id, ['required' => 'required', 'change' => 'onChangeContact']) }}
|
||||
|
||||
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange', $currencies, $bill->currency_code, ['required' => 'required', 'change' => 'onChangeCurrency']) }}
|
||||
|
||||
{{ Form::dateGroup('billed_at', trans('bills.bill_date'), 'calendar', ['id' => 'billed_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($bill->billed_at)->toDateString()) }}
|
||||
|
||||
{{ Form::dateGroup('due_at', trans('bills.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($bill->due_at)->toDateString()) }}
|
||||
|
||||
{{ Form::textGroup('bill_number', trans('bills.bill_number'), 'file-text-o') }}
|
||||
|
||||
{{ Form::textGroup('order_number', trans('bills.order_number'), 'shopping-cart',[]) }}
|
||||
|
||||
<div class="col-md-12 mb-4">
|
||||
{!! Form::label('items', trans_choice('general.items', 2), ['class' => 'control-label']) !!}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered" id="items">
|
||||
<thead class="thead-light">
|
||||
<tr class="row">
|
||||
@stack('actions_th_start')
|
||||
<th class="col-md-1 action-column border-right-0 border-bottom-0">{{ trans('general.actions') }}</th>
|
||||
@stack('actions_th_end')
|
||||
|
||||
@stack('name_th_start')
|
||||
<th class="col-md-3 text-left border-right-0 border-bottom-0">{{ trans('general.name') }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="col-md-2 text-center border-right-0 border-bottom-0">{{ trans('bills.quantity') }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans('bills.price') }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@stack('taxes_th_start')
|
||||
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans_choice('general.taxes', 1) }}</th>
|
||||
@stack('taxes_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="col-md-2 text-right border-bottom-0">{{ trans('bills.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@include('purchases.bills.item')
|
||||
|
||||
@stack('add_item_td_start')
|
||||
<tr class="row" id="addItem">
|
||||
<td class="col-md-1 action-column border-right-0 border-bottom-0"><button type="button" @click="onAddItem" id="button-add-item" data-toggle="tooltip" title="{{ trans('general.add') }}" class="btn btn-icon btn-outline-success btn-lg" data-original-title="{{ trans('general.add') }}"><i class="fa fa-plus"></i></button></td>
|
||||
<td class="col-md-11 text-right border-bottom-0"></td>
|
||||
</tr>
|
||||
@stack('add_item_td_end')
|
||||
|
||||
@stack('sub_total_td_start')
|
||||
<tr class="row" id="tr-subtotal">
|
||||
<td class="col-md-10 text-right border-right-0 border-bottom-0">
|
||||
<strong>{{ trans('bills.sub_total') }}</strong>
|
||||
</td>
|
||||
<td class="col-md-2 text-right border-bottom-0 long-texts">
|
||||
<span id="sub-total" v-html="totals.sub">0</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('sub_total_td_end')
|
||||
|
||||
@stack('add_discount_td_start')
|
||||
<tr class="row" id="tr-discount">
|
||||
<td class="col-md-10 text-right border-right-0 border-bottom-0">
|
||||
<el-popover
|
||||
popper-class="p-0 h-0"
|
||||
placement="bottom"
|
||||
width="300"
|
||||
v-model="discount">
|
||||
<div class="card">
|
||||
<div class="discount card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-6">
|
||||
<div class="input-group input-group-merge">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" id="input-discount">
|
||||
<i class="fa fa-percent"></i>
|
||||
</span>
|
||||
</div>
|
||||
{!! Form::number('pre_discount', null, ['id' => 'pre-discount', 'class' => 'form-control text-right']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="discount-description">
|
||||
<strong>{{ trans('invoices.discount_desc') }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="discount card-footer">
|
||||
<div class="row text-center">
|
||||
<div class="col-md-12">
|
||||
<a href="javascript:void(0)" @click="discount = false" class="btn btn-icon btn-outline-secondary">
|
||||
<span class="btn-inner--icon"><i class="fas fa-times"></i></span>
|
||||
<span class="btn-inner--text">{{ trans('general.cancel') }}</span>
|
||||
</a>
|
||||
{!! Form::button('<span class="fa fa-save"></span> ' . trans('general.save'), ['type' => 'button', 'id' => 'save-discount', '@click' => 'onAddDiscount', 'class' => 'btn btn-success']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-link slot="reference" type="primary" v-if="!totals.discount_text">{{ trans('invoices.add_discount') }}</el-link>
|
||||
<el-link slot="reference" type="primary" v-if="totals.discount_text" v-html="totals.discount_text"></el-link>
|
||||
</el-popover>
|
||||
</td>
|
||||
<td class="col-md-2 text-right border-bottom-0">
|
||||
<span id="discount-total" v-html="totals.discount"></span>
|
||||
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
|
||||
</td>
|
||||
</tr>
|
||||
@stack('add_discount_td_end')
|
||||
|
||||
@stack('tax_total_td_start')
|
||||
<tr class="row" id="tr-tax">
|
||||
<td class="col-md-10 text-right border-right-0 border-bottom-0">
|
||||
<strong>{{ trans_choice('general.taxes', 1) }}</strong>
|
||||
</td>
|
||||
<td class="col-md-2 text-right border-bottom-0 long-texts">
|
||||
<span id="tax-total" v-html="totals.tax">0</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('tax_total_td_end')
|
||||
|
||||
@stack('grand_total_td_start')
|
||||
<tr class="row" id="tr-total">
|
||||
<td class="col-md-10 text-right border-right-0">
|
||||
<strong>{{ trans('bills.total') }}</strong>
|
||||
</td>
|
||||
<td class="col-md-2 text-right long-texts">
|
||||
<span id="grand-total" v-html="totals.total">0</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('grand_total_td_end')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2)) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $bill->category_id) }}
|
||||
|
||||
{{ Form::recurring('edit', $bill) }}
|
||||
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
|
||||
|
||||
{{ Form::hidden('contact_name', old('contact_name'), ['id' => 'contact_name', 'v-model' => 'form.contact_name']) }}
|
||||
{{ Form::hidden('contact_email', old('contact_email'), ['id' => 'contact_email', 'v-model' => 'form.contact_email']) }}
|
||||
{{ Form::hidden('contact_tax_number', old('contact_tax_number'), ['id' => 'contact_tax_number', 'v-model' => 'form.contact_tax_number']) }}
|
||||
{{ Form::hidden('contact_phone', old('contact_phone'), ['id' => 'contact_phone', 'v-model' => 'form.contact_phone']) }}
|
||||
{{ Form::hidden('contact_address', old('contact_address'), ['id' => 'contact_address', 'v-model' => 'form.contact_address']) }}
|
||||
{{ Form::hidden('currency_rate', old('currency_rate', 1), ['id' => 'currency_rate', 'v-model' => 'form.contact_rate']) }}
|
||||
{{ Form::hidden('bill_status_code', old('bill_status_code', 'draft'), ['id' => 'bill_status_code', 'v-model' => 'form.bill_status_code']) }}
|
||||
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@permission('update-purchases-bills')
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('purchases/bills') }}
|
||||
</div>
|
||||
</div>
|
||||
@endpermission
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script type="text/javascript">
|
||||
var bill_items = {!! json_encode($bill->items()->select(['item_id', 'name', 'quantity', 'price', 'total', 'tax'])->get()) !!};
|
||||
</script>
|
||||
|
||||
<script src="{{ asset('public/js/purchases/bills.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
104
resources/views/purchases/bills/index.blade.php
Normal file
104
resources/views/purchases/bills/index.blade.php
Normal file
@ -0,0 +1,104 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans_choice('general.bills', 2))
|
||||
|
||||
@section('new_button')
|
||||
@permission('create-purchases-bills')
|
||||
<span><a href="{{ route('bills.create') }}" class="btn btn-success btn-sm header-button-top"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
<span><a href="{{ url('common/import/purchases/bills') }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload"></span> {{ trans('import.import') }}</a></span>
|
||||
@endpermission
|
||||
<span><a href="{{ route('bills.export', request()->input()) }}" class="btn btn-white btn-sm header-button-bottom"><span class="fa fa-download"></span> {{ trans('general.export') }}</a></span>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@if ($bills->count())
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
|
||||
{!! Form::open([
|
||||
'url' => 'purchases/bills',
|
||||
'role' => 'form',
|
||||
'method' => 'GET',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="row" v-if="!bulk_action.show">
|
||||
<div class="col-12 d-flex align-items-center">
|
||||
<span class="font-weight-400 d-none d-lg-block mr-2">{{ trans('general.search') }}:</span>
|
||||
<akaunting-search></akaunting-search>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::bulkActionRowGroup('general.bills', $bulk_actions, 'purchases/bills') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
|
||||
<th class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">@sortablelink('bill_number', trans_choice('general.numbers', 1), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
|
||||
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2">@sortablelink('contact_name', trans_choice('general.vendors', 1))</th>
|
||||
<th class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block text-right">@sortablelink('amount', trans('general.amount'))</th>
|
||||
<th class="col-lg-2 col-xl-2 d-none d-lg-block">@sortablelink('billed_at', trans('bills.bill_date'))</th>
|
||||
<th class="col-lg-2 col-xl-2 d-none d-lg-block">@sortablelink('due_at', trans('bills.due_date'))</th>
|
||||
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1">@sortablelink('bill_status_code', trans_choice('general.statuses', 1))</th>
|
||||
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($bills as $item)
|
||||
@php $paid = $item->paid; @endphp
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionGroup($item->id, $item->bill_number) }}</td>
|
||||
<td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block"><a class="col-aka text-success" href="{{ route('bills.show', $item->id) }}">{{ $item->bill_number }}</a></td>
|
||||
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2">{{ $item->contact_name }}</td>
|
||||
<td class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-lg-2 col-xl-2 d-none d-lg-block">@date($item->billed_at)</td>
|
||||
<td class="col-lg-2 col-xl-2 d-none d-lg-block">@date($item->due_at)</td>
|
||||
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1">
|
||||
<span class="badge badge-pill badge-{{ $item->status->label }}">{{ trans('bills.status.' . $item->status->code) }}</span>
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<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('bills.show', $item->id) }}">{{ trans('general.show') }}</a>
|
||||
@if (!$item->reconciled)
|
||||
<a class="dropdown-item" href="{{ route('bills.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
@endif
|
||||
<div class="dropdown-divider"></div>
|
||||
@permission('create-purchases-bills')
|
||||
<a class="dropdown-item" href="{{ route('bills.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
|
||||
@endpermission
|
||||
@permission('delete-purchases-bills')
|
||||
<div class="dropdown-divider"></div>
|
||||
@if (!$item->reconciled)
|
||||
{!! Form::deleteLink($item, 'purchases/bills') !!}
|
||||
@endif
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $bills])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
@include('partials.admin.empty_page', ['page' => 'bills', 'docs_path' => 'purchases/bills'])
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/purchases/bills.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
123
resources/views/purchases/bills/item.blade.php
Normal file
123
resources/views/purchases/bills/item.blade.php
Normal file
@ -0,0 +1,123 @@
|
||||
<tr class="row" v-for="(row, index) in form.items"
|
||||
:index="index">
|
||||
@stack('actions_td_start')
|
||||
<td class="col-md-1 action-column border-right-0 border-bottom-0">
|
||||
@stack('actions_button_start')
|
||||
<button type="button"
|
||||
@click="onDeleteItem(index)"
|
||||
data-toggle="tooltip"
|
||||
title="{{ trans('general.delete') }}"
|
||||
class="btn btn-icon btn-outline-danger btn-lg"><i class="fa fa-trash"></i>
|
||||
</button>
|
||||
@stack('actions_button_end')
|
||||
</td>
|
||||
@stack('actions_td_end')
|
||||
|
||||
@stack('name_td_start')
|
||||
<td class="col-md-3 border-right-0 border-bottom-0">
|
||||
@stack('name_input_start')
|
||||
<input class="form-control"
|
||||
data-item="name"
|
||||
required="required"
|
||||
name="items[][name]"
|
||||
v-model="row.name"
|
||||
@input="onGetItem($event, index)"
|
||||
type="text"
|
||||
autocomplete="off">
|
||||
<div class="dropdown-menu item-show dropdown-menu-center" ref="menu" :class="[{show: row.show}]">
|
||||
<div class="list-group list-group-flush">
|
||||
<a class="list-group-item list-group-item-action" v-for="(item, item_index) in items" @click="onSelectItem(item, index)">
|
||||
<div class="row align-items-center">
|
||||
<div class="col ml--2">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<div class="name" v-text="item.name"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<input name="items[][show]"
|
||||
value="false"
|
||||
v-model="row.show"
|
||||
data-item="show"
|
||||
type="hidden">
|
||||
<input name="items[][item_id]"
|
||||
v-model="row.item_id"
|
||||
data-item="item_id"
|
||||
type="hidden">
|
||||
{!! $errors->first('item.name', '<p class="help-block">:message</p>') !!}
|
||||
@stack('name_input_end')
|
||||
</td>
|
||||
@stack('name_td_end')
|
||||
|
||||
@stack('quantity_td_start')
|
||||
<td class="col-md-2 border-right-0 border-bottom-0">
|
||||
@stack('quantity_input_start')
|
||||
<input class="form-control text-center"
|
||||
autocomplete="off"
|
||||
required="required"
|
||||
data-item="quantity"
|
||||
v-model="row.quantity"
|
||||
@input="onCalculateTotal"
|
||||
name="item[][quantity]"
|
||||
type="text">
|
||||
{!! $errors->first('item.quantity', '<p class="help-block">:message</p>') !!}
|
||||
@stack('quantity_input_end')
|
||||
</td>
|
||||
@stack('quantity_td_end')
|
||||
|
||||
@stack('price_td_start')
|
||||
<td class="col-md-2 border-right-0 border-bottom-0">
|
||||
@stack('price_input_start')
|
||||
<input class="form-control text-right input-price"
|
||||
required="required"
|
||||
autocomplete="off"
|
||||
data-item="price"
|
||||
v-model.lazy="row.price"
|
||||
v-money="money"
|
||||
@input="onCalculateTotal"
|
||||
name="items[][price]"
|
||||
type="text">
|
||||
<input name="items[][currency]"
|
||||
data-item="currency"
|
||||
v-model="row.currency"
|
||||
@input="onCalculateTotal"
|
||||
type="hidden">
|
||||
{!! $errors->first('item.price', '<p class="help-block">:message</p>') !!}
|
||||
@stack('price_input_end')
|
||||
</td>
|
||||
@stack('price_td_end')
|
||||
|
||||
@stack('taxes_td_start')
|
||||
<td class="col-md-2 border-right-0 border-bottom-0">
|
||||
@stack('tax_id_input_start')
|
||||
{{ Form::multiSelectAddNewGroup('tax_id', '', '', $taxes, '', [
|
||||
'data-item' => 'tax_id',
|
||||
'v-model' => 'row.tax_id',
|
||||
'change' => 'onCalculateTotal',
|
||||
'class' => 'form-control'
|
||||
], 'mb-0 select-tax') }}
|
||||
@stack('tax_id_input_end')
|
||||
</td>
|
||||
@stack('taxes_td_end')
|
||||
|
||||
@stack('total_td_start')
|
||||
<td class="col-md-2 text-right total-column border-bottom-0 long-texts">
|
||||
<input name="item[][total]"
|
||||
data-item="total"
|
||||
v-model.lazy="row.total"
|
||||
v-money="money"
|
||||
type="hidden">
|
||||
@stack('total_input_start')
|
||||
@if (empty($item) || !isset($item->total))
|
||||
<span id="item-total" v-html="row.total">0</span>
|
||||
@else
|
||||
<span id="item-total" v-html="row.total">@money($item->total, $bill->currency_code, true)</span>
|
||||
@endif
|
||||
@stack('total_input_end')
|
||||
</td>
|
||||
@stack('total_td_end')
|
||||
</tr>
|
271
resources/views/purchases/bills/print.blade.php
Normal file
271
resources/views/purchases/bills/print.blade.php
Normal file
@ -0,0 +1,271 @@
|
||||
@extends('layouts.print')
|
||||
|
||||
@section('title', trans_choice('general.bills', 1) . ': ' . $bill->bill_number)
|
||||
|
||||
@section('content')
|
||||
<div class="mt-6">
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
@if (!empty($bill->contact->logo) && !empty($bill->contact->logo->id))
|
||||
<img src="{{ Storage::url($bill->contact->logo->id) }}" height="128" width="128" alt="{{ $bill->contact_name }}"/>
|
||||
@else
|
||||
<img src="{{ $logo }}" alt="{{ $bill->contact_name }}"/>
|
||||
@endif
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
{{ setting('company.name') }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{!! nl2br(setting('company.address')) !!}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@if (setting('company.tax_number'))
|
||||
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
|
||||
@endif
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@if (setting('company.phone'))
|
||||
{{ setting('company.phone') }}
|
||||
@endif
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{{ setting('company.email') }}
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
{{ trans('bills.bill_from') }}
|
||||
@stack('name_input_start')
|
||||
<strong class="d-block">{{ $bill->contact_name }}</strong><br>
|
||||
@stack('name_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('address_input_start')
|
||||
{!! nl2br($bill->contact_address) !!}
|
||||
@stack('address_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('tax_number_input_start')
|
||||
@if ($bill->contact_tax_number)
|
||||
{{ trans('general.tax_number') }}: {{ $bill->contact_tax_number }}
|
||||
@endif
|
||||
@stack('tax_number_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('phone_input_start')
|
||||
@if ($bill->contact_phone)
|
||||
{{ $bill->contact_phone }}
|
||||
@endif
|
||||
@stack('phone_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('email_start')
|
||||
{{ $bill->contact_email }}
|
||||
@stack('email_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
@stack('bill_number_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('bills.bill_number') }}:</th>
|
||||
<td class="text-right">{{ $bill->bill_number }}</td>
|
||||
</tr>
|
||||
@stack('bill_number_input_end')
|
||||
|
||||
@stack('order_number_input_start')
|
||||
@if ($bill->order_number)
|
||||
<tr>
|
||||
<th>{{ trans('bills.order_number') }}:</th>
|
||||
<td class="text-right">{{ $bill->order_number }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@stack('order_number_input_end')
|
||||
|
||||
@stack('billed_at_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('bills.bill_date') }}:</th>
|
||||
<td class="text-right">@date($bill->billed_at)</td>
|
||||
</tr>
|
||||
@stack('billed_at_input_end')
|
||||
|
||||
@stack('due_at_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('bills.payment_due') }}:</th>
|
||||
<td class="text-right">@date($bill->due_at)</td>
|
||||
</tr>
|
||||
@stack('due_at_input_end')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
@stack('actions_th_start')
|
||||
@stack('actions_th_end')
|
||||
|
||||
@stack('name_th_start')
|
||||
<th>{{ trans_choice('general.items', 1) }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="text-center">{{ trans('bills.quantity') }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="text-center pr-5">{{ trans('bills.price') }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@stack('taxes_th_start')
|
||||
@stack('taxes_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="text-right">{{ trans('bills.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($bill->items as $item)
|
||||
<tr>
|
||||
@stack('name_td_start')
|
||||
<td>{{ $item->name }}</td>
|
||||
@stack('name_td_end')
|
||||
|
||||
@stack('quantity_td_start')
|
||||
<td class="text-center">{{ $item->quantity }}</td>
|
||||
@stack('quantity_td_end')
|
||||
|
||||
@stack('price_td_start')
|
||||
<td class="text-center pr-5">@money($item->price, $bill->currency_code, true)</td>
|
||||
@stack('price_td_end')
|
||||
|
||||
@stack('total_td_start')
|
||||
<td class="text-right">@money($item->total, $bill->currency_code, true)</td>
|
||||
@stack('total_td_end')
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<div class="table-responsive">
|
||||
@stack('notes_input_start')
|
||||
@if ($bill->notes)
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
{{ trans_choice('general.notes', 2) }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{{ $bill->notes }}
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
@stack('notes_input_end')
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
@foreach ($bill->totals as $total)
|
||||
@if ($total->code != 'total')
|
||||
@stack($total->code . '_td_start')
|
||||
<tr>
|
||||
<th>
|
||||
{{ trans($total->title) }}:
|
||||
</th>
|
||||
<td class="text-right">
|
||||
@money($total->amount, $bill->currency_code, true)
|
||||
</td>
|
||||
</tr>
|
||||
@stack($total->code . '_td_end')
|
||||
@else
|
||||
@if ($bill->paid)
|
||||
<tr class="text-success">
|
||||
<th>
|
||||
{{ trans('invoices.paid') }}:
|
||||
</th>
|
||||
<td class="text-right">
|
||||
- @money($bill->paid, $bill->currency_code, true)
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@stack('grand_total_td_start')
|
||||
<tr>
|
||||
<th>
|
||||
{{ trans($total->name) }}:
|
||||
</th>
|
||||
<td class="text-right">
|
||||
@money($total->amount - $bill->paid, $bill->currency_code, true)
|
||||
</td>
|
||||
</tr>
|
||||
@stack('grand_total_td_end')
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
607
resources/views/purchases/bills/show.blade.php
Normal file
607
resources/views/purchases/bills/show.blade.php
Normal file
@ -0,0 +1,607 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans_choice('general.bills', 1) . ': ' . $bill->bill_number)
|
||||
|
||||
@section('content')
|
||||
@stack('recurring_message_start')
|
||||
@if (($recurring = $bill->recurring) && ($next = $recurring->next()))
|
||||
<div class="callout callout-info">
|
||||
@stack('recurring_message_head_start')
|
||||
<h4>{{ trans('recurring.recurring') }}</h4>
|
||||
@stack('recurring_message_head_end')
|
||||
|
||||
@stack('recurring_message_body_start')
|
||||
<p>{{ trans('recurring.message', [
|
||||
'type' => mb_strtolower(trans_choice('general.bills', 1)),
|
||||
'date' => $next->format($date_format)
|
||||
]) }}
|
||||
</p>
|
||||
@stack('recurring_message_body_end')
|
||||
</div>
|
||||
@endif
|
||||
@stack('recurring_message_end')
|
||||
|
||||
@stack('status_message_start')
|
||||
@if ($bill->status->code == 'draft')
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
|
||||
<div class="alert alert-warning fade show" role="alert">
|
||||
@stack('status_message_body_start')
|
||||
<span class="alert-text">
|
||||
<strong>{!! trans('bills.messages.draft') !!}</strong>
|
||||
</span>
|
||||
@stack('status_message_body_end')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@stack('status_message_end')
|
||||
|
||||
@stack('timeline_start')
|
||||
@if ($bill->status->code != 'paid')
|
||||
@stack('timeline_body_start')
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="timeline timeline-one-side" data-timeline-content="axis" data-timeline-axis-style="dashed">
|
||||
@stack('timeline_body_create_bill_start')
|
||||
<div class="timeline-block">
|
||||
<span class="timeline-step badge-info">
|
||||
<i class="fas fa-plus"></i>
|
||||
</span>
|
||||
<div class="timeline-content">
|
||||
@stack('timeline_body_create_bill_head_start')
|
||||
<h2 class="font-weight-500">{{ trans('bills.create_bill') }}</h2>
|
||||
@stack('timeline_body_create_bill_head_end')
|
||||
|
||||
@stack('timeline_body_create_bill_body_start')
|
||||
@stack('timeline_body_create_bill_body_message_start')
|
||||
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
|
||||
<small>{{ trans('bills.messages.status.created', ['date' => Date::parse($bill->created_at)->format($date_format)]) }}</small>
|
||||
@stack('timeline_body_create_bill_body_message_end')
|
||||
|
||||
<div class="mt-3">
|
||||
@stack('timeline_body_create_bill_body_button_edit_start')
|
||||
<a href="{{ url('purchases/bills/' . $bill->id . '/edit') }}" class="btn btn-info btn-sm btn-alone">
|
||||
{{ trans('general.edit') }}
|
||||
</a>
|
||||
@stack('timeline_body_create_bill_body_button_edit_end')
|
||||
</div>
|
||||
@stack('timeline_body_create_bill_body_end')
|
||||
</div>
|
||||
</div>
|
||||
@stack('timeline_body_create_bill_end')
|
||||
|
||||
@stack('timeline_body_receive_bill_start')
|
||||
<div class="timeline-block">
|
||||
<span class="timeline-step badge-warning">
|
||||
<i class="far fa-envelope"></i>
|
||||
</span>
|
||||
<div class="timeline-content">
|
||||
@stack('timeline_body_receive_bill_head_start')
|
||||
<h2 class="font-weight-500">{{ trans('bills.receive_bill') }}</h2>
|
||||
@stack('timeline_body_receive_bill_head_end')
|
||||
|
||||
@stack('timeline_body_receive_bill_body_start')
|
||||
@if ($bill->status->code == 'draft')
|
||||
@stack('timeline_body_receive_bill_body_message_start')
|
||||
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
|
||||
<small>{{ trans('bills.messages.status.receive.draft') }}</small>
|
||||
@stack('timeline_body_receive_bill_body_message_end')
|
||||
|
||||
<div class="mt-3">
|
||||
@stack('timeline_body_receive_bill_body_button_sent_start')
|
||||
@permission('update-purchases-bills')
|
||||
<a href="{{ url('purchases/bills/' . $bill->id . '/received') }}" class="btn btn-warning btn-sm btn-alone">{{ trans('bills.mark_received') }}</a>
|
||||
@endpermission
|
||||
@stack('timeline_body_receive_bill_body_button_sent_end')
|
||||
</div>
|
||||
@else
|
||||
@stack('timeline_body_receive_bill_body_message_start')
|
||||
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
|
||||
<small>{{ trans('bills.messages.status.receive.received', ['date' => Date::parse($bill->created_at)->format($date_format)]) }}</small>
|
||||
@stack('timeline_body_receive_bill_body_message_end')
|
||||
@endif
|
||||
@stack('timeline_body_receive_bill_body_end')
|
||||
</div>
|
||||
</div>
|
||||
@stack('timeline_body_receive_bill_end')
|
||||
|
||||
@stack('timeline_body_make_payment_start')
|
||||
<div class="timeline-block">
|
||||
<span class="timeline-step badge-success">
|
||||
<i class="far fa-money-bill-alt"></i>
|
||||
</span>
|
||||
|
||||
<div class="timeline-content">
|
||||
@stack('timeline_body_make_payment_head_start')
|
||||
<h2 class="font-weight-500">{{ trans('bills.make_payment') }}</h2>
|
||||
@stack('timeline_body_make_payment_head_end')
|
||||
|
||||
@stack('timeline_body_make_payment_body_start')
|
||||
@stack('timeline_body_get_paid_body_message_start')
|
||||
@if($bill->status->code != 'paid' && empty($bill->transactions->count()))
|
||||
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
|
||||
<small>{{ trans('bills.messages.status.paid.await') }}</small>
|
||||
@else
|
||||
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
|
||||
<small>{{ trans('general.partially_paid') }}</small>
|
||||
@endif
|
||||
@stack('timeline_body_make_payment_body_message_end')
|
||||
|
||||
<div class="mt-3">
|
||||
@stack('timeline_body_make_payment_body_button_payment_start')
|
||||
@if(empty($bill->transactions->count()) || (!empty($bill->transactions->count()) && $bill->paid != $bill->amount))
|
||||
<button @click="onPayment" id="button-payment" class="btn btn-success btn-sm header-button-bottom">{{ trans('bills.add_payment') }}</button>
|
||||
@endif
|
||||
@stack('timeline_body_make_payment_body_button_payment_end')
|
||||
</div>
|
||||
@stack('timeline_body_make_payment_body_end')
|
||||
</div>
|
||||
</div>
|
||||
@stack('timeline_body_make_payment_end')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('timeline_body_end')
|
||||
@endif
|
||||
@stack('timeline_end')
|
||||
|
||||
@stack('bill_start')
|
||||
<div class="card">
|
||||
@stack('bill_status_start')
|
||||
<div class="card-header status-{{ $bill->status->label }}">
|
||||
<h3 class="text-white mb-0 float-right">{{ trans('bills.status.' . $bill->status->code) }}</h3>
|
||||
</div>
|
||||
@stack('bill_status_end')
|
||||
|
||||
<div class="card-body">
|
||||
@stack('bill_header_start')
|
||||
<div class="row mx--4">
|
||||
<div class="col-md-7 border-bottom-1">
|
||||
<div class="table-responsive mt-2">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
@if (!empty($bill->contact->logo) && !empty($bill->contact->logo->id))
|
||||
<img src="{{ Storage::url($bill->contact->logo->id) }}" height="128" width="128" alt="{{ $bill->contact_name }}"/>
|
||||
@else
|
||||
<img src="{{ $logo }}" alt="{{ $bill->contact_name }}"/>
|
||||
@endif
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 border-bottom-1">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
{{ setting('company.name') }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{!! nl2br(setting('company.address')) !!}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@if (setting('company.tax_number'))
|
||||
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
|
||||
@endif
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@if (setting('company.phone'))
|
||||
{{ setting('company.phone') }}
|
||||
@endif
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{{ setting('company.email') }}
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('bill_header_end')
|
||||
|
||||
@stack('bill_information_start')
|
||||
<div class="row">
|
||||
<div class="col-md-7 long-texts">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
{{ trans('bills.bill_from') }}
|
||||
@stack('name_input_start')
|
||||
<strong class="d-block">{{ $bill->contact_name }}</strong>
|
||||
@stack('name_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('address_input_start')
|
||||
{!! nl2br($bill->contact_address) !!}
|
||||
@stack('address_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('tax_number_input_start')
|
||||
@if ($bill->contact_tax_number)
|
||||
{{ trans('general.tax_number') }}: {{ $bill->contact_tax_number }}
|
||||
@endif
|
||||
@stack('tax_number_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('phone_input_start')
|
||||
@if ($bill->contact_phone)
|
||||
{{ $bill->contact_phone }}
|
||||
@endif
|
||||
@stack('phone_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('email_start')
|
||||
{{ $bill->contact_email }}
|
||||
@stack('email_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 long-texts">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
@stack('bill_number_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('bills.bill_number') }}:</th>
|
||||
<td class="text-right">{{ $bill->bill_number }}</td>
|
||||
</tr>
|
||||
@stack('bill_number_input_end')
|
||||
|
||||
@stack('order_number_input_start')
|
||||
@if ($bill->order_number)
|
||||
<tr>
|
||||
<th>{{ trans('bills.order_number') }}:</th>
|
||||
<td class="text-right">{{ $bill->order_number }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@stack('order_number_input_end')
|
||||
|
||||
@stack('billed_at_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('bills.bill_date') }}:</th>
|
||||
<td class="text-right">@date($bill->billed_at)</td>
|
||||
</tr>
|
||||
@stack('billed_at_input_end')
|
||||
|
||||
@stack('due_at_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('bills.payment_due') }}:</th>
|
||||
<td class="text-right">@date($bill->due_at)</td>
|
||||
</tr>
|
||||
@stack('due_at_input_end')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('bill_information_end')
|
||||
|
||||
@stack('bill_item_start')
|
||||
<div class="row show-table">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
<tr class="row">
|
||||
@stack('name_th_start')
|
||||
<th class="col-xs-4 col-sm-3 pl-5">{{ trans_choice('general.items', 1) }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="col-xs-4 col-sm-3 text-center">{{ trans('bills.quantity') }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="col-sm-3 text-center d-none d-sm-block pl-5">{{ trans('bills.price') }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="col-xs-4 col-sm-3 text-right pr-5">{{ trans('bills.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
@foreach($bill->items as $item)
|
||||
<tr class="row">
|
||||
@stack('name_td_start')
|
||||
<td class="col-xs-4 col-sm-3 pl-5">{{ $item->name }}</td>
|
||||
@stack('name_td_end')
|
||||
|
||||
@stack('quantity_td_start')
|
||||
<td class="col-xs-4 col-sm-3 text-center">{{ $item->quantity }}</td>
|
||||
@stack('quantity_td_end')
|
||||
|
||||
@stack('price_td_start')
|
||||
<td class="col-sm-3 text-center d-none d-sm-block pl-8">@money($item->price, $bill->currency_code, true)</td>
|
||||
@stack('price_td_end')
|
||||
|
||||
@stack('total_td_start')
|
||||
<td class="col-xs-4 col-sm-3 text-right pr-5">@money($item->total, $bill->currency_code, true)</td>
|
||||
@stack('total_td_end')
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('bill_item_end')
|
||||
|
||||
@stack('bill_total_start')
|
||||
<div class="row mt-5">
|
||||
<div class="col-md-7">
|
||||
@stack('notes_input_start')
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
@if ($bill->notes)
|
||||
<tr>
|
||||
<th>
|
||||
<p class="form-control-label">{{ trans_choice('general.notes', 2) }}:</p>
|
||||
<p class="form-control text-muted long-texts">{{ $bill->notes }}</p>
|
||||
</th>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@stack('notes_input_end')
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
@foreach ($bill->totals as $total)
|
||||
@if ($total->code != 'total')
|
||||
@stack($total->code . '_td_start')
|
||||
<tr>
|
||||
<th>{{ trans($total->title) }}:</th>
|
||||
<td class="text-right">@money($total->amount, $bill->currency_code, true)</td>
|
||||
</tr>
|
||||
@stack($total->code . '_td_end')
|
||||
@else
|
||||
@if ($bill->paid)
|
||||
<tr class="text-success">
|
||||
<th>{{ trans('bills.paid') }}:</th>
|
||||
<td class="text-right">- @money($bill->paid, $bill->currency_code, true)</td>
|
||||
</tr>
|
||||
@endif
|
||||
@stack('grand_total_td_start')
|
||||
<tr>
|
||||
<th>{{ trans($total->name) }}:</th>
|
||||
<td class="text-right">@money($total->amount - $bill->paid, $bill->currency_code, true)</td>
|
||||
</tr>
|
||||
@stack('grand_total_td_end')
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('bill_total_end')
|
||||
</div>
|
||||
|
||||
@stack('box_footer_start')
|
||||
<div class="card-footer">
|
||||
<div class="float-right">
|
||||
@stack('button_edit_start')
|
||||
@if(!$bill->reconciled)
|
||||
<a href="{{ route('bills.edit', $bill->id) }}" class="btn btn-info header-button-top">
|
||||
<i class="fas fa-edit"></i> {{ trans('general.edit') }}
|
||||
</a>
|
||||
@endif
|
||||
@stack('button_edit_end')
|
||||
|
||||
@stack('button_print_start')
|
||||
<a href="{{ route('bills.print', $bill->id) }}" target="_blank" class="btn btn-success header-button-top">
|
||||
<i class="fa fa-print"></i> {{ trans('general.print') }}
|
||||
</a>
|
||||
@stack('button_print_end')
|
||||
|
||||
@stack('button_group_start')
|
||||
<div class="dropup">
|
||||
<button type="button" class="btn btn-primary header-button-top" data-toggle="dropdown" aria-expanded="false"><i class="fa fa-chevron-up"></i> {{ trans('general.more_actions') }}</button>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
@stack('button_pay_start')
|
||||
@if($bill->status->code != 'paid')
|
||||
@if(empty($bill->paid) || ($bill->paid != $bill->amount))
|
||||
<a class="dropdown-item" href="#" id="button-payment">{{ trans('bills.add_payment') }}</a>
|
||||
@endif
|
||||
@permission('update-purchases-bills')
|
||||
@if($bill->bill_status_code == 'draft')
|
||||
<a class="dropdown-item" href="{{ route('bills.received', $bill->id) }}">{{ trans('bills.mark_received') }}</a></a>
|
||||
@else
|
||||
<button type="button" class="dropdown-item" disabled="disabled">{{ trans('bills.mark_received') }}</button>
|
||||
@endif
|
||||
@endpermission
|
||||
<div class="dropdown-divider"></div>
|
||||
@endif
|
||||
@stack('button_pay_end')
|
||||
|
||||
@stack('button_pdf_start')
|
||||
<a class="dropdown-item" href="{{ route('bills.pdf', $bill->id) }}">{{ trans('bills.download_pdf') }}</a>
|
||||
@stack('button_pdf_end')
|
||||
|
||||
@stack('button_delete_start')
|
||||
@permission('delete-purchases-bills')
|
||||
@if(!$bill->reconciled)
|
||||
{!! Form::deleteLink($bill, 'purchases/bills') !!}
|
||||
@endif
|
||||
@endpermission
|
||||
@stack('button_delete_end')
|
||||
</div>
|
||||
</div>
|
||||
@stack('button_group_end')
|
||||
|
||||
@if($bill->attachment)
|
||||
@php $file = $bill->attachment; @endphp
|
||||
@include('partials.media.file')
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@stack('box_footer_end')
|
||||
</div>
|
||||
@stack('bill_end')
|
||||
|
||||
@stack('row_footer_start')
|
||||
<div class="row">
|
||||
@stack('row_footer_history_start')
|
||||
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
||||
<div class="accordion">
|
||||
<div class="card">
|
||||
<div class="card-header" id="headingOne" data-toggle="collapse" data-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
|
||||
<h4 class="mb-0">{{ trans('bills.histories') }}</h4>
|
||||
</div>
|
||||
<div id="collapseOne" class="collapse hide" aria-labelledby="headingOne">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-xs-4 col-sm-4">{{ trans('general.date') }}</th>
|
||||
<th class="col-xs-4 col-sm-4 text-center">{{ trans_choice('general.statuses', 1) }}</th>
|
||||
<th class="col-xs-4 col-sm-4 text-left long-texts">{{ trans('general.description') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($bill->histories as $history)
|
||||
<tr class="row align-items-center">
|
||||
<td class="col-xs-4 col-sm-4">@date($history->created_at)</td>
|
||||
<td class="col-xs-4 col-sm-4 text-center">{{ $history->status->name }}</td>
|
||||
<td class="col-xs-4 col-sm-4 text-left long-texts">{{ $history->description }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('row_footer_history_end')
|
||||
|
||||
@stack('row_footer_transaction_start')
|
||||
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
||||
<div class="accordion">
|
||||
<div class="card">
|
||||
<div class="card-header" id="headingTwo" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
|
||||
<h4 class="mb-0">{{ trans_choice('general.transactions', 2) }}</h4>
|
||||
</div>
|
||||
<div id="collapseTwo" class="collapse hide" aria-labelledby="headingTwo">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-xs-4 col-sm-3">{{ trans('general.date') }}</th>
|
||||
<th class="col-xs-4 col-sm-3">{{ trans('general.amount') }}</th>
|
||||
<th class="col-sm-3 d-none d-sm-block">{{ trans_choice('general.accounts', 1) }}</th>
|
||||
<th class="col-xs-4 col-sm-3">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ($bill->transactions->count())
|
||||
@foreach($bill->transactions as $transaction)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-xs-4 col-sm-3">@date($item->paid_at)</td>
|
||||
<td class="col-xs-4 col-sm-3">@money($transaction->amount, $transaction->currency_code, true)</td>
|
||||
<td class="col-sm-3 d-none d-sm-block">{{ $transaction->account->name }}</td>
|
||||
<td class="col-xs-4 col-sm-3">
|
||||
@if ($transaction->reconciled)
|
||||
<button type="button" class="btn btn-secondary btn-sm">
|
||||
<i class="fa fa-check"></i> {{ trans('reconciliations.reconciled') }}
|
||||
</button>
|
||||
@else
|
||||
{!! Form::open([
|
||||
'id' => 'bill-transaction-' . $transaction->id,
|
||||
'method' => 'DELETE',
|
||||
'route' => ['transactions.destroy', $transaction->id],
|
||||
'style' => 'display:inline'
|
||||
]) !!}
|
||||
{!! Form::button('<i class="fa fa-trash-o" aria-hidden="true"></i> ' . trans('general.delete'), array(
|
||||
'type' => 'button',
|
||||
'class' => 'btn btn-danger btn-sm',
|
||||
'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') . '")'
|
||||
)) !!}
|
||||
{!! Form::close() !!}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="text-muted" id="datatable-basic_info" role="status" aria-live="polite">
|
||||
{{ trans('general.no_records') }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('row_footer_transaction_end')
|
||||
</div>
|
||||
@stack('row_footer_end')
|
||||
@endsection
|
||||
|
||||
@push('content_content_end')
|
||||
<akaunting-modal
|
||||
:show="payment.modal"
|
||||
@cancel="payment.modal = false"
|
||||
:title="'{{ trans('general.title.new', ['type' => trans_choice('general.payments', 1)]) }}'"
|
||||
:message="payment.html"
|
||||
:button_cancel="'{{ trans('general.button.save') }}'"
|
||||
:button_delete="'{{ trans('general.button.cancel') }}'">
|
||||
<template #modal-body>
|
||||
@include('modals.bills.payment')
|
||||
</template>
|
||||
|
||||
<template #card-footer>
|
||||
<div class="float-right">
|
||||
<button type="button" class="btn btn-outline-secondary" @click="closePayment">
|
||||
<span>{{ trans('general.cancel') }}</span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-success button-submit" @click="addPayment">
|
||||
<div class="aka-loader d-none"></div>
|
||||
<span>{{ trans('general.confirm') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
</akaunting-modal>
|
||||
@endpush
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/purchases/bills.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
60
resources/views/purchases/payments/create.blade.php
Normal file
60
resources/views/purchases/payments/create.blade.php
Normal file
@ -0,0 +1,60 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.payments', 1)]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'route' => 'payments.store',
|
||||
'id' => 'payment',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button needs-validation',
|
||||
'novalidate' => 'true'
|
||||
]) !!}
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
|
||||
|
||||
{!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
|
||||
{!! Form::hidden('currency_rate', '1', ['id' => 'currency_rate']) !!}
|
||||
|
||||
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency], 0) }}
|
||||
|
||||
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'change' => 'onChangeAccount']) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, setting('default.vendor'), []) }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category'), ['required' => 'required']) }}
|
||||
|
||||
{{ Form::recurring('create') }}
|
||||
|
||||
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('default.payment_method')) }}
|
||||
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
|
||||
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
|
||||
|
||||
{{ Form::selectGroup('document_id', trans_choice('general.bills', 1), 'file-invoice', [], null, ['disabled']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('purchases/payments') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::hidden('type', 'expense') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/purchases/payments.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
76
resources/views/purchases/payments/edit.blade.php
Normal file
76
resources/views/purchases/payments/edit.blade.php
Normal file
@ -0,0 +1,76 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.payments', 1)]))
|
||||
|
||||
@section('content')
|
||||
@if (($recurring = $payment->recurring) && ($next = $recurring->next()))
|
||||
<div class="callout callout-info">
|
||||
<h4>{{ trans('recurring.recurring') }}</h4>
|
||||
|
||||
<p>{{ trans('recurring.message', [
|
||||
'type' => mb_strtolower(trans_choice('general.payments', 1)),
|
||||
'date' => $next->format($date_format)
|
||||
]) }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card">
|
||||
{!! Form::model($payment, [
|
||||
'method' => 'PATCH',
|
||||
'files' => true,
|
||||
'route' => ['payments.update', $payment->id],
|
||||
'role' => 'form',
|
||||
'id' => 'payment',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => 'true'
|
||||
]) !!}
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::dateGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($payment->paid_at)->toDateString()) }}
|
||||
|
||||
{!! Form::hidden('currency_code', $payment->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
|
||||
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
|
||||
|
||||
{{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency], $payment->amount) }}
|
||||
|
||||
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $payment->account_id, ['required' => 'required', 'change' => 'onChangeAccount']) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $payment->contact_id, []) }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $payment->category_id, ['required' => 'required']) }}
|
||||
|
||||
{{ Form::recurring('edit', $payment) }}
|
||||
|
||||
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, $payment->payment_method) }}
|
||||
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }}
|
||||
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
|
||||
|
||||
@if ($payment->bill)
|
||||
{{ Form::textGroup('document_id', trans_choice('general.bills', 1), 'file-invoice', ['disabled'], $payment->bill->bill_number) }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@permission('update-purchases-payments')
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('purchases/payments') }}
|
||||
</div>
|
||||
</div>
|
||||
@endpermission
|
||||
{{ Form::hidden('type', 'expense') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/purchases/payments.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
111
resources/views/purchases/payments/index.blade.php
Normal file
111
resources/views/purchases/payments/index.blade.php
Normal file
@ -0,0 +1,111 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans_choice('general.payments', 2))
|
||||
|
||||
@section('new_button')
|
||||
@permission('create-purchases-payments')
|
||||
<span><a href="{{ route('payments.create') }}" class="btn btn-success btn-sm header-button-top"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
<span><a href="{{ url('common/import/purchases/payments') }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload"></span> {{ trans('import.import') }}</a></span>
|
||||
@endpermission
|
||||
<span><a href="{{ route('payments.export', request()->input()) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-download"></span> {{ trans('general.export') }}</a></span>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@if ($payments->count())
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
|
||||
{!! Form::open([
|
||||
'url' => 'purchases/payments',
|
||||
'role' => 'form',
|
||||
'method' => 'GET',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="row" v-if="!bulk_action.show">
|
||||
<div class="col-12 d-flex align-items-center">
|
||||
<span class="font-weight-400 d-none d-lg-block mr-2">{{ trans('general.search') }}:</span>
|
||||
<akaunting-search></akaunting-search>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::bulkActionRowGroup('general.payments', $bulk_actions, 'purchases/payments') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
|
||||
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-3">@sortablelink('paid_at', trans('general.date'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
|
||||
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-1 text-right">@sortablelink('amount', trans('general.amount'))</th>
|
||||
<th class="col-md-2 col-lg-2 col-xl-3 d-none d-md-block">@sortablelink('contact.name', trans_choice('general.vendors', 1))</th>
|
||||
<th class="col-lg-2 col-xl-2 d-none d-lg-block">@sortablelink('category.name', trans_choice('general.categories', 1))</th>
|
||||
<th class="col-lg-2 col-xl-1 d-none d-lg-block">@sortablelink('account.name', trans_choice('general.accounts', 1))</th>
|
||||
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center"><a>{{ trans('general.actions') }}</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($payments as $item)
|
||||
@php $is_transfer = ($item->category && ($item->category->id == $transfer_cat_id)); @endphp
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-sm-2 col-md-2 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionGroup($item->id, $item->contact->name) }}</td>
|
||||
@if ($item->reconciled)
|
||||
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-3">@date($item->paid_at)</td>
|
||||
@else
|
||||
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-3"><a class="col-aka text-success " href="{{ route('payments.edit', $item->id) }}">@date($item->paid_at)</a></td>
|
||||
@endif
|
||||
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-1 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-md-2 col-lg-2 col-xl-3 d-none d-md-block">{{ !empty($item->contact->name) ? $item->contact->name : trans('general.na') }}</td>
|
||||
<td class="col-lg-2 col-xl-2 d-none d-lg-block">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
|
||||
<td class="col-lg-2 col-xl-1 d-none d-lg-block">{{ $item->account ? $item->account->name : trans('general.na') }}</td>
|
||||
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">
|
||||
@if (!$is_transfer)
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-h text-muted"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
|
||||
@if (!$item->reconciled)
|
||||
<a class="dropdown-item" href="{{ route('payments.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@endif
|
||||
@permission('create-purchases-payments')
|
||||
<a class="dropdown-item" href="{{ route('payments.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
|
||||
@endpermission
|
||||
@permission('delete-purchases-payments')
|
||||
@if (!$item->reconciled)
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::deleteLink($item, 'purchases/payments') !!}
|
||||
@endif
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-white btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="tooltip" aria-haspopup="true" aria-expanded="false" title="This Transfer, If you want to action redirect">
|
||||
<i class="fa fa-exchange-alt text-muted"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $payments])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
@include('partials.admin.empty_page', ['page' => 'payments', 'docs_path' => 'purchases/payments'])
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/purchases/payments.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
55
resources/views/purchases/vendors/create.blade.php
vendored
Normal file
55
resources/views/purchases/vendors/create.blade.php
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.vendors', 1)]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'route' => 'vendors.store',
|
||||
'id' => 'vendor',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button needs-validation',
|
||||
'novalidate' => 'true'
|
||||
]) !!}
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'user') }}
|
||||
|
||||
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
|
||||
|
||||
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
|
||||
|
||||
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency')) }}
|
||||
|
||||
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
|
||||
|
||||
{{ Form::textGroup('website', trans('general.website'), 'globe', []) }}
|
||||
|
||||
{{ Form::textareaGroup('address', trans('general.address')) }}
|
||||
|
||||
{{ Form::fileGroup('logo', trans_choice('general.pictures', 1)) }}
|
||||
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('purchases/vendors') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::hidden('type', 'vendor') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/purchases/vendors.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
58
resources/views/purchases/vendors/edit.blade.php
vendored
Normal file
58
resources/views/purchases/vendors/edit.blade.php
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.vendors', 1)]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::model($vendor, [
|
||||
'id' => 'vendor',
|
||||
'method' => 'PATCH',
|
||||
'route' => ['vendors.update', $vendor->id],
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'class' => 'form-loading-button',
|
||||
'novalidate' => true
|
||||
]) !!}
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'user') }}
|
||||
|
||||
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
|
||||
|
||||
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
|
||||
|
||||
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $vendor->currency_code) }}
|
||||
|
||||
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
|
||||
|
||||
{{ Form::textGroup('website', trans('general.website'), 'globe',[]) }}
|
||||
|
||||
{{ Form::textareaGroup('address', trans('general.address')) }}
|
||||
|
||||
{{ Form::fileGroup('logo', trans_choice('general.logos', 1)) }}
|
||||
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), $vendor->enabled) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@permission('update-purchases-vendors')
|
||||
<div class="card-footer">
|
||||
<div class="float-right">
|
||||
{{ Form::saveButtons('purchases/vendors') }}
|
||||
</div>
|
||||
</div>
|
||||
@endpermission
|
||||
|
||||
{{ Form::hidden('type', 'vendor') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/purchases/vendors.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
115
resources/views/purchases/vendors/index.blade.php
vendored
Normal file
115
resources/views/purchases/vendors/index.blade.php
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans_choice('general.vendors', 2))
|
||||
|
||||
@section('new_button')
|
||||
@permission('create-purchases-vendors')
|
||||
<span><a href="{{ route('vendors.create') }}" class="btn btn-success btn-sm header-button-top"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
<span><a href="{{ url('common/import/purchases/vendors') }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-upload"></span> {{ trans('import.import') }}</a></span>
|
||||
@endpermission
|
||||
<span><a href="{{ route('vendors.export', request()->input()) }}" class="btn btn-white btn-sm header-button-top"><span class="fa fa-download"></span> {{ trans('general.export') }}</a></span>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@if ($vendors->count())
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
|
||||
{!! Form::open([
|
||||
'url' => 'purchases/vendors',
|
||||
'role' => 'form',
|
||||
'method' => 'GET',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="row" v-if="!bulk_action.show">
|
||||
<div class="col-12 d-flex align-items-center">
|
||||
<span class="font-weight-400 d-none d-lg-block mr-2">{{ trans('general.search') }}:</span>
|
||||
<akaunting-search></akaunting-search>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::bulkActionRowGroup('general.vendors', $bulk_actions, 'purchases/vendors') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">{{ Form::bulkActionAllGroup() }}</th>
|
||||
<th class="col-xs-4 col-sm-3 col-md-3 col-lg-3 col-xl-3">@sortablelink('name', trans('general.name'), ['filter' => 'active, visible'], ['class' => 'col-aka', 'rel' => 'nofollow'])</th>
|
||||
<th class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block">@sortablelink('email', trans('general.email'))</th>
|
||||
<th class="col-sm-3 col-md-2 col-lg-2 col-xl-2 d-none d-sm-block">@sortablelink('phone', trans('general.phone'))</th>
|
||||
<th class="col-lg-2 col-xl-2 text-right d-none d-lg-block">@sortablelink('unpaid', trans('general.unpaid'))</th>
|
||||
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1">@sortablelink('enabled', trans('general.enabled'))</th>
|
||||
<th class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($vendors as $item)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-sm-2 col-md-1 col-lg-1 col-xl-1 d-none d-sm-block">
|
||||
{{ Form::bulkActionGroup($item->id, $item->name) }}
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-3 col-md-3 col-lg-3 col-xl-3">
|
||||
<a class="col-aka text-success " href="{{ route('vendors.show', $item->id) }}">{{ $item->name }}</a>
|
||||
</td>
|
||||
<td class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block long-texts">
|
||||
{{ !empty($item->email) ? $item->email : trans('general.na') }}
|
||||
</td>
|
||||
<td class="col-sm-3 col-md-2 col-lg-2 col-xl-2 d-none d-sm-block long-texts">
|
||||
{{ $item->phone }}
|
||||
</td>
|
||||
<td class="col-lg-2 col-xl-2 text-right d-none d-lg-block long-texts">
|
||||
@money($item->unpaid, setting('default.currency'), true)
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1">
|
||||
@if (user()->can('update-purchases-vendors'))
|
||||
{{ Form::enabledGroup($item->id, $item->name, $item->enabled) }}
|
||||
@else
|
||||
@if ($item->enabled)
|
||||
<badge rounded type="success">{{ trans('general.enabled') }}</badge>
|
||||
@else
|
||||
<badge rounded type="danger">{{ trans('general.disabled') }}</badge>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">
|
||||
<div class="dropdown">
|
||||
<a class="btn btn-neutral btn-sm text-light items-align-center py-2" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<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>
|
||||
@permission('create-purchases-vendors')
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="{{ route('vendors.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
|
||||
@endpermission
|
||||
@permission('delete-purchases-vendors')
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::deleteLink($item, 'purchases/vendors') !!}
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $vendors])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
@include('partials.admin.empty_page', ['page' => 'vendors', 'docs_path' => 'purchases/vendors'])
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/purchases/vendors.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
186
resources/views/purchases/vendors/show.blade.php
vendored
Normal file
186
resources/views/purchases/vendors/show.blade.php
vendored
Normal file
@ -0,0 +1,186 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', $vendor->name)
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0 show-transaction-card-header">
|
||||
<a class="text-sm">{{ trans_choice('general.bills', 2) }}</a> <a class="float-right text-xs">{{ $counts['bills'] }}</a>
|
||||
</div>
|
||||
|
||||
<div class="card-footer show-transaction-card-footer">
|
||||
<a class="text-sm">{{ trans_choice('general.transactions', 2) }}</a> <a class="float-right text-xs">{{ $counts['transactions'] }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="mb-0">{{ trans('auth.profile') }}</h4>
|
||||
</div>
|
||||
|
||||
<div class="card-body d-grid">
|
||||
<a class="text-sm font-weight-600">{{ trans('general.email') }}</a> <a class="text-xs long-texts">{{ $vendor->email }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="text-sm font-weight-600">{{ trans('general.phone') }}</a> <a class="text-xs long-texts">{{ $vendor->phone }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="text-sm font-weight-600">{{ trans('general.website') }}</a> <a class="text-xs long-texts">{{ $vendor->website }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="text-sm font-weight-600">{{ trans('general.tax_number') }}</a> <a class="text-xs long-texts">{{ $vendor->tax_number }}</a>
|
||||
@if ($vendor->reference)
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="text-sm font-weight-600">{{ trans('general.reference') }}</a> <a class="text-xs long-texts">{{ $vendor->reference }}</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="mb-0">{{ trans('general.address') }}</h4>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<a class="text-xs m-0">
|
||||
{{ $vendor->address }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="{{ url('purchases/vendors/' . $vendor->id . '/edit') }}" class="btn btn-default btn-block edit-sv"><i class="fas fa-edit"></i><b>{{ trans('general.edit') }}</b></a>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-9">
|
||||
<div class="row mb--3">
|
||||
<div class="col-md-4">
|
||||
<div class="card bg-gradient-success border-0">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('general.paid') }}</h5>
|
||||
<div class="dropdown-divider"></div>
|
||||
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['paid'], setting('default.currency'), true)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card bg-gradient-warning border-0">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('dashboard.open_bills') }}</h5>
|
||||
<div class="dropdown-divider"></div>
|
||||
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['open'], setting('default.currency'), true)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card bg-gradient-danger border-0">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="text-uppercase text-muted mb-0 text-white">{{ trans('dashboard.overdue_bills') }}</h5>
|
||||
<div class="dropdown-divider"></div>
|
||||
<span class="h2 font-weight-bold mb-0 text-white">@money($amounts['overdue'], setting('default.currency'), true)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<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">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-sm-3 mb-md-0 active" id="tabs-icons-text-1-tab" data-toggle="tab" href="#tabs-icons-text-1" role="tab" aria-controls="tabs-icons-text-1" aria-selected="true"><i class="fas fa-hand-holding-usd mr-2"></i>{{ trans_choice('general.transactions', 2) }}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link mb-sm-3 mb-md-0" id="tabs-icons-text-2-tab" data-toggle="tab" href="#tabs-icons-text-2" role="tab" aria-controls="tabs-icons-text-2" aria-selected="false"><i class="fa fa-shopping-cart mr-2"></i>{{ trans_choice('general.bills', 2) }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="card shadow">
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="tabs-icons-text-1" role="tabpanel" aria-labelledby="tabs-icons-text-1-tab">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush" id="tbl-transactions">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-xs-6 col-sm-3">{{ trans('general.date') }}</th>
|
||||
<th class="col-xs-6 col-sm-2">{{ trans('general.amount') }}</th>
|
||||
<th class="col-sm-4 d-none d-sm-none">{{ trans_choice('general.categories', 1) }}</th>
|
||||
<th class="col-sm-3 d-none d-sm-none">{{ trans_choice('general.accounts', 1) }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($transactions as $item)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-xs-6 col-sm-3">@date($item->paid_at)</td>
|
||||
<td class="col-xs-6 col-sm-2">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-sm-4 d-none d-sm-none">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
|
||||
<td class="col-sm-3 d-none d-sm-none">{{ $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>
|
||||
|
||||
<div class="tab-pane fade" id="tabs-icons-text-2" role="tabpanel" aria-labelledby="tabs-icons-text-2-tab">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush" id="tbl-bills">
|
||||
<thead class="thead-light">
|
||||
<tr class="row table-head-line">
|
||||
<th class="col-xs-4 col-sm-3">{{ trans_choice('general.numbers', 1) }}</th>
|
||||
<th class="col-xs-4 col-sm-3">{{ trans('general.amount') }}</th>
|
||||
<th class="col-sm-2 d-none d-sm-none">{{ trans('bills.bill_date') }}</th>
|
||||
<th class="col-sm-2 d-none d-sm-none">{{ 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">
|
||||
<td class="col-xs-4 col-sm-3"><a href="{{ url('purchases/bills/' . $item->id . ' ') }}">{{ $item->bill_number }}</a></td>
|
||||
<td class="col-xs-4 col-sm-3">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-sm-2 d-none d-sm-none">@date($item->billed_at)</td>
|
||||
<td class="col-sm-2 d-none d-sm-none">@date($item->due_at)</td>
|
||||
<td class="col-xs-4 col-sm-2"><span class="badge badge-pill badge-{{ $item->status->label }}">{{ trans('bills.status.' . $item->status->code) }}</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/purchases/vendors.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
Reference in New Issue
Block a user