diff --git a/app/Http/Resources/EstimateResource.php b/app/Http/Resources/EstimateResource.php index 46b69ea3..e7284bd7 100644 --- a/app/Http/Resources/EstimateResource.php +++ b/app/Http/Resources/EstimateResource.php @@ -23,7 +23,7 @@ class EstimateResource extends JsonResource 'reference_number' => $this->reference_number, 'tax_per_item' => $this->tax_per_item, 'discount_per_item' => $this->discount_per_item, - 'notes' => $this->getNotes(), + 'notes' => $this->notes, 'discount' => $this->discount, 'discount_type' => $this->discount_type, 'discount_val' => $this->discount_val, diff --git a/app/Http/Resources/PaymentResource.php b/app/Http/Resources/PaymentResource.php index 0ac625f8..7350a912 100644 --- a/app/Http/Resources/PaymentResource.php +++ b/app/Http/Resources/PaymentResource.php @@ -18,7 +18,7 @@ class PaymentResource extends JsonResource 'id' => $this->id, 'payment_number' => $this->payment_number, 'payment_date' => $this->payment_date, - 'notes' => $this->getNotes(), + 'notes' => $this->notes, 'amount' => $this->amount, 'unique_hash' => $this->unique_hash, 'invoice_id' => $this->invoice_id, diff --git a/app/Models/Estimate.php b/app/Models/Estimate.php index 5b7c3b8f..8c916c6a 100644 --- a/app/Models/Estimate.php +++ b/app/Models/Estimate.php @@ -483,7 +483,8 @@ class Estimate extends Model implements HasMedia '{ESTIMATE_DATE}' => $this->formattedEstimateDate, '{ESTIMATE_EXPIRY_DATE}' => $this->formattedExpiryDate, '{ESTIMATE_NUMBER}' => $this->estimate_number, - '{ESTIMATE_REF_NUMBER}' => $this->reference_number, + '{PDF_LINK}' => $this->estimatePdfUrl, + '{TOTAL_AMOUNT}' => format_money_pdf($this->total, $this->customer->currency) ]; } diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index bef7c61c..f4b773de 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -650,7 +650,9 @@ class Invoice extends Model implements HasMedia '{INVOICE_DATE}' => $this->formattedInvoiceDate, '{INVOICE_DUE_DATE}' => $this->formattedDueDate, '{INVOICE_NUMBER}' => $this->invoice_number, - '{INVOICE_REF_NUMBER}' => $this->reference_number, + '{PDF_LINK}' => $this->invoicePdfUrl, + '{DUE_AMOUNT}' => format_money_pdf($this->due_amount, $this->customer->currency), + '{TOTAL_AMOUNT}' => format_money_pdf($this->total, $this->customer->currency) ]; } diff --git a/app/Models/Payment.php b/app/Models/Payment.php index 83a17441..68a6d6a3 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -435,7 +435,8 @@ class Payment extends Model implements HasMedia '{PAYMENT_DATE}' => $this->formattedPaymentDate, '{PAYMENT_MODE}' => $this->paymentMethod ? $this->paymentMethod->name : null, '{PAYMENT_NUMBER}' => $this->payment_number, - '{PAYMENT_AMOUNT}' => $this->reference_number, + '{PDF_LINK}' => $this->paymentPdfUrl, + '{PAYMENT_AMOUNT}' => format_money_pdf($this->amount, $this->customer->currency) ]; } diff --git a/resources/scripts/components/base/BaseCustomInput.vue b/resources/scripts/components/base/BaseCustomInput.vue index 3b35de80..050b0511 100644 --- a/resources/scripts/components/base/BaseCustomInput.vue +++ b/resources/scripts/components/base/BaseCustomInput.vue @@ -126,7 +126,7 @@ onMounted(() => { }) const value = computed({ - get: () => props.modelValue, + get: () => (props.modelValue ? props.modelValue : ''), set: (value) => { emit('update:modelValue', value) }, @@ -195,7 +195,9 @@ async function getFields() { { label: 'Date', value: 'INVOICE_DATE' }, { label: 'Due Date', value: 'INVOICE_DUE_DATE' }, { label: 'Number', value: 'INVOICE_NUMBER' }, - { label: 'Ref Number', value: 'INVOICE_REF_NUMBER' }, + { label: 'PDF Link', value: 'PDF_LINK' }, + { label: 'Due Amount', value: 'DUE_AMOUNT' }, + { label: 'Total Amount', value: 'TOTAL_AMOUNT' }, ...invoiceFields.value.map((i) => ({ label: i.label, value: i.slug, @@ -211,7 +213,8 @@ async function getFields() { { label: 'Date', value: 'ESTIMATE_DATE' }, { label: 'Expiry Date', value: 'ESTIMATE_EXPIRY_DATE' }, { label: 'Number', value: 'ESTIMATE_NUMBER' }, - { label: 'Ref Number', value: 'ESTIMATE_REF_NUMBER' }, + { label: 'PDF Link', value: 'PDF_LINK' }, + { label: 'Total Amount', value: 'TOTAL_AMOUNT' }, ...estimateFields.value.map((i) => ({ label: i.label, value: i.slug, @@ -228,6 +231,7 @@ async function getFields() { { label: 'Number', value: 'PAYMENT_NUMBER' }, { label: 'Mode', value: 'PAYMENT_MODE' }, { label: 'Amount', value: 'PAYMENT_AMOUNT' }, + { label: 'PDF Link', value: 'PDF_LINK' }, ...paymentFields.value.map((i) => ({ label: i.label, value: i.slug,