Added qty to email notification

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-07-18 00:25:29 +01:00
parent 6c3cafa72f
commit 4c4b0f722a

View file

@ -30,6 +30,7 @@ class CheckoutAccessoryNotification extends Notification
$this->item = $accessory; $this->item = $accessory;
$this->admin = $checkedOutBy; $this->admin = $checkedOutBy;
$this->note = $note; $this->note = $note;
$this->checkout_qty = $accessory->checkout_qty;
$this->target = $checkedOutTo; $this->target = $checkedOutTo;
$this->acceptance = $acceptance; $this->acceptance = $acceptance;
$this->settings = Setting::getSettings(); $this->settings = Setting::getSettings();
@ -107,7 +108,7 @@ class CheckoutAccessoryNotification extends Notification
->from($botname) ->from($botname)
->to($channel) ->to($channel)
->attachment(function ($attachment) use ($item, $note, $admin, $fields) { ->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) ->fields($fields)
->content($note); ->content($note);
}); });
@ -127,6 +128,7 @@ class CheckoutAccessoryNotification extends Notification
->addStartGroupToSection('activityText') ->addStartGroupToSection('activityText')
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle') ->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle')
->fact(trans('mail.assigned_to'), $target->present()->name) ->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.checkedout_from'), $item->location->name ? $item->location->name : '')
->fact(trans('mail.Accessory_Checkout_Notification') . " by ", $admin->present()->fullName()) ->fact(trans('mail.Accessory_Checkout_Notification') . " by ", $admin->present()->fullName())
->fact(trans('admin/consumables/general.remaining'), $item->numRemaining()) ->fact(trans('admin/consumables/general.remaining'), $item->numRemaining())
@ -184,6 +186,7 @@ class CheckoutAccessoryNotification extends Notification
'eula' => $eula, 'eula' => $eula,
'req_accept' => $req_accept, 'req_accept' => $req_accept,
'accept_url' => $accept_url, 'accept_url' => $accept_url,
'checkout_qty' => $this->checkout_qty,
]) ])
->subject(trans('mail.Confirm_accessory_delivery')); ->subject(trans('mail.Confirm_accessory_delivery'));
} }