Refactor Estimate templates

This commit is contained in:
radhu587
2020-05-06 18:02:27 +05:30
parent 189141c84d
commit 30f76e2088
4 changed files with 472 additions and 414 deletions

View File

@ -1,11 +1,11 @@
<table width="100%" class="item-table" cellspacing="0" border="0">
<table width="100%" class="items-table" cellspacing="0" border="0">
<tr class="item-table-heading-row">
<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>
<th width="2%" class="item-table-heading text-right pr-20">#</th>
<th width="40%" class="item-table-heading text-left pl-0">Items</th>
<th class="item-table-heading text-right pr-20">Quantity</th>
<th class="item-table-heading text-right pr-20">Price</th>
@if($estimate->discount_per_item === 'YES')
<th class="item-table-heading text-right" style="padding-left: 10px">Discount</th>
<th class="item-table-heading text-right pl-10">Discount</th>
@endif
<th class="item-table-heading text-right">Amount</th>
</tr>
@ -15,37 +15,33 @@
@foreach ($estimate->items as $item)
<tr class="item-row">
<td
class="item-cell text-right"
style="padding-right: 20px; vertical-align: top;"
class="item-cell text-right pr-20"
style="vertical-align: top;"
>
{{$index}}
</td>
<td
class="item-cell text-left"
style="padding-left: 0px"
class="item-cell text-left pl-0"
>
<span>{{ $item->name }}</span><br>
<span
class="text-left"
style="color: #595959; font-size: 9px; font-weight:300; line-height: 12px;"
class="item-description"
>
{!! nl2br(htmlspecialchars($item->description)) !!}
</span>
</td>
<td
class="item-cell text-right"
style="padding-right: 20px"
class="item-cell text-right pr-20"
>
{{$item->quantity}}
</td>
<td
class="item-cell text-right"
style="padding-right: 20px"
class="item-cell text-right pr-20"
>
{!! format_money_pdf($item->price, $estimate->user->currency) !!}
</td>
@if($estimate->discount_per_item === 'YES')
<td class="item-cell text-right" style="padding-left: 10px">
<td class="item-cell text-right pl-10">
@if($item->discount_type === 'fixed')
{!! format_money_pdf($item->discount_val, $estimate->user->currency) !!}
@endif
@ -68,18 +64,17 @@
<table width="100%" cellspacing="0px" border="0" class="total-display-table @if(count($estimate->items) > 12) page-break @endif">
<tr>
<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>
<td class="border-0 total-table-attribute-label">Subtotal</td>
<td class="border-0 item-cell total-table-attribute-value ">{!! format_money_pdf($estimate->sub_total, $estimate->user->currency) !!}</td>
</tr>
@if ($estimate->tax_per_item === 'YES')
@for ($i = 0; $i < count($labels); $i++)
<tr>
<td class="no-border text-left" style="padding-left:10px; font-size:12px; color: #55547A;">
<td class="border-0 total-table-attribute-label">
{{$labels[$i]}}
</td>
<td class="no-border item-cell padd2 text-right" style="padding-right:10px; font-weight: 500; font-size:12px; color: #040405">
<td class="border-0 item-cell total-table-attribute-value">
{!! format_money_pdf($taxes[$i], $estimate->user->currency) !!}
</td>
</tr>
@ -87,10 +82,10 @@
@else
@foreach ($estimate->taxes as $tax)
<tr>
<td class="no-border text-left" style="padding-left:10px; font-size:12px; color: #55547A;">
<td class="border-0 total-table-attribute-label">
{{$tax->name.' ('.$tax->percent.'%)'}}
</td>
<td class="no-border item-cell padd2 text-right" style="padding-right:10px; font-weight: 500; font-size:12px; color: #040405">
<td class="border-0 item-cell total-table-attribute-value" >
{!! format_money_pdf($tax->amount, $estimate->user->currency) !!}
</td>
</tr>
@ -99,7 +94,7 @@
@if ($estimate->discount_per_item === 'NO')
<tr>
<td class="no-border" style="padding-left:10px; text-align:left; font-size:12px; color: #55547A;">
<td class="border-0 total-table-attribute-label pl-10">
@if($estimate->discount_type === 'fixed')
Discount
@endif
@ -107,7 +102,7 @@
Discount ({{$estimate->discount}}%)
@endif
</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="border-0 item-cell total-table-attribute-value pr-10">
@if($estimate->discount_type === 'fixed')
{!! format_money_pdf($estimate->discount_val, $estimate->user->currency) !!}
@endif
@ -118,19 +113,12 @@
</tr>
@endif
<tr>
<td style="padding:3px 0px"></td>
<td style="padding:3px 0px"></td>
<td class="py-3"></td>
<td class="py-3"></td>
</tr>
<tr>
<td class="no-border total-border-left"
style="padding-left:10px; padding-bottom:10px; text-align:left; padding-top:20px; font-size:12px; color: #55547A;"
>
<label class="total-bottom"> Total </label>
</td>
<td
class="no-border total-border-right item-cell padd8"
style="padding-right:10px; font-weight: 500; text-align: right; font-size:12px; padding-top:20px; color: #5851DB"
>
<td class="border-0 total-border-left total-table-attribute-label">Total</td>
<td class="border-0 total-border-right item-cell py-8 total-table-attribute-value text-primary">
{!! format_money_pdf($estimate->total, $estimate->user->currency)!!}
</td>
</tr>