Refactor estimate pdf template

This commit is contained in:
radhu587
2020-05-05 18:21:25 +05:30
parent f8ccfece09
commit 189141c84d
5 changed files with 122 additions and 143 deletions

View File

@ -1,13 +1,13 @@
<table width="100%" class="table2" cellspacing="0" border="0">
<table width="100%" class="item-table" cellspacing="0" border="0">
<tr class="item-table-heading-row">
<th width="2%" class="item-table-heading" style="text-align: right; color: #55547A; padding-right: 20px">#</th>
<th width="40%" class="item-table-heading" style="text-align: left; color: #55547A; padding-left: 0px">Items</th>
<th class="item-table-heading" style="text-align: right; color: #55547A; padding-right: 20px">Quantity</th>
<th class="item-table-heading" style="text-align: right; color: #55547A; padding-right: 20px">Price</th>
<th width="2%" class="item-table-heading text-right" style="padding-right: 20px">#</th>
<th width="40%" class="item-table-heading text-left" style="padding-left: 0px">Items</th>
<th class="item-table-heading text-right" style="padding-right: 20px">Quantity</th>
<th class="item-table-heading text-right" style="padding-right: 20px">Price</th>
@if($estimate->discount_per_item === 'YES')
<th class="item-table-heading" style="text-align: right; color: #55547A; padding-left: 10px">Discount</th>
<th class="item-table-heading text-right" style="padding-left: 10px">Discount</th>
@endif
<th class="item-table-heading" style="text-align: right; color: #55547A;">Amount</th>
<th class="item-table-heading text-right">Amount</th>
</tr>
@php
$index = 1
@ -15,36 +15,37 @@
@foreach ($estimate->items as $item)
<tr class="item-row">
<td
class="inv-item item-cell"
style="text-align: right; color: #040405; padding-right: 20px; vertical-align: top;"
class="item-cell text-right"
style="padding-right: 20px; vertical-align: top;"
>
{{$index}}
</td>
<td
class="inv-item item-cell"
style="text-align: left; color: #040405;padding-left: 0px"
class="item-cell text-left"
style="padding-left: 0px"
>
<span>{{ $item->name }}</span><br>
<span
style="text-align: left; color: #595959; font-size: 9px; font-weight:300; line-height: 12px;"
class="text-left"
style="color: #595959; font-size: 9px; font-weight:300; line-height: 12px;"
>
{!! nl2br(htmlspecialchars($item->description)) !!}
</span>
</td>
<td
class="inv-item item-cell"
style="text-align: right; color: #040405; padding-right: 20px"
class="item-cell text-right"
style="padding-right: 20px"
>
{{$item->quantity}}
</td>
<td
class="inv-item item-cell"
style="text-align: right; color: #040405; padding-right: 20px"
class="item-cell text-right"
style="padding-right: 20px"
>
{!! format_money_pdf($item->price, $estimate->user->currency) !!}
</td>
@if($estimate->discount_per_item === 'YES')
<td class="inv-item item-cell" style="text-align: right; color: #040405; padding-left: 10px">
<td class="item-cell text-right" style="padding-left: 10px">
@if($item->discount_type === 'fixed')
{!! format_money_pdf($item->discount_val, $estimate->user->currency) !!}
@endif
@ -53,7 +54,7 @@
@endif
</td>
@endif
<td class="inv-item item-cell" style="text-align: right; color: #040405;">
<td class="item-cell text-right">
{!! format_money_pdf($item->total, $estimate->user->currency) !!}
</td>
</tr>
@ -65,9 +66,9 @@
<hr class="items-table-hr">
<table width="100%" cellspacing="0px" style="margin-left:420px;margin-top: 10px" border="0" class="table3 @if(count($estimate->items) > 12) page-break @endif">
<table width="100%" cellspacing="0px" border="0" class="total-display-table @if(count($estimate->items) > 12) page-break @endif">
<tr>
<td class="no-borde" style="color: #55547A; padding-left:10px; font-size:12px;">Subtotal</td>
<td class="no-border" style="color: #55547A; padding-left:10px; font-size:12px;">Subtotal</td>
<td class="no-border item-cell"
style="padding-right:10px; text-align: right; font-size:12px; color: #040405; font-weight: 500;">{!! format_money_pdf($estimate->sub_total, $estimate->user->currency) !!}</td>
</tr>
@ -75,10 +76,10 @@
@if ($estimate->tax_per_item === 'YES')
@for ($i = 0; $i < count($labels); $i++)
<tr>
<td class="no-border" style="padding-left:10px; text-align:left; font-size:12px; color: #55547A;">
<td class="no-border text-left" style="padding-left:10px; font-size:12px; color: #55547A;">
{{$labels[$i]}}
</td>
<td class="no-border item-cell padd2" style="padding-right:10px; font-weight: 500; text-align: right; font-size:12px; color: #040405">
<td class="no-border item-cell padd2 text-right" style="padding-right:10px; font-weight: 500; font-size:12px; color: #040405">
{!! format_money_pdf($taxes[$i], $estimate->user->currency) !!}
</td>
</tr>
@ -86,10 +87,10 @@
@else
@foreach ($estimate->taxes as $tax)
<tr>
<td class="no-border" style="padding-left:10px; text-align:left; font-size:12px; color: #55547A;">
<td class="no-border text-left" style="padding-left:10px; font-size:12px; color: #55547A;">
{{$tax->name.' ('.$tax->percent.'%)'}}
</td>
<td class="no-border item-cell padd2" style="padding-right:10px; font-weight: 500; text-align: right; font-size:12px; color: #040405">
<td class="no-border item-cell padd2 text-right" style="padding-right:10px; font-weight: 500; font-size:12px; color: #040405">
{!! format_money_pdf($tax->amount, $estimate->user->currency) !!}
</td>
</tr>