From 0a28b677df607d40a9a99c74fab624c5d5b172f1 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 21 Mar 2023 08:02:33 +1100 Subject: [PATCH] Updates for logging and also new variables --- app/Utils/HtmlEngine.php | 13 +++++++++++++ config/logging.php | 2 ++ 2 files changed, 15 insertions(+) diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 5a2a51e1dc44..36cd4e272206 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -638,6 +638,10 @@ class HtmlEngine $data['$entity_images'] = ['value' => $this->generateEntityImagesMarkup(), 'label' => '']; $data['$payments'] = ['value' => '', 'label' => ctrans('texts.payments')]; + $data['$payment.custom1'] = ['value' => '', 'label' => ctrans('texts.payment')]; + $data['$payment.custom2'] = ['value' => '', 'label' => ctrans('texts.payment')]; + $data['$payment.custom3'] = ['value' => '', 'label' => ctrans('texts.payment')]; + $data['$payment.custom4'] = ['value' => '', 'label' => ctrans('texts.payment')]; if ($this->entity_string == 'invoice' && $this->entity->payments()->exists()) { $payment_list = '

'; @@ -647,6 +651,15 @@ class HtmlEngine } $data['$payments'] = ['value' => $payment_list, 'label' => ctrans('texts.payments')]; + + + $payment = $this->entity->payments()->first(); + + $data['$payment.custom1'] = ['value' => $payment->custom_value1, 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment1')]; + $data['$payment.custom2'] = ['value' => $payment->custom_value2, 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment2')]; + $data['$payment.custom3'] = ['value' => $payment->custom_value3, 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment3')]; + $data['$payment.custom4'] = ['value' => $payment->custom_value4, 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment4')]; + } if (($this->entity_string == 'invoice' || $this->entity_string == 'recurring_invoice') && isset($this->company?->custom_fields?->company1)) { diff --git a/config/logging.php b/config/logging.php index 5be233cfdc7f..9a4f1f01f4c7 100644 --- a/config/logging.php +++ b/config/logging.php @@ -56,12 +56,14 @@ return [ 'driver' => 'single', 'path' => storage_path('logs/invoiceninja.log'), 'level' => env('LOG_LEVEL', 'debug'), + 'days' => 7, ], 'stack' => [ 'driver' => 'stack', 'channels' => ['single'], 'ignore_exceptions' => false, + 'days' => 7, ], 'single' => [