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

@ -13,31 +13,31 @@
html {
margin: 0px;
padding: 0px;
margin-top: 50px;
}
table {
border-collapse: collapse;
}
.header-line {
color: rgba(0, 0, 0, 0.2);
position: absolute;
top: 90px;
left: 0px;
width: 100%;
}
hr {
margin: 0 30px 0 30px;
color: rgba(0, 0, 0, 0.2);
border: 0.5px solid #EAF1FB;
}
.header-center {
text-align: center
/* -------------------------- */
/* header style */
.header-bottom-divider {
color: rgba(0, 0, 0, 0.2);
position: absolute;
top: 90px;
left: 0px;
width: 100%;
}
.header-table {
.header-container {
position: absolute;
width: 100%;
height: 90px;
@ -64,41 +64,38 @@
padding-bottom: 20px;
}
.address {
/* display: inline-block; */
padding-top: 30px
.company-details-container {
padding-top: 30px;
}
.company {
/* -------------------------- */
/* company address style */
.company-address-container {
float: left;
padding-left: 30px;
font-weight: normal;
width: 30%;
text-transform: capitalize;
margin-bottom: 2px;
}
.company h1 {
font-style: normal;
font-weight: normal;
.company-address-heading {
font-size: 15px;
line-height: 22px;
letter-spacing: 0.05em;
margin-bottom: 0px;
margin-top: 10px;
}
.company-address {
.company-address-text {
margin-top: 2px;
text-align: left;
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 15px;
color: #595959;
}
.job-add {
/* display: inline; */
.estimate-details-container {
float: right;
padding: 10px 30px 0 0;
}
@ -108,22 +105,24 @@
}
.attribute-label {
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 18px;
padding-right: 40px;
text-align: left;
color: #55547A
}
.attribute-value {
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 18px;
text-align: right;
}
.bill-add {
/* -------------------------- */
/* customer address style */
.customer-address-container {
width: 45%;
padding: 0px 0 0 0px;
}
@ -131,14 +130,17 @@
/* -------------------------- */
/* shipping style */
.ship-address-container {
.shipping-address-container {
float: right;
padding-left: 30px;
}
.ship-to {
font-style: normal;
font-weight: normal;
.shipping-address-container--left {
float: left;
padding-left: 30px;
}
.shipping-address-label {
font-size: 12px;
line-height: 18px;
padding: 0px;
@ -146,18 +148,15 @@
margin-bottom: 0px;
}
.ship-user-name {
max-width: 250px font-style: normal;
font-weight: normal;
.shipping-address-name {
max-width: 250px;
font-size: 15px;
line-height: 22px;
padding: 0px;
margin: 0px;
}
.ship-user-address {
font-style: normal;
font-weight: normal;
.shipping-address-text {
font-size: 10px;
line-height: 15px;
color: #595959;
@ -166,27 +165,15 @@
width: 160px;
}
.ship-user-phone {
font-style: normal;
font-weight: normal;
font-size: 10px;
line-height: 15px;
color: #595959;
padding: 0px;
margin: 0px;
}
/* -------------------------- */
/* billing style */
.bill-address-container {
.billing-address-container {
float: left;
padding-left: 30px;
}
.bill-to {
font-style: normal;
font-weight: normal;
.billing-address-label {
font-size: 12px;
line-height: 18px;
padding: 0px;
@ -194,18 +181,15 @@
margin-bottom: 0px;
}
.bill-user-name {
max-width: 250px font-style: normal;
font-weight: normal;
.billing-address-name {
max-width: 250px;
font-size: 15px;
line-height: 22px;
padding: 0px;
margin: 0px;
}
.bill-user-address {
font-style: normal;
font-weight: normal;
.billing-address-text {
font-size: 10px;
line-height: 15px;
color: #595959;
@ -214,24 +198,14 @@
width: 160px;
}
.bill-user-phone {
font-style: normal;
font-weight: normal;
font-size: 10px;
line-height: 15px;
color: #595959;
padding: 0px;
margin: 0px;
}
.table2 {
.item-table {
margin-top: 35px;
padding: 0px 30px 10px 30px;
page-break-before: avoid;
page-break-after: auto;
}
.table2 hr {
.item-table hr {
height: 0.1px;
}
@ -245,8 +219,6 @@
tr.item-table-heading-row th {
border-bottom: 0.620315px solid #E8E8E8;
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 18px;
}
@ -256,18 +228,17 @@
}
tr.item-row td {
font-style: normal;
font-weight: normal;
font-size: 12px;
line-height: 18px;
}
.item-cell {
font-size: 13;
color: rgba(0, 0, 0, 0.6);
color: #040405;
text-align: center;
padding: 5px;
padding-top: 10px;
border-color: #d9d9d9;
}
.padd8 {
@ -280,14 +251,15 @@
padding-bottom: 2px;
}
.table3 {
.total-display-table {
border-top: none;
box-sizing: border-box;
width: 630px;
page-break-inside: avoid;
page-break-before: auto;
page-break-after: auto;
margin-left:420px;
margin-top: 10px
}
.total-border-left {
@ -302,21 +274,13 @@
border-left: 0px !important;
padding-top: 0px;
padding: 8px !important;
}
.inv-item {
border-color: #d9d9d9;
border-color: red;
}
.no-border {
border: none;
}
.notes {
font-style: normal;
font-weight: 300;
font-size: 12px;
color: #595959;
margin-top: 15px;
@ -327,8 +291,6 @@
}
.notes-label {
font-style: normal;
font-weight: normal;
font-size: 15px;
line-height: 22px;
letter-spacing: 0.05em;
@ -337,14 +299,30 @@
height: 19.87px;
padding-bottom: 10px;
}
.text-center {
text-align: center
}
table .text-left {
text-align: left;
}
table .text-right {
text-align: right;
}
.no-border {
border: none;
}
</style>
</head>
<body>
<div class="header-table">
<div class="header-container">
<table width="100%">
<tr>
<td class="header-center">
<td class="text-center">
@if($logo)
<img class="header-logo" src="{{ $logo }}" alt="Company Logo">
@else
@ -355,43 +333,43 @@
</td>
</tr>
</table>
<hr class="header-line" />
<hr class="header-bottom-divider" />
</div>
<div class="wrapper">
<div class="address">
<div class="company">
<div class="company-details-container">
<div class="company-address-container">
@include('app.pdf.estimate.partials.company-address')
</div>
<div class="job-add">
<table>
<div class="estimate-details-container">
<table class="estimate-details-table">
<tr>
<td class="attribute-label" style="text-align: left; color: #55547A">Estimate Number</td>
<td class="attribute-label">Estimate Number</td>
<td class="attribute-value"> &nbsp;{{$estimate->estimate_number}}</td>
</tr>
<tr>
<td class="attribute-label" style="text-align: left; color: #55547A">Estimate Date </td>
<td class="attribute-label">Estimate Date </td>
<td class="attribute-value"> &nbsp;{{$estimate->formattedEstimateDate}}</td>
</tr>
<tr>
<td class="attribute-label" style="text-align: left; color: #55547A">Expiry Date</td>
<td class="attribute-label">Expiry Date</td>
<td class="attribute-value"> &nbsp;{{$estimate->formattedExpiryDate}}</td>
</tr>
</table>
</div>
<div style="clear: both;"></div>
</div>
<div class="bill-add">
<div class="bill-address-container">
<div class="customer-address-container">
<div class="billing-address-container">
@include('app.pdf.estimate.partials.billing-address')
</div>
@if($estimate->user->billingaddress)
<div class="ship-address-container">
@else
<div class="ship-address-container " style="float:left;padding-left:0px;">
@endif
@include('app.pdf.estimate.partials.shipping-address')
</div>
<div style="clear: both;"></div>
<div class="shipping-address-container">
@else
<div class="shipping-address-container--left">
@endif
@include('app.pdf.estimate.partials.shipping-address')
</div>
<div style="clear: both;"></div>
</div>
<div style="position:relative">
@include('app.pdf.estimate.partials.table')
@ -400,4 +378,4 @@
</div>
</body>
</html>
</html>

View File

@ -1,11 +1,11 @@
@if($estimate->user->billingaddress)
<p class="bill-to">Bill To,</p>
<p class="billing-address-label">Bill To,</p>
@if($estimate->user->billingaddress->name)
<p class="bill-user-name">
<p class="billing-address-name">
{{$estimate->user->billingaddress->name}}
</p>
@endif
<p class="bill-user-address">
<p class="billing-address-text">
@if($estimate->user->billingaddress->address_street_1)
{!! nl2br(htmlspecialchars($estimate->user->billingaddress->address_street_1)) !!}<br>
@endif
@ -31,7 +31,7 @@
@endif
@if($estimate->user->billingaddress->phone)
<p class="bill-user-phone">
<p class="billing-address-text">
Phone :{{$estimate->user->billingaddress->phone}}
</p>
@endif

View File

@ -1,9 +1,9 @@
@if($estimate->user->company)
<h1> {{$estimate->user->company->name}} </h1>
<p class="company-address-heading"> {{$estimate->user->company->name}} </p>
@endif
@if($company_address)
<p class="company-add">
<p class="company-address-text">
@if($company_address->addresses[0]['address_street_1'])
{!! nl2br(htmlspecialchars($company_address->addresses[0]['address_street_1'])) !!} <br>
@endif

View File

@ -1,11 +1,11 @@
@if($estimate->user->shippingaddress)
<p class="ship-to">Ship To,</p>
<p class="shipping-address-label">Ship To,</p>
@if($estimate->user->shippingaddress->name)
<p class="ship-user-name">
<p class="shipping-address-name">
{{$estimate->user->shippingaddress->name}}
</p>
@endif
<p class="ship-user-address">
<p class="shipping-address-text">
@if($estimate->user->shippingaddress->address_street_1)
{!! nl2br(htmlspecialchars($estimate->user->shippingaddress->address_street_1)) !!}<br>
@endif
@ -31,7 +31,7 @@
@endif
@if($estimate->user->phone)
<p class="ship-user-phone">
<p class="shipping-address-text">
Phone :{{$estimate->user->shippingaddress->phone}}
</p>
@endif

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>