From 24c9edd1a7c4108cd72825eee269ab5e99be6079 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 5 Jan 2024 10:50:39 +1100 Subject: [PATCH] Adjustments for PDf previews --- app/Models/Invoice.php | 5 +---- app/Services/Pdf/PdfMock.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index ef82156fa6..2d9a5babc3 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -245,9 +245,6 @@ class Invoice extends BaseModel public function getPartialDueDateAttribute($value) { - if($value == "0000-00-00 00:00:00") - return null; - return $this->dateMutator($value); } @@ -399,7 +396,7 @@ class Invoice extends BaseModel public function getStatusAttribute() { $due_date = $this->due_date ? Carbon::parse($this->due_date) : false; - $partial_due_date = $this->partial_due_date ? Carbon::parse($this->partial_due_date) : false; + $partial_due_date = $this->partial_due_Date ? Carbon::parse($this->partial_due_date) : false; if ($this->status_id == self::STATUS_SENT && $due_date && $due_date->gt(now())) { return self::STATUS_UNPAID; diff --git a/app/Services/Pdf/PdfMock.php b/app/Services/Pdf/PdfMock.php index 7cc2bd72a3..ee96b808a9 100644 --- a/app/Services/Pdf/PdfMock.php +++ b/app/Services/Pdf/PdfMock.php @@ -462,7 +462,7 @@ class PdfMock '$viewLink' => 'View Invoice', '$autoBill' => 'This invoice will automatically be billed to your credit card on file on the due date.', '$view_url' => 'http://ninja.test:8000/client/invoice/UAUY8vIPuno72igmXbbpldwo5BDDKIqs', - '$font_url' => 'https://fonts.googleapis.com/css2?family=Roboto&display=swap', + '$font_url' => isset($this->settings?->primary_font) ? \App\Utils\Helpers::resolveFont($this->settings->primary_font)['url'] : 'https://fonts.googleapis.com/css2?family=Roboto&display=swap', '$details' => '', '$balance' => '$40.00', '$partial' => '$30.00',