From ef9adbd6c9ce60e7d619b61567cc87c453eeac96 Mon Sep 17 00:00:00 2001 From: mchev Date: Sun, 12 Jan 2025 11:27:29 +0100 Subject: [PATCH] Adding sent and viewed field to payload (#247) --- app/Http/Requests/InvoicesRequest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Requests/InvoicesRequest.php b/app/Http/Requests/InvoicesRequest.php index 3e401638..48c5ac10 100644 --- a/app/Http/Requests/InvoicesRequest.php +++ b/app/Http/Requests/InvoicesRequest.php @@ -111,7 +111,7 @@ class InvoicesRequest extends FormRequest return $rules; } - public function getInvoicePayload() + public function getInvoicePayload(): array { $company_currency = CompanySetting::getSetting('currency', $this->header('company')); $current_currency = $this->currency_id; @@ -127,6 +127,8 @@ class InvoicesRequest extends FormRequest 'tax_per_item' => CompanySetting::getSetting('tax_per_item', $this->header('company')) ?? 'NO ', 'discount_per_item' => CompanySetting::getSetting('discount_per_item', $this->header('company')) ?? 'NO', 'due_amount' => $this->total, + 'sent' => (bool) $this->sent ?? false, + 'viewed' => (bool) $this->viewed ?? false, 'exchange_rate' => $exchange_rate, 'base_total' => $this->total * $exchange_rate, 'base_discount_val' => $this->discount_val * $exchange_rate,