renamed income/expense
This commit is contained in:
85
resources/views/sales/customers/create.blade.php
Normal file
85
resources/views/sales/customers/create.blade.php
Normal file
@ -0,0 +1,85 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.customers', 1)]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'route' => 'customers.store',
|
||||
'id' => 'customer',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'files' => true,
|
||||
'role' => 'form',
|
||||
'autocomplete' => "off",
|
||||
'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', ['autocomplete' => 'off']) }}
|
||||
|
||||
{{ 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::textGroup('reference', trans('general.reference'), 'file', []) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), true) }}
|
||||
|
||||
@stack('create_user_input_start')
|
||||
<div id="customer-create-user" class="form-group col-md-12 margin-top">
|
||||
<div class="custom-control custom-checkbox">
|
||||
{{ Form::checkbox('create_user', '1', null, [
|
||||
'v-model' => 'form.create_user',
|
||||
'id' => 'create_user',
|
||||
'class' => 'custom-control-input',
|
||||
'@input' => 'onCanLogin($event)'
|
||||
]) }}
|
||||
|
||||
<label class="custom-control-label" for="create_user">
|
||||
<strong>{{ trans('customers.can_login') }}</strong>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@stack('create_user_input_end')
|
||||
|
||||
<div v-if="can_login" class="row col-md-12">
|
||||
{{Form::passwordGroup('password', trans('auth.password.current'), 'key', [], 'col-md-6 password')}}
|
||||
|
||||
{{Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key', [], 'col-md-6 password')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('sales/customers') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::hidden('type', 'customer') }}
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script>
|
||||
var can_login_errors = {
|
||||
valid: '{{ trans('validation.required', ['attribute' => 'email']) }}',
|
||||
email: '{{ trans('customers.error.email') }}'
|
||||
};
|
||||
</script>
|
||||
|
||||
<script src="{{ asset('public/js/sales/customers.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
90
resources/views/sales/customers/edit.blade.php
Normal file
90
resources/views/sales/customers/edit.blade.php
Normal file
@ -0,0 +1,90 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.customers', 1)]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::model($customer, [
|
||||
'method' => 'PATCH',
|
||||
'route' => ['customers.update', $customer->id],
|
||||
'role' => 'form',
|
||||
'id' => 'customer',
|
||||
'@submit.prevent' => 'onSubmit',
|
||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
||||
'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, $customer->currency_code) }}
|
||||
|
||||
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
|
||||
|
||||
{{ Form::textGroup('website', trans('general.website'), 'globe',[]) }}
|
||||
|
||||
{{ Form::textareaGroup('address', trans('general.address')) }}
|
||||
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
|
||||
|
||||
{{ Form::radioGroup('enabled', trans('general.enabled'), $customer->enabled) }}
|
||||
|
||||
@stack('create_user_input_start')
|
||||
<div id="customer-create-user" class="form-group col-md-12 margin-top">
|
||||
<div class="custom-control custom-checkbox">
|
||||
@if ($customer->user_id)
|
||||
{{ Form::checkbox('create_user', '1', 1, [
|
||||
'id' => 'create_user',
|
||||
'class' => 'custom-control-input',
|
||||
'disabled' => 'disabled'
|
||||
]) }}
|
||||
|
||||
<label class="custom-control-label" for="create_user">
|
||||
<strong>{{ trans('customers.user_created') }}</strong>
|
||||
</label>
|
||||
@else
|
||||
{{ Form::checkbox('create_user', '1', null, [
|
||||
'id' => 'create_user',
|
||||
'class' => 'custom-control-input',
|
||||
'v-on:input' => 'onCanLogin($event)'
|
||||
]) }}
|
||||
|
||||
<label class="custom-control-label" for="create_user">
|
||||
<strong>{{ trans('customers.can_login') }}</strong>
|
||||
</label>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@stack('create_user_input_end')
|
||||
|
||||
<div v-if="can_login" class="row col-md-12">
|
||||
{{Form::passwordGroup('password', trans('auth.password.current'), 'key', [], 'col-md-6 password')}}
|
||||
|
||||
{{Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key', [], 'col-md-6 password')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@permission('update-sales-customers')
|
||||
<div class="card-footer">
|
||||
<div class="float-right">
|
||||
{{ Form::saveButtons('sales/customers') }}
|
||||
</div>
|
||||
</div>
|
||||
@endpermission
|
||||
|
||||
{{ Form::hidden('type', 'customer') }}
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/sales/customers.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
117
resources/views/sales/customers/index.blade.php
Normal file
117
resources/views/sales/customers/index.blade.php
Normal file
@ -0,0 +1,117 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans_choice('general.customers', 2))
|
||||
|
||||
@section('new_button')
|
||||
@permission('create-sales-customers')
|
||||
<span><a href="{{ url('sales/customers/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/sales/customers') }}" 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('customers.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 ($customers->count())
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
|
||||
{!! Form::open([
|
||||
'url' => 'sales/customers',
|
||||
'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.customers', $bulk_actions, 'sales/customers') }}
|
||||
{!! 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($customers 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('customers.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-sales-customers'))
|
||||
{{ 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('customers.show', $item->id) }}">{{ trans('general.show') }}</a>
|
||||
<a class="dropdown-item" href="{{ route('customers.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
@permission('create-sales-customers')
|
||||
<a class="dropdown-item" href="{{ route('customers.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
@endpermission
|
||||
@permission('delete-sales-customers')
|
||||
{!! Form::deleteLink($item, 'sales/customers') !!}
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $customers])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
@include('partials.admin.empty_page', ['page' => 'customers', 'docs_path' => 'sales/customers'])
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/sales/customers.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
180
resources/views/sales/customers/show.blade.php
Normal file
180
resources/views/sales/customers/show.blade.php
Normal file
@ -0,0 +1,180 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', $customer->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 font-weight-600">{{ trans_choice('general.invoices', 2) }}</a> <a class="float-right text-xs">{{ $counts['invoices'] }}</a>
|
||||
</div>
|
||||
<div class="card-footer show-transaction-card-footer">
|
||||
<a class="text-sm font-weight-600">{{ 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">{{ $customer->email }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="text-sm font-weight-600">{{ trans('general.phone') }}</a> <a class="text-xs long-texts">{{ $customer->phone }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="text-sm font-weight-600">{{ trans('general.website') }}</a> <a class="text-xs long-texts">{{ $customer->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">{{ $customer->tax_number }}</a>
|
||||
@if ($customer->reference)
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="text-sm font-weight-600">{{ trans('general.reference') }}</a> <a class="text-xs long-texts">{{ $customer->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">
|
||||
{{ $customer->address }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="{{ route('customers.edit', $customer->id) }}" 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_invoices') }}</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_invoices') }}</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-money-bill mr-2"></i>{{ trans_choice('general.invoices', 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-3">{{ trans('general.amount') }}</th>
|
||||
<th class="col-sm-3 d-none d-sm-block">{{ trans_choice('general.categories', 1) }}</th>
|
||||
<th class="col-sm-3 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">
|
||||
<td class="col-xs-6 col-sm-3">@date($item->paid_at)</td>
|
||||
<td class="col-xs-6 col-sm-3">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-sm-3 d-none d-sm-block">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
|
||||
<td class="col-sm-3 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>
|
||||
|
||||
<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-invoices">
|
||||
<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-block">{{ trans('invoices.invoice_date') }}</th>
|
||||
<th class="col-sm-2 d-none d-sm-block">{{ trans('invoices.due_date') }}</th>
|
||||
<th class="col-xs-4 col-sm-2">{{ trans_choice('general.statuses', 1) }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($invoices as $item)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-xs-4 col-sm-3"><a href="{{ url('sales/invoices/' . $item->id . ' ') }}">{{ $item->invoice_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-block">@date($item->invoiced_at)</td>
|
||||
<td class="col-sm-2 d-none d-sm-block">@date($item->due_at)</td>
|
||||
<td class="col-xs-4 col-sm-2"><span class="badge badge-pill badge-{{ $item->status->label }}">{{ trans('invoices.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' => $invoices, 'type' => 'invoices'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/sales/customers.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
197
resources/views/sales/invoices/create.blade.php
Normal file
197
resources/views/sales/invoices/create.blade.php
Normal file
@ -0,0 +1,197 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.invoices', 1)]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'route' => 'invoices.store',
|
||||
'id' => 'invoice',
|
||||
'@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.customers', 1), 'user', $customers, config('general.customers'), ['required' => 'required', 'change' => 'onChangeContact', 'path' => route('modals.customers.create')]) }}
|
||||
|
||||
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'change' => 'onChangeCurrency']) }}
|
||||
|
||||
{{ Form::dateGroup('invoiced_at', trans('invoices.invoice_date'), 'calendar', ['id' => 'invoiced_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->toDateString()) }}
|
||||
|
||||
{{ Form::dateGroup('due_at', trans('invoices.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::now()->addDays(setting('invoice.payment_terms', 0))->toDateString()) }}
|
||||
|
||||
{{ Form::textGroup('invoice_number', trans('invoices.invoice_number'), 'file', ['required' => 'required'], $number) }}
|
||||
|
||||
{{ Form::textGroup('order_number', trans('invoices.order_number'), 'shopping-cart', []) }}
|
||||
|
||||
<div class="col-md-12 mb-4">
|
||||
{!! Form::label('items', trans_choice($text_override['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($text_override['quantity']) }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans($text_override['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('invoices.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="invoice-item-rows">
|
||||
@include('sales.invoices.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('invoices.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']) !!}
|
||||
</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('invoices.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), '', setting('invoice.notes')) }}
|
||||
|
||||
{{ Form::textareaGroup('footer', trans('general.footer'), '', setting('invoice.footer')) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('defaults.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('invoice_status_code', old('invoice_status_code', 'draft'), ['id' => 'invoice_status_code', 'v-model' => 'form.invoice_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('sales/invoices') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script type="text/javascript">
|
||||
var invoice_items = false;
|
||||
</script>
|
||||
|
||||
<script src="{{ asset('public/js/sales/invoices.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
200
resources/views/sales/invoices/edit.blade.php
Normal file
200
resources/views/sales/invoices/edit.blade.php
Normal file
@ -0,0 +1,200 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.invoices', 1)]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::model($invoice, [
|
||||
'id' => 'invoice',
|
||||
'method' => 'PATCH',
|
||||
'route' => ['invoices.update', $invoice->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.customers', 1), 'user', $customers, $invoice->contact_id, ['required' => 'required', 'change' => 'onChangeContact']) }}
|
||||
|
||||
{{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $invoice->currency_code, ['required' => 'required', 'change' => 'onChangeCurrency']) }}
|
||||
|
||||
{{ Form::dateGroup('invoiced_at', trans('invoices.invoice_date'), 'calendar', ['id' => 'invoiced_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($invoice->invoiced_at)->toDateString()) }}
|
||||
|
||||
{{ Form::dateGroup('due_at', trans('invoices.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($invoice->due_at)->toDateString()) }}
|
||||
|
||||
{{ Form::textGroup('invoice_number', trans('invoices.invoice_number'), 'file') }}
|
||||
|
||||
{{ Form::textGroup('order_number', trans('invoices.order_number'), 'shopping-cart',[]) }}
|
||||
|
||||
<div class="col-md-12 mb-4">
|
||||
{!! Form::label('items', trans_choice($text_override['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($text_override['quantity']) }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="col-md-2 text-right border-right-0 border-bottom-0">{{ trans($text_override['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('invoices.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="invoice-item-rows">
|
||||
@include('sales.invoices.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('invoices.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('invoices.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::textareaGroup('footer', trans('general.footer')) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $invoice->category_id) }}
|
||||
|
||||
{{ Form::recurring('edit', $invoice) }}
|
||||
|
||||
{{ 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('invoice_status_code', old('invoice_status_code', 'draft'), ['id' => 'invoice_status_code', 'v-model' => 'form.invoice_status_code']) }}
|
||||
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@permission('update-sales-invoices')
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('sales/invoices') }}
|
||||
</div>
|
||||
</div>
|
||||
@endpermission
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script type="text/javascript">
|
||||
var invoice_items = {!! json_encode($invoice->items()->select(['item_id', 'name', 'quantity', 'price', 'total', 'tax'])->get()) !!};
|
||||
</script>
|
||||
|
||||
<script src="{{ asset('public/js/sales/invoices.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
106
resources/views/sales/invoices/index.blade.php
Normal file
106
resources/views/sales/invoices/index.blade.php
Normal file
@ -0,0 +1,106 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans_choice('general.invoices', 2))
|
||||
|
||||
@section('new_button')
|
||||
@permission('create-sales-invoices')
|
||||
<span><a href="{{ route('invoices.create') }}" class="btn btn-primary btn-sm btn-success header-button-top"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
<span><a href="{{ url('common/import/sales/invoices') }}" 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('invoices.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 ($invoices->count())
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
|
||||
{!! Form::open([
|
||||
'url' => 'sales/invoices',
|
||||
'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.invoices', $bulk_actions, 'sales/invoices') }}
|
||||
{!! 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-md-2 col-lg-2 col-xl-2 d-none d-md-block">@sortablelink('invoice_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-4 col-lg-2 col-xl-2">@sortablelink('contact_name', trans_choice('general.customers', 1))</th>
|
||||
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1 text-right">@sortablelink('amount', trans('general.amount'))</th>
|
||||
<th class="col-lg-2 col-xl-2 d-none d-lg-block">@sortablelink('invoiced_at', trans('invoices.invoice_date'))</th>
|
||||
<th class="col-lg-2 col-xl-2 d-none d-lg-block">@sortablelink('due_at', trans('invoices.due_date'))</th>
|
||||
<th class="col-lg-1 col-xl-1 d-none d-lg-block">@sortablelink('invoice_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"><a>{{ trans('general.actions') }}</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($invoices 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->invoice_number) }}</td>
|
||||
<td class="col-md-2 col-lg-2 col-xl-2 d-none d-md-block"><a class="col-aka text-success" href="{{ route('invoices.show' , $item->id) }}">{{ $item->invoice_number }}</a></td>
|
||||
<td class="col-xs-4 col-sm-4 col-md-4 col-lg-2 col-xl-2">{{ $item->contact_name }}</td>
|
||||
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1 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->invoiced_at)</td>
|
||||
<td class="col-lg-2 col-xl-2 d-none d-lg-block">@date($item->due_at)</td>
|
||||
<td class="col-lg-1 col-xl-1 d-none d-lg-block">
|
||||
<span class="badge badge-pill badge-{{ $item->status->label }}">{{ trans('invoices.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('invoices.show', $item->id) }}">{{ trans('general.show') }}</a>
|
||||
@if (!$item->reconciled)
|
||||
<a class="dropdown-item" href="{{ route('invoices.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
@endif
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
@permission('create-sales-invoices')
|
||||
<a class="dropdown-item" href="{{ route('invoices.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@endpermission
|
||||
|
||||
@permission('delete-sales-invoices')
|
||||
@if (!$item->reconciled)
|
||||
{!! Form::deleteLink($item, 'sales/invoices') !!}
|
||||
@endif
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card-footer table-action">
|
||||
<div class="row">
|
||||
@include('partials.admin.pagination', ['items' => $invoices])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
@include('partials.admin.empty_page', ['page' => 'invoices', 'docs_path' => 'sales/invoices'])
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/sales/invoices.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
109
resources/views/sales/invoices/item.blade.php
Normal file
109
resources/views/sales/invoices/item.blade.php
Normal file
@ -0,0 +1,109 @@
|
||||
<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')
|
||||
{{ Form::selectAddNewGroup('name', '', '', $items, '', [
|
||||
'data-item' => 'name',
|
||||
'v-model' => 'row.name',
|
||||
'@input' => 'onGetItem($event, index)',
|
||||
'class' => 'form-control',
|
||||
'autocomplete' => 'form-control',
|
||||
'path' => route('modals.taxes.create')
|
||||
], 'mb-0 select-item') }}
|
||||
<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">
|
||||
@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"
|
||||
autocomplete="off"
|
||||
required="required"
|
||||
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',
|
||||
'collapse' => 'false',
|
||||
'path' => route('modals.taxes.create')
|
||||
], '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, $invoice->currency_code, true)</span>
|
||||
@endif
|
||||
@stack('total_input_end')
|
||||
</td>
|
||||
@stack('total_td_end')
|
||||
</tr>
|
265
resources/views/sales/invoices/print_classic.blade.php
Normal file
265
resources/views/sales/invoices/print_classic.blade.php
Normal file
@ -0,0 +1,265 @@
|
||||
@extends('layouts.print')
|
||||
|
||||
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<img class="mt-4" src="{{ $logo }}" alt="{{ setting('company.name') }}"/>
|
||||
</div>
|
||||
<div class="col-md-5 text-right">
|
||||
<p class="mb-0 mt-4 font-weight-600">
|
||||
{{ setting('company.name') }}
|
||||
</p>
|
||||
|
||||
<p class="mb-0">
|
||||
{!! nl2br(setting('company.address')) !!}
|
||||
</p>
|
||||
|
||||
<p class="mb-0">
|
||||
@if (setting('company.tax_number'))
|
||||
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
|
||||
@endif
|
||||
</p>
|
||||
|
||||
<p class="mb-0 mt-3">
|
||||
@if (setting('company.phone'))
|
||||
{{ setting('company.phone') }}
|
||||
@endif
|
||||
</p>
|
||||
|
||||
<p class="mb-0">
|
||||
{{ setting('company.email') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row my-4">
|
||||
<div class="col-md-4">
|
||||
<hr class="bg-default invoice-classic-line mb-1 mt-5">
|
||||
<hr class="bg-default invoice-classic-line my-0">
|
||||
</div>
|
||||
<div class="col-md-4 text-center">
|
||||
<div class="invoice-classic-frame">
|
||||
<div class="invoice-classic-inline-frame">
|
||||
@stack('invoice_number_input_start')
|
||||
<p class="mt-4">
|
||||
<b>{{ trans('invoices.invoice_number') }}:</b>
|
||||
{{ $invoice->invoice_number }}
|
||||
</p>
|
||||
@stack('invoice_number_input_end')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<hr class="bg-default invoice-classic-line mb-1 mt-5">
|
||||
<hr class="bg-default invoice-classic-line my-0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-7">
|
||||
|
||||
<h4>{{ trans('invoices.bill_to') }}</h4>
|
||||
@stack('name_input_start')
|
||||
<strong class="d-block">{{ $invoice->contact_name }}</strong>
|
||||
@stack('name_input_end')
|
||||
|
||||
@stack('address_input_start')
|
||||
<p class="mb-0">
|
||||
{!! nl2br($invoice->contact_address) !!}
|
||||
</p>
|
||||
@stack('address_input_end')
|
||||
|
||||
@stack('tax_number_input_start')
|
||||
<p class="mb-0">
|
||||
@if ($invoice->contact_tax_number)
|
||||
{{ trans('general.tax_number') }}: {{ $invoice->contact_tax_number }}<br>
|
||||
@endif
|
||||
</p>
|
||||
@stack('tax_number_input_end')
|
||||
|
||||
@stack('phone_input_start')
|
||||
<p class="mb-0 mt-3">
|
||||
@if ($invoice->contact_phone)
|
||||
{{ $invoice->contact_phone }}
|
||||
@endif
|
||||
</p>
|
||||
@stack('phone_input_end')
|
||||
|
||||
@stack('email_start')
|
||||
<p class="mb-0">
|
||||
{{ $invoice->contact_email }}
|
||||
</p>
|
||||
@stack('email_input_end')
|
||||
|
||||
</div>
|
||||
<div class="col-md-5 text-right">
|
||||
@stack('order_number_input_start')
|
||||
@if ($invoice->order_number)
|
||||
<p>
|
||||
<b>{{ trans('invoices.order_number') }}:</b>
|
||||
{{ $invoice->order_number }}
|
||||
</p>
|
||||
@endif
|
||||
@stack('order_number_input_end')
|
||||
|
||||
@stack('invoiced_at_input_start')
|
||||
<p>
|
||||
<b>{{ trans('invoices.invoice_date') }}:</b>
|
||||
@date($invoice->invoiced_at)
|
||||
</p>
|
||||
@stack('invoiced_at_input_end')
|
||||
|
||||
@stack('due_at_input_start')
|
||||
<p>
|
||||
<b>{{ trans('invoices.payment_due') }}:</b>
|
||||
@date($invoice->due_at)
|
||||
</p>
|
||||
@stack('due_at_input_end')
|
||||
|
||||
@foreach ($invoice->totals as $total)
|
||||
@if ($total->code == 'total')
|
||||
<p class="bg-light border-radius-5 float-right text-center w-50">
|
||||
<b>{{ trans($total->name) }}:</b>
|
||||
@money($total->amount - $invoice->paid, $invoice->currency_code, true)
|
||||
</p>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row show-table">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr class="row border-dashed">
|
||||
@stack('name_th_start')
|
||||
<th class="col-xs-4 col-sm-3 pl-5">{{ trans_choice($text_override['items'], 2) }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="col-xs-4 col-sm-3 text-center">{{ trans($text_override['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($text_override['price']) }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="col-xs-4 col-sm-3 text-right pr-5">{{ trans('invoices.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
@foreach($invoice->items as $item)
|
||||
<tr class="row border-dashed">
|
||||
@stack('name_td_start')
|
||||
<td class="col-xs-4 col-sm-3 pl-5">
|
||||
{{ $item->name }}
|
||||
@if ($item->desc)
|
||||
<br><small>{!! $item->desc !!}</small>
|
||||
@endif
|
||||
</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-5">@money($item->price, $invoice->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, $invoice->currency_code, true)</td>
|
||||
@stack('total_td_end')
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-7">
|
||||
<div class="table-responsive">
|
||||
@stack('notes_input_start')
|
||||
@if ($invoice->notes)
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<p class="form-control-label">{{ trans_choice('general.notes', 2) }}</p>
|
||||
<p class="form-control text-muted">{{ $invoice->notes }}</p>
|
||||
</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 border-dashed">
|
||||
<tbody>
|
||||
@foreach ($invoice->totals as $total)
|
||||
@if ($total->code != 'total')
|
||||
@stack($total->code . '_td_start')
|
||||
<tr class="border-dashed">
|
||||
<th>
|
||||
{{ trans($total->title) }}:
|
||||
</th>
|
||||
<td class="text-right">
|
||||
@money($total->amount, $invoice->currency_code, true)
|
||||
</td>
|
||||
</tr>
|
||||
@stack($total->code . '_td_end')
|
||||
@else
|
||||
@if ($invoice->paid)
|
||||
<tr class="border-dashed">
|
||||
<th>
|
||||
{{ trans('invoices.paid') }}:
|
||||
</th>
|
||||
<td class="text-right">
|
||||
- @money($invoice->paid, $invoice->currency_code, true)
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@stack('grand_total_td_start')
|
||||
<tr class="border-dashed">
|
||||
<th>
|
||||
{{ trans($total->name) }}:
|
||||
</th>
|
||||
<td class="text-right">
|
||||
@money($total->amount - $invoice->paid, $invoice->currency_code, true)
|
||||
</td>
|
||||
</tr>
|
||||
@stack('grand_total_td_end')
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($invoice->footer)
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless mb-0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
{!! $invoice->footer !!}
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
280
resources/views/sales/invoices/print_default.blade.php
Normal file
280
resources/views/sales/invoices/print_default.blade.php
Normal file
@ -0,0 +1,280 @@
|
||||
@extends('layouts.print')
|
||||
|
||||
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
|
||||
|
||||
@section('content')
|
||||
<div class="row mx--4">
|
||||
<div class="col-md-7 border-bottom-1">
|
||||
<div class="table-responsive mt-4">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<img src="{{ $logo }}" alt="{{ setting('company.name') }}"/>
|
||||
</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>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
{{ trans('invoices.bill_to') }}
|
||||
@stack('name_input_start')
|
||||
<strong class="d-block">{{ $invoice->contact_name }}</strong>
|
||||
@stack('name_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('address_input_start')
|
||||
{!! nl2br($invoice->contact_address) !!}
|
||||
@stack('address_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('tax_number_input_start')
|
||||
@if ($invoice->contact_tax_number)
|
||||
{{ trans('general.tax_number') }}: {{ $invoice->contact_tax_number }}<br>
|
||||
@endif
|
||||
@stack('tax_number_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('phone_input_start')
|
||||
@if ($invoice->contact_phone)
|
||||
{{ $invoice->contact_phone }}
|
||||
@endif
|
||||
@stack('phone_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('email_start')
|
||||
{{ $invoice->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('invoice_number_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('invoices.invoice_number') }}:</th>
|
||||
<td class="text-right">{{ $invoice->invoice_number }}</td>
|
||||
</tr>
|
||||
@stack('invoice_number_input_end')
|
||||
|
||||
@stack('order_number_input_start')
|
||||
@if ($invoice->order_number)
|
||||
<tr>
|
||||
<th>{{ trans('invoices.order_number') }}:</th>
|
||||
<td class="text-right">{{ $invoice->order_number }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@stack('order_number_input_end')
|
||||
|
||||
@stack('invoiced_at_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('invoices.invoice_date') }}:</th>
|
||||
<td class="text-right">@date($invoice->invoiced_at)</td>
|
||||
</tr>
|
||||
@stack('invoiced_at_input_end')
|
||||
|
||||
@stack('due_at_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('invoices.payment_due') }}:</th>
|
||||
<td class="text-right">@date($invoice->due_at)</td>
|
||||
</tr>
|
||||
@stack('due_at_input_end')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row show-table">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr class="row bg-default text-white">
|
||||
@stack('name_th_start')
|
||||
<th class="col-xs-4 col-sm-3 pl-5 text-white">{{ trans_choice($text_override['items'], 2) }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="col-xs-4 col-sm-3 text-center text-white">{{ trans($text_override['quantity']) }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="col-sm-3 text-center d-none d-sm-block pl-5 text-white">{{ trans($text_override['price']) }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="col-xs-4 col-sm-3 text-right pr-5 text-white">{{ trans('invoices.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
@foreach($invoice->items as $item)
|
||||
<tr class="row">
|
||||
@stack('name_td_start')
|
||||
<td class="col-xs-4 col-sm-3 pl-5">
|
||||
{{ $item->name }}
|
||||
@if ($item->desc)
|
||||
<br><small>{!! $item->desc !!}</small>
|
||||
@endif
|
||||
</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-5">@money($item->price, $invoice->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, $invoice->currency_code, true)</td>
|
||||
@stack('total_td_end')
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-5">
|
||||
<div class="col-md-7">
|
||||
<div class="table-responsive">
|
||||
@stack('notes_input_start')
|
||||
@if ($invoice->notes)
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<p class="form-control-label">{{ trans_choice('general.notes', 2) }}</p>
|
||||
<p class="form-control text-muted">{{ $invoice->notes }}</p>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
@stack('notes_input_end')
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
@foreach ($invoice->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, $invoice->currency_code, true)
|
||||
</td>
|
||||
</tr>
|
||||
@stack($total->code . '_td_end')
|
||||
@else
|
||||
@if ($invoice->paid)
|
||||
<tr>
|
||||
<th>
|
||||
{{ trans('invoices.paid') }}:
|
||||
</th>
|
||||
<td class="text-right">
|
||||
- @money($invoice->paid, $invoice->currency_code, true)
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@stack('grand_total_td_start')
|
||||
<tr>
|
||||
<th>
|
||||
{{ trans($total->name) }}:
|
||||
</th>
|
||||
<td class="text-right">
|
||||
@money($total->amount - $invoice->paid, $invoice->currency_code, true)
|
||||
</td>
|
||||
</tr>
|
||||
@stack('grand_total_td_end')
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($invoice->footer)
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
{!! $invoice->footer !!}
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
276
resources/views/sales/invoices/print_modern.blade.php
Normal file
276
resources/views/sales/invoices/print_modern.blade.php
Normal file
@ -0,0 +1,276 @@
|
||||
@extends('layouts.print')
|
||||
|
||||
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-7 bg-primary">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless mt-4">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="d-flex align-items-center">
|
||||
<img src="{{ $logo }}" alt="{{ setting('company.name') }}"/>
|
||||
<h3 class="ml-4 text-white">{{ setting('company.name') }}</h3>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 bg-default">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="text-white">
|
||||
{!! nl2br(setting('company.address')) !!}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-white">
|
||||
@if (setting('company.tax_number'))
|
||||
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
|
||||
@endif
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-white">
|
||||
@if (setting('company.phone'))
|
||||
{{ setting('company.phone') }}
|
||||
@endif
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-white">
|
||||
{{ setting('company.email') }}
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<h4>{{ trans('invoices.bill_to') }}</h4>
|
||||
@stack('name_input_start')
|
||||
<strong class="d-block">{{ $invoice->contact_name }}</strong>
|
||||
@stack('name_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@stack('address_input_start')
|
||||
{!! nl2br($invoice->contact_address) !!}
|
||||
@stack('address_input_end')
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@stack('tax_number_input_start')
|
||||
@if ($invoice->contact_tax_number)
|
||||
{{ trans('general.tax_number') }}: {{ $invoice->contact_tax_number }}<br>
|
||||
@endif
|
||||
@stack('tax_number_input_end')
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@stack('phone_input_start')
|
||||
@if ($invoice->contact_phone)
|
||||
{{ $invoice->contact_phone }}
|
||||
@endif
|
||||
@stack('phone_input_end')
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@stack('email_start')
|
||||
{{ $invoice->contact_email }}
|
||||
@stack('email_input_end')
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
@stack('invoice_number_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('invoices.invoice_number') }}:</th>
|
||||
<td class="text-right">{{ $invoice->invoice_number }}</td>
|
||||
</tr>
|
||||
@stack('invoice_number_input_end')
|
||||
|
||||
@stack('order_number_input_start')
|
||||
@if ($invoice->order_number)
|
||||
<tr>
|
||||
<th>{{ trans('invoices.order_number') }}:</th>
|
||||
<td class="text-right">{{ $invoice->order_number }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@stack('order_number_input_end')
|
||||
|
||||
@stack('invoiced_at_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('invoices.invoice_date') }}:</th>
|
||||
<td class="text-right">@date($invoice->invoiced_at)</td>
|
||||
</tr>
|
||||
@stack('invoiced_at_input_end')
|
||||
|
||||
@stack('due_at_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('invoices.payment_due') }}:</th>
|
||||
<td class="text-right">@date($invoice->due_at)</td>
|
||||
</tr>
|
||||
@stack('due_at_input_end')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row show-table">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr class="row bg-default">
|
||||
@stack('name_th_start')
|
||||
<th class="col-xs-4 col-sm-3 pl-5 text-white">{{ trans_choice($text_override['items'], 2) }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="col-xs-4 col-sm-3 text-center text-white">{{ trans($text_override['quantity']) }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="col-sm-3 text-center d-none d-sm-block pl-5 text-white">{{ trans($text_override['price']) }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="col-xs-4 col-sm-3 text-right pr-5 text-white">{{ trans('invoices.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
@foreach($invoice->items as $item)
|
||||
<tr class="row">
|
||||
@stack('name_td_start')
|
||||
<td class="col-xs-4 col-sm-3 pl-5">
|
||||
{{ $item->name }}
|
||||
@if ($item->desc)
|
||||
<br><small>{!! $item->desc !!}</small>
|
||||
@endif
|
||||
</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-5">@money($item->price, $invoice->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, $invoice->currency_code, true)</td>
|
||||
@stack('total_td_end')
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-7">
|
||||
<div class="table-responsive">
|
||||
@stack('notes_input_start')
|
||||
@if ($invoice->notes)
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<p class="form-control-label">{{ trans_choice('general.notes', 2) }}</p>
|
||||
<p class="form-control text-muted">{{ $invoice->notes }}</p>
|
||||
</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 ($invoice->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, $invoice->currency_code, true)
|
||||
</td>
|
||||
</tr>
|
||||
@stack($total->code . '_td_end')
|
||||
@else
|
||||
@if ($invoice->paid)
|
||||
<tr>
|
||||
<th>
|
||||
{{ trans('invoices.paid') }}:
|
||||
</th>
|
||||
<td class="text-right">
|
||||
- @money($invoice->paid, $invoice->currency_code, true)
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@stack('grand_total_td_start')
|
||||
<tr>
|
||||
<th>
|
||||
{{ trans($total->name) }}:
|
||||
</th>
|
||||
<td class="text-right">
|
||||
@money($total->amount - $invoice->paid, $invoice->currency_code, true)
|
||||
</td>
|
||||
</tr>
|
||||
@stack('grand_total_td_end')
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($invoice->footer)
|
||||
<div class="row">
|
||||
<div class="col-md-12 bg-default">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless mb-0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="text-white">
|
||||
{!! $invoice->footer !!}
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
668
resources/views/sales/invoices/show.blade.php
Normal file
668
resources/views/sales/invoices/show.blade.php
Normal file
@ -0,0 +1,668 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
|
||||
|
||||
@section('content')
|
||||
@stack('recurring_message_start')
|
||||
@if (($recurring = $invoice->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.invoices', 1)),
|
||||
'date' => $next->format($date_format)
|
||||
]) }}
|
||||
</p>
|
||||
@stack('recurring_message_body_end')
|
||||
</div>
|
||||
@endif
|
||||
@stack('recurring_message_end')
|
||||
|
||||
@stack('status_message_start')
|
||||
@if ($invoice->status->code == 'draft')
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="alert alert-warning fade show" role="alert">
|
||||
@stack('status_message_body_start')
|
||||
<span class="alert-text">
|
||||
<strong>{!! trans('invoices.messages.draft') !!}</strong>
|
||||
</span>
|
||||
@stack('status_message_body_end')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@stack('status_message_end')
|
||||
|
||||
@stack('timeline_start')
|
||||
@if ($invoice->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_invoice_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_invoice_head_start')
|
||||
<h2 class="font-weight-500">{{ trans('invoices.create_invoice') }}</h2>
|
||||
@stack('timeline_body_create_invoice_head_end')
|
||||
|
||||
@stack('timeline_body_create_invoice_body_start')
|
||||
@stack('timeline_body_create_invoice_body_message_start')
|
||||
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
|
||||
<small>{{ trans('invoices.messages.status.created', ['date' => Date::parse($invoice->created_at)->format($date_format)]) }}</small>
|
||||
@stack('timeline_body_create_invoice_body_message_end')
|
||||
|
||||
<div class="mt-3">
|
||||
@stack('timeline_body_create_invoice_body_button_edit_start')
|
||||
<a href="{{ url('sales/invoices/' . $invoice->id . '/edit') }}" class="btn btn-info btn-sm btn-alone">
|
||||
{{ trans('general.edit') }}
|
||||
</a>
|
||||
@stack('timeline_body_create_invoice_body_button_edit_end')
|
||||
</div>
|
||||
@stack('timeline_body_create_invoice_body_end')
|
||||
</div>
|
||||
</div>
|
||||
@stack('timeline_body_create_invoice_end')
|
||||
|
||||
@stack('timeline_body_send_invoice_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_send_invoice_head_start')
|
||||
<h2 class="font-weight-500">{{ trans('invoices.send_invoice') }}</h2>
|
||||
@stack('timeline_body_send_invoice_head_end')
|
||||
|
||||
@stack('timeline_body_send_invoice_body_start')
|
||||
@if ($invoice->status->code != 'sent' && $invoice->status->code != 'partial' && $invoice->status->code != 'viewed')
|
||||
@stack('timeline_body_send_invoice_body_message_start')
|
||||
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
|
||||
<small>{{ trans('invoices.messages.status.send.draft') }}</small>
|
||||
@stack('timeline_body_send_invoice_body_message_end')
|
||||
|
||||
<div class="mt-3">
|
||||
@stack('timeline_body_send_invoice_body_button_sent_start')
|
||||
@permission('update-sales-invoices')
|
||||
@if($invoice->invoice_status_code == 'draft')
|
||||
<a href="{{ url('sales/invoices/' . $invoice->id . '/sent') }}" class="btn btn-white btn-sm header-button-top">{{ trans('invoices.mark_sent') }}</a>
|
||||
@else
|
||||
<button type="button" class="btn btn-secondary btn-sm header-button-top" disabled="disabled">
|
||||
<span class="text-disabled">{{ trans('invoices.mark_sent') }}</span>
|
||||
</button>
|
||||
@endif
|
||||
@endpermission
|
||||
@stack('timeline_body_send_invoice_body_button_sent_end')
|
||||
|
||||
@stack('timeline_body_send_invoice_body_button_email_start')
|
||||
@if($invoice->contact_email)
|
||||
<a href="{{ url('sales/invoices/' . $invoice->id . '/email') }}" class="btn btn-warning btn-sm header-button-bottom">{{ trans('invoices.send_mail') }}</a>
|
||||
@else
|
||||
<button type="button" class="btn btn-white btn-sm header-button-bottom green-tooltip" disabled="disabled" data-toggle="tooltip" data-placement="right" title="{{ trans('invoices.messages.email_required') }}">
|
||||
<span class="text-disabled">{{ trans('invoices.send_mail') }}</span>
|
||||
</button>
|
||||
@endif
|
||||
@stack('timeline_body_send_invoice_body_button_email_end')
|
||||
</div>
|
||||
@elseif($invoice->status->code == 'viewed')
|
||||
@stack('timeline_body_viewed_invoice_body_message_start')
|
||||
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
|
||||
<small>{{ trans('invoices.messages.status.viewed') }}</small>
|
||||
@stack('timeline_body_viewed_invoice_body_message_end')
|
||||
@else
|
||||
@stack('timeline_body_send_invoice_body_message_start')
|
||||
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
|
||||
<small>{{ trans('invoices.messages.status.send.sent', ['date' => Date::parse($invoice->created_at)->format($date_format)]) }}</small>
|
||||
@stack('timeline_body_send_invoice_body_message_end')
|
||||
@endif
|
||||
@stack('timeline_body_send_invoice_body_end')
|
||||
</div>
|
||||
</div>
|
||||
@stack('timeline_body_send_invoice_end')
|
||||
|
||||
@stack('timeline_body_get_paid_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_get_paid_head_start')
|
||||
<h2 class="font-weight-500">{{ trans('invoices.get_paid') }}</h2>
|
||||
@stack('timeline_body_get_paid_head_end')
|
||||
|
||||
@stack('timeline_body_get_paid_body_start')
|
||||
@stack('timeline_body_get_paid_body_message_start')
|
||||
@if($invoice->status->code != 'paid' && empty($invoice->transactions->count()))
|
||||
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
|
||||
<small>{{ trans('invoices.messages.status.paid.await') }}</small>
|
||||
@else
|
||||
<small>{{ trans_choice('general.statuses', 1) . ':' }}</small>
|
||||
<small>{{ trans('general.partially_paid') }}</small>
|
||||
@endif
|
||||
@stack('timeline_body_get_paid_body_message_end')
|
||||
|
||||
<div class="mt-3">
|
||||
@stack('timeline_body_get_paid_body_button_pay_start')
|
||||
@permission('update-sales-invoices')
|
||||
<a href="{{ route('invoices.paid', $invoice->id) }}" class="btn btn-white btn-sm header-button-top">{{ trans('invoices.mark_paid') }}</a>
|
||||
@endpermission
|
||||
@stack('timeline_body_get_paid_body_button_pay_end')
|
||||
|
||||
@stack('timeline_body_get_paid_body_button_payment_start')
|
||||
@if(empty($invoice->transactions->count()) || (!empty($invoice->transactions->count()) && $invoice->paid != $invoice->amount))
|
||||
<button @click="onPayment" id="button-payment" class="btn btn-success btn-sm header-button-bottom">{{ trans('invoices.add_payment') }}</button>
|
||||
@endif
|
||||
@stack('timeline_body_get_paid_body_button_payment_end')
|
||||
</div>
|
||||
@stack('timeline_body_get_paid_body_end')
|
||||
</div>
|
||||
</div>
|
||||
@stack('timeline_body_get_paid_end')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('timeline_body_get_paid_end')
|
||||
@endif
|
||||
@stack('timeline_end')
|
||||
|
||||
@stack('invoice_start')
|
||||
<div class="card">
|
||||
@stack('invoice_status_start')
|
||||
<div class="card-header status-{{ $invoice->status->label }}">
|
||||
<h3 class="text-white mb-0 float-right">{{ trans('invoices.status.' . $invoice->status->code) }}</h3>
|
||||
</div>
|
||||
@stack('invoice_status_end')
|
||||
|
||||
<div class="card-body">
|
||||
@stack('invoice_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>
|
||||
<img src="{{ $logo }}" alt="{{ setting('company.name') }}"/>
|
||||
</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('invoice_header_end')
|
||||
|
||||
@stack('invoice_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('invoices.bill_to') }}
|
||||
@stack('name_input_start')
|
||||
<strong class="d-block">{{ $invoice->contact_name }}</strong>
|
||||
@stack('name_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('address_input_start')
|
||||
{!! nl2br($invoice->contact_address) !!}
|
||||
@stack('address_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('tax_number_input_start')
|
||||
@if ($invoice->contact_tax_number)
|
||||
{{ trans('general.tax_number') }}: {{ $invoice->contact_tax_number }}
|
||||
@endif
|
||||
@stack('tax_number_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('phone_input_start')
|
||||
@if ($invoice->contact_phone)
|
||||
{{ $invoice->contact_phone }}
|
||||
@endif
|
||||
@stack('phone_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@stack('email_start')
|
||||
{{ $invoice->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('invoice_number_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('invoices.invoice_number') }}:</th>
|
||||
<td class="text-right">{{ $invoice->invoice_number }}</td>
|
||||
</tr>
|
||||
@stack('invoice_number_input_end')
|
||||
|
||||
@stack('order_number_input_start')
|
||||
@if ($invoice->order_number)
|
||||
<tr>
|
||||
<th>{{ trans('invoices.order_number') }}:</th>
|
||||
<td class="text-right">{{ $invoice->order_number }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@stack('order_number_input_end')
|
||||
|
||||
@stack('invoiced_at_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('invoices.invoice_date') }}:</th>
|
||||
<td class="text-right">@date($invoice->invoiced_at)</td>
|
||||
</tr>
|
||||
@stack('invoiced_at_input_end')
|
||||
|
||||
@stack('due_at_input_start')
|
||||
<tr>
|
||||
<th>{{ trans('invoices.payment_due') }}:</th>
|
||||
<td class="text-right">@date($invoice->due_at)</td>
|
||||
</tr>
|
||||
@stack('due_at_input_end')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('invoice_information_end')
|
||||
|
||||
@stack('invoice_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($text_override['items'], 2) }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="col-xs-4 col-sm-3 text-center">{{ trans($text_override['quantity']) }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="col-sm-3 text-center d-none d-sm-block">{{ trans($text_override['price']) }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="col-xs-4 col-sm-3 text-right pr-5">{{ trans('invoices.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
@foreach($invoice->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, $invoice->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, $invoice->currency_code, true)</td>
|
||||
@stack('total_td_end')
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('invoice_item_end')
|
||||
|
||||
@stack('invoice_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 ($invoice->notes)
|
||||
<tr>
|
||||
<th>
|
||||
<p class="form-control-label">{{ trans_choice('general.notes', 2) }}</p>
|
||||
<p class="form-control text-muted long-texts">{{ $invoice->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 ($invoice->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, $invoice->currency_code, true)</td>
|
||||
</tr>
|
||||
@stack($total->code . '_td_end')
|
||||
@else
|
||||
@if ($invoice->paid)
|
||||
<tr class="text-success">
|
||||
<th>{{ trans('invoices.paid') }}:</th>
|
||||
<td class="text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
|
||||
</tr>
|
||||
@endif
|
||||
@stack('grand_total_td_start')
|
||||
<tr>
|
||||
<th>{{ trans($total->name) }}:</th>
|
||||
<td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
|
||||
</tr>
|
||||
@stack('grand_total_td_end')
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('invoice_total_end')
|
||||
</div>
|
||||
|
||||
@stack('card_footer_start')
|
||||
<div class="card-footer">
|
||||
<div class="float-right">
|
||||
@stack('button_edit_start')
|
||||
@if(!$invoice->reconciled)
|
||||
<a href="{{ url('sales/invoices/' . $invoice->id . '/edit') }}" 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="{{ url('sales/invoices/' . $invoice->id . '/print') }}" 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_share_start')
|
||||
<a href="{{ $signed_url }}" target="_blank" class="btn btn-white header-button-top">
|
||||
<i class="fa fa-share"></i> Share
|
||||
</a>
|
||||
@stack('button_share_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($invoice->status->code != 'paid')
|
||||
@permission('update-sales-invoices')
|
||||
<a class="dropdown-item" href="{{ url('sales/invoices/' . $invoice->id . '/pay') }}">{{ trans('invoices.mark_paid') }}</a>
|
||||
@endpermission
|
||||
|
||||
@if(empty($invoice->paid) || ($invoice->paid != $invoice->amount))
|
||||
<button class="dropdown-item" id="button-payment" @click="onPayment">{{ trans('invoices.add_payment') }}</button>
|
||||
@endif
|
||||
<div class="dropdown-divider"></div>
|
||||
@endif
|
||||
@stack('button_pay_end')
|
||||
|
||||
@stack('button_sent_start')
|
||||
@permission('update-sales-invoices')
|
||||
@if($invoice->invoice_status_code == 'draft')
|
||||
<a class="dropdown-item" href="{{ url('sales/invoices/' . $invoice->id . '/sent') }}">{{ trans('invoices.mark_sent') }}</a>
|
||||
@else
|
||||
<button type="button" class="dropdown-item" disabled="disabled"><span class="text-disabled">{{ trans('invoices.mark_sent') }}</span></button>
|
||||
@endif
|
||||
@endpermission
|
||||
@stack('button_sent_end')
|
||||
|
||||
@stack('button_email_start')
|
||||
@if($invoice->contact_email)
|
||||
<a class="dropdown-item" href="{{ url('sales/invoices/' . $invoice->id . '/email') }}">{{ trans('invoices.send_mail') }}</a>
|
||||
@else
|
||||
<button type="button" class="dropdown-item" disabled="disabled" data-toggle="tooltip" data-placement="right" title="{{ trans('invoices.messages.email_required') }}">
|
||||
<span class="text-disabled">{{ trans('invoices.send_mail') }}</span>
|
||||
</button>
|
||||
@endif
|
||||
@stack('button_email_end')
|
||||
|
||||
@stack('button_pdf_start')
|
||||
<a class="dropdown-item" href="{{ url('sales/invoices/' . $invoice->id . '/pdf') }}">{{ trans('invoices.download_pdf') }}</a>
|
||||
@stack('button_pdf_end')
|
||||
|
||||
@stack('button_delete_start')
|
||||
@permission('delete-sales-invoices')
|
||||
@if(!$invoice->reconciled)
|
||||
{!! Form::deleteLink($invoice, 'sales/invoices') !!}
|
||||
@endif
|
||||
@endpermission
|
||||
@stack('button_delete_end')
|
||||
</div>
|
||||
</div>
|
||||
@stack('button_group_end')
|
||||
|
||||
@if($invoice->attachment)
|
||||
@php $file = $invoice->attachment; @endphp
|
||||
@include('partials.media.file')
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@stack('card_footer_end')
|
||||
</div>
|
||||
@stack('invoice_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('invoices.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($invoice->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 ($invoice->transactions->count())
|
||||
@foreach($invoice->transactions as $transaction)
|
||||
<tr class="row align-items-center border-top-1">
|
||||
<td class="col-xs-4 col-sm-3">@date($transaction->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-default btn-xs">
|
||||
<i class="fa fa-check"></i> {{ trans('reconciliations.reconciled') }}
|
||||
</button>
|
||||
@else
|
||||
{!! Form::open([
|
||||
'id' => 'invoice-transaction-' . $transaction->id,
|
||||
'method' => 'DELETE',
|
||||
'route' => ['transactions.destroy', $transaction->id],
|
||||
'class' => 'd-inline'
|
||||
]) !!}
|
||||
{{ Form::hidden('form_id', '#invoice-transaction-' . $transaction->id, ['id' => 'form_id-' . $transaction->id]) }}
|
||||
{{ Form::hidden('title', trans_choice('general.transactions', 2), ['id' => 'title-' . $transaction->id]) }}
|
||||
@php $message = trans('general.delete_confirm', [
|
||||
'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))
|
||||
]);
|
||||
@endphp
|
||||
{{ Form::hidden('message', $message, ['id' => 'mesage-' . $transaction->id]) }}
|
||||
{{ Form::hidden('cancel', trans('general.cancel'), ['id' => 'cancel-' . $transaction->id]) }}
|
||||
{{ Form::hidden('delete', trans('general.delete'), ['id' => 'delete-' . $transaction->id]) }}
|
||||
|
||||
{!! Form::button('<i class="fa fa-trash-o" aria-hidden="true"></i> ' . trans('general.delete'), array(
|
||||
'type' => 'button',
|
||||
'class' => 'btn btn-danger btn-sm',
|
||||
'title' => trans('general.delete'),
|
||||
'@click' => 'onDeleteTransaction("invoice-transaction-' . $transaction->id . '")'
|
||||
)) !!}
|
||||
{!! 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.invoices.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>
|
||||
|
||||
<a href="{{ url('apps/categories/payment-method') }}" class="btn btn-white">
|
||||
<span class="fa fa-money"></span> {{ trans('invoices.accept_payments') }}
|
||||
</a>
|
||||
|
||||
<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/sales/invoices.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
60
resources/views/sales/revenues/create.blade.php
Normal file
60
resources/views/sales/revenues/create.blade.php
Normal file
@ -0,0 +1,60 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.revenues', 1)]))
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
{!! Form::open([
|
||||
'route' => 'revenues.store',
|
||||
'id' => 'revenue',
|
||||
'@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', '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.customers', 1), 'user', $customers, setting('default.contact'), []) }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.category')) }}
|
||||
|
||||
{{ 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.invoices', 1), 'file-invoice', [], null, ['disabled']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('sales/revenues') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::hidden('type', 'income') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/sales/revenues.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
77
resources/views/sales/revenues/edit.blade.php
Normal file
77
resources/views/sales/revenues/edit.blade.php
Normal file
@ -0,0 +1,77 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.revenues', 1)]))
|
||||
|
||||
@section('content')
|
||||
@if (($recurring = $revenue->recurring) && ($next = $recurring->next()))
|
||||
<div class="callout callout-info">
|
||||
<h4>{{ trans('recurring.recurring') }}</h4>
|
||||
|
||||
<p>{{ trans('recurring.message', [
|
||||
'type' => mb_strtolower(trans_choice('general.revenues', 1)),
|
||||
'date' => $next->format($date_format)
|
||||
]) }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card">
|
||||
{!! Form::model($revenue, [
|
||||
'method' => 'PATCH',
|
||||
'files' => true,
|
||||
'route' => ['revenues.update', $revenue->id],
|
||||
'role' => 'form',
|
||||
'id' => 'revenue',
|
||||
'@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($revenue->paid_at)->toDateString()) }}
|
||||
|
||||
{!! Form::hidden('currency_code', $revenue->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], $revenue->amount) }}
|
||||
|
||||
{{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $revenue->account_id, ['required' => 'required', 'change' => 'onChangeAccount']) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $revenue->contact_id, []) }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $revenue->category_id) }}
|
||||
|
||||
{{ Form::recurring('edit', $revenue) }}
|
||||
|
||||
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, $revenue->payment_method) }}
|
||||
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }}
|
||||
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment')) }}
|
||||
|
||||
@if ($revenue->invoice)
|
||||
{{ Form::textGroup('document_id', trans_choice('general.invoices', 1), 'file-invoice', ['disabled'], $revenue->invoice->invoice_number) }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@permission('update-sales-revenues')
|
||||
<div class="card-footer">
|
||||
<div class="row float-right">
|
||||
{{ Form::saveButtons('sales/revenues') }}
|
||||
</div>
|
||||
</div>
|
||||
@endpermission
|
||||
|
||||
{{ Form::hidden('type', 'income') }}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/sales/revenues.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
114
resources/views/sales/revenues/index.blade.php
Normal file
114
resources/views/sales/revenues/index.blade.php
Normal file
@ -0,0 +1,114 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans_choice('general.revenues', 2))
|
||||
|
||||
@section('new_button')
|
||||
@permission('create-sales-revenues')
|
||||
<span><a href="{{ route('revenues.create') }}" class="btn btn-primary btn-sm btn-success header-button-top"><span class="fa fa-plus"></span> {{ trans('general.add_new') }}</a></span>
|
||||
<span><a href="{{ url('common/import/sales/revenues') }}" 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('revenues.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 ($revenues->count())
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0" v-bind:class="[bulk_action.show ? 'bg-gradient-primary' : '']">
|
||||
{!! Form::open([
|
||||
'url' => 'sales/revenues',
|
||||
'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.revenues', $bulk_actions, 'sales/revenues') }}
|
||||
{!! 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.customers', 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($revenues 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="text-success col-aka" href="{{ route('revenues.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('revenues.edit', $item->id) }}">{{ trans('general.edit') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@endif
|
||||
@permission('create-sales-revenues')
|
||||
<a class="dropdown-item" href="{{ route('revenues.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
|
||||
@endpermission
|
||||
|
||||
@permission('delete-sales-revenues')
|
||||
@if (!$item->reconciled)
|
||||
<div class="dropdown-divider"></div>
|
||||
{!! Form::deleteLink($item, 'sales/revenues') !!}
|
||||
@endif
|
||||
@endpermission
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-secondary 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' => $revenues])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
@include('partials.admin.empty_page', ['page' => 'revenues', 'docs_path' => 'sales/revenues'])
|
||||
@endif
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/sales/revenues.js?v=' . version('short')) }}"></script>
|
||||
@endpush
|
Reference in New Issue
Block a user