mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
added "Due Amount, Total Amount and PDF Link" new custom fields
This commit is contained in:
committed by
Mohit Panjwani
parent
18507ddb6f
commit
32949d1eec
@ -23,7 +23,7 @@ class EstimateResource extends JsonResource
|
|||||||
'reference_number' => $this->reference_number,
|
'reference_number' => $this->reference_number,
|
||||||
'tax_per_item' => $this->tax_per_item,
|
'tax_per_item' => $this->tax_per_item,
|
||||||
'discount_per_item' => $this->discount_per_item,
|
'discount_per_item' => $this->discount_per_item,
|
||||||
'notes' => $this->getNotes(),
|
'notes' => $this->notes,
|
||||||
'discount' => $this->discount,
|
'discount' => $this->discount,
|
||||||
'discount_type' => $this->discount_type,
|
'discount_type' => $this->discount_type,
|
||||||
'discount_val' => $this->discount_val,
|
'discount_val' => $this->discount_val,
|
||||||
|
|||||||
@ -18,7 +18,7 @@ class PaymentResource extends JsonResource
|
|||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'payment_number' => $this->payment_number,
|
'payment_number' => $this->payment_number,
|
||||||
'payment_date' => $this->payment_date,
|
'payment_date' => $this->payment_date,
|
||||||
'notes' => $this->getNotes(),
|
'notes' => $this->notes,
|
||||||
'amount' => $this->amount,
|
'amount' => $this->amount,
|
||||||
'unique_hash' => $this->unique_hash,
|
'unique_hash' => $this->unique_hash,
|
||||||
'invoice_id' => $this->invoice_id,
|
'invoice_id' => $this->invoice_id,
|
||||||
|
|||||||
@ -483,7 +483,8 @@ class Estimate extends Model implements HasMedia
|
|||||||
'{ESTIMATE_DATE}' => $this->formattedEstimateDate,
|
'{ESTIMATE_DATE}' => $this->formattedEstimateDate,
|
||||||
'{ESTIMATE_EXPIRY_DATE}' => $this->formattedExpiryDate,
|
'{ESTIMATE_EXPIRY_DATE}' => $this->formattedExpiryDate,
|
||||||
'{ESTIMATE_NUMBER}' => $this->estimate_number,
|
'{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)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -650,7 +650,9 @@ class Invoice extends Model implements HasMedia
|
|||||||
'{INVOICE_DATE}' => $this->formattedInvoiceDate,
|
'{INVOICE_DATE}' => $this->formattedInvoiceDate,
|
||||||
'{INVOICE_DUE_DATE}' => $this->formattedDueDate,
|
'{INVOICE_DUE_DATE}' => $this->formattedDueDate,
|
||||||
'{INVOICE_NUMBER}' => $this->invoice_number,
|
'{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)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -435,7 +435,8 @@ class Payment extends Model implements HasMedia
|
|||||||
'{PAYMENT_DATE}' => $this->formattedPaymentDate,
|
'{PAYMENT_DATE}' => $this->formattedPaymentDate,
|
||||||
'{PAYMENT_MODE}' => $this->paymentMethod ? $this->paymentMethod->name : null,
|
'{PAYMENT_MODE}' => $this->paymentMethod ? $this->paymentMethod->name : null,
|
||||||
'{PAYMENT_NUMBER}' => $this->payment_number,
|
'{PAYMENT_NUMBER}' => $this->payment_number,
|
||||||
'{PAYMENT_AMOUNT}' => $this->reference_number,
|
'{PDF_LINK}' => $this->paymentPdfUrl,
|
||||||
|
'{PAYMENT_AMOUNT}' => format_money_pdf($this->amount, $this->customer->currency)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -126,7 +126,7 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const value = computed({
|
const value = computed({
|
||||||
get: () => props.modelValue,
|
get: () => (props.modelValue ? props.modelValue : ''),
|
||||||
set: (value) => {
|
set: (value) => {
|
||||||
emit('update:modelValue', value)
|
emit('update:modelValue', value)
|
||||||
},
|
},
|
||||||
@ -195,7 +195,9 @@ async function getFields() {
|
|||||||
{ label: 'Date', value: 'INVOICE_DATE' },
|
{ label: 'Date', value: 'INVOICE_DATE' },
|
||||||
{ label: 'Due Date', value: 'INVOICE_DUE_DATE' },
|
{ label: 'Due Date', value: 'INVOICE_DUE_DATE' },
|
||||||
{ label: 'Number', value: 'INVOICE_NUMBER' },
|
{ 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) => ({
|
...invoiceFields.value.map((i) => ({
|
||||||
label: i.label,
|
label: i.label,
|
||||||
value: i.slug,
|
value: i.slug,
|
||||||
@ -211,7 +213,8 @@ async function getFields() {
|
|||||||
{ label: 'Date', value: 'ESTIMATE_DATE' },
|
{ label: 'Date', value: 'ESTIMATE_DATE' },
|
||||||
{ label: 'Expiry Date', value: 'ESTIMATE_EXPIRY_DATE' },
|
{ label: 'Expiry Date', value: 'ESTIMATE_EXPIRY_DATE' },
|
||||||
{ label: 'Number', value: 'ESTIMATE_NUMBER' },
|
{ 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) => ({
|
...estimateFields.value.map((i) => ({
|
||||||
label: i.label,
|
label: i.label,
|
||||||
value: i.slug,
|
value: i.slug,
|
||||||
@ -228,6 +231,7 @@ async function getFields() {
|
|||||||
{ label: 'Number', value: 'PAYMENT_NUMBER' },
|
{ label: 'Number', value: 'PAYMENT_NUMBER' },
|
||||||
{ label: 'Mode', value: 'PAYMENT_MODE' },
|
{ label: 'Mode', value: 'PAYMENT_MODE' },
|
||||||
{ label: 'Amount', value: 'PAYMENT_AMOUNT' },
|
{ label: 'Amount', value: 'PAYMENT_AMOUNT' },
|
||||||
|
{ label: 'PDF Link', value: 'PDF_LINK' },
|
||||||
...paymentFields.value.map((i) => ({
|
...paymentFields.value.map((i) => ({
|
||||||
label: i.label,
|
label: i.label,
|
||||||
value: i.slug,
|
value: i.slug,
|
||||||
|
|||||||
Reference in New Issue
Block a user