diff --git a/app/Jobs/Quote/CreateQuotePdf.php b/app/Jobs/Quote/CreateQuotePdf.php index 4e94cd81c4d9..c7493e77a081 100644 --- a/app/Jobs/Quote/CreateQuotePdf.php +++ b/app/Jobs/Quote/CreateQuotePdf.php @@ -19,6 +19,7 @@ use App\Models\ClientContact; use App\Models\Company; use App\Models\Design; use App\Models\Invoice; +use App\Services\PdfMaker\Design as PdfMakerDesign; use App\Services\PdfMaker\PdfMaker as PdfMakerService; use App\Utils\HtmlEngine; use App\Utils\PhantomJS\Phantom; @@ -82,17 +83,12 @@ class CreateQuotePdf implements ShouldQueue $quote_design_id = $this->quote->design_id ? $this->quote->design_id : $this->decodePrimaryKey($this->quote->client->getSetting('quote_design_id')); $design = Design::find($quote_design_id); - $html = new HtmlEngine(null, $this->invitation, 'quote'); - $design_namespace = 'App\Services\PdfMaker\Designs\\'.$design->name; - - $design_class = new $design_namespace(); - - $pdf_variables = json_decode(json_encode($this->quote->company->settings->pdf_variables), 1); + $template = new PdfMakerDesign(strtolower($design->name)); $state = [ - 'template' => $design_class->elements([ + 'template' => $template->elements([ 'client' => $this->quote->client, 'entity' => $this->quote, 'pdf_variables' => (array) $this->quote->company->settings->pdf_variables, @@ -107,7 +103,7 @@ class CreateQuotePdf implements ShouldQueue $maker = new PdfMakerService($state); $maker - ->design($design_namespace) + ->design($template) ->build(); //todo - move this to the client creation stage so we don't keep hitting this unnecessarily diff --git a/resources/views/portal/ninja2020/invoices/payment.blade.php b/resources/views/portal/ninja2020/invoices/payment.blade.php index 0a1838e0336c..9cd24264dd4b 100644 --- a/resources/views/portal/ninja2020/invoices/payment.blade.php +++ b/resources/views/portal/ninja2020/invoices/payment.blade.php @@ -2,18 +2,18 @@ @section('meta_title', ctrans('texts.pay_now')) @push('head') - - - + + + @endpush @section('body') -
- @csrf - - - - + + @csrf + + + +
@@ -21,112 +21,111 @@
@if(count($payment_methods) > 0) -
-
-
- -
+
+
+
+
-
-
-
- @foreach($payment_methods as $payment_method) - - {{ $payment_method['label'] }} - - @endforeach -
+
+
+
+
+ @foreach($payment_methods as $payment_method) + + {{ $payment_method['label'] }} + + @endforeach
+
@else - - {{ ctrans('texts.to_pay_invoices') }}   - {{ ctrans('texts.add_payment_method_first') }}. - + + {{ ctrans('texts.to_pay_invoices') }}   + {{ ctrans('texts.add_payment_method_first') }}. + @endif
@foreach($invoices as $key => $invoice) - -
-
-

- {{ ctrans('texts.invoice') }} - - (#{{ $invoice->number }}) - -

-

-

-
-
-
-
-
- {{ ctrans('texts.invoice_number') }} -
-
- {{ $invoice->number }} -
-
-
-
- {{ ctrans('texts.due_date') }} -
-
- {{ $invoice->due_date }} -
-
-
-
- {{ ctrans('texts.additional_info') }} -
-
- @if($invoice->po_number) - {{ $invoice->po_number }} - @elseif($invoice->public_notes) - {{ $invoice->public_notes }} - @else - {{ $invoice->date}} - @endif -
-
-
-
- {{ ctrans('texts.amount') }} -
-
- - -
-
-
-
+ +
+
+

+ {{ ctrans('texts.invoice') }} + + (#{{ $invoice->number }}) + +

+
+
+ @if(!empty($invoice->number) && !is_null($invoice->number)) +
+
+ {{ ctrans('texts.invoice_number') }} +
+
+ {{ $invoice->number }} +
+
+ @endif + + @if(!empty($invoice->due_date) && !is_null($invoice->due_date)) +
+
+ {{ ctrans('texts.due_date') }} +
+
+ {{ $invoice->due_date }} +
+
+ @endif + +
+
+ {{ ctrans('texts.additional_info') }} +
+
+ @if($invoice->po_number) + {{ $invoice->po_number }} + @elseif($invoice->public_notes) + {{ $invoice->public_notes }} + @else + {{ $invoice->date}} + @endif +
+
+ + @if(!empty($invoice->amount) && !is_null($invoice->amount)) +
+
+ {{ ctrans('texts.amount') }} +
+
+ + +
+
+ @endif +
+
+
@endforeach
- - @include('portal.ninja2020.invoices.includes.terms') - @include('portal.ninja2020.invoices.includes.signature') + +@include('portal.ninja2020.invoices.includes.terms') +@include('portal.ninja2020.invoices.includes.signature') @endsection @push('footer') - -@endpush + +@endpush \ No newline at end of file diff --git a/resources/views/portal/ninja2020/payment_methods/show.blade.php b/resources/views/portal/ninja2020/payment_methods/show.blade.php index e39a2c468406..5d7f624d3a4a 100644 --- a/resources/views/portal/ninja2020/payment_methods/show.blade.php +++ b/resources/views/portal/ninja2020/payment_methods/show.blade.php @@ -3,27 +3,31 @@ @section('body')
-
+
-

+

{{ ctrans("texts.{$payment_method->gateway_type->alias}") }}

-

+

{{ ctrans('texts.payment_method_details') }}

-
-
+ @if(!empty($payment_method->gateway_type->name) && !is_null($payment_method->gateway_type->name)) +
+
{{ ctrans('texts.payment_type') }}
{{ ucfirst($payment_method->gateway_type->name) }}
-
-
+ @endif + + @if(!empty($payment_method->meta) && !is_null($payment_method->meta)) +
+
{{ ctrans('texts.type') }}
@@ -31,33 +35,44 @@ {{ optional($payment_method->meta)->scheme }}
-
-
+ @endif + + @if(!empty($payment_method->meta->last4) && !is_null($payment_method->meta->last4)) +
+
{{ ctrans('texts.card_number') }}
**** {{ ucfirst($payment_method->meta->last4) }}
-
-
+ @endif + + @if(!empty($payment_method->created_at) && !is_null($payment_method->created_at)) +
+
{{ ctrans('texts.date_created') }}
{{ $payment_method->formatDateTimestamp($payment_method->created_at, auth()->user()->client->date_format()) }}
-
-
+ @endif + + @if(!empty($payment_method->is_default) && !is_null($payment_method->is_default)) +
+
{{ ctrans('texts.default') }}
{{ $payment_method->is_default ? ctrans('texts.yes') : ctrans('texts.no') }}
+ @endif + @isset($payment_method->meta->exp_month) -
-
+
+
{{ ctrans('texts.expires') }}
@@ -68,14 +83,14 @@
-
+
-

+

{{ ctrans('texts.remove')}}

-
+

{{ ctrans('texts.permanently_remove_payment_method') }}

diff --git a/resources/views/portal/ninja2020/payments/show.blade.php b/resources/views/portal/ninja2020/payments/show.blade.php index 494189757277..167138e02208 100644 --- a/resources/views/portal/ninja2020/payments/show.blade.php +++ b/resources/views/portal/ninja2020/payments/show.blade.php @@ -2,87 +2,100 @@ @section('meta_title', ctrans('texts.payment')) @section('body') -
-
-
-

- {{ ctrans('texts.payment') }} -

-

- {{ ctrans('texts.payment_details') }} -

-
-
-
-
-
- {{ ctrans('texts.payment_date') }} -
-
- {{ $payment->clientPaymentDate() }} -
-
-
-
- {{ ctrans('texts.transaction_reference') }} -
-
- {{ $payment->transaction_reference }} -
-
-
-
- {{ ctrans('texts.method') }} -
-
- {{ optional($payment->type)->name }} -
-
-
-
- {{ ctrans('texts.amount') }} -
-
- {{ $payment->formattedAmount() }} -
-
-
-
- {{ ctrans('texts.status') }} -
-
- {!! \App\Models\Payment::badgeForStatus($payment->status_id) !!} -
-
-
-
+
+
+
+

+ {{ ctrans('texts.payment') }} +

+

+ {{ ctrans('texts.payment_details') }} +

-
-
-

- {{ ctrans('texts.invoices') }} -

-

- {{ ctrans('texts.list_of_payment_invoices') }} -

-
-
-
- @foreach($payment->invoices as $invoice) -
-
- {{ ctrans('texts.invoice_number') }} -
- -
- @endforeach -
-
+
+
+ @if(!empty($payment->clientPaymentDate()) && !is_null($payment->clientPaymentDate())) +
+
+ {{ ctrans('texts.payment_date') }} +
+
+ {{ $payment->clientPaymentDate() }} +
+
+ @endif + + @if(!empty($payment->transaction_reference) && !is_null($payment->transaction_reference)) +
+
+ {{ ctrans('texts.transaction_reference') }} +
+
+ {{ $payment->transaction_reference }} +
+
+ @endif + + @if(!empty(optional($payment->type)->name) && !is_null(optional($payment->type)->name)) +
+
+ {{ ctrans('texts.method') }} +
+
+ {{ optional($payment->type)->name }} +
+
+ @endif + + @if(!empty($payment->formattedAmount()) && !is_null($payment->formattedAmount())) +
+
+ {{ ctrans('texts.amount') }} +
+
+ {{ $payment->formattedAmount() }} +
+
+ @endif + + @if(!empty($payment->status_id) && !is_null($payment->status_id)) +
+
+ {{ ctrans('texts.status') }} +
+
+ {!! \App\Models\Payment::badgeForStatus($payment->status_id) !!} +
+
+ @endif +
-@endsection +
+
+

+ {{ ctrans('texts.invoices') }} +

+

+ {{ ctrans('texts.list_of_payment_invoices') }} +

+
+
+
+ @foreach($payment->invoices as $invoice) +
+
+ {{ ctrans('texts.invoice_number') }} +
+ +
+ @endforeach +
+
+
+
+@endsection \ No newline at end of file