From fc05cf61fa324942d9d6f9ab29df6f0abde44366 Mon Sep 17 00:00:00 2001 From: klittle81 <31577819+klittle81@users.noreply.github.com> Date: Fri, 27 Feb 2026 22:06:27 -0500 Subject: [PATCH] Patch to update reciept PDF generated by payment.blade.php to include Invoice Total, Balance Due, and Invoice Status --- app/Models/Invoice.php | 12 ++++++++++++ resources/views/app/pdf/payment/payment.blade.php | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 5c923af7..7da9a949 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -57,6 +57,7 @@ class Invoice extends Model implements HasMedia 'formattedCreatedAt', 'formattedInvoiceDate', 'formattedDueDate', + 'formattedDueAmount', 'invoicePdfUrl', ]; @@ -190,6 +191,17 @@ class Invoice extends Model implements HasMedia return Carbon::parse($this->due_date)->translatedFormat($dateFormat); } + public function getFormattedDueAmountAttribute($value) + { + $currency = $this->currency; + + if (! $currency) { + $currency = Currency::findOrFail(CompanySetting::getSetting('currency', $this->company_id)); + } + + return format_money_pdf($this->due_amount, $currency); + } + public function getFormattedInvoiceDateAttribute($value) { $dateFormat = CompanySetting::getSetting('carbon_date_format', $this->company_id); diff --git a/resources/views/app/pdf/payment/payment.blade.php b/resources/views/app/pdf/payment/payment.blade.php index 86210d48..7766971c 100644 --- a/resources/views/app/pdf/payment/payment.blade.php +++ b/resources/views/app/pdf/payment/payment.blade.php @@ -343,6 +343,10 @@ @lang('pdf_invoice_label')  {{ $payment->invoice->invoice_number }} + + Invoice Amount +  {!! format_money_pdf($payment->invoice->total, $payment->invoice->currency) !!} + @endif @@ -352,6 +356,12 @@

@lang('pdf_payment_amount_received_label')

{!! format_money_pdf($payment->amount, $payment->customer->currency) !!} + @if ($payment->invoice && $payment->invoice->invoice_number) +

Balance Due

+ {!! $payment->invoice->formattedDueAmount !!}
+

Invoice Status

+ {{ str_replace('_', ' ', optional($payment->invoice)->paid_status ?? optional($payment->invoice)->status) }} + @endif
@if ($notes)