revert: 🎨 removed random formatting lol

This commit is contained in:
IceToast 2021-12-22 14:50:00 +01:00
parent f10933104c
commit f0852498ed
2 changed files with 662 additions and 710 deletions

View file

@ -1,324 +1,301 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<title>{{ $invoice->name }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<head> <style type="text/css" media="screen">
<title>{{ $invoice->name }}</title> html {
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> font-family: sans-serif;
line-height: 1.15;
margin: 0;
}
<style type="text/css" media="screen"> body {
html { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-family: sans-serif; font-weight: 400;
line-height: 1.15; line-height: 1.5;
margin: 0; color: #212529;
} text-align: left;
background-color: #fff;
font-size: 10px;
margin: 36pt;
}
body { h4 {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; margin-top: 0;
font-weight: 400; margin-bottom: 0.5rem;
line-height: 1.5; }
color: #212529;
text-align: left;
background-color: #fff;
font-size: 10px;
margin: 36pt;
}
h4 { p {
margin-top: 0; margin-top: 0;
margin-bottom: 0.5rem; margin-bottom: 1rem;
} }
p { strong {
margin-top: 0; font-weight: bolder;
margin-bottom: 1rem; }
}
strong { img {
font-weight: bolder; vertical-align: middle;
} border-style: none;
}
img { table {
vertical-align: middle; border-collapse: collapse;
border-style: none; }
}
table { th {
border-collapse: collapse; text-align: inherit;
} }
th { h4, .h4 {
text-align: inherit; margin-bottom: 0.5rem;
} font-weight: 500;
line-height: 1.2;
}
h4, h4, .h4 {
.h4 { font-size: 1.5rem;
margin-bottom: 0.5rem; }
font-weight: 500;
line-height: 1.2;
}
h4, .table {
.h4 { width: 100%;
font-size: 1.5rem; margin-bottom: 1rem;
} color: #212529;
}
.table { .table th,
width: 100%; .table td {
margin-bottom: 1rem; padding: 0.75rem;
color: #212529; vertical-align: top;
} }
.table th, .table.table-items td {
.table td { border-top: 1px solid #dee2e6;
padding: 0.75rem; }
vertical-align: top;
}
.table.table-items td { .table thead th {
border-top: 1px solid #dee2e6; vertical-align: bottom;
} border-bottom: 2px solid #dee2e6;
}
.table thead th { .mt-5 {
vertical-align: bottom; margin-top: 3rem !important;
border-bottom: 2px solid #dee2e6; }
}
.mt-5 { .pr-0,
margin-top: 3rem !important; .px-0 {
} padding-right: 0 !important;
}
.pr-0, .pl-0,
.px-0 { .px-0 {
padding-right: 0 !important; padding-left: 0 !important;
} }
.pl-0, .text-right {
.px-0 { text-align: right !important;
padding-left: 0 !important; }
}
.text-right { .text-center {
text-align: right !important; text-align: center !important;
} }
.text-center { .text-uppercase {
text-align: center !important; text-transform: uppercase !important;
} }
* {
font-family: "DejaVu Sans";
}
body, h1, h2, h3, h4, h5, h6, table, th, tr, td, p, div {
line-height: 1.1;
}
.party-header {
font-size: 1.5rem;
font-weight: 400;
}
.total-amount {
font-size: 12px;
font-weight: 700;
}
.border-0 {
border: none !important;
}
.cool-gray {
color: #6B7280;
}
.cool-green {
color: #308d00;
}
</style>
</head>
.text-uppercase { <body>
text-transform: uppercase !important; {{-- Header --}}
} @if($invoice->logo)
<img src="{{ $invoice->getLogo() }}" alt="logo" height="100">
@endif
* { <table class="table mt-5">
font-family: "DejaVu Sans"; <tbody>
} <tr>
<tr>
body, <td class="border-0 pl-0" width="70%">
h1, <h4 class="text-uppercase">
h2, <strong>{{ $invoice->name }} {{$invoice->getSerialNumber()}}</strong>
h3,
h4,
h5,
h6,
table,
th,
tr,
td,
p,
div {
line-height: 1.1;
}
.party-header {
font-size: 1.5rem;
font-weight: 400;
}
.total-amount {
font-size: 12px;
font-weight: 700;
}
.border-0 {
border: none !important;
}
.cool-gray {
color: #6B7280;
}
.cool-green {
color: #308d00;
}
</style>
</head>
<body>
{{-- Header --}}
@if ($invoice->logo)
<img src="{{ $invoice->getLogo() }}" alt="logo" height="100">
@endif
<table class="table mt-5">
<tbody>
<tr>
<tr>
<td class="border-0 pl-0" width="70%">
<h4 class="text-uppercase">
<strong>{{ $invoice->name }} {{ $invoice->getSerialNumber() }}</strong>
</h4>
</td>
<td class="border-0 pl-0">
@if ($invoice->status)
<h4 class="text-uppercase cool-green">
<strong>{{ $invoice->status }}</strong>
</h4> </h4>
</td>
<td class="border-0 pl-0">
@if($invoice->status)
<h4 class="text-uppercase cool-green">
<strong>{{ $invoice->status }}</strong>
</h4>
@endif
<p>{{ __('Serial No.') }} <strong>{{ $invoice->getSerialNumber() }}</strong></p>
<p>{{ __('Invoice date') }}: <strong>{{ $invoice->getDate() }}</strong></p>
</td>
</tr>
</tbody>
</table>
{{-- Seller - Buyer --}}
<table class="table">
<thead>
<tr>
<th class="border-0 pl-0 party-header" width="48.5%">
{{ __('Seller') }}
</th>
<th class="border-0" width="3%"></th>
<th class="border-0 pl-0 party-header">
{{ __('Buyer') }}
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="px-0">
@if($invoice->seller->name)
<p class="seller-name">
<strong>{{ $invoice->seller->name }}</strong>
</p>
@endif
@if($invoice->seller->address)
<p class="seller-address">
{{ __('Address') }}: {{ $invoice->seller->address }}
</p>
@endif
@if($invoice->seller->code)
<p class="seller-code">
{{ __('Code') }}: {{ $invoice->seller->code }}
</p>
@endif
@if($invoice->seller->vat)
<p class="seller-vat">
{{ __('VAT Code') }}: {{ $invoice->seller->vat }}
</p>
@endif
@if($invoice->seller->phone)
<p class="seller-phone">
{{ __('Phone') }}: {{ $invoice->seller->phone }}
</p>
@endif
@foreach($invoice->seller->custom_fields as $key => $value)
<p class="seller-custom-field">
{{ ucfirst($key) }}: {{ $value }}
</p>
@endforeach
</td>
<td class="border-0"></td>
<td class="px-0">
@if($invoice->buyer->name)
<p class="buyer-name">
<strong>{{ $invoice->buyer->name }}</strong>
</p>
@endif
@if($invoice->buyer->adress)
<p class="buyer-address">
{{ __('Address') }}: {{ $invoice->buyer->address }}
</p>
@endif
@if($invoice->buyer->code)
<p class="buyer-code">
{{ __('Code') }}: {{ $invoice->buyer->code }}
</p>
@endif
@if($invoice->buyer->vat)
<p class="buyer-vat">
{{ __('VAT Code') }}: {{ $invoice->buyer->vat }}
</p>
@endif
@if($invoice->buyer->phone)
<p class="buyer-phone">
{{ __('Phone') }}: {{ $invoice->buyer->phone }}
</p>
@endif
@foreach($invoice->buyer->custom_fields as $key => $value)
<p class="buyer-custom-field">
{{ ucfirst($key) }}: {{ $value }}
</p>
@endforeach
</td>
</tr>
</tbody>
</table>
{{-- Table --}}
<table class="table table-items">
<thead>
<tr>
<th scope="col" class="border-0 pl-0">{{ __('Description') }}</th>
@if($invoice->hasItemUnits)
<th scope="col" class="text-center border-0">{{ __('Units') }}</th>
@endif @endif
<p>{{ __('Serial No.') }} <strong>{{ $invoice->getSerialNumber() }}</strong></p> <th scope="col" class="text-center border-0">{{ __('Quantity') }}</th>
<p>{{ __('Invoice date') }}: <strong>{{ $invoice->getDate() }}</strong></p> <th scope="col" class="text-right border-0">{{ __('Price') }}</th>
</td> @if($invoice->hasItemDiscount)
</tr> <th scope="col" class="text-right border-0">{{ __('Discount') }}</th>
</tbody>
</table>
{{-- Seller - Buyer --}}
<table class="table">
<thead>
<tr>
<th class="border-0 pl-0 party-header" width="48.5%">
{{ __('Seller') }}
</th>
<th class="border-0" width="3%"></th>
<th class="border-0 pl-0 party-header">
{{ __('Buyer') }}
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="px-0">
@if ($invoice->seller->name)
<p class="seller-name">
<strong>{{ $invoice->seller->name }}</strong>
</p>
@endif @endif
@if($invoice->hasItemTax)
@if ($invoice->seller->address) <th scope="col" class="text-right border-0">{{ __('Tax') }}</th>
<p class="seller-address">
{{ __('Address') }}: {{ $invoice->seller->address }}
</p>
@endif @endif
<th scope="col" class="text-right border-0 pr-0">{{ __('Subtotal') }}</th>
@if ($invoice->seller->code) </tr>
<p class="seller-code"> </thead>
{{ __('Code') }}: {{ $invoice->seller->code }} <tbody>
</p> {{-- Items --}}
@endif @foreach($invoice->items as $item)
@if ($invoice->seller->vat)
<p class="seller-vat">
{{ __('VAT Code') }}: {{ $invoice->seller->vat }}
</p>
@endif
@if ($invoice->seller->phone)
<p class="seller-phone">
{{ __('Phone') }}: {{ $invoice->seller->phone }}
</p>
@endif
@foreach ($invoice->seller->custom_fields as $key => $value)
<p class="seller-custom-field">
{{ ucfirst($key) }}: {{ $value }}
</p>
@endforeach
</td>
<td class="border-0"></td>
<td class="px-0">
@if ($invoice->buyer->name)
<p class="buyer-name">
<strong>{{ $invoice->buyer->name }}</strong>
</p>
@endif
@if ($invoice->buyer->adress)
<p class="buyer-address">
{{ __('Address') }}: {{ $invoice->buyer->address }}
</p>
@endif
@if ($invoice->buyer->code)
<p class="buyer-code">
{{ __('Code') }}: {{ $invoice->buyer->code }}
</p>
@endif
@if ($invoice->buyer->vat)
<p class="buyer-vat">
{{ __('VAT Code') }}: {{ $invoice->buyer->vat }}
</p>
@endif
@if ($invoice->buyer->phone)
<p class="buyer-phone">
{{ __('Phone') }}: {{ $invoice->buyer->phone }}
</p>
@endif
@foreach ($invoice->buyer->custom_fields as $key => $value)
<p class="buyer-custom-field">
{{ ucfirst($key) }}: {{ $value }}
</p>
@endforeach
</td>
</tr>
</tbody>
</table>
{{-- Table --}}
<table class="table table-items">
<thead>
<tr>
<th scope="col" class="border-0 pl-0">{{ __('Description') }}</th>
@if ($invoice->hasItemUnits)
<th scope="col" class="text-center border-0">{{ __('Units') }}</th>
@endif
<th scope="col" class="text-center border-0">{{ __('Quantity') }}</th>
<th scope="col" class="text-right border-0">{{ __('Price') }}</th>
@if ($invoice->hasItemDiscount)
<th scope="col" class="text-right border-0">{{ __('Discount') }}</th>
@endif
@if ($invoice->hasItemTax)
<th scope="col" class="text-right border-0">{{ __('Tax') }}</th>
@endif
<th scope="col" class="text-right border-0 pr-0">{{ __('Subtotal') }}</th>
</tr>
</thead>
<tbody>
{{-- Items --}}
@foreach ($invoice->items as $item)
<tr> <tr>
<td class="pl-0"> <td class="pl-0">
{{ $item->title }} {{ $item->title }}
@if ($item->description) @if($item->description)
<p class="cool-gray">{{ $item->description }}</p> <p class="cool-gray">{{ $item->description }}</p>
@endif @endif
</td> </td>
@if ($invoice->hasItemUnits) @if($invoice->hasItemUnits)
<td class="text-center">{{ $item->units }}</td> <td class="text-center">{{ $item->units }}</td>
@endif @endif
<td class="text-center">{{ $item->quantity }}</td> <td class="text-center">{{ $item->quantity }}</td>
<td class="text-right"> <td class="text-right">
{{ $invoice->formatCurrency($item->price_per_unit) }} {{ $invoice->formatCurrency($item->price_per_unit) }}
</td> </td>
@if ($invoice->hasItemDiscount) @if($invoice->hasItemDiscount)
<td class="text-right"> <td class="text-right">
{{ $invoice->formatCurrency($item->discount) }} {{ $invoice->formatCurrency($item->discount) }}
</td> </td>
@endif @endif
@if ($invoice->hasItemTax) @if($invoice->hasItemTax)
<td class="text-right"> <td class="text-right">
{{ $invoice->formatCurrency($item->tax) }} {{ $invoice->formatCurrency($item->tax) }}
</td> </td>
@ -328,87 +305,86 @@
{{ $invoice->formatCurrency($item->sub_total_price) }} {{ $invoice->formatCurrency($item->sub_total_price) }}
</td> </td>
</tr> </tr>
@endforeach @endforeach
{{-- Summary --}} {{-- Summary --}}
@if ($invoice->hasItemOrInvoiceDiscount()) @if($invoice->hasItemOrInvoiceDiscount())
<tr> <tr>
<td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td> <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
<td class="text-right pl-0">{{ __('Total discount') }}</td> <td class="text-right pl-0">{{ __('Total discount') }}</td>
<td class="text-right pr-0"> <td class="text-right pr-0">
{{ $invoice->formatCurrency($invoice->total_discount) }} {{ $invoice->formatCurrency($invoice->total_discount) }}
</td> </td>
</tr> </tr>
@endif @endif
@if ($invoice->taxable_amount) @if($invoice->taxable_amount)
<tr> <tr>
<td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td> <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
<td class="text-right pl-0">{{ __('Taxable amount') }}</td> <td class="text-right pl-0">{{ __('Taxable amount') }}</td>
<td class="text-right pr-0"> <td class="text-right pr-0">
{{ $invoice->formatCurrency($invoice->taxable_amount) }} {{ $invoice->formatCurrency($invoice->taxable_amount) }}
</td> </td>
</tr> </tr>
@endif @endif
@if ($invoice->tax_rate) @if($invoice->tax_rate)
<tr> <tr>
<td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td> <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
<td class="text-right pl-0">{{ __('Tax rate') }}</td> <td class="text-right pl-0">{{ __('Tax rate') }}</td>
<td class="text-right pr-0"> <td class="text-right pr-0">
{{ $invoice->tax_rate }}% {{ $invoice->tax_rate }}%
</td> </td>
</tr> </tr>
@endif @endif
@if ($invoice->hasItemOrInvoiceTax()) @if($invoice->hasItemOrInvoiceTax())
<tr> <tr>
<td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td> <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
<td class="text-right pl-0">{{ __('Total taxes') }}</td> <td class="text-right pl-0">{{ __('Total taxes') }}</td>
<td class="text-right pr-0"> <td class="text-right pr-0">
{{ $invoice->formatCurrency($invoice->total_taxes) }} {{ $invoice->formatCurrency($invoice->total_taxes) }}
</td> </td>
</tr> </tr>
@endif @endif
@if ($invoice->shipping_amount) @if($invoice->shipping_amount)
<tr> <tr>
<td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td> <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
<td class="text-right pl-0">{{ __('Shipping') }}</td> <td class="text-right pl-0">{{ __('Shipping') }}</td>
<td class="text-right pr-0"> <td class="text-right pr-0">
{{ $invoice->formatCurrency($invoice->shipping_amount) }} {{ $invoice->formatCurrency($invoice->shipping_amount) }}
</td> </td>
</tr> </tr>
@endif @endif
<tr> <tr>
<td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td> <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
<td class="text-right pl-0">{{ __('Total amount') }}</td> <td class="text-right pl-0">{{ __('Total amount') }}</td>
<td class="text-right pr-0 total-amount"> <td class="text-right pr-0 total-amount">
{{ $invoice->formatCurrency($invoice->total_amount) }} {{ $invoice->formatCurrency($invoice->total_amount) }}
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@if($invoice->notes)
<p>
{{ __('Notes') }}: {!! $invoice->notes !!}
</p>
@endif
@if ($invoice->notes)
<p> <p>
{{ __('Notes') }}: {!! $invoice->notes !!} {{ __('Amount in words') }}: {{ $invoice->getTotalAmountInWords() }}
</p>
<p>
{{ __('Please pay until') }}: {{ $invoice->getPayUntilDate() }}
</p> </p>
@endif
<p>
{{ __('Amount in words') }}: {{ $invoice->getTotalAmountInWords() }}
</p>
<p>
{{ __('Please pay until') }}: {{ $invoice->getPayUntilDate() }}
</p>
<script type="text/php">
if (isset($pdf) && $PAGE_COUNT > 1) {
$text = "Page {PAGE_NUM} / {PAGE_COUNT}";
$size = 10;
$font = $fontMetrics->getFont("Verdana");
$width = $fontMetrics->get_text_width($text, $font, $size) / 2;
$x = ($pdf->get_width() - $width);
$y = $pdf->get_height() - 35;
$pdf->page_text($x, $y, $text, $font, $size);
}
</script>
</body>
<script type="text/php">
if (isset($pdf) && $PAGE_COUNT > 1) {
$text = "Page {PAGE_NUM} / {PAGE_COUNT}";
$size = 10;
$font = $fontMetrics->getFont("Verdana");
$width = $fontMetrics->get_text_width($text, $font, $size) / 2;
$x = ($pdf->get_width() - $width);
$y = $pdf->get_height() - 35;
$pdf->page_text($x, $y, $text, $font, $size);
}
</script>
</body>
</html> </html>

View file

@ -1,324 +1,301 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<title>{{ $invoice->name }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<head> <style type="text/css" media="screen">
<title>{{ $invoice->name }}</title> html {
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> font-family: sans-serif;
line-height: 1.15;
margin: 0;
}
<style type="text/css" media="screen"> body {
html { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-family: sans-serif; font-weight: 400;
line-height: 1.15; line-height: 1.5;
margin: 0; color: #212529;
} text-align: left;
background-color: #fff;
font-size: 10px;
margin: 36pt;
}
body { h4 {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; margin-top: 0;
font-weight: 400; margin-bottom: 0.5rem;
line-height: 1.5; }
color: #212529;
text-align: left;
background-color: #fff;
font-size: 10px;
margin: 36pt;
}
h4 { p {
margin-top: 0; margin-top: 0;
margin-bottom: 0.5rem; margin-bottom: 1rem;
} }
p { strong {
margin-top: 0; font-weight: bolder;
margin-bottom: 1rem; }
}
strong { img {
font-weight: bolder; vertical-align: middle;
} border-style: none;
}
img { table {
vertical-align: middle; border-collapse: collapse;
border-style: none; }
}
table { th {
border-collapse: collapse; text-align: inherit;
} }
th { h4, .h4 {
text-align: inherit; margin-bottom: 0.5rem;
} font-weight: 500;
line-height: 1.2;
}
h4, h4, .h4 {
.h4 { font-size: 1.5rem;
margin-bottom: 0.5rem; }
font-weight: 500;
line-height: 1.2;
}
h4, .table {
.h4 { width: 100%;
font-size: 1.5rem; margin-bottom: 1rem;
} color: #212529;
}
.table { .table th,
width: 100%; .table td {
margin-bottom: 1rem; padding: 0.75rem;
color: #212529; vertical-align: top;
} }
.table th, .table.table-items td {
.table td { border-top: 1px solid #dee2e6;
padding: 0.75rem; }
vertical-align: top;
}
.table.table-items td { .table thead th {
border-top: 1px solid #dee2e6; vertical-align: bottom;
} border-bottom: 2px solid #dee2e6;
}
.table thead th { .mt-5 {
vertical-align: bottom; margin-top: 3rem !important;
border-bottom: 2px solid #dee2e6; }
}
.mt-5 { .pr-0,
margin-top: 3rem !important; .px-0 {
} padding-right: 0 !important;
}
.pr-0, .pl-0,
.px-0 { .px-0 {
padding-right: 0 !important; padding-left: 0 !important;
} }
.pl-0, .text-right {
.px-0 { text-align: right !important;
padding-left: 0 !important; }
}
.text-right { .text-center {
text-align: right !important; text-align: center !important;
} }
.text-center { .text-uppercase {
text-align: center !important; text-transform: uppercase !important;
} }
* {
font-family: "DejaVu Sans";
}
body, h1, h2, h3, h4, h5, h6, table, th, tr, td, p, div {
line-height: 1.1;
}
.party-header {
font-size: 1.5rem;
font-weight: 400;
}
.total-amount {
font-size: 12px;
font-weight: 700;
}
.border-0 {
border: none !important;
}
.cool-gray {
color: #6B7280;
}
.cool-green {
color: #308d00;
}
</style>
</head>
.text-uppercase { <body>
text-transform: uppercase !important; {{-- Header --}}
} @if($invoice->logo)
<img src="{{ $invoice->getLogo() }}" alt="logo" height="100">
@endif
* { <table class="table mt-5">
font-family: "DejaVu Sans"; <tbody>
} <tr>
<tr>
body, <td class="border-0 pl-0" width="70%">
h1, <h4 class="text-uppercase">
h2, <strong>{{ $invoice->name }} {{$invoice->getSerialNumber()}}</strong>
h3,
h4,
h5,
h6,
table,
th,
tr,
td,
p,
div {
line-height: 1.1;
}
.party-header {
font-size: 1.5rem;
font-weight: 400;
}
.total-amount {
font-size: 12px;
font-weight: 700;
}
.border-0 {
border: none !important;
}
.cool-gray {
color: #6B7280;
}
.cool-green {
color: #308d00;
}
</style>
</head>
<body>
{{-- Header --}}
@if ($invoice->logo)
<img src="{{ $invoice->getLogo() }}" alt="logo" height="100">
@endif
<table class="table mt-5">
<tbody>
<tr>
<tr>
<td class="border-0 pl-0" width="70%">
<h4 class="text-uppercase">
<strong>{{ $invoice->name }} {{ $invoice->getSerialNumber() }}</strong>
</h4>
</td>
<td class="border-0 pl-0">
@if ($invoice->status)
<h4 class="text-uppercase cool-green">
<strong>{{ $invoice->status }}</strong>
</h4> </h4>
</td>
<td class="border-0 pl-0">
@if($invoice->status)
<h4 class="text-uppercase cool-green">
<strong>{{ $invoice->status }}</strong>
</h4>
@endif
<p>{{ __('invoices::invoice.serial') }} <strong>{{ $invoice->getSerialNumber() }}</strong></p>
<p>{{ __('invoices::invoice.date') }}: <strong>{{ $invoice->getDate() }}</strong></p>
</td>
</tr>
</tbody>
</table>
{{-- Seller - Buyer --}}
<table class="table">
<thead>
<tr>
<th class="border-0 pl-0 party-header" width="48.5%">
{{ __('invoices::invoice.seller') }}
</th>
<th class="border-0" width="3%"></th>
<th class="border-0 pl-0 party-header">
{{ __('invoices::invoice.buyer') }}
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="px-0">
@if($invoice->seller->name)
<p class="seller-name">
<strong>{{ $invoice->seller->name }}</strong>
</p>
@endif
@if($invoice->seller->address)
<p class="seller-address">
{{ __('invoices::invoice.address') }}: {{ $invoice->seller->address }}
</p>
@endif
@if($invoice->seller->code)
<p class="seller-code">
{{ __('invoices::invoice.code') }}: {{ $invoice->seller->code }}
</p>
@endif
@if($invoice->seller->vat)
<p class="seller-vat">
{{ __('invoices::invoice.vat') }}: {{ $invoice->seller->vat }}
</p>
@endif
@if($invoice->seller->phone)
<p class="seller-phone">
{{ __('invoices::invoice.phone') }}: {{ $invoice->seller->phone }}
</p>
@endif
@foreach($invoice->seller->custom_fields as $key => $value)
<p class="seller-custom-field">
{{ ucfirst($key) }}: {{ $value }}
</p>
@endforeach
</td>
<td class="border-0"></td>
<td class="px-0">
@if($invoice->buyer->name)
<p class="buyer-name">
<strong>{{ $invoice->buyer->name }}</strong>
</p>
@endif
@if($invoice->buyer->address)
<p class="buyer-address">
{{ __('invoices::invoice.address') }}: {{ $invoice->buyer->address }}
</p>
@endif
@if($invoice->buyer->code)
<p class="buyer-code">
{{ __('invoices::invoice.code') }}: {{ $invoice->buyer->code }}
</p>
@endif
@if($invoice->buyer->vat)
<p class="buyer-vat">
{{ __('invoices::invoice.vat') }}: {{ $invoice->buyer->vat }}
</p>
@endif
@if($invoice->buyer->phone)
<p class="buyer-phone">
{{ __('invoices::invoice.phone') }}: {{ $invoice->buyer->phone }}
</p>
@endif
@foreach($invoice->buyer->custom_fields as $key => $value)
<p class="buyer-custom-field">
{{ ucfirst($key) }}: {{ $value }}
</p>
@endforeach
</td>
</tr>
</tbody>
</table>
{{-- Table --}}
<table class="table table-items">
<thead>
<tr>
<th scope="col" class="border-0 pl-0">{{ __('invoices::invoice.description') }}</th>
@if($invoice->hasItemUnits)
<th scope="col" class="text-center border-0">{{ __('invoices::invoice.units') }}</th>
@endif @endif
<p>{{ __('invoices::invoice.serial') }} <strong>{{ $invoice->getSerialNumber() }}</strong></p> <th scope="col" class="text-center border-0">{{ __('invoices::invoice.quantity') }}</th>
<p>{{ __('invoices::invoice.date') }}: <strong>{{ $invoice->getDate() }}</strong></p> <th scope="col" class="text-right border-0">{{ __('invoices::invoice.price') }}</th>
</td> @if($invoice->hasItemDiscount)
</tr> <th scope="col" class="text-right border-0">{{ __('invoices::invoice.discount') }}</th>
</tbody>
</table>
{{-- Seller - Buyer --}}
<table class="table">
<thead>
<tr>
<th class="border-0 pl-0 party-header" width="48.5%">
{{ __('invoices::invoice.seller') }}
</th>
<th class="border-0" width="3%"></th>
<th class="border-0 pl-0 party-header">
{{ __('invoices::invoice.buyer') }}
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="px-0">
@if ($invoice->seller->name)
<p class="seller-name">
<strong>{{ $invoice->seller->name }}</strong>
</p>
@endif @endif
@if($invoice->hasItemTax)
@if ($invoice->seller->address) <th scope="col" class="text-right border-0">{{ __('invoices::invoice.tax') }}</th>
<p class="seller-address">
{{ __('invoices::invoice.address') }}: {{ $invoice->seller->address }}
</p>
@endif @endif
<th scope="col" class="text-right border-0 pr-0">{{ __('invoices::invoice.sub_total') }}</th>
@if ($invoice->seller->code) </tr>
<p class="seller-code"> </thead>
{{ __('invoices::invoice.code') }}: {{ $invoice->seller->code }} <tbody>
</p> {{-- Items --}}
@endif @foreach($invoice->items as $item)
@if ($invoice->seller->vat)
<p class="seller-vat">
{{ __('invoices::invoice.vat') }}: {{ $invoice->seller->vat }}
</p>
@endif
@if ($invoice->seller->phone)
<p class="seller-phone">
{{ __('invoices::invoice.phone') }}: {{ $invoice->seller->phone }}
</p>
@endif
@foreach ($invoice->seller->custom_fields as $key => $value)
<p class="seller-custom-field">
{{ ucfirst($key) }}: {{ $value }}
</p>
@endforeach
</td>
<td class="border-0"></td>
<td class="px-0">
@if ($invoice->buyer->name)
<p class="buyer-name">
<strong>{{ $invoice->buyer->name }}</strong>
</p>
@endif
@if ($invoice->buyer->address)
<p class="buyer-address">
{{ __('invoices::invoice.address') }}: {{ $invoice->buyer->address }}
</p>
@endif
@if ($invoice->buyer->code)
<p class="buyer-code">
{{ __('invoices::invoice.code') }}: {{ $invoice->buyer->code }}
</p>
@endif
@if ($invoice->buyer->vat)
<p class="buyer-vat">
{{ __('invoices::invoice.vat') }}: {{ $invoice->buyer->vat }}
</p>
@endif
@if ($invoice->buyer->phone)
<p class="buyer-phone">
{{ __('invoices::invoice.phone') }}: {{ $invoice->buyer->phone }}
</p>
@endif
@foreach ($invoice->buyer->custom_fields as $key => $value)
<p class="buyer-custom-field">
{{ ucfirst($key) }}: {{ $value }}
</p>
@endforeach
</td>
</tr>
</tbody>
</table>
{{-- Table --}}
<table class="table table-items">
<thead>
<tr>
<th scope="col" class="border-0 pl-0">{{ __('invoices::invoice.description') }}</th>
@if ($invoice->hasItemUnits)
<th scope="col" class="text-center border-0">{{ __('invoices::invoice.units') }}</th>
@endif
<th scope="col" class="text-center border-0">{{ __('invoices::invoice.quantity') }}</th>
<th scope="col" class="text-right border-0">{{ __('invoices::invoice.price') }}</th>
@if ($invoice->hasItemDiscount)
<th scope="col" class="text-right border-0">{{ __('invoices::invoice.discount') }}</th>
@endif
@if ($invoice->hasItemTax)
<th scope="col" class="text-right border-0">{{ __('invoices::invoice.tax') }}</th>
@endif
<th scope="col" class="text-right border-0 pr-0">{{ __('invoices::invoice.sub_total') }}</th>
</tr>
</thead>
<tbody>
{{-- Items --}}
@foreach ($invoice->items as $item)
<tr> <tr>
<td class="pl-0"> <td class="pl-0">
{{ $item->title }} {{ $item->title }}
@if ($item->description) @if($item->description)
<p class="cool-gray">{{ $item->description }}</p> <p class="cool-gray">{{ $item->description }}</p>
@endif @endif
</td> </td>
@if ($invoice->hasItemUnits) @if($invoice->hasItemUnits)
<td class="text-center">{{ $item->units }}</td> <td class="text-center">{{ $item->units }}</td>
@endif @endif
<td class="text-center">{{ $item->quantity }}</td> <td class="text-center">{{ $item->quantity }}</td>
<td class="text-right"> <td class="text-right">
{{ $invoice->formatCurrency($item->price_per_unit) }} {{ $invoice->formatCurrency($item->price_per_unit) }}
</td> </td>
@if ($invoice->hasItemDiscount) @if($invoice->hasItemDiscount)
<td class="text-right"> <td class="text-right">
{{ $invoice->formatCurrency($item->discount) }} {{ $invoice->formatCurrency($item->discount) }}
</td> </td>
@endif @endif
@if ($invoice->hasItemTax) @if($invoice->hasItemTax)
<td class="text-right"> <td class="text-right">
{{ $invoice->formatCurrency($item->tax) }} {{ $invoice->formatCurrency($item->tax) }}
</td> </td>
@ -328,87 +305,86 @@
{{ $invoice->formatCurrency($item->sub_total_price) }} {{ $invoice->formatCurrency($item->sub_total_price) }}
</td> </td>
</tr> </tr>
@endforeach @endforeach
{{-- Summary --}} {{-- Summary --}}
@if ($invoice->hasItemOrInvoiceDiscount()) @if($invoice->hasItemOrInvoiceDiscount())
<tr> <tr>
<td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td> <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
<td class="text-right pl-0">{{ __('invoices::invoice.total_discount') }}</td> <td class="text-right pl-0">{{ __('invoices::invoice.total_discount') }}</td>
<td class="text-right pr-0"> <td class="text-right pr-0">
{{ $invoice->formatCurrency($invoice->total_discount) }} {{ $invoice->formatCurrency($invoice->total_discount) }}
</td> </td>
</tr> </tr>
@endif @endif
@if ($invoice->taxable_amount) @if($invoice->taxable_amount)
<tr> <tr>
<td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td> <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
<td class="text-right pl-0">{{ __('invoices::invoice.taxable_amount') }}</td> <td class="text-right pl-0">{{ __('invoices::invoice.taxable_amount') }}</td>
<td class="text-right pr-0"> <td class="text-right pr-0">
{{ $invoice->formatCurrency($invoice->taxable_amount) }} {{ $invoice->formatCurrency($invoice->taxable_amount) }}
</td> </td>
</tr> </tr>
@endif @endif
@if ($invoice->tax_rate) @if($invoice->tax_rate)
<tr> <tr>
<td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td> <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
<td class="text-right pl-0">{{ __('invoices::invoice.tax_rate') }}</td> <td class="text-right pl-0">{{ __('invoices::invoice.tax_rate') }}</td>
<td class="text-right pr-0"> <td class="text-right pr-0">
{{ $invoice->tax_rate }}% {{ $invoice->tax_rate }}%
</td> </td>
</tr> </tr>
@endif @endif
@if ($invoice->hasItemOrInvoiceTax()) @if($invoice->hasItemOrInvoiceTax())
<tr> <tr>
<td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td> <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
<td class="text-right pl-0">{{ __('invoices::invoice.total_taxes') }}</td> <td class="text-right pl-0">{{ __('invoices::invoice.total_taxes') }}</td>
<td class="text-right pr-0"> <td class="text-right pr-0">
{{ $invoice->formatCurrency($invoice->total_taxes) }} {{ $invoice->formatCurrency($invoice->total_taxes) }}
</td> </td>
</tr> </tr>
@endif @endif
@if ($invoice->shipping_amount) @if($invoice->shipping_amount)
<tr> <tr>
<td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td> <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
<td class="text-right pl-0">{{ __('invoices::invoice.shipping') }}</td> <td class="text-right pl-0">{{ __('invoices::invoice.shipping') }}</td>
<td class="text-right pr-0"> <td class="text-right pr-0">
{{ $invoice->formatCurrency($invoice->shipping_amount) }} {{ $invoice->formatCurrency($invoice->shipping_amount) }}
</td> </td>
</tr> </tr>
@endif @endif
<tr> <tr>
<td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td> <td colspan="{{ $invoice->table_columns - 2 }}" class="border-0"></td>
<td class="text-right pl-0">{{ __('invoices::invoice.total_amount') }}</td> <td class="text-right pl-0">{{ __('invoices::invoice.total_amount') }}</td>
<td class="text-right pr-0 total-amount"> <td class="text-right pr-0 total-amount">
{{ $invoice->formatCurrency($invoice->total_amount) }} {{ $invoice->formatCurrency($invoice->total_amount) }}
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@if($invoice->notes)
<p>
{{ __('invoices::invoice.notes') }}: {!! $invoice->notes !!}
</p>
@endif
@if ($invoice->notes)
<p> <p>
{{ __('invoices::invoice.notes') }}: {!! $invoice->notes !!} {{ __('invoices::invoice.amount_in_words') }}: {{ $invoice->getTotalAmountInWords() }}
</p>
<p>
{{ __('invoices::invoice.pay_until') }}: {{ $invoice->getPayUntilDate() }}
</p> </p>
@endif
<p>
{{ __('invoices::invoice.amount_in_words') }}: {{ $invoice->getTotalAmountInWords() }}
</p>
<p>
{{ __('invoices::invoice.pay_until') }}: {{ $invoice->getPayUntilDate() }}
</p>
<script type="text/php">
if (isset($pdf) && $PAGE_COUNT > 1) {
$text = "Page {PAGE_NUM} / {PAGE_COUNT}";
$size = 10;
$font = $fontMetrics->getFont("Verdana");
$width = $fontMetrics->get_text_width($text, $font, $size) / 2;
$x = ($pdf->get_width() - $width);
$y = $pdf->get_height() - 35;
$pdf->page_text($x, $y, $text, $font, $size);
}
</script>
</body>
<script type="text/php">
if (isset($pdf) && $PAGE_COUNT > 1) {
$text = "Page {PAGE_NUM} / {PAGE_COUNT}";
$size = 10;
$font = $fontMetrics->getFont("Verdana");
$width = $fontMetrics->get_text_width($text, $font, $size) / 2;
$x = ($pdf->get_width() - $width);
$y = $pdf->get_height() - 35;
$pdf->page_text($x, $y, $text, $font, $size);
}
</script>
</body>
</html> </html>