From be4ace293ed134197e29bfb519b4acf4aade3ff9 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 18 Sep 2025 13:51:57 +0100 Subject: [PATCH] Use trans_choice for user acceptance --- app/Models/CheckoutAcceptance.php | 3 +++ .../AcceptanceAssetAcceptedToUserNotification.php | 4 ++-- resources/lang/en-US/mail.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Models/CheckoutAcceptance.php b/app/Models/CheckoutAcceptance.php index f23c6d7f4b..b5c5ee9efe 100644 --- a/app/Models/CheckoutAcceptance.php +++ b/app/Models/CheckoutAcceptance.php @@ -207,6 +207,9 @@ class CheckoutAcceptance extends Model if ($data['item_serial'] != null) { $pdf->writeHTML(trans('admin/hardware/form.serial').': '.e($data['item_serial']), true, 0, true, 0, ''); } + if (($data['qty'] != null) && ($data['qty'] > 1)) { + $pdf->writeHTML(trans('general.qty').': '.e($data['qty']), true, 0, true, 0, ''); + } $pdf->writeHTML(trans('general.assignee').': '.e($data['assigned_to']), true, 0, true, 0, ''); $pdf->Ln(); $pdf->writeHTML('
', true, 0, true, 0, ''); diff --git a/app/Notifications/AcceptanceAssetAcceptedToUserNotification.php b/app/Notifications/AcceptanceAssetAcceptedToUserNotification.php index 246eb3777b..1f53443449 100644 --- a/app/Notifications/AcceptanceAssetAcceptedToUserNotification.php +++ b/app/Notifications/AcceptanceAssetAcceptedToUserNotification.php @@ -72,10 +72,10 @@ use Illuminate\Notifications\Notification; 'company_name' => $this->company_name, 'admin' => $this->admin, 'qty' => $this->qty, - 'intro_text' => trans('mail.acceptance_asset_accepted_to_user', ['site_name' => $this->company_name ?? $this->settings->site_name]), + 'intro_text' => trans_choice('mail.acceptance_asset_accepted_to_user', $this->qty, ['qty' => $this->qty, 'site_name' => $this->settings->site_name]), ]) ->attach($pdf_path) - ->subject(trans('mail.acceptance_asset_accepted_to_user', ['site_name' => $this->settings->site_name])); + ->subject(trans_choice('mail.acceptance_asset_accepted_to_user', $this->qty, ['qty' => $this->qty, 'site_name' => $this->settings->site_name])); return $message; } diff --git a/resources/lang/en-US/mail.php b/resources/lang/en-US/mail.php index 15a5bdd206..707390e4f0 100644 --- a/resources/lang/en-US/mail.php +++ b/resources/lang/en-US/mail.php @@ -31,7 +31,7 @@ return [ 'Low_Inventory_Report' => 'Low Inventory Report', 'a_user_canceled' => 'A user has canceled an item request on the website', 'a_user_requested' => 'A user has requested an item on the website', - 'acceptance_asset_accepted_to_user' => 'You have accepted an item assigned to you by :site_name', + 'acceptance_asset_accepted_to_user' => 'You have accepted an item assigned to you by :site_name|You have accepted :qty items assigned to you by :site_name', 'acceptance_asset_accepted' => 'A user has accepted an item', 'acceptance_asset_declined' => 'A user has declined an item', 'send_pdf_copy' => 'Send a copy of this acceptance to my email address',