From cdaa1ff1039ad89a847642fa002806bfa40804b7 Mon Sep 17 00:00:00 2001 From: Mohit Panjwani Date: Mon, 12 Apr 2021 14:40:59 +0530 Subject: [PATCH] refactor estimate & invoice templates --- .../app/pdf/estimate/estimate1.blade.php | 52 ++++++------ .../app/pdf/estimate/estimate2.blade.php | 51 ++++++------ .../app/pdf/estimate/estimate3.blade.php | 57 +++++++------ .../views/app/pdf/invoice/invoice1.blade.php | 16 +++- .../views/app/pdf/invoice/invoice2.blade.php | 70 ++++++++-------- .../views/app/pdf/invoice/invoice3.blade.php | 82 ++++++++++--------- 6 files changed, 176 insertions(+), 152 deletions(-) diff --git a/resources/views/app/pdf/estimate/estimate1.blade.php b/resources/views/app/pdf/estimate/estimate1.blade.php index 0b13c335..0a66346d 100644 --- a/resources/views/app/pdf/estimate/estimate1.blade.php +++ b/resources/views/app/pdf/estimate/estimate1.blade.php @@ -389,22 +389,24 @@ @if($logo) - + @else - @if($estimate->user->company) - - @endif + @if($estimate->user->company) + + @endif @endif
+
{!! $company_address !!}
+
@@ -423,39 +425,43 @@
+
@if($billing_address !== '
')
@if($billing_address) - @lang('pdf_bill_to') + @lang('pdf_bill_to')
{!! $billing_address !!} @endif
@endif - @if($billing_address !== '
') -
- @else -
- @endif + + +
') class="shipping-address-container shipping-address" @else class="shipping-address-container--left shipping-address" style="padding-left:30px;" @endif> + @if($shipping_address) - @lang('pdf_ship_to') + @lang('pdf_ship_to')
{!! $shipping_address !!} @endif
+
-
-
- @include('app.pdf.estimate.partials.table') -
-
- @if($notes) -
- @lang('pdf_notes') -
- {!! $notes !!} - @endif -
+ +
+ @include('app.pdf.estimate.partials.table') +
+ +
+ @if($notes) +
+ @lang('pdf_notes') +
+ + {!! $notes !!} + @endif +
+
diff --git a/resources/views/app/pdf/estimate/estimate2.blade.php b/resources/views/app/pdf/estimate/estimate2.blade.php index bb6a8ca2..5d881580 100644 --- a/resources/views/app/pdf/estimate/estimate2.blade.php +++ b/resources/views/app/pdf/estimate/estimate2.blade.php @@ -94,7 +94,7 @@ /* -- Address -- */ - .wrapper { + .content-wrapper { display: block; margin-top: 60px; padding-bottom: 20px; @@ -400,13 +400,14 @@ @if($logo) + @else + + @endif
- @else - - @if($estimate->user->company) -

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

- @endif - @endif
+ @if($estimate->user->company) +

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

+ @endif +

@lang('pdf_estimate_label')

{{$estimate->estimate_number}}

@@ -416,41 +417,41 @@

-
+
{!! $company_address !!}
+ @if($shipping_address !== '
')
@if($shipping_address) - @lang('pdf_ship_to') + @lang('pdf_ship_to')
{!! $shipping_address !!} @endif
@endif - @if($shipping_address !== '
') -
- @else -
- @endif + +
') style="float:right; margin-right:30px;" @endif> @if($billing_address) - @lang('pdf_bill_to') + @lang('pdf_bill_to')
{!! $billing_address !!} @endif
-
- @include('app.pdf.estimate.partials.table') -
- @if($notes) -
- @lang('pdf_notes') -
- {!! $notes !!} - @endif -
+ + @include('app.pdf.estimate.partials.table') + +
+ @if($notes) +
+ @lang('pdf_notes') +
+ {!! $notes !!} + @endif +
+
diff --git a/resources/views/app/pdf/estimate/estimate3.blade.php b/resources/views/app/pdf/estimate/estimate3.blade.php index 3986151b..7efb93a2 100644 --- a/resources/views/app/pdf/estimate/estimate3.blade.php +++ b/resources/views/app/pdf/estimate/estimate3.blade.php @@ -354,7 +354,7 @@

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

@endif - + {!! $company_address !!} @@ -368,42 +368,41 @@
@if($billing_address) - @lang('pdf_bill_to') + @lang('pdf_bill_to')
{!! $billing_address !!} @endif
- @if($estimate->user->billingaddress) -
- @else -
- @endif - @if($shipping_address) - @lang('pdf_ship_to') - {!! $shipping_address !!} - @endif -
-
+ +
user->billingaddress) class="shipping-address-container shipping-address" @else class="shipping-address-container--left shipping-address" @endif> + @if($shipping_address) + @lang('pdf_ship_to')
+ {!! $shipping_address !!} + @endif
-
- - - - - - - - - - - - - -
@lang('pdf_estimate_number')  {{$estimate->estimate_number}}
@lang('pdf_estimate_date')  {{$estimate->formattedEstimateDate}}
@lang('pdf_estimate_expire_date')  {{$estimate->formattedExpiryDate}}
-
+ +
+ + + + + + + + + + + + + +
@lang('pdf_estimate_number')  {{$estimate->estimate_number}}
@lang('pdf_estimate_date')  {{$estimate->formattedEstimateDate}}
@lang('pdf_estimate_expire_date')  {{$estimate->formattedExpiryDate}}
+
+
+ @include('app.pdf.estimate.partials.table') +
@if($notes)
diff --git a/resources/views/app/pdf/invoice/invoice1.blade.php b/resources/views/app/pdf/invoice/invoice1.blade.php index b30a7a21..0cc849b7 100644 --- a/resources/views/app/pdf/invoice/invoice1.blade.php +++ b/resources/views/app/pdf/invoice/invoice1.blade.php @@ -116,6 +116,7 @@ padding-left: 40px; width: 160px; } + .shipping-address { font-size: 12px; line-height: 15px; @@ -349,11 +350,13 @@
+
{!! $company_address !!}
+
@@ -370,33 +373,40 @@
+
@if($billing_address) - @lang('pdf_bill_to') + @lang('pdf_bill_to')
+ {!! $billing_address !!} @endif
-
') style="float:left;" @else style="display:block; float:left: padding-left: 0px;" @endif> +
' ) style="float:left;" @else style="display:block; float:left: padding-left: 0px;" @endif> @if($shipping_address) - @lang('pdf_ship_to') + @lang('pdf_ship_to')
+ {!! $shipping_address !!} @endif
+
@include('app.pdf.invoice.partials.table')
+
@if($notes)
@lang('pdf_notes')
+ {!! $notes !!} @endif
+
diff --git a/resources/views/app/pdf/invoice/invoice2.blade.php b/resources/views/app/pdf/invoice/invoice2.blade.php index a99209c7..cf90f5a4 100644 --- a/resources/views/app/pdf/invoice/invoice2.blade.php +++ b/resources/views/app/pdf/invoice/invoice2.blade.php @@ -123,7 +123,7 @@ /* margin-top: 18px; */ } - .company-address{ + .company-address { font-size: 10px; line-height: 15px; color: #595959; @@ -156,7 +156,7 @@ margin-bottom: 0px; } - .billing-address{ + .billing-address { font-size: 10px; line-height: 15px; color: #595959; @@ -380,15 +380,17 @@ @if($logo) - + + @else + + @endif +
- - @else - - @if($invoice->user->company) -

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

- @endif - @endif -
+ + + @if($invoice->user->company) +

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

+ @endif +

@lang('pdf_invoice_label')

{{$invoice->invoice_number}}

@@ -397,43 +399,47 @@
+
+
{!! $company_address !!}
+ @if($shipping_address !== '
')
@if($shipping_address) - @lang('pdf_ship_to') + @lang('pdf_ship_to')
{!! $shipping_address !!} @endif
@endif - @if($shipping_address !== '
') -
- @else -
- @endif - @if($billing_address) - @lang('pdf_bill_to') - {!! $billing_address !!} - @endif -
-
-
- @include('app.pdf.invoice.partials.table') - {{-- @include('app.pdf.invoice.partials.notes') --}} -
- @if($notes) -
- @lang('pdf_notes') -
- {!! $notes !!} + + +
') style="float:right; margin-right:30px;" @endif> + @if($billing_address) + @lang('pdf_bill_to')
+ {!! $billing_address !!} @endif
+ +
+ + @include('app.pdf.invoice.partials.table') + +
+ @if($notes) +
+ @lang('pdf_notes') +
+ + {!! $notes !!} + @endif +
+
diff --git a/resources/views/app/pdf/invoice/invoice3.blade.php b/resources/views/app/pdf/invoice/invoice3.blade.php index 6f1b4deb..382dca5f 100644 --- a/resources/views/app/pdf/invoice/invoice3.blade.php +++ b/resources/views/app/pdf/invoice/invoice3.blade.php @@ -34,17 +34,20 @@ width: 100%; padding: 0px 30px; } + .header-logo { height: 50px; text-transform: capitalize; color: #817AE3; padding-top: 0px; } + .company-address-container { width: 50%; padding-left: 80px; margin-bottom: 2px; } + .company-address { margin-top: 12px; font-size: 12px; @@ -70,12 +73,12 @@ /* -- Shipping -- */ .shipping-address-container { - float:right; + float: right; display: block; } .shipping-address-container--left { - float:left; + float: left; display: block; padding-left: 0; } @@ -243,7 +246,7 @@ padding-bottom: 10px; } - /* -- Helpers -- */ + /* -- Helpers -- */ .text-primary { color: #5851DB; @@ -307,12 +310,12 @@ @if($logo) - + @else -

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

+

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

@endif - + {!! $company_address !!} @@ -326,50 +329,49 @@
@if($billing_address) - @lang('pdf_bill_to') + @lang('pdf_bill_to')
{!! $billing_address !!} @endif
- @if($billing_address !== '
') -
- @else -
- @endif + +
') class="shipping-address-container shipping-address" @else class="shipping-address-container--left shipping-address" @endif> @if($shipping_address) - @lang('pdf_ship_to') + @lang('pdf_ship_to')
{!! $shipping_address !!} @endif -
-
-
- -
- - - - - - - - - - - - - -
@lang('pdf_invoice_number')  {{$invoice->invoice_number}}
@lang('pdf_invoice_date')  {{$invoice->formattedInvoiceDate}}
@lang('pdf_invoice_due_date')  {{$invoice->formattedDueDate}}
- @include('app.pdf.invoice.partials.table') -
- @if($notes) -
- @lang('pdf_notes') -
- {!! $notes !!} - @endif + +
+ + + + + + + + + + + + + +
@lang('pdf_invoice_number')  {{$invoice->invoice_number}}
@lang('pdf_invoice_date')  {{$invoice->formattedInvoiceDate}}
@lang('pdf_invoice_due_date')  {{$invoice->formattedDueDate}}
+
+
+ + @include('app.pdf.invoice.partials.table') + +
+ @if($notes) +
+ @lang('pdf_notes') +
+ + {!! $notes !!} + @endif