Merge Invoice and Bill into Document
This commit is contained in:
@@ -1,231 +1,11 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('general.title.new', ['type' => trans_choice('general.invoices', 1)]))
|
||||
@section('title', trans('general.title.new', ['type' => setting('invoice.title', 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::selectRemoteAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, setting('default.contact'), ['required' => 'required', 'change' => 'onChangeContact', 'path' => route('modals.customers.create'), 'remote_action' => route('customers.index')]) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'model' => 'form.currency_code', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], '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'], request()->get('invoiced_at', 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'], request()->get('due_at', Date::parse(request()->get('invoiced_at', Date::now()->toDateString()))->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-sm-12 mb-4">
|
||||
@php $item_colspan = in_array(setting('localisation.discount_location', 'total'), ['item', 'both']) ? '6' : '5' @endphp
|
||||
{!! Form::label('items', trans_choice($text_override['items'], 2), ['class' => 'form-control-label']) !!}
|
||||
<div class="table-responsive overflow-x-scroll overflow-y-hidden">
|
||||
<table class="table table-bordered" id="items">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
@stack('actions_th_start')
|
||||
<th class="text-center border-right-0 border-bottom-0">{{ trans('general.actions') }}</th>
|
||||
@stack('actions_th_end')
|
||||
|
||||
@stack('name_th_start')
|
||||
<th class="text-left border-right-0 border-bottom-0">{{ trans('general.name') }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="text-center border-right-0 border-bottom-0 w-10">{{ trans($text_override['quantity']) }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="text-right border-right-0 border-bottom-0">{{ trans($text_override['price']) }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('discount_th_start')
|
||||
<th class="text-right border-right-0 border-bottom-0">{{ trans('invoices.discount') }}</th>
|
||||
@stack('discount_th_end')
|
||||
@endif
|
||||
|
||||
@stack('taxes_th_start')
|
||||
<th class="text-right border-right-0 border-bottom-0">{{ trans_choice('general.taxes', 1) }}</th>
|
||||
@stack('taxes_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="text-right border-bottom-0 item-total">{{ 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 id="addItem">
|
||||
<td class="text-center 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="text-right border-bottom-0" colspan="{{ $item_colspan }}" :colspan="colspan"></td>
|
||||
</tr>
|
||||
@stack('add_item_td_end')
|
||||
|
||||
@stack('sub_total_td_start')
|
||||
<tr id="tr-subtotal">
|
||||
<td class="text-right border-right-0 border-bottom-0" colspan="{{ $item_colspan }}" :colspan="colspan">
|
||||
<strong>{{ trans('invoices.sub_total') }}</strong>
|
||||
</td>
|
||||
<td class="text-right border-bottom-0 long-texts">
|
||||
{{ Form::moneyGroup('sub_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.sub', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
|
||||
<span id="sub-total" v-if="totals.sub" v-html="totals.sub"></span>
|
||||
<span v-else>@money(0, $currency->code, true)</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('sub_total_td_end')
|
||||
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('item_discount_td_start')
|
||||
<tr id="tr-subtotal">
|
||||
<td class="text-right border-right-0 border-bottom-0" colspan="{{ $item_colspan }}" :colspan="colspan">
|
||||
<strong>{{ trans('invoices.item_discount') }}</strong>
|
||||
</td>
|
||||
<td class="text-right border-bottom-0 long-texts">
|
||||
{{ Form::moneyGroup('item_discount', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.item_discount', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
|
||||
<span id="item-discount" v-if="totals.item_discount" v-html="totals.item_discount"></span>
|
||||
<span v-else>@money(0, $currency->code, true)</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('item_discount_td_end')
|
||||
@endif
|
||||
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['total', 'both']))
|
||||
@stack('add_discount_td_start')
|
||||
<tr id="tr-discount">
|
||||
<td class="text-right border-right-0 border-bottom-0" colspan="{{ $item_colspan }}" :colspan="colspan">
|
||||
<el-popover
|
||||
popper-class="p-0 h-0"
|
||||
placement="bottom"
|
||||
width="300"
|
||||
v-model="discount">
|
||||
<div class="card d-none" :class="[{'show' : discount}]">
|
||||
<div class="discount card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-sm-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', 'v-model' => 'form.discount']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="discount-description">
|
||||
<strong>{{ trans('invoices.discount_desc') }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="discount card-footer">
|
||||
<div class="row float-right">
|
||||
<div class="col-xs-12 col-sm-12">
|
||||
<a href="javascript:void(0)" @click="discount = false" class="btn btn-outline-secondary" @click="closePayment">
|
||||
{{ trans('general.cancel') }}
|
||||
</a>
|
||||
{!! Form::button(trans('general.save'), ['type' => 'button', 'id' => 'save-discount', '@click' => 'onAddDiscount', 'class' => 'btn btn-success']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-link class="cursor-pointer text-info" 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="text-right border-bottom-0">
|
||||
{{ Form::moneyGroup('discount_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.discount', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
|
||||
<span id="discount-total" v-if="totals.discount" v-html="totals.discount"></span>
|
||||
<span v-else>@money(0, $currency->code, true)</span>
|
||||
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
|
||||
</td>
|
||||
</tr>
|
||||
@stack('add_discount_td_end')
|
||||
@endif
|
||||
|
||||
@stack('tax_total_td_start')
|
||||
<tr id="tr-tax">
|
||||
<td class="text-right border-right-0 border-bottom-0" colspan="{{ $item_colspan }}" :colspan="colspan">
|
||||
<strong>{{ trans_choice('general.taxes', 1) }}</strong>
|
||||
</td>
|
||||
<td class="text-right border-bottom-0 long-texts">
|
||||
{{ Form::moneyGroup('tax_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.tax', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
|
||||
<span id="tax-total" v-if="totals.tax" v-html="totals.tax"></span>
|
||||
<span v-else>@money(0, $currency->code, true)</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('tax_total_td_end')
|
||||
|
||||
@stack('grand_total_td_start')
|
||||
<tr id="tr-total">
|
||||
<td class="text-right border-right-0" colspan="{{ $item_colspan }}" :colspan="colspan">
|
||||
<strong>{{ trans('invoices.total') }}</strong>
|
||||
</td>
|
||||
<td class="text-right long-texts">
|
||||
{{ Form::moneyGroup('grand_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.total', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
|
||||
<span id="grand-total" v-if="totals.total" v-html="totals.total"></span>
|
||||
<span v-else>@money(0, $currency->code, true)</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('grand_total_td_end')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2), '', setting('invoice.notes'), ['rows' => '3'], 'col-md-6') }}
|
||||
|
||||
{{ Form::textareaGroup('footer', trans('general.footer'), '', setting('invoice.footer'), ['rows' => '3'], 'col-md-6') }}
|
||||
|
||||
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, setting('default.income_category'), ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income', 'remote_action' => route('categories.index'). '?type=income']) }}
|
||||
|
||||
{{ 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('status', old('status', 'draft'), ['id' => 'status', 'v-model' => 'form.status']) }}
|
||||
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
{{ Form::saveButtons('invoices.index') }}
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
<x-documents.form.content type="invoice" />
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script type="text/javascript">
|
||||
var invoice_items = {!! (old('items')) ? json_encode(old('items')) : 'false' !!};
|
||||
</script>
|
||||
|
||||
<script src="{{ asset('public/js/sales/invoices.js?v=' . version('short')) }}"></script>
|
||||
<x-documents.script />
|
||||
@endpush
|
||||
|
||||
@@ -3,232 +3,9 @@
|
||||
@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::selectRemoteAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $invoice->contact_id, ['required' => 'required', 'change' => 'onChangeContact', 'path' => route('modals.customers.create'), 'remote_action' => route('customers.index')]) }}
|
||||
|
||||
{{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $invoice->currency_code, ['required' => 'required', 'model' => 'form.currency_code', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], '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-sm-12 mb-4">
|
||||
@php $item_colspan = in_array(setting('localisation.discount_location', 'total'), ['item', 'both']) ? '6' : '5' @endphp
|
||||
{!! Form::label('items', trans_choice($text_override['items'], 2), ['class' => 'control-label']) !!}
|
||||
<div class="table-responsive overflow-x-scroll overflow-y-hidden">
|
||||
<table class="table table-bordered" id="items">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
@stack('actions_th_start')
|
||||
<th class="text-center border-right-0 border-bottom-0">{{ trans('general.actions') }}</th>
|
||||
@stack('actions_th_end')
|
||||
|
||||
@stack('name_th_start')
|
||||
<th class="text-left border-right-0 border-bottom-0">{{ trans('general.name') }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="text-center border-right-0 border-bottom-0 w-10">{{ trans($text_override['quantity']) }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="text-right border-right-0 border-bottom-0">{{ trans($text_override['price']) }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('discount_th_start')
|
||||
<th class="text-right border-right-0 border-bottom-0">{{ trans('invoices.discount') }}</th>
|
||||
@stack('discount_th_end')
|
||||
@endif
|
||||
|
||||
@stack('taxes_th_start')
|
||||
<th class="text-right border-right-0 border-bottom-0">{{ trans_choice('general.taxes', 1) }}</th>
|
||||
@stack('taxes_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="text-right border-bottom-0 item-total">{{ 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 id="addItem">
|
||||
<td class="text-center 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="text-right border-bottom-0" colspan="{{ $item_colspan }}" :colspan="colspan"></td>
|
||||
</tr>
|
||||
@stack('add_item_td_end')
|
||||
|
||||
@stack('sub_total_td_start')
|
||||
<tr id="tr-subtotal">
|
||||
<td class="text-right border-right-0 border-bottom-0" colspan="{{ $item_colspan }}" :colspan="colspan">
|
||||
<strong>{{ trans('invoices.sub_total') }}</strong>
|
||||
</td>
|
||||
<td class="text-right border-bottom-0 long-texts">
|
||||
{{ Form::moneyGroup('sub_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.sub', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
|
||||
<span id="sub-total" v-if="totals.sub" v-html="totals.sub"></span>
|
||||
<span v-else>@money(0, $currency->code, true)</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('sub_total_td_end')
|
||||
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('item_discount_td_start')
|
||||
<tr id="tr-subtotal">
|
||||
<td class="text-right border-right-0 border-bottom-0" colspan="{{ $item_colspan }}" :colspan="colspan">
|
||||
<strong>{{ trans('invoices.item_discount') }}</strong>
|
||||
</td>
|
||||
<td class="text-right border-bottom-0 long-texts">
|
||||
{{ Form::moneyGroup('item_discount', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.item_discount', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
|
||||
<span id="item-discount" v-if="totals.item_discount" v-html="totals.item_discount"></span>
|
||||
<span v-else>@money(0, $currency->code, true)</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('item_discount_td_end')
|
||||
@endif
|
||||
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['total', 'both']))
|
||||
@stack('add_discount_td_start')
|
||||
<tr id="tr-discount">
|
||||
<td class="text-right border-right-0 border-bottom-0" colspan="{{ $item_colspan }}" :colspan="colspan">
|
||||
<el-popover
|
||||
popper-class="p-0 h-0"
|
||||
placement="bottom"
|
||||
width="300"
|
||||
v-model="discount">
|
||||
<div class="card d-none" :class="[{'show' : discount}]">
|
||||
<div class="discount card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-sm-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', 'v-model' => 'form.discount']) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="discount-description">
|
||||
<strong>{{ trans('invoices.discount_desc') }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="discount card-footer">
|
||||
<div class="row float-right">
|
||||
<div class="col-xs-12 col-sm-12">
|
||||
<a href="javascript:void(0)" @click="discount = false" class="btn btn-outline-secondary" @click="closePayment">
|
||||
{{ trans('general.cancel') }}
|
||||
</a>
|
||||
{!! Form::button(trans('general.save'), ['type' => 'button', 'id' => 'save-discount', '@click' => 'onAddDiscount', 'class' => 'btn btn-success']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-link class="cursor-pointer text-info" 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="text-right border-bottom-0">
|
||||
{{ Form::moneyGroup('discount_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.discount', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
|
||||
<span id="discount-total" v-if="totals.discount" v-html="totals.discount"></span>
|
||||
<span v-else>@money(0, $currency->code, true)</span>
|
||||
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
|
||||
</td>
|
||||
</tr>
|
||||
@stack('add_discount_td_end')
|
||||
@endif
|
||||
|
||||
@stack('tax_total_td_start')
|
||||
<tr id="tr-tax">
|
||||
<td class="text-right border-right-0 border-bottom-0" colspan="{{ $item_colspan }}" :colspan="colspan">
|
||||
<strong>{{ trans_choice('general.taxes', 1) }}</strong>
|
||||
</td>
|
||||
<td class="text-right border-bottom-0 long-texts">
|
||||
{{ Form::moneyGroup('tax_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.tax', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
|
||||
<span id="tax-total" v-if="totals.tax" v-html="totals.tax"></span>
|
||||
<span v-else>@money(0, $currency->code, true)</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('tax_total_td_end')
|
||||
|
||||
@stack('grand_total_td_start')
|
||||
<tr id="tr-total">
|
||||
<td class="text-right border-right-0" colspan="{{ $item_colspan }}" :colspan="colspan">
|
||||
<strong>{{ trans('invoices.total') }}</strong>
|
||||
</td>
|
||||
<td class="text-right long-texts">
|
||||
{{ Form::moneyGroup('grand_total', '', '', ['disabled' => true, 'required' => 'required', 'v-model' => 'totals.total', 'currency' => $currency, 'masked' => 'true'], 0.00, 'text-right d-none') }}
|
||||
<span id="grand-total" v-if="totals.total" v-html="totals.total"></span>
|
||||
<span v-else>@money(0, $currency->code, true)</span>
|
||||
</td>
|
||||
</tr>
|
||||
@stack('grand_total_td_end')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::textareaGroup('notes', trans_choice('general.notes', 2), '', null, ['rows' => '3'], 'col-md-6') }}
|
||||
|
||||
{{ Form::textareaGroup('footer', trans('general.footer'), '', null, ['rows' => '3'], 'col-md-6') }}
|
||||
|
||||
{{ Form::selectRemoteAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, $invoice->category_id, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=income', 'remote_action' => route('categories.index'). '?type=income']) }}
|
||||
|
||||
{{ 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('status', old('status', 'draft'), ['id' => 'status', 'v-model' => 'form.status']) }}
|
||||
{{ Form::hidden('amount', old('amount', '0'), ['id' => 'amount', 'v-model' => 'form.amount']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@can('update-sales-invoices')
|
||||
<div class="card-footer">
|
||||
<div class="row save-buttons">
|
||||
{{ Form::saveButtons('invoices.index') }}
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
<x-documents.form.content type="invoice" :document="$invoice" />
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script type="text/javascript">
|
||||
var invoice_items = {!! json_encode(old('items', $invoice->items()->get())) !!};
|
||||
</script>
|
||||
|
||||
<script src="{{ asset('public/js/sales/invoices.js?v=' . version('short')) }}"></script>
|
||||
<x-documents.script :items="$invoice->items()->get()" />
|
||||
@endpush
|
||||
|
||||
@@ -3,107 +3,13 @@
|
||||
@section('title', trans_choice('general.invoices', 2))
|
||||
|
||||
@section('new_button')
|
||||
@can('create-sales-invoices')
|
||||
<a href="{{ route('invoices.create') }}" class="btn btn-primary btn-sm btn-success">{{ trans('general.add_new') }}</a>
|
||||
<a href="{{ route('import.create', ['group' => 'sales', 'type' => 'invoices']) }}" class="btn btn-white btn-sm">{{ trans('import.import') }}</a>
|
||||
@endcan
|
||||
<a href="{{ route('invoices.export', request()->input()) }}" class="btn btn-white btn-sm">{{ trans('general.export') }}</a>
|
||||
<x-documents.index.top-buttons type="invoice" />
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@if ($invoices->count() || request()->get('search', false))
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom-0" :class="[{'bg-gradient-primary': bulk_action.show}]">
|
||||
{!! Form::open([
|
||||
'method' => 'GET',
|
||||
'route' => 'invoices.index',
|
||||
'role' => 'form',
|
||||
'class' => 'mb-0'
|
||||
]) !!}
|
||||
<div class="align-items-center" v-if="!bulk_action.show">
|
||||
<x-search-string model="App\Models\Sale\Invoice" />
|
||||
</div>
|
||||
|
||||
{{ Form::bulkActionRowGroup('general.invoices', $bulk_actions, ['group' => 'sales', 'type' => '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-1 col-xl-1 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 text-left">@sortablelink('contact_name', trans_choice('general.customers', 1))</th>
|
||||
<th class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@sortablelink('amount', trans('general.amount'))</th>
|
||||
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@sortablelink('invoiced_at', trans('invoices.invoice_date'))</th>
|
||||
<th class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@sortablelink('due_at', trans('invoices.due_date'))</th>
|
||||
<th class="col-lg-1 col-xl-1 d-none d-lg-block text-center">@sortablelink('status', 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-1 col-xl-1 d-none d-md-block"><a class="col-aka" 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 text-left">{{ $item->contact_name }}</td>
|
||||
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@date($item->invoiced_at)</td>
|
||||
<td class="col-lg-2 col-xl-2 d-none d-lg-block text-left">@date($item->due_at)</td>
|
||||
<td class="col-lg-1 col-xl-1 d-none d-lg-block text-center">
|
||||
<span class="badge badge-pill badge-{{ $item->status_label }}">{{ trans('invoices.statuses.' . $item->status) }}</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>
|
||||
|
||||
@if ($item->status != 'cancelled')
|
||||
@can('create-sales-invoices')
|
||||
<a class="dropdown-item" href="{{ route('invoices.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
@endcan
|
||||
|
||||
@can('update-sales-invoices')
|
||||
<a class="dropdown-item" href="{{ route('invoices.cancelled', $item->id) }}">{{ trans('general.cancel') }}</a>
|
||||
@endcan
|
||||
@endif
|
||||
|
||||
@can('delete-sales-invoices')
|
||||
@if (!$item->reconciled)
|
||||
{!! Form::deleteLink($item, 'invoices.destroy') !!}
|
||||
@endif
|
||||
@endcan
|
||||
</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
|
||||
<x-documents.index.content type="invoice" :documents="$invoices" />
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/sales/invoices.js?v=' . version('short')) }}"></script>
|
||||
<x-documents.script />
|
||||
@endpush
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
<tr v-for="(row, index) in form.items"
|
||||
:index="index">
|
||||
@stack('actions_td_start')
|
||||
<td class="text-center 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="border-right-0 border-bottom-0"
|
||||
:class="[{'has-error': form.errors.has('items.' + index + '.name') }]">
|
||||
@stack('name_input_start')
|
||||
<akaunting-select-remote
|
||||
:form-classes="[{'has-error': form.errors.has('items.' + index + '.name')}]"
|
||||
:placeholder="'{{ trans('general.type_item_name') }}'"
|
||||
:name="'item_id'"
|
||||
:options="{{ json_encode($items) }}"
|
||||
:value="form.items[index].item_id"
|
||||
:add-new="{{ json_encode([
|
||||
'status' => true,
|
||||
'text' => trans('general.add_new'),
|
||||
'path' => route('modals.items.store'),
|
||||
'type' => 'inline',
|
||||
'field' => [
|
||||
'key' => 'id',
|
||||
'value' => 'name'
|
||||
],
|
||||
'new_text' => trans('modules.new'),
|
||||
])}}"
|
||||
@interface="row.item_id = $event"
|
||||
@label="row.name = $event"
|
||||
@option="onSelectItem($event, index)"
|
||||
@change="form.errors.clear('items.' + index + '.name')"
|
||||
:remote-action="'{{ route('items.autocomplete') }}'"
|
||||
remote-type="invoice"
|
||||
:currency-code="form.currency_code"
|
||||
:form-error="form.errors.get('items.' + index + '.name')"
|
||||
:loading-text="'{{ trans('general.loading') }}'"
|
||||
:no-data-text="'{{ trans('general.no_data') }}'"
|
||||
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
|
||||
></akaunting-select-remote>
|
||||
<input type="hidden"
|
||||
data-item="name"
|
||||
v-model="row.name"
|
||||
@input="onCalculateTotal"
|
||||
name="item[][name]">
|
||||
|
||||
<div class="invalid-feedback d-block"
|
||||
v-if="form.errors.has('items.' + index + '.name')"
|
||||
v-html="form.errors.get('items.' + index + '.name')">
|
||||
</div>
|
||||
@stack('name_input_end')
|
||||
</td>
|
||||
@stack('name_td_end')
|
||||
|
||||
@stack('quantity_td_start')
|
||||
<td class="border-right-0 border-bottom-0 w-10"
|
||||
:class="[{'has-error': form.errors.has('items.' + index + '.quantity') }]">
|
||||
@stack('quantity_input_start')
|
||||
<input type="text"
|
||||
class="form-control text-center"
|
||||
:name="'items.' + index + '.quantity'"
|
||||
autocomplete="off"
|
||||
required="required"
|
||||
data-item="quantity"
|
||||
v-model="row.quantity"
|
||||
@input="onCalculateTotal"
|
||||
@change="form.errors.clear('items.' + index + '.quantity')">
|
||||
|
||||
<div class="invalid-feedback d-block"
|
||||
v-if="form.errors.has('items.' + index + '.quantity')"
|
||||
v-html="form.errors.get('items.' + index + '.quantity')">
|
||||
</div>
|
||||
@stack('quantity_input_end')
|
||||
</td>
|
||||
@stack('quantity_td_end')
|
||||
|
||||
@stack('price_td_start')
|
||||
<td class="border-right-0 border-bottom-0 pb-0"
|
||||
:class="[{'has-error': form.errors.has('items.' + index + '.price') }]">
|
||||
@stack('price_input_start')
|
||||
{{ Form::moneyGroup('price', '', '', ['required' => 'required', 'v-model' => 'row.price', 'v-error' => 'form.errors.get(\'items.\' + index + \'.price\')', 'v-error-message' => 'form.errors.get(\'items.\' + index + \'.price\')' , 'data-item' => 'price', 'currency' => $currency, 'dynamic-currency' => 'currency', 'change' => 'row.price = $event; form.errors.clear(\'items.\' + index + \'.price\'); onCalculateTotal'], 0.00, 'text-right input-price') }}
|
||||
|
||||
<input :name="'items.' + index + '.currency'"
|
||||
data-item="currency"
|
||||
v-model="row.currency"
|
||||
@input="onCalculateTotal"
|
||||
type="hidden">
|
||||
@stack('price_input_end')
|
||||
</td>
|
||||
@stack('price_td_end')
|
||||
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('discount_td_start')
|
||||
<td class="border-right-0 border-bottom-0 w-12"
|
||||
:class="[{'has-error': form.errors.has('items.' + index + '.discount') }]">
|
||||
@stack('discount_input_start')
|
||||
<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>
|
||||
<input type="number"
|
||||
max="100"
|
||||
min="0"
|
||||
class="form-control text-center"
|
||||
:name="'items.' + index + '.discount'"
|
||||
autocomplete="off"
|
||||
required="required"
|
||||
data-item="quantity"
|
||||
v-model="row.discount"
|
||||
@input="onCalculateTotal"
|
||||
@change="form.errors.clear('items.' + index + '.discount')">
|
||||
|
||||
<div class="invalid-feedback d-block"
|
||||
v-if="form.errors.has('items.' + index + '.discount')"
|
||||
v-html="form.errors.get('items.' + index + '.discount')">
|
||||
</div>
|
||||
</div>
|
||||
@stack('discount_input_end')
|
||||
</td>
|
||||
@stack('discount_td_end')
|
||||
@endif
|
||||
|
||||
@stack('taxes_td_start')
|
||||
<td class="border-right-0 border-bottom-0"
|
||||
:class="[{'has-error': form.errors.has('items.' + index + '.tax_id') }]">
|
||||
@stack('tax_id_input_start')
|
||||
<akaunting-select
|
||||
class="mb-0 select-tax"
|
||||
:form-classes="[{'has-error': form.errors.has('items.' + index + '.tax_id') }]"
|
||||
:icon="''"
|
||||
:title="''"
|
||||
:placeholder="'{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}'"
|
||||
:name="'tax_id'"
|
||||
:options="{{ json_encode($taxes->pluck('title', 'id')) }}"
|
||||
:value="row.tax_id"
|
||||
:multiple="true"
|
||||
:add-new="{{ json_encode([
|
||||
'status' => true,
|
||||
'text' => trans('general.add_new'),
|
||||
'path' => route('modals.taxes.create'),
|
||||
'type' => 'modal',
|
||||
'field' => [
|
||||
'key' => 'id',
|
||||
'value' => 'title'
|
||||
],
|
||||
'new_text' => trans('modules.new'),
|
||||
'buttons' => [
|
||||
'cancel' => [
|
||||
'text' => trans('general.cancel'),
|
||||
'class' => 'btn-outline-secondary'
|
||||
],
|
||||
'confirm' => [
|
||||
'text' => trans('general.save'),
|
||||
'class' => 'btn-success'
|
||||
]
|
||||
]
|
||||
])}}"
|
||||
:collapse="true"
|
||||
@interface="row.tax_id = $event"
|
||||
@change="onCalculateTotal()"
|
||||
@new="taxes.push($event)"
|
||||
:form-error="form.errors.get('items.' + index + '.tax_id')"
|
||||
:no-data-text="'{{ trans('general.no_data') }}'"
|
||||
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
|
||||
></akaunting-select>
|
||||
<input id="taxes" name="taxes" type="hidden" data-value="{{ json_encode($taxes) }}" v-model="taxes">
|
||||
@stack('tax_id_input_end')
|
||||
</td>
|
||||
@stack('taxes_td_end')
|
||||
|
||||
@stack('total_td_start')
|
||||
<td class="text-right total-column border-bottom-0 long-texts">
|
||||
<akaunting-money :col="'d-none'"
|
||||
:masked="true"
|
||||
:error="{{ 'form.errors.get("total")' }}"
|
||||
:name="'total'"
|
||||
:currency="{{ json_encode($currency) }}"
|
||||
:dynamic-currency="currency"
|
||||
v-model="row.total"
|
||||
@interface="row.total = $event"
|
||||
></akaunting-money>
|
||||
@stack('total_input_start')
|
||||
<span id="item-total" v-if="row.total" v-html="row.total"></span>
|
||||
@if (empty($item) || !isset($item->total))
|
||||
<span id="item-total" v-else>@money(0, $currency->code, true)</span>
|
||||
@else
|
||||
<span id="item-total" v-else>@money($item->total, $invoice->currency_code, true)</span>
|
||||
@endif
|
||||
@stack('total_input_end')
|
||||
</td>
|
||||
@stack('total_td_end')
|
||||
</tr>
|
||||
@@ -1,209 +1,10 @@
|
||||
@extends('layouts.print')
|
||||
|
||||
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
|
||||
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->document_number)
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-58">
|
||||
<div class="text company">
|
||||
<img src="{{ $logo }}" class="c-logo" alt="{{ setting('company.name') }}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-42">
|
||||
<div class="text company">
|
||||
<strong>{{ setting('company.name') }}</strong><br>
|
||||
|
||||
<p>{!! nl2br(setting('company.address')) !!}</p>
|
||||
|
||||
<p>
|
||||
@if (setting('company.tax_number'))
|
||||
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
|
||||
@endif
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@if (setting('company.phone'))
|
||||
{{ setting('company.phone') }}
|
||||
@endif
|
||||
</p>
|
||||
|
||||
<p>{{ setting('company.email') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-33">
|
||||
<hr class="invoice-classic-line mb-1 mt-4" style="background-color:{{ setting('invoice.color') }};">
|
||||
<hr class="invoice-classic-line" style="background-color:{{ setting('invoice.color') }};">
|
||||
</div>
|
||||
|
||||
<div class="col-33">
|
||||
<div class="invoice-classic-frame ml-1">
|
||||
<div class="invoice-classic-inline-frame text-center">
|
||||
@stack('invoice_number_input_start')
|
||||
<div class="text company">
|
||||
<strong>{{ trans('invoices.invoice_number') }}:</strong><br>
|
||||
{{ $invoice->invoice_number }}
|
||||
</div>
|
||||
@stack('invoice_number_input_end')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-33">
|
||||
<hr class="invoice-classic-line mb-1 mt-4" style="background-color:{{ setting('invoice.color') }};">
|
||||
<hr class="invoice-classic-line" style="background-color:{{ setting('invoice.color') }};">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-58">
|
||||
<div class="text company">
|
||||
<strong>{{ trans('invoices.bill_to') }}</strong><br>
|
||||
@stack('name_input_start')
|
||||
<strong>{{ $invoice->contact_name }}</strong><br>
|
||||
@stack('name_input_end')
|
||||
|
||||
@stack('address_input_start')
|
||||
<p>{!! nl2br($invoice->contact_address) !!}</p>
|
||||
@stack('address_input_end')
|
||||
|
||||
@stack('tax_number_input_start')
|
||||
<p>
|
||||
@if ($invoice->contact_tax_number)
|
||||
{{ trans('general.tax_number') }}: {{ $invoice->contact_tax_number }}
|
||||
@endif
|
||||
</p>
|
||||
@stack('tax_number_input_end')
|
||||
|
||||
@stack('phone_input_start')
|
||||
<p>
|
||||
@if ($invoice->contact_phone)
|
||||
{{ $invoice->contact_phone }}
|
||||
@endif
|
||||
</p>
|
||||
@stack('phone_input_end')
|
||||
|
||||
@stack('email_start')
|
||||
<p>{{ $invoice->contact_email }}</p>
|
||||
@stack('email_input_end')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-42">
|
||||
<div class="text company">
|
||||
@stack('order_number_input_start')
|
||||
@if ($invoice->order_number)
|
||||
<strong>{{ trans('invoices.order_number') }}:</strong>
|
||||
<span class="float-right">{{ $invoice->order_number }}</span><br><br>
|
||||
@endif
|
||||
@stack('order_number_input_end')
|
||||
|
||||
@stack('invoiced_at_input_start')
|
||||
<strong>{{ trans('invoices.invoice_date') }}:</strong>
|
||||
<span class="float-right">@date($invoice->invoiced_at)</span><br><br>
|
||||
@stack('invoiced_at_input_end')
|
||||
|
||||
@stack('due_at_input_start')
|
||||
<strong>{{ trans('invoices.payment_due') }}:</strong>
|
||||
<span class="float-right">@date($invoice->due_at)</span><br><br>
|
||||
@stack('due_at_input_end')
|
||||
|
||||
@foreach ($invoice->totals_sorted as $total)
|
||||
@if ($total->code == 'total')
|
||||
<strong>{{ trans($total->name) }}:</strong>
|
||||
<span class="float-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</span><br><br>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-100">
|
||||
<div class="text">
|
||||
<table class="c-lines">
|
||||
<thead>
|
||||
<tr>
|
||||
@stack('name_th_start')
|
||||
<th class="text-left item">{{ trans_choice($text_override['items'], 2) }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="quantity">{{ trans($text_override['quantity']) }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="price">{{ trans($text_override['price']) }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="total">{{ trans('invoices.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($invoice->items as $item)
|
||||
@include('partials.documents.item.print', ['document' => $invoice])
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-58">
|
||||
<div class="text company">
|
||||
@stack('notes_input_start')
|
||||
@if ($invoice->notes)
|
||||
<strong>{{ trans_choice('general.notes', 2) }}</strong><br><br>
|
||||
{!! nl2br($invoice->notes) !!}
|
||||
@endif
|
||||
@stack('notes_input_end')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-42 float-right text-right">
|
||||
<div class="text company pr-2">
|
||||
@foreach ($invoice->totals_sorted as $total)
|
||||
@if ($total->code != 'total')
|
||||
@stack($total->code . '_total_tr_start')
|
||||
<div class="border-top-dashed py-2">
|
||||
<strong class="float-left">{{ trans($total->title) }}:</strong>
|
||||
<span>@money($total->amount, $invoice->currency_code, true)</span>
|
||||
</div>
|
||||
@stack($total->code . '_total_tr_end')
|
||||
@else
|
||||
@if ($invoice->paid)
|
||||
@stack('paid_total_tr_start')
|
||||
<div class="border-top-dashed py-2">
|
||||
<strong class="float-left">{{ trans('invoices.paid') }}:</strong>
|
||||
<span>- @money($invoice->paid, $invoice->currency_code, true)</span>
|
||||
</div>
|
||||
@stack('paid_total_tr_end')
|
||||
@endif
|
||||
@stack('grand_total_tr_start')
|
||||
<div class="border-top-dashed py-2">
|
||||
<strong class="float-left">{{ trans($total->name) }}:</strong>
|
||||
<span>@money($total->amount - $invoice->paid, $invoice->currency_code, true)</span>
|
||||
</div>
|
||||
@stack('grand_total_tr_end')
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($invoice->footer)
|
||||
<div class="row mt-1">
|
||||
<div class="col-100">
|
||||
<div class="text company">
|
||||
<strong>{!! nl2br($invoice->footer) !!}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<x-documents.template.classic
|
||||
type="invoice"
|
||||
:document="$invoice"
|
||||
/>
|
||||
@endsection
|
||||
|
||||
@@ -1,197 +1,10 @@
|
||||
@extends('layouts.print')
|
||||
|
||||
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
|
||||
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->document_number)
|
||||
|
||||
@section('content')
|
||||
<div class="row border-bottom-1">
|
||||
<div class="col-58">
|
||||
<div class="text company">
|
||||
<img class="d-logo" src="{{ $logo }}" alt="{{ setting('company.name') }}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-42">
|
||||
<div class="text company">
|
||||
<strong>{{ setting('company.name') }}</strong><br>
|
||||
<p>{!! nl2br(setting('company.address')) !!}</p>
|
||||
|
||||
<p>
|
||||
@if (setting('company.tax_number'))
|
||||
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
|
||||
@endif
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@if (setting('company.phone'))
|
||||
{{ setting('company.phone') }}
|
||||
@endif
|
||||
</p>
|
||||
|
||||
<p>{{ setting('company.email') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-58">
|
||||
<div class="text company">
|
||||
<br>
|
||||
<strong>{{ trans('invoices.bill_to') }}</strong><br>
|
||||
@stack('name_input_start')
|
||||
<strong>{{ $invoice->contact_name }}</strong><br>
|
||||
@stack('name_input_end')
|
||||
|
||||
@stack('address_input_start')
|
||||
<p>{!! nl2br($invoice->contact_address) !!}</p>
|
||||
@stack('address_input_end')
|
||||
|
||||
@stack('tax_number_input_start')
|
||||
<p>
|
||||
@if ($invoice->contact_tax_number)
|
||||
{{ trans('general.tax_number') }}: {{ $invoice->contact_tax_number }}
|
||||
@endif
|
||||
</p>
|
||||
@stack('tax_number_input_end')
|
||||
|
||||
@stack('phone_input_start')
|
||||
<p>
|
||||
@if ($invoice->contact_phone)
|
||||
{{ $invoice->contact_phone }}
|
||||
@endif
|
||||
</p>
|
||||
@stack('phone_input_end')
|
||||
|
||||
@stack('email_start')
|
||||
<p>
|
||||
{{ $invoice->contact_email }}
|
||||
</p>
|
||||
@stack('email_input_end')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-42">
|
||||
<div class="text company">
|
||||
<br>
|
||||
@stack('invoice_number_input_start')
|
||||
<strong>
|
||||
{{ trans('invoices.invoice_number') }}:
|
||||
</strong>
|
||||
<span class="float-right">{{ $invoice->invoice_number }}</span><br><br>
|
||||
@stack('invoice_number_input_end')
|
||||
|
||||
@stack('order_number_input_start')
|
||||
@if ($invoice->order_number)
|
||||
<strong>
|
||||
{{ trans('invoices.order_number') }}:
|
||||
</strong>
|
||||
<span class="float-right">{{ $invoice->order_number }}</span><br><br>
|
||||
@endif
|
||||
@stack('order_number_input_end')
|
||||
|
||||
@stack('invoiced_at_input_start')
|
||||
<strong>
|
||||
{{ trans('invoices.invoice_date') }}:
|
||||
</strong>
|
||||
<span class="float-right">@date($invoice->invoiced_at)</span><br><br>
|
||||
@stack('invoiced_at_input_end')
|
||||
|
||||
@stack('due_at_input_start')
|
||||
<strong>
|
||||
{{ trans('invoices.payment_due') }}:
|
||||
</strong>
|
||||
<span class="float-right">@date($invoice->due_at)</span><br><br>
|
||||
@stack('due_at_input_end')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-100">
|
||||
<div class="text">
|
||||
<table class="lines">
|
||||
@foreach($invoice as $item)
|
||||
<thead style="background-color:{{ setting('invoice.color') }} !important; -webkit-print-color-adjust: exact;">
|
||||
@endforeach
|
||||
<tr>
|
||||
@stack('name_th_start')
|
||||
<th class="item text-left text-white">{{ trans_choice($text_override['items'], 2) }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="quantity text-white">{{ trans($text_override['quantity']) }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="price text-white">{{ trans($text_override['price']) }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="total text-white">{{ trans('invoices.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($invoice->items as $item)
|
||||
@include('partials.documents.item.print', ['document' => $invoice])
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-9">
|
||||
<div class="col-58">
|
||||
<div class="text company">
|
||||
@stack('notes_input_start')
|
||||
@if ($invoice->notes)
|
||||
<br>
|
||||
<strong>{{ trans_choice('general.notes', 2) }}</strong><br><br>
|
||||
{!! nl2br($invoice->notes) !!}
|
||||
@endif
|
||||
@stack('notes_input_end')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-42 float-right text-right">
|
||||
<div class="text company">
|
||||
@foreach ($invoice->totals_sorted as $total)
|
||||
@if ($total->code != 'total')
|
||||
@stack($total->code . '_total_tr_start')
|
||||
<div class="border-top-1 py-2">
|
||||
<strong class="float-left">{{ trans($total->title) }}:</strong>
|
||||
<span>@money($total->amount, $invoice->currency_code, true)</span><br>
|
||||
</div>
|
||||
@stack($total->code . '_total_tr_end')
|
||||
@else
|
||||
@if ($invoice->paid)
|
||||
@stack('paid_total_tr_start')
|
||||
<div class="border-top-1 py-2">
|
||||
<strong class="float-left">{{ trans('invoices.paid') }}:</strong>
|
||||
<span>- @money($invoice->paid, $invoice->currency_code, true)</span><br>
|
||||
</div>
|
||||
@stack('paid_total_tr_end')
|
||||
@endif
|
||||
@stack('grand_total_tr_start')
|
||||
<div class="border-top-1 py-2">
|
||||
<strong class="float-left">{{ trans($total->name) }}:</strong>
|
||||
<span>@money($total->amount - $invoice->paid, $invoice->currency_code, true)</span>
|
||||
</div>
|
||||
@stack('grand_total_tr_end')
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($invoice->footer)
|
||||
<div class="row mt-4">
|
||||
<div class="col-100 text-left">
|
||||
<div class="text company">
|
||||
<strong>{!! nl2br($invoice->footer) !!}<strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<x-documents.template.ddefault
|
||||
type="invoice"
|
||||
:document="$invoice"
|
||||
/>
|
||||
@endsection
|
||||
|
||||
@@ -1,172 +1,10 @@
|
||||
@extends('layouts.print')
|
||||
|
||||
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
|
||||
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->document_number)
|
||||
|
||||
@section('content')
|
||||
<div class="row" style="background-color:{{ setting('invoice.color') }} !important; -webkit-print-color-adjust: exact;">
|
||||
<div class="col-58">
|
||||
<div class="text company pl-2 mb-1 d-flex align-items-center">
|
||||
<img src="{{ $logo }}" alt="{{ setting('company.name') }}"/>
|
||||
|
||||
<strong class="pl-2 text-white">{{ setting('company.name') }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-42">
|
||||
<div class="text company">
|
||||
<strong class="text-white">{!! nl2br(setting('company.address')) !!}</strong><br><br>
|
||||
|
||||
<strong class="text-white">
|
||||
@if (setting('company.tax_number'))
|
||||
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
|
||||
@endif
|
||||
</strong><br><br>
|
||||
|
||||
<strong class="text-white">
|
||||
@if (setting('company.phone'))
|
||||
{{ setting('company.phone') }}
|
||||
@endif
|
||||
</strong><br><br>
|
||||
|
||||
<strong class="text-white">{{ setting('company.email') }}</strong><br><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-58">
|
||||
<div class="text company">
|
||||
<strong>{{ trans('invoices.bill_to') }}</strong><br>
|
||||
@stack('name_input_start')
|
||||
<strong>{{ $invoice->contact_name }}</strong><br><br>
|
||||
@stack('name_input_end')
|
||||
|
||||
@stack('address_input_start')
|
||||
{!! nl2br($invoice->contact_address) !!}<br><br>
|
||||
@stack('address_input_end')
|
||||
|
||||
@stack('tax_number_input_start')
|
||||
@if ($invoice->contact_tax_number)
|
||||
{{ trans('general.tax_number') }}: {{ $invoice->contact_tax_number }}<br><br>
|
||||
@endif
|
||||
@stack('tax_number_input_end')
|
||||
|
||||
@stack('phone_input_start')
|
||||
@if ($invoice->contact_phone)
|
||||
{{ $invoice->contact_phone }}<br><br>
|
||||
@endif
|
||||
@stack('phone_input_end')
|
||||
|
||||
@stack('email_start')
|
||||
{{ $invoice->contact_email }}<br><br>
|
||||
@stack('email_input_end')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-42">
|
||||
<div class="text company">
|
||||
@stack('order_number_input_start')
|
||||
@if ($invoice->order_number)
|
||||
<strong>{{ trans('invoices.order_number') }}:</strong>
|
||||
<span class="float-right">{{ $invoice->order_number }}</span><br><br>
|
||||
@endif
|
||||
@stack('order_number_input_end')
|
||||
|
||||
@stack('invoice_number_input_start')
|
||||
<strong>{{ trans('invoices.invoice_number') }}:</strong>
|
||||
<span class="float-right">{{ $invoice->invoice_number }}</span><br><br>
|
||||
@stack('invoice_number_input_end')
|
||||
|
||||
@stack('invoiced_at_input_start')
|
||||
<strong>{{ trans('invoices.invoice_date') }}:</strong>
|
||||
<span class="float-right">@date($invoice->invoiced_at)</span><br><br>
|
||||
@stack('invoiced_at_input_end')
|
||||
|
||||
@stack('due_at_input_start')
|
||||
<strong>{{ trans('invoices.payment_due') }}:</strong>
|
||||
<span class="float-right">@date($invoice->due_at)</span>
|
||||
@stack('due_at_input_end')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-100">
|
||||
<div class="text">
|
||||
<table class="m-lines">
|
||||
<thead style="background-color:{{ setting('invoice.color') }} !important; -webkit-print-color-adjust: exact;">
|
||||
<tr>
|
||||
@stack('name_th_start')
|
||||
<th class="item text-left text-white">{{ trans_choice($text_override['items'], 2) }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="quantity text-white">{{ trans($text_override['quantity']) }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="price text-white">{{ trans($text_override['price']) }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@stack('total_th_start')
|
||||
<th class="total text-white">{{ trans('invoices.total') }}</th>
|
||||
@stack('total_th_end')
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($invoice->items as $item)
|
||||
@include('partials.documents.item.print', ['document' => $invoice])
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-7">
|
||||
<div class="col-58">
|
||||
<div class="text company">
|
||||
@stack('notes_input_start')
|
||||
@if ($invoice->notes)
|
||||
<strong>{{ trans_choice('general.notes', 2) }}</strong><br><br>
|
||||
{!! nl2br($invoice->notes) !!}
|
||||
@endif
|
||||
@stack('notes_input_end')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-42 float-right text-right">
|
||||
<div class="text company pr-2">
|
||||
@foreach ($invoice->totals_sorted as $total)
|
||||
@if ($total->code != 'total')
|
||||
@stack($total->code . '_total_tr_start')
|
||||
<strong class="float-left">{{ trans($total->title) }}:</strong>
|
||||
<span>@money($total->amount, $invoice->currency_code, true)</span><br><br>
|
||||
@stack($total->code . '_total_tr_end')
|
||||
@else
|
||||
@if ($invoice->paid)
|
||||
@stack('paid_total_tr_start')
|
||||
<strong class="float-left">{{ trans('invoices.paid') }}:</strong>
|
||||
<span>- @money($invoice->paid, $invoice->currency_code, true)</span><br><br>
|
||||
@stack('paid_total_tr_end')
|
||||
@endif
|
||||
@stack('grand_total_tr_start')
|
||||
<strong class="float-left">{{ trans($total->name) }}:</strong>
|
||||
<span>@money($total->amount - $invoice->paid, $invoice->currency_code, true)</span>
|
||||
@stack('grandtotal_tr_end')
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($invoice->footer)
|
||||
<div class="row mt-7">
|
||||
<div class="col-100 py-2" style="background-color:{{ setting('invoice.color') }} !important; -webkit-print-color-adjust: exact;">
|
||||
<div class="text pl-2">
|
||||
<strong class="text-white">{!! nl2br($invoice->footer) !!}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<x-documents.template.modern
|
||||
type="invoice"
|
||||
:document="$invoice"
|
||||
/>
|
||||
@endsection
|
||||
|
||||
@@ -1,683 +1,17 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
|
||||
@section('title', setting('invoice.title', trans_choice('general.invoices', 1)) . ': ' . $invoice->document_number)
|
||||
|
||||
@section('new_button')
|
||||
<x-documents.show.top-buttons type="invoice" :document="$invoice" />
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@stack('recurring_message_start')
|
||||
@if (($recurring = $invoice->recurring) && ($next = $recurring->getNextRecurring()))
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-12">
|
||||
<div class="media">
|
||||
<div class="media-body">
|
||||
<div class="media-comment-text">
|
||||
<div class="d-flex">
|
||||
@stack('recurring_message_head_start')
|
||||
<h5 class="mt-0">{{ trans('recurring.recurring') }}</h5>
|
||||
@stack('recurring_message_head_end')
|
||||
</div>
|
||||
|
||||
@stack('recurring_message_body_start')
|
||||
<p class="text-sm lh-160 mb-0">{{ trans('recurring.message', [
|
||||
'type' => mb_strtolower(trans_choice('general.invoices', 1)),
|
||||
'date' => $next->format($date_format)
|
||||
]) }}
|
||||
</p>
|
||||
@stack('recurring_message_body_end')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@stack('recurring_message_end')
|
||||
|
||||
@stack('status_message_start')
|
||||
@if ($invoice->status == 'draft')
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="alert alert-danger 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 (!in_array($invoice->status, ['paid', 'cancelled']))
|
||||
@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-primary">
|
||||
<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="{{ route('invoices.edit', $invoice->id) }}" class="btn btn-primary 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-danger">
|
||||
<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 != 'sent' && $invoice->status != 'partial' && $invoice->status != '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')
|
||||
@can('update-sales-invoices')
|
||||
@if($invoice->status == 'draft')
|
||||
<a href="{{ route('invoices.sent', $invoice->id) }}" class="btn btn-white btn-sm">{{ trans('invoices.mark_sent') }}</a>
|
||||
@else
|
||||
<button type="button" class="btn btn-secondary btn-sm" disabled="disabled">
|
||||
<span class="text-disabled">{{ trans('invoices.mark_sent') }}</span>
|
||||
</button>
|
||||
@endif
|
||||
@endcan
|
||||
@stack('timeline_body_send_invoice_body_button_sent_end')
|
||||
|
||||
@stack('timeline_body_send_invoice_body_button_email_start')
|
||||
@if($invoice->contact_email)
|
||||
<a href="{{ route('invoices.email', $invoice->id) }}" class="btn btn-danger btn-sm">{{ trans('invoices.send_mail') }}</a>
|
||||
@else
|
||||
<button type="button" class="btn btn-white btn-sm 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 == '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->sent_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 != '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')
|
||||
@can('update-sales-invoices')
|
||||
<a href="{{ route('invoices.paid', $invoice->id) }}" class="btn btn-white btn-sm header-button-top">{{ trans('invoices.mark_paid') }}</a>
|
||||
@endcan
|
||||
@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.statuses.' . $invoice->status) }}</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>
|
||||
@if (setting('company.address'))
|
||||
<tr>
|
||||
<th>
|
||||
{!! nl2br(setting('company.address')) !!}
|
||||
</th>
|
||||
</tr>
|
||||
@endif
|
||||
@if (setting('company.tax_number'))
|
||||
<tr>
|
||||
<th>
|
||||
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
|
||||
</th>
|
||||
</tr>
|
||||
@endif
|
||||
@if (setting('company.phone'))
|
||||
<tr>
|
||||
<th>
|
||||
{{ setting('company.phone') }}
|
||||
</th>
|
||||
</tr>
|
||||
@endif
|
||||
<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>
|
||||
@if ($invoice->contact_address || $__env->hasStack('address_input_start', 'address_input_end'))
|
||||
<tr>
|
||||
<th>
|
||||
@stack('address_input_start')
|
||||
@if ($invoice->contact_address)
|
||||
{!! nl2br($invoice->contact_address) !!}
|
||||
@endif
|
||||
@stack('address_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
@endif
|
||||
@if ($invoice->contact_tax_number || $__env->hasStack('tax_number_input_start', 'tax_number_input_end'))
|
||||
<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>
|
||||
@endif
|
||||
@if ($invoice->contact_phone || $__env->hasStack('phone_input_start', 'phone_input_end'))
|
||||
<tr>
|
||||
<th>
|
||||
@stack('phone_input_start')
|
||||
@if ($invoice->contact_phone)
|
||||
{{ $invoice->contact_phone }}
|
||||
@endif
|
||||
@stack('phone_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
@endif
|
||||
@if ($invoice->contact_email || $__env->hasStack('email_start', 'email_input_end'))
|
||||
<tr>
|
||||
<th>
|
||||
@stack('email_start')
|
||||
@if ($invoice->contact_email)
|
||||
{{ $invoice->contact_email }}
|
||||
@endif
|
||||
@stack('email_input_end')
|
||||
</th>
|
||||
</tr>
|
||||
@endif
|
||||
</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 overflow-y-hidden">
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
<tr class="d-flex flex-nowrap">
|
||||
@stack('name_th_start')
|
||||
<th class="col-xs-4 col-sm-5 pl-5">{{ trans_choice($text_override['items'], 2) }}</th>
|
||||
@stack('name_th_end')
|
||||
|
||||
@stack('quantity_th_start')
|
||||
<th class="col-xs-4 col-sm-1 text-center">{{ trans($text_override['quantity']) }}</th>
|
||||
@stack('quantity_th_end')
|
||||
|
||||
@stack('price_th_start')
|
||||
<th class="col-sm-3 text-right d-none d-sm-block">{{ trans($text_override['price']) }}</th>
|
||||
@stack('price_th_end')
|
||||
|
||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||
@stack('discount_th_start')
|
||||
<th class="col-sm-1 text-center d-none d-sm-block">{{ trans('invoices.discount') }}</th>
|
||||
@stack('discount_th_end')
|
||||
@endif
|
||||
|
||||
@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)
|
||||
@include('partials.documents.item.show', ['document' => $invoice])
|
||||
@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="text-muted long-texts">{!! nl2br($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_sorted as $total)
|
||||
@if ($total->code != 'total')
|
||||
@stack($total->code . '_total_tr_start')
|
||||
<tr>
|
||||
<th>{{ trans($total->title) }}:</th>
|
||||
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
|
||||
</tr>
|
||||
@stack($total->code . '_total_tr_end')
|
||||
@else
|
||||
@if ($invoice->paid)
|
||||
@stack('paid_total_tr_start')
|
||||
<tr>
|
||||
<th class="text-success">
|
||||
{{ trans('invoices.paid') }}:
|
||||
</th>
|
||||
<td class="text-success text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
|
||||
</tr>
|
||||
@stack('paid_total_tr_end')
|
||||
@endif
|
||||
@stack('grand_total_tr_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_tr_end')
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('invoice_total_end')
|
||||
</div>
|
||||
|
||||
@stack('card_footer_start')
|
||||
<div class="card-footer">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
@if ($invoice->attachment)
|
||||
@php $file = $invoice->attachment; @endphp
|
||||
@include('partials.media.file')
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-8 text-right">
|
||||
@stack('button_edit_start')
|
||||
@if(!$invoice->reconciled)
|
||||
<a href="{{ route('invoices.edit', $invoice->id) }}" class="btn btn-info">
|
||||
{{ trans('general.edit') }}
|
||||
</a>
|
||||
@endif
|
||||
@stack('button_edit_end')
|
||||
|
||||
@stack('button_print_start')
|
||||
<a href="{{ route('invoices.print', $invoice->id) }}" target="_blank" class="btn btn-success">
|
||||
{{ trans('general.print') }}
|
||||
</a>
|
||||
@stack('button_print_end')
|
||||
|
||||
@if ($invoice->status != 'cancelled')
|
||||
@stack('button_share_start')
|
||||
<a href="{{ $signed_url }}" target="_blank" class="btn btn-white">
|
||||
{{ trans('general.share') }}
|
||||
</a>
|
||||
@stack('button_share_end')
|
||||
@endif
|
||||
|
||||
@stack('button_group_start')
|
||||
<div class="dropup header-drop-top">
|
||||
<button type="button" class="btn btn-primary" 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_dropdown_start')
|
||||
@if ($invoice->status != 'cancelled')
|
||||
@if ($invoice->status != 'paid')
|
||||
@stack('button_pay_start')
|
||||
@can('update-sales-invoices')
|
||||
<a class="dropdown-item" href="{{ route('invoices.paid', $invoice->id) }}">{{ trans('invoices.mark_paid') }}</a>
|
||||
@endcan
|
||||
|
||||
@if (empty($invoice->paid) || ($invoice->paid != $invoice->amount))
|
||||
<button class="dropdown-item" id="button-payment" @click="onPayment">{{ trans('invoices.add_payment') }}</button>
|
||||
@endif
|
||||
@stack('button_pay_end')
|
||||
<div class="dropdown-divider"></div>
|
||||
@endif
|
||||
|
||||
@stack('button_dropdown_divider_1')
|
||||
|
||||
@can('update-sales-invoices')
|
||||
@stack('button_sent_start')
|
||||
@if ($invoice->status == 'draft')
|
||||
<a class="dropdown-item" href="{{ route('invoices.sent', $invoice->id) }}">{{ 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
|
||||
@stack('button_sent_end')
|
||||
@endcan
|
||||
|
||||
@stack('button_email_start')
|
||||
@if ($invoice->contact_email)
|
||||
<a class="dropdown-item" href="{{ route('invoices.email', $invoice->id) }}">{{ 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')
|
||||
@endif
|
||||
|
||||
@stack('button_pdf_start')
|
||||
<a class="dropdown-item" href="{{ route('invoices.pdf', $invoice->id) }}">{{ trans('invoices.download_pdf') }}</a>
|
||||
@stack('button_pdf_end')
|
||||
|
||||
@can('update-sales-invoices')
|
||||
@if ($invoice->status != 'cancelled')
|
||||
@stack('button_cancelled_start')
|
||||
<a class="dropdown-item" href="{{ route('invoices.cancelled', $invoice->id) }}">{{ trans('general.cancel') }}</a>
|
||||
@stack('button_cancelled_end')
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@stack('button_dropdown_divider_2')
|
||||
|
||||
@can('delete-sales-invoices')
|
||||
@if (!$invoice->reconciled)
|
||||
@stack('button_delete_start')
|
||||
{!! Form::deleteLink($invoice, 'sales/invoices') !!}
|
||||
@stack('button_delete_end')
|
||||
@endif
|
||||
@endcan
|
||||
@stack('button_dropdown_end')
|
||||
</div>
|
||||
</div>
|
||||
@stack('button_group_end')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('card_footer_end')
|
||||
</div>
|
||||
@stack('invoice_end')
|
||||
|
||||
@stack('row_footer_start')
|
||||
<div class="row">
|
||||
@stack('row_footer_histories_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="accordion-histories-header" data-toggle="collapse" data-target="#accordion-histories-body" aria-expanded="false" aria-controls="accordion-histories-body">
|
||||
<h4 class="mb-0">{{ trans('invoices.histories') }}</h4>
|
||||
</div>
|
||||
<div id="accordion-histories-body" class="collapse hide" aria-labelledby="accordion-histories-header">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover">
|
||||
<thead class="thead-light">
|
||||
@stack('row_footer_histories_head_tr_start')
|
||||
<tr class="row table-head-line">
|
||||
@stack('row_footer_histories_head_start')
|
||||
<th class="col-xs-4 col-sm-3">{{ trans('general.date') }}</th>
|
||||
<th class="col-xs-4 col-sm-3 text-left">{{ trans_choice('general.statuses', 1) }}</th>
|
||||
<th class="col-xs-4 col-sm-6 text-left long-texts">{{ trans('general.description') }}</th>
|
||||
@stack('row_footer_histories_head_end')
|
||||
</tr>
|
||||
@stack('row_footer_histories_head_tr_end')
|
||||
</thead>
|
||||
<tbody>
|
||||
@stack('row_footer_histories_body_tr_start')
|
||||
@foreach($invoice->histories as $history)
|
||||
<tr class="row align-items-center border-top-1 tr-py">
|
||||
@stack('row_footer_histories_body_td_start')
|
||||
<td class="col-xs-4 col-sm-3">@date($history->created_at)</td>
|
||||
<td class="col-xs-4 col-sm-3 text-left">{{ trans('invoices.statuses.' . $history->status) }}</td>
|
||||
<td class="col-xs-4 col-sm-6 text-left long-texts">{{ $history->description }}</td>
|
||||
@stack('row_footer_histories_body_td_end')
|
||||
</tr>
|
||||
@endforeach
|
||||
@stack('row_footer_histories_body_tr_end')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('row_footer_histories_end')
|
||||
|
||||
@stack('row_footer_transactions_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="accordion-transactions-header" data-toggle="collapse" data-target="#accordion-transactions-body" aria-expanded="false" aria-controls="accordion-transactions-body">
|
||||
<h4 class="mb-0">{{ trans_choice('general.transactions', 2) }}</h4>
|
||||
</div>
|
||||
<div id="accordion-transactions-body" class="collapse hide" aria-labelledby="accordion-transactions-header">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush table-hover">
|
||||
<thead class="thead-light">
|
||||
@stack('row_footer_transactions_head_tr_start')
|
||||
<tr class="row table-head-line">
|
||||
@stack('row_footer_transactions_head_td_start')
|
||||
<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>
|
||||
@stack('row_footer_transactions_head_td_end')
|
||||
</tr>
|
||||
@stack('row_footer_transactions_head_tr_end')
|
||||
</thead>
|
||||
<tbody>
|
||||
@stack('row_footer_transactions_body_tr_start')
|
||||
@if ($invoice->transactions->count())
|
||||
@foreach($invoice->transactions as $transaction)
|
||||
<tr class="row align-items-center border-top-1 tr-py">
|
||||
@stack('row_footer_transactions_body_td_start')
|
||||
<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 py-0">
|
||||
@if ($transaction->reconciled)
|
||||
<button type="button" class="btn btn-default btn-sm">
|
||||
{{ trans('reconciliations.reconciled') }}
|
||||
</button>
|
||||
@else
|
||||
@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::button(trans('general.delete'), array(
|
||||
'type' => 'button',
|
||||
'class' => 'btn btn-danger btn-sm',
|
||||
'title' => trans('general.delete'),
|
||||
'@click' => 'confirmDelete("' . route('transactions.destroy', $transaction->id) . '", "' . trans_choice('general.transactions', 2) . '", "' . $message. '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
|
||||
)) !!}
|
||||
@endif
|
||||
</td>
|
||||
@stack('row_footer_transactions_body_td_end')
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="text-muted nr-py" id="datatable-basic_info" role="status" aria-live="polite">
|
||||
{{ trans('general.no_records') }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@stack('row_footer_transactions_body_tr_end')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stack('row_footer_transactions_end')
|
||||
</div>
|
||||
@stack('row_footer_end')
|
||||
|
||||
{{ Form::hidden('invoice_id', $invoice->id, ['id' => 'invoice_id']) }}
|
||||
<x-documents.show.content type="invoice" :document="$invoice" hide-button-received />
|
||||
@endsection
|
||||
|
||||
@push('scripts_start')
|
||||
<script src="{{ asset('public/js/sales/invoices.js?v=' . version('short')) }}"></script>
|
||||
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
|
||||
|
||||
<x-documents.script />
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user