Refactor Invoice and Payment templates

This commit is contained in:
radhu587
2020-05-07 16:42:04 +05:30
parent 30f76e2088
commit 6046113cb1
16 changed files with 758 additions and 949 deletions

View File

@ -1,13 +1,13 @@
<table width="100%" class="table2" 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" 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 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 pr-20 text-right">Price</th>
@if($invoice->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 pl-10">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,32 +15,29 @@
@foreach ($invoice->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 pr-20"
style="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 pl-0"
>
<span>{{ $item->name }}</span><br>
<span style="text-align: left; color: #595959; font-size: 9px; font-weight:300; line-height: 12px;">{!! nl2br(htmlspecialchars($item->description)) !!}</span>
<span class="item-description">{!! nl2br(htmlspecialchars($item->description)) !!}</span>
</td>
<td
class="inv-item item-cell"
style="text-align: right; color: #040405; padding-right: 20px"
class="item-cell pr-20 text-right"
>
{{$item->quantity}}
</td>
<td
class="inv-item item-cell"
style="text-align: right; color: #040405; padding-right: 20px"
class="item-cell text-right pr-20"
>
{!! format_money_pdf($item->price, $invoice->user->currency) !!}
</td>
@if($invoice->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 pl-10">
@if($item->discount_type === 'fixed')
{!! format_money_pdf($item->discount_val, $invoice->user->currency) !!}
@endif
@ -50,8 +47,7 @@
</td>
@endif
<td
class="inv-item item-cell"
style="text-align: right; color: #040405;"
class="item-cell text-right"
>
{!! format_money_pdf($item->total, $invoice->user->currency) !!}
</td>
@ -64,20 +60,21 @@
<hr class="item-cell-table-hr">
<table width="100%" cellspacing="0px" style="margin-left:420px; margin-top: 10px" border="0" class="table3 @if(count($invoice->items) > 12) page-break @endif">
<table width="100%" cellspacing="0px" border="0" class="total-display-table @if(count($invoice->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 padd2"
style="padding-right:10px; text-align: right; font-size:12px; color: #040405; font-weight: 500;">{!! format_money_pdf($invoice->sub_total, $invoice->user->currency) !!}</td>
<td class="border-0 total-table-attribute-label">Subtotal</td>
<td class="border-0 item-cell py-2 total-table-attribute-value">
{!! format_money_pdf($invoice->sub_total, $invoice->user->currency) !!}
</td>
</tr>
@if ($invoice->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="border-0 total-table-attribute-label">
{{$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="border-0 item-cell py-2 total-table-attribute-value">
{!! format_money_pdf($taxes[$i], $invoice->user->currency) !!}
</td>
</tr>
@ -85,10 +82,10 @@
@else
@foreach ($invoice->taxes as $tax)
<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">
{{$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="border-0 item-cell py-2 total-table-attribute-value">
{!! format_money_pdf($tax->amount, $invoice->user->currency) !!}
</td>
</tr>
@ -97,7 +94,7 @@
@if ($invoice->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">
@if($invoice->discount_type === 'fixed')
Discount
@endif
@ -105,7 +102,7 @@
Discount ({{$invoice->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 py-2 total-table-attribute-value" >
@if($invoice->discount_type === 'fixed')
{!! format_money_pdf($invoice->discount_val, $invoice->user->currency) !!}
@endif
@ -116,18 +113,15 @@
</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 class="border-0 total-border-left total-table-attribute-label">
Total
</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"
class="border-0 total-border-right item-cell py-8 total-table-attribute-value text-primary"
>
{!! format_money_pdf($invoice->total, $invoice->user->currency)!!}
</td>