Merge pull request #1187 from batuhawk/master

Bill print updated
This commit is contained in:
Batuhan Baş 2020-01-25 12:00:22 +03:00 committed by GitHub
commit b92d0aa9cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 182 additions and 255 deletions

View File

@ -3,273 +3,200 @@
@section('title', trans_choice('general.bills', 1) . ': ' . $bill->bill_number) @section('title', trans_choice('general.bills', 1) . ': ' . $bill->bill_number)
@section('content') @section('content')
<div class="mt-6"> <div class="row border-bottom-1">
<div class="row"> <div class="col-58">
<div class="col-md-7"> <div class="text company">
<div class="table-responsive"> @if (!empty($bill->contact->logo) && !empty($bill->contact->logo->id))
<table class="table table-borderless"> <img class="d-logo" src="{{ Storage::url($bill->contact->logo->id) }}" alt="{{ $bill->contact_name }}"/>
<tbody> @else
<tr> <img class="d-logo" src="{{ $logo }}" alt="{{ $bill->contact_name }}"/>
<th> @endif
@if (!empty($bill->contact->logo) && !empty($bill->contact->logo->id))
<img src="{{ Storage::url($bill->contact->logo->id) }}" height="128" width="128" alt="{{ $bill->contact_name }}"/>
@else
<img src="{{ $logo }}" alt="{{ $bill->contact_name }}"/>
@endif
</th>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-5">
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
<tr>
<th>
{{ setting('company.name') }}
</th>
</tr>
<tr>
<th>
{!! nl2br(setting('company.address')) !!}
</th>
</tr>
<tr>
<th>
@if (setting('company.tax_number'))
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
@endif
</th>
</tr>
<tr>
<th>
@if (setting('company.phone'))
{{ setting('company.phone') }}
@endif
</th>
</tr>
<tr>
<th>
{{ setting('company.email') }}
</th>
</tr>
</tbody>
</table>
</div>
</div> </div>
</div> </div>
<div class="dropdown-divider"></div> <div class="col-42">
<div class="text company">
<strong>{{ setting('company.name') }}</strong><br>
<p>{!! nl2br(setting('company.address')) !!}</p>
<div class="row"> <p>
<div class="col-md-7"> @if (setting('company.tax_number'))
<div class="table-responsive"> {{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
<table class="table table-borderless"> @endif
<tbody> </p>
<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') <p>
@if ($bill->order_number) @if (setting('company.phone'))
<tr> {{ setting('company.phone') }}
<th>{{ trans('bills.order_number') }}:</th> @endif
<td class="text-right">{{ $bill->order_number }}</td> </p>
</tr>
@endif
@stack('order_number_input_end')
@stack('billed_at_input_start') <p>{{ setting('company.email') }}</p>
<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>
</div>
<table class="table table-striped"> <div class="row">
<thead> <div class="col-58">
<tr> <div class="text company">
@stack('actions_th_start') <br>
@stack('actions_th_end') <strong>{{ trans('bills.bill_from') }}</strong><br>
@stack('name_input_start')
<strong class="d-block">{{ $bill->contact_name }}</strong><br>
@stack('name_input_end')
@stack('name_th_start') @stack('address_input_start')
<th>{{ trans_choice('general.items', 1) }}</th> <p>{!! nl2br($bill->contact_address) !!}</p>
@stack('name_th_end') @stack('address_input_end')
@stack('quantity_th_start') @stack('tax_number_input_start')
<th class="text-center">{{ trans('bills.quantity') }}</th> <p>
@stack('quantity_th_end') @if ($bill->contact_tax_number)
{{ trans('general.tax_number') }}: {{ $bill->contact_tax_number }}
@stack('price_th_start')
<th class="text-center pr-5">{{ trans('bills.price') }}</th>
@stack('price_th_end')
@stack('taxes_th_start')
@stack('taxes_th_end')
@stack('total_th_start')
<th class="text-right">{{ trans('bills.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody>
@foreach($bill->items as $bill_item)
<tr>
@stack('name_td_start')
<td>
{{ $bill_item->name }}
@if (!empty($bill_item->item->description))
<br><small>{!! \Illuminate\Support\Str::limit($bill_item->item->description, 500) !!}<small>
@endif
</td>
@stack('name_td_end')
@stack('quantity_td_start')
<td class="text-center">{{ $bill_item->quantity }}</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="text-center pr-5">@money($bill_item->price, $bill->currency_code, true)</td>
@stack('price_td_end')
@stack('total_td_start')
<td class="text-right">@money($bill_item->total, $bill->currency_code, true)</td>
@stack('total_td_end')
</tr>
@endforeach
</tbody>
</table>
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
@stack('notes_input_start')
@if ($bill->notes)
<table class="table table-borderless">
<tbody>
<tr>
<th>
{{ trans_choice('general.notes', 2) }}
</th>
</tr>
<tr>
<th>
{{ $bill->notes }}
</th>
</tr>
</tbody>
</table>
@endif @endif
@stack('notes_input_end') </p>
</div> @stack('tax_number_input_end')
@stack('phone_input_start')
<p>
@if ($bill->contact_phone)
{{ $bill->contact_phone }}
@endif
</p>
@stack('phone_input_end')
@stack('email_start')
<p>
{{ $bill->contact_email }}
</p>
@stack('email_input_end')
</div> </div>
<div class="col-md-5"> </div>
<div class="table-responsive">
<table class="table table-borderless"> <div class="col-42">
<tbody> <div class="text company">
@foreach ($bill->totals as $total) <br>
@if ($total->code != 'total') @stack('bill_number_input_start')
@stack($total->code . '_td_start') <strong>{{ trans('bills.bill_number') }}:</strong>
<tr> <span class="float-right">{{ $bill->bill_number }}</span><br><br>
<th> @stack('bill_number_input_end')
{{ trans($total->title) }}:
</th> @stack('order_number_input_start')
<td class="text-right"> @if ($bill->order_number)
@money($total->amount, $bill->currency_code, true) <strong>{{ trans('bills.order_number') }}:</strong>
</td> <span class="float-right">{{ $bill->order_number }}</span><br><br>
</tr> @endif
@stack($total->code . '_td_end') @stack('order_number_input_end')
@else
@if ($bill->paid) @stack('billed_at_input_start')
<tr class="text-success"> <strong>{{ trans('bills.bill_date') }}:</strong>
<th> <span class="float-right">@date($bill->billed_at)</span><br><br>
{{ trans('invoices.paid') }}: @stack('billed_at_input_end')
</th>
<td class="text-right"> @stack('due_at_input_start')
- @money($bill->paid, $bill->currency_code, true) <strong>{{ trans('bills.payment_due') }}:</strong>
</td> <span class="float-right">@date($bill->due_at)</span><br><br>
</tr> @stack('due_at_input_end')
@endif </div>
@stack('grand_total_td_start') </div>
<tr> </div>
<th>
{{ trans($total->name) }}: <div class="row">
</th> <div class="col-100">
<td class="text-right"> <div class="text">
@money($total->amount - $bill->paid, $bill->currency_code, true) <table class="lines">
</td> @foreach($bill as $item)
</tr> <thead style="background-color:{{ setting('invoice.color') }} !important; -webkit-print-color-adjust: exact;">
@stack('grand_total_td_end') @endforeach
@endif <tr>
@endforeach @stack('name_th_start')
</tbody> <th class="item text-left text-white">{{ trans_choice('general.items', 1) }}</th>
</table> @stack('name_th_end')
</div>
@stack('quantity_th_start')
<th class="quantity text-white">{{ trans('bills.quantity') }}</th>
@stack('quantity_th_end')
@stack('price_th_start')
<th class="price text-white">{{ trans('bills.price') }}</th>
@stack('price_th_end')
@stack('total_th_start')
<th class="total text-white">{{ trans('bills.total') }}</th>
@stack('total_th_end')
</tr>
</thead>
<tbody>
@foreach($bill->items as $bill_item)
<tr>
@stack('name_td_start')
<td class="item">
{{ $bill_item->name }}
@if (!empty($bill_item->item->description))
<br><small>{!! \Illuminate\Support\Str::limit($bill_item->item->description, 500) !!}<small>
@endif
</td>
@stack('name_td_end')
@stack('quantity_td_start')
<td class="quantity">{{ $bill_item->quantity }}</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="price">@money($bill_item->price, $bill->currency_code, true)</td>
@stack('price_td_end')
@stack('total_td_start')
<td class="total">@money($bill_item->total, $bill->currency_code, true)</td>
@stack('total_td_end')
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<div class="row mt-9">
<div class="col-58">
<div class="text company">
@stack('notes_input_start')
@if ($bill->notes)
<br>
<strong>{{ trans_choice('general.notes', 2) }}</strong><br><br>
{{ $bill->notes }}
@endif
@stack('notes_input_end')
</div>
</div>
<div class="col-42">
<div class="text company pr-2">
@foreach ($bill->totals as $total)
@if ($total->code != 'total')
@stack($total->code . '_td_start')
<div class="border-top-1 py-2">
<strong>{{ trans($total->title) }}:</strong>
<span class="float-right">@money($total->amount, $bill->currency_code, true)</span><br><br>
</div>
@stack($total->code . '_td_end')
@else
@if ($bill->paid)
<div class="border-top-1 py-2">
<strong>{{ trans('invoices.paid') }}:</strong>
<span class="float-right">- @money($bill->paid, $bill->currency_code, true)
</span><br><br>
</div>
@endif
@stack('grand_total_td_start')
<div class="border-top-1 py-2">
<strong>{{ trans($total->name) }}:</strong>
<span class="float-right">@money($total->amount - $bill->paid, $bill->currency_code, true)</span>
</div>
@stack('grand_total_td_end')
@endif
@endforeach
</div> </div>
</div> </div>
</div> </div>

View File

@ -182,7 +182,7 @@
@stack($total->code . '_td_start') @stack($total->code . '_td_start')
<div class="border-top-1 py-2"> <div class="border-top-1 py-2">
<strong>{{ trans($total->title) }}:</strong> <strong>{{ trans($total->title) }}:</strong>
<span class="float-right">@money($total->amount, $invoice->currency_code, true)</s><br><br> <span class="float-right">@money($total->amount, $invoice->currency_code, true)</span><br><br>
</div> </div>
@stack($total->code . '_td_end') @stack($total->code . '_td_end')
@else @else