From 4c4b0f722a40ab68c78e0592888fbea9618b51ba Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 18 Jul 2024 00:25:29 +0100 Subject: [PATCH] Added qty to email notification Signed-off-by: snipe --- app/Notifications/CheckoutAccessoryNotification.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Notifications/CheckoutAccessoryNotification.php b/app/Notifications/CheckoutAccessoryNotification.php index 803b697e8..721ba7f6a 100644 --- a/app/Notifications/CheckoutAccessoryNotification.php +++ b/app/Notifications/CheckoutAccessoryNotification.php @@ -30,6 +30,7 @@ class CheckoutAccessoryNotification extends Notification $this->item = $accessory; $this->admin = $checkedOutBy; $this->note = $note; + $this->checkout_qty = $accessory->checkout_qty; $this->target = $checkedOutTo; $this->acceptance = $acceptance; $this->settings = Setting::getSettings(); @@ -107,7 +108,7 @@ class CheckoutAccessoryNotification extends Notification ->from($botname) ->to($channel) ->attachment(function ($attachment) use ($item, $note, $admin, $fields) { - $attachment->title(htmlspecialchars_decode($item->present()->name), $item->present()->viewUrl()) + $attachment->title(htmlspecialchars_decode($this->checkout_qty.' x '.$item->present()->name), $item->present()->viewUrl()) ->fields($fields) ->content($note); }); @@ -127,6 +128,7 @@ class CheckoutAccessoryNotification extends Notification ->addStartGroupToSection('activityText') ->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle') ->fact(trans('mail.assigned_to'), $target->present()->name) + ->fact(trans('general.qty'), $this->checkout_qty) ->fact(trans('mail.checkedout_from'), $item->location->name ? $item->location->name : '') ->fact(trans('mail.Accessory_Checkout_Notification') . " by ", $admin->present()->fullName()) ->fact(trans('admin/consumables/general.remaining'), $item->numRemaining()) @@ -184,6 +186,7 @@ class CheckoutAccessoryNotification extends Notification 'eula' => $eula, 'req_accept' => $req_accept, 'accept_url' => $accept_url, + 'checkout_qty' => $this->checkout_qty, ]) ->subject(trans('mail.Confirm_accessory_delivery')); }