From 189141c84df804adbd5bdd3fbc43859591f9bc28 Mon Sep 17 00:00:00 2001 From: radhu587 Date: Tue, 5 May 2020 18:21:25 +0530 Subject: [PATCH] Refactor estimate pdf template --- .../app/pdf/estimate/estimate1.blade.php | 196 ++++++++---------- .../partials/billing-address.blade.php | 8 +- .../partials/company-address.blade.php | 4 +- .../partials/shipping-address.blade.php | 8 +- .../app/pdf/estimate/partials/table.blade.php | 49 ++--- 5 files changed, 122 insertions(+), 143 deletions(-) diff --git a/resources/views/app/pdf/estimate/estimate1.blade.php b/resources/views/app/pdf/estimate/estimate1.blade.php index 00a699b1..5bd08298 100644 --- a/resources/views/app/pdf/estimate/estimate1.blade.php +++ b/resources/views/app/pdf/estimate/estimate1.blade.php @@ -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; + } -
+
-
+ @if($logo) @else @@ -355,43 +333,43 @@
-
+
-
-
+
+
@include('app.pdf.estimate.partials.company-address')
-
- +
+
- + - + - +
Estimate NumberEstimate Number  {{$estimate->estimate_number}}
Estimate Date Estimate Date  {{$estimate->formattedEstimateDate}}
Expiry DateExpiry Date  {{$estimate->formattedExpiryDate}}
-
-
+
+
@include('app.pdf.estimate.partials.billing-address')
@if($estimate->user->billingaddress) -
- @else -
- @endif - @include('app.pdf.estimate.partials.shipping-address') -
-
+
+ @else +
+ @endif + @include('app.pdf.estimate.partials.shipping-address') +
+
@include('app.pdf.estimate.partials.table') @@ -400,4 +378,4 @@
- \ No newline at end of file + diff --git a/resources/views/app/pdf/estimate/partials/billing-address.blade.php b/resources/views/app/pdf/estimate/partials/billing-address.blade.php index 2818a8b0..d25cced0 100644 --- a/resources/views/app/pdf/estimate/partials/billing-address.blade.php +++ b/resources/views/app/pdf/estimate/partials/billing-address.blade.php @@ -1,11 +1,11 @@ @if($estimate->user->billingaddress) -

Bill To,

+

Bill To,

@if($estimate->user->billingaddress->name) -

+

{{$estimate->user->billingaddress->name}}

@endif -

+

@if($estimate->user->billingaddress->address_street_1) {!! nl2br(htmlspecialchars($estimate->user->billingaddress->address_street_1)) !!}
@endif @@ -31,7 +31,7 @@ @endif @if($estimate->user->billingaddress->phone) -

+

Phone :{{$estimate->user->billingaddress->phone}}

@endif diff --git a/resources/views/app/pdf/estimate/partials/company-address.blade.php b/resources/views/app/pdf/estimate/partials/company-address.blade.php index f6cdb5c6..cdbcd466 100644 --- a/resources/views/app/pdf/estimate/partials/company-address.blade.php +++ b/resources/views/app/pdf/estimate/partials/company-address.blade.php @@ -1,9 +1,9 @@ @if($estimate->user->company) -

{{$estimate->user->company->name}}

+

{{$estimate->user->company->name}}

@endif @if($company_address) -

+

@if($company_address->addresses[0]['address_street_1']) {!! nl2br(htmlspecialchars($company_address->addresses[0]['address_street_1'])) !!}
@endif diff --git a/resources/views/app/pdf/estimate/partials/shipping-address.blade.php b/resources/views/app/pdf/estimate/partials/shipping-address.blade.php index 90d34531..8dd437aa 100644 --- a/resources/views/app/pdf/estimate/partials/shipping-address.blade.php +++ b/resources/views/app/pdf/estimate/partials/shipping-address.blade.php @@ -1,11 +1,11 @@ @if($estimate->user->shippingaddress) -

Ship To,

+

Ship To,

@if($estimate->user->shippingaddress->name) -

+

{{$estimate->user->shippingaddress->name}}

@endif -

+

@if($estimate->user->shippingaddress->address_street_1) {!! nl2br(htmlspecialchars($estimate->user->shippingaddress->address_street_1)) !!}
@endif @@ -31,7 +31,7 @@ @endif @if($estimate->user->phone) -

+

Phone :{{$estimate->user->shippingaddress->phone}}

@endif diff --git a/resources/views/app/pdf/estimate/partials/table.blade.php b/resources/views/app/pdf/estimate/partials/table.blade.php index 7d5f9ed4..cd472b33 100644 --- a/resources/views/app/pdf/estimate/partials/table.blade.php +++ b/resources/views/app/pdf/estimate/partials/table.blade.php @@ -1,13 +1,13 @@ - +
- - - - + + + + @if($estimate->discount_per_item === 'YES') - + @endif - + @php $index = 1 @@ -15,36 +15,37 @@ @foreach ($estimate->items as $item) @if($estimate->discount_per_item === 'YES') - @endif - @@ -65,9 +66,9 @@
-
#ItemsQuantityPrice#ItemsQuantityPriceDiscountDiscountAmountAmount
{{$index}} {{ $item->name }}
{!! nl2br(htmlspecialchars($item->description)) !!}
{{$item->quantity}} {!! format_money_pdf($item->price, $estimate->user->currency) !!} + @if($item->discount_type === 'fixed') {!! format_money_pdf($item->discount_val, $estimate->user->currency) !!} @endif @@ -53,7 +54,7 @@ @endif + {!! format_money_pdf($item->total, $estimate->user->currency) !!}
+
- + @@ -75,10 +76,10 @@ @if ($estimate->tax_per_item === 'YES') @for ($i = 0; $i < count($labels); $i++) - - @@ -86,10 +87,10 @@ @else @foreach ($estimate->taxes as $tax) - -
SubtotalSubtotal {!! format_money_pdf($estimate->sub_total, $estimate->user->currency) !!}
+ {{$labels[$i]}} + {!! format_money_pdf($taxes[$i], $estimate->user->currency) !!}
+ {{$tax->name.' ('.$tax->percent.'%)'}} + {!! format_money_pdf($tax->amount, $estimate->user->currency) !!}