Skip to content

Commit fab85da

Browse files
committed
Added employee number and email to acceptance PDF
1 parent 955faed commit fab85da

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/Http/Controllers/Account/AcceptanceController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public function store(Request $request, $id) : RedirectResponse
157157
'accepted_date' => Helper::getFormattedDateObject(now()->format('Y-m-d H:i:s'), 'datetime', false),
158158
'declined_date' => Helper::getFormattedDateObject(now()->format('Y-m-d H:i:s'), 'datetime', false),
159159
'assigned_to' => $assigned_user->display_name,
160+
'email' => $assigned_user->email,
161+
'employee_num' => $assigned_user->employee_num,
160162
'site_name' => $settings->site_name,
161163
'company_name' => $item->company?->name?? $settings->site_name,
162164
'signature' => (($sig_filename && array_key_exists('1', $encoded_image))) ? $encoded_image[1] : null,

app/Models/CheckoutAcceptance.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,10 @@ public function generateAcceptancePdf($data, $pdf_filename) {
210210
if (($data['qty'] != null) && ($data['qty'] > 1)) {
211211
$pdf->writeHTML(trans('general.qty').': '.e($data['qty']), true, 0, true, 0, '');
212212
}
213-
$pdf->writeHTML(trans('general.assignee').': '.e($data['assigned_to']), true, 0, true, 0, '');
213+
$pdf->writeHTML(trans('general.assignee').': '.e($data['assigned_to']) . ($data['employee_num'] ? ' ('.$data['employee_num'].')' : ''), true, 0, true, 0, '');
214+
if ($data['email'] != null) {
215+
$pdf->writeHTML(trans('general.email').': '.e($data['email']), true, 0, true, 0, '');
216+
}
214217
$pdf->Ln();
215218
$pdf->writeHTML('<hr>', true, 0, true, 0, '');
216219

0 commit comments

Comments
 (0)