fix custom field invoice issue

This commit is contained in:
radhika587
2022-01-27 15:04:32 +05:30
parent 221184df41
commit 30f36461c2
3 changed files with 8 additions and 2 deletions

View File

@ -46,6 +46,7 @@ class InvoiceResource extends JsonResource
'base_due_amount' => $this->base_due_amount,
'currency_id' => $this->currency_id,
'formatted_created_at' => $this->formattedCreatedAt,
'formatted_notes' => $this->formattedNotes,
'invoice_pdf_url' => $this->invoicePdfUrl,
'formatted_invoice_date' => $this->formattedInvoiceDate,
'formatted_due_date' => $this->formattedDueDate,

View File

@ -166,6 +166,11 @@ class Invoice extends Model implements HasMedia
}
}
public function getFormattedNotesAttribute($value)
{
return $this->getNotes();
}
public function getFormattedCreatedAtAttribute($value)
{
$dateFormat = CompanySetting::getSetting('carbon_date_format', $this->company_id);

View File

@ -48,14 +48,14 @@
</dd>
</div>
<div
v-if="invoice.notes"
v-if="invoice.formatted_notes"
class="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"
>
<dt class="text-sm font-medium text-gray-500">
{{ $t('invoices.notes') }}
</dt>
<dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
<span v-html="invoice.notes"></span>
<span v-html="invoice.formatted_notes"></span>
</dd>
</div>
</dl>