Skip to content

Commit 07f0e8a

Browse files
authored
Merge pull request #18070 from Godmartinz/fix-admin-in-user-acceptance-notif
Fixes `admin` parameter acceptance notifications
2 parents cc5afb1 + a8733bd commit 07f0e8a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/Http/Controllers/Account/AcceptanceController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ public function store(Request $request, $id) : RedirectResponse
115115
}
116116

117117
$item = $acceptance->checkoutable_type::find($acceptance->checkoutable_id);
118-
118+
$lastCheckout = $item->checkouts()->latest()->first();
119+
$admin = $lastCheckout?->adminuser;
119120

120121

121122
// If signatures are required, make sure we have one
@@ -164,11 +165,10 @@ public function store(Request $request, $id) : RedirectResponse
164165
'signature' => (($sig_filename && array_key_exists('1', $encoded_image))) ? $encoded_image[1] : null,
165166
'logo' => ($encoded_logo) ?? null,
166167
'date_settings' => $settings->date_display_format,
167-
'admin' => auth()->user()->present()?->fullName,
168+
'admin' => $admin?->present()->fullName,
168169
'qty' => $acceptance->qty ?? 1,
169170
];
170171

171-
172172
if ($request->input('asset_acceptance') == 'accepted') {
173173

174174

0 commit comments

Comments
 (0)