From b6b4ca02672119d3f121f246ec1a5dc441ee18d5 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 18 Sep 2021 07:59:04 +1000 Subject: [PATCH] minor fixes --- app/Listeners/Invoice/InvoiceViewedActivity.php | 1 - app/Utils/Traits/MakesInvoiceValues.php | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Listeners/Invoice/InvoiceViewedActivity.php b/app/Listeners/Invoice/InvoiceViewedActivity.php index 40b6c3ecb335..6336734a9164 100644 --- a/app/Listeners/Invoice/InvoiceViewedActivity.php +++ b/app/Listeners/Invoice/InvoiceViewedActivity.php @@ -43,7 +43,6 @@ class InvoiceViewedActivity implements ShouldQueue $fields = new stdClass; - $user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->invitation->invoice->user_id; $fields->user_id = $user_id; diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index f9813ef96595..5361d38a5ac3 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -311,7 +311,10 @@ trait MakesInvoiceValues $data[$key][$table_type.'.cost'] = Number::formatMoney($item->cost, $this->client); $data[$key][$table_type.'.line_total'] = Number::formatMoney($item->line_total, $this->client); - $data[$key][$table_type.'.gross_line_total'] = Number::formatMoney($item->gross_line_total, $this->client); + + /* need to test here as this is new - 18/09/2021*/ + if(array_key_exists($table_type.'.gross_line_total', $data[$key])) + $data[$key][$table_type.'.gross_line_total'] = Number::formatMoney($item->gross_line_total, $this->client); if (isset($item->discount) && $item->discount > 0) { if ($item->is_amount_discount) {