From 6f231fbd602673196530f6a7a055fb7efdd2e1ac Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 29 Aug 2025 09:51:12 +1000 Subject: [PATCH] Update for page numbering --- app/Utils/Traits/Pdf/PDF.php | 12 +++++------- composer.lock | 12 ++++++------ config/ninja.php | 2 +- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/Utils/Traits/Pdf/PDF.php b/app/Utils/Traits/Pdf/PDF.php index d9d79727ef..2624c40440 100644 --- a/app/Utils/Traits/Pdf/PDF.php +++ b/app/Utils/Traits/Pdf/PDF.php @@ -36,23 +36,21 @@ class PDF extends FPDI // Calculate X position with offset $base_x = config('ninja.pdf_page_numbering_x_alignment'); - $x_position = $base_x + $this->x_offset; // Set X position based on alignment if ($this->text_alignment == 'L') { - $this->SetX($x_position); + $this->SetX($this->GetX() + $base_x); // Adjust cell width to account for X offset - $cell_width = $this->GetPageWidth() - $x_position - 10; + $cell_width = $this->GetPageWidth(); $this->Cell($cell_width, 5, $trans, 0, 0, 'L'); } elseif ($this->text_alignment == 'R') { - $this->SetX($x_position); + $this->SetX($this->GetX() + $base_x); // For right alignment, calculate width from X position to right edge - $cell_width = $this->GetPageWidth() - $x_position; + $cell_width = $this->GetPageWidth(); $this->Cell($cell_width, 5, $trans, 0, 0, 'R'); } else { - $this->SetX($x_position); // For center alignment, calculate appropriate width - $cell_width = $this->GetPageWidth() - ($x_position * 2); + $cell_width = $this->GetPageWidth(); $this->Cell($cell_width, 5, $trans, 0, 0, 'C'); } } diff --git a/composer.lock b/composer.lock index dce347b197..680267c012 100644 --- a/composer.lock +++ b/composer.lock @@ -11410,16 +11410,16 @@ }, { "name": "sentry/sentry", - "version": "4.15.0", + "version": "4.15.1", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "b2d84de69f3eda8ca22b0b00e9f923be3b837355" + "reference": "0d09baf3700869ec4b723c95eb466de56c3d74b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/b2d84de69f3eda8ca22b0b00e9f923be3b837355", - "reference": "b2d84de69f3eda8ca22b0b00e9f923be3b837355", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/0d09baf3700869ec4b723c95eb466de56c3d74b6", + "reference": "0d09baf3700869ec4b723c95eb466de56c3d74b6", "shasum": "" }, "require": { @@ -11483,7 +11483,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/4.15.0" + "source": "https://github.com/getsentry/sentry-php/tree/4.15.1" }, "funding": [ { @@ -11495,7 +11495,7 @@ "type": "custom" } ], - "time": "2025-08-20T14:26:37+00:00" + "time": "2025-08-28T15:45:14+00:00" }, { "name": "sentry/sentry-laravel", diff --git a/config/ninja.php b/config/ninja.php index 78665e10ac..d4a537a670 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -257,7 +257,7 @@ return [ 'storecove_email_catchall' => env('STORECOVE_CATCHALL_EMAIL',false), 'qvalia_api_key' => env('QVALIA_API_KEY', false), 'qvalia_partner_number' => env('QVALIA_PARTNER_NUMBER', false), - 'pdf_page_numbering_x_alignment' => env('PDF_PAGE_NUMBER_X', 0), + 'pdf_page_numbering_x_alignment' => env('PDF_PAGE_NUMBER_X', -10), 'pdf_page_numbering_y_alignment' => env('PDF_PAGE_NUMBER_Y', -6), 'hosted_einvoice_secret' => env('HOSTED_EINVOICE_SECRET', null), 'e_invoice_quota_warning' => env('E_INVOICE_QUOTA_WARNING', 15),