mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 21:44:51 +00:00
Patch to update reciept PDF generated by payment.blade.php to include Invoice Total, Balance Due, and Invoice Status
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user