v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

@@ -3,179 +3,267 @@
@section('title', trans_choice('general.bills', 1) . ': ' . $bill->bill_number)
@section('content')
<div class="row header">
<div class="col-58">
@if ($logo)
<img src="{{ $logo }}" class="logo" />
@endif
</div>
<div class="col-42">
<div class="text company">
<strong>{{ setting('general.company_name') }}</strong><br>
{!! nl2br(setting('general.company_address')) !!}<br>
@if (setting('general.company_tax_number'))
{{ trans('general.tax_number') }}: {{ setting('general.company_tax_number') }}<br>
@endif
<br>
@if (setting('general.company_phone'))
{{ setting('general.company_phone') }}<br>
@endif
{{ setting('general.company_email') }}
<div class="mt-6">
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
<tr>
<th>
@if ($logo)
<img src="{{ $logo }}"/>
@endif
</th>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-5">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
<tr>
<th>
{{ setting('company.name') }}
</th>
</tr>
<tr>
<th>
{!! nl2br(setting('company.address')) !!}
</th>
</tr>
<tr>
<th>
@if (setting('company.tax_number'))
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
@endif
</th>
</tr>
<tr>
<th>
@if (setting('company.phone'))
{{ setting('company.phone') }}
@endif
</th>
</tr>
<tr>
<th>
{{ setting('company.email') }}
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-58">
<div class="text">
{{ trans('bills.bill_from') }}<br><br>
@stack('name_input_start')
<strong>{{ $bill->vendor_name }}</strong><br>
@stack('name_input_end')
@stack('address_input_start')
{!! nl2br($bill->vendor_address) !!}<br>
@stack('address_input_end')
@stack('tax_number_input_start')
@if ($bill->vendor_tax_number)
{{ trans('general.tax_number') }}: {{ $bill->vendor_tax_number }}<br>
@endif
@stack('tax_number_input_end')
<br>
@stack('phone_input_start')
@if ($bill->vendor_phone)
{{ $bill->vendor_phone }}<br>
@endif
@stack('phone_input_end')
@stack('email_start')
{{ $bill->vendor_email }}
@stack('email_input_end')
<div class="dropdown-divider"></div>
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
<tr>
<th>
{{ trans('bills.bill_from') }}
@stack('name_input_start')
<strong class="d-block">{{ $bill->contact_name }}</strong><br>
@stack('name_input_end')
</th>
</tr>
<tr>
<th>
@stack('address_input_start')
{!! nl2br($bill->contact_address) !!}
@stack('address_input_end')
</th>
</tr>
<tr>
<th>
@stack('tax_number_input_start')
@if ($bill->contact_tax_number)
{{ trans('general.tax_number') }}: {{ $bill->contact_tax_number }}
@endif
@stack('tax_number_input_end')
</th>
</tr>
<tr>
<th>
@stack('phone_input_start')
@if ($bill->contact_phone)
{{ $bill->contact_phone }}
@endif
@stack('phone_input_end')
</th>
</tr>
<tr>
<th>
@stack('email_start')
{{ $bill->contact_email }}
@stack('email_input_end')
</th>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-5">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
@stack('bill_number_input_start')
<tr>
<th>{{ trans('bills.bill_number') }}:</th>
<td class="text-right">{{ $bill->bill_number }}</td>
</tr>
@stack('bill_number_input_end')
@stack('order_number_input_start')
@if ($bill->order_number)
<tr>
<th>{{ trans('bills.order_number') }}:</th>
<td class="text-right">{{ $bill->order_number }}</td>
</tr>
@endif
@stack('order_number_input_end')
@stack('billed_at_input_start')
<tr>
<th>{{ trans('bills.bill_date') }}:</th>
<td class="text-right">@date($bill->billed_at)</td>
</tr>
@stack('billed_at_input_end')
@stack('due_at_input_start')
<tr>
<th>{{ trans('bills.payment_due') }}:</th>
<td class="text-right">@date($bill->due_at)</td>
</tr>
@stack('due_at_input_end')
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-42">
<div class="text">
<table>
<tbody>
@stack('bill_number_input_start')
<tr>
<th>{{ trans('bills.bill_number') }}:</th>
<td class="text-right">{{ $bill->bill_number }}</td>
</tr>
@stack('bill_number_input_end')
@stack('order_number_input_start')
@if ($bill->order_number)
<tr>
<th>{{ trans('bills.order_number') }}:</th>
<td class="text-right">{{ $bill->order_number }}</td>
</tr>
@endif
@stack('order_number_input_end')
@stack('billed_at_input_start')
<tr>
<th>{{ trans('bills.bill_date') }}:</th>
<td class="text-right">{{ Date::parse($bill->billed_at)->format($date_format) }}</td>
</tr>
@stack('billed_at_input_end')
@stack('due_at_input_start')
<tr>
<th>{{ trans('bills.payment_due') }}:</th>
<td class="text-right">{{ Date::parse($bill->due_at)->format($date_format) }}</td>
</tr>
@stack('due_at_input_end')
</tbody>
</table>
</div>
</div>
</div>
<table class="lines">
<thead>
<tr>
@stack('actions_th_start')
@stack('actions_th_end')
@stack('name_th_start')
<th class="item">{{ trans_choice('general.items', 1) }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th class="quantity">{{ trans('bills.quantity') }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th class="price">{{ trans('bills.price') }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
@stack('taxes_th_end')
@stack('total_th_start')
<th class="total">{{ trans('bills.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody>
@foreach($bill->items as $item)
<tr>
@stack('actions_td_start')
@stack('actions_td_end')
@stack('name_td_start')
<td class="item">
{{ $item->name }}
@if ($item->sku)
<br><small>{{ trans('items.sku') }}: {{ $item->sku }}</small>
@endif
</td>
@stack('name_td_end')
@stack('quantity_td_start')
<td class="quantity">{{ $item->quantity }}</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="style-price price">@money($item->price, $bill->currency_code, true)</td>
@stack('price_td_end')
@stack('taxes_td_start')
@stack('taxes_td_end')
@stack('total_td_start')
<td class="style-price total">@money($item->total, $bill->currency_code, true)</td>
@stack('total_td_end')
</tr>
@endforeach
</tbody>
</table>
<table class="table table-striped">
<thead>
<tr>
@stack('actions_th_start')
@stack('actions_th_end')
<div class="row">
<div class="col-58">
@stack('notes_input_start')
@if ($bill->notes)
<table class="text" style="page-break-inside: avoid;">
<tr><th>{{ trans_choice('general.notes', 2) }}</th></tr>
<tr><td>{{ $bill->notes }}</td></tr>
</table>
@endif
@stack('notes_input_end')
</div>
<div class="col-42">
<table class="text" style="page-break-inside: avoid;">
@stack('name_th_start')
<th>{{ trans_choice('general.items', 1) }}</th>
@stack('name_th_end')
@stack('quantity_th_start')
<th class="text-center">{{ trans('bills.quantity') }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th class="text-center pr-5">{{ trans('bills.price') }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
@stack('taxes_th_end')
@stack('total_th_start')
<th class="text-right">{{ trans('bills.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody>
@foreach ($bill->totals as $total)
@if ($total->code != 'total')
@stack($total->code . '_td_start')
@foreach($bill->items as $item)
<tr>
<th>{{ trans($total->title) }}:</th>
<td class="style-price text-right">@money($total->amount, $bill->currency_code, true)</td>
@stack('name_td_start')
<td>{{ $item->name }}</td>
@stack('name_td_end')
@stack('quantity_td_start')
<td class="text-center">{{ $item->quantity }}</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="text-center pr-5">@money($item->price, $bill->currency_code, true)</td>
@stack('price_td_end')
@stack('total_td_start')
<td class="text-right">@money($item->total, $bill->currency_code, true)</td>
@stack('total_td_end')
</tr>
@stack($total->code . '_td_end')
@else
@if ($bill->paid)
<tr class="text-success">
<th>{{ trans('invoices.paid') }}:</th>
<td class="style-price text-right">- @money($bill->paid, $bill->currency_code, true)</td>
</tr>
@endif
@stack('grand_total_td_start')
<tr>
<th>{{ trans($total->name) }}:</th>
<td class="style-price text-right">@money($total->amount - $bill->paid, $bill->currency_code, true)</td>
</tr>
@stack('grand_total_td_end')
@endif
@endforeach
@endforeach
</tbody>
</table>
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
@stack('notes_input_start')
@if ($bill->notes)
<table class="table table-borderless">
<tbody>
<tr>
<th>
{{ trans_choice('general.notes', 2) }}
</th>
</tr>
<tr>
<th>
{{ $bill->notes }}
</th>
</tr>
</tbody>
</table>
@endif
@stack('notes_input_end')
</div>
</div>
<div class="col-md-5">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
@foreach ($bill->totals as $total)
@if ($total->code != 'total')
@stack($total->code . '_td_start')
<tr>
<th>
{{ trans($total->title) }}:
</th>
<td class="text-right">
@money($total->amount, $bill->currency_code, true)
</td>
</tr>
@stack($total->code . '_td_end')
@else
@if ($bill->paid)
<tr class="text-success">
<th>
{{ trans('invoices.paid') }}:
</th>
<td class="text-right">
- @money($bill->paid, $bill->currency_code, true)
</td>
</tr>
@endif
@stack('grand_total_td_start')
<tr>
<th>
{{ trans($total->name) }}:
</th>
<td class="text-right">
@money($total->amount - $bill->paid, $bill->currency_code, true)
</td>
</tr>
@stack('grand_total_td_end')
@endif
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection