Merge pull request 'Added logic for gate out entry for out time' (#726) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #726
This commit was merged in pull request #726.
This commit is contained in:
@@ -54,15 +54,27 @@ class GateOutEntry extends Page implements HasForms
|
||||
$entry = VisitorEntry::where('register_id', $gatePass)->first();
|
||||
|
||||
if ($entry) {
|
||||
$entry->out_time = now();
|
||||
$entry->save();
|
||||
|
||||
Notification::make()
|
||||
->title('Gate Pass Processed')
|
||||
->body('Gate pass has been successfully processed. Visitor marked as exited.')
|
||||
->success()
|
||||
->send();
|
||||
$this->filters['scan_out_gate_pass'] = '';
|
||||
if (!empty($entry->out_time)) {
|
||||
Notification::make()
|
||||
->title('Already Exited')
|
||||
->body('Gate pass has already been processed. Out time was already punched.')
|
||||
->warning()
|
||||
->send();
|
||||
$this->filters['scan_out_gate_pass'] = '';
|
||||
return;
|
||||
}
|
||||
else{
|
||||
$entry->out_time = now();
|
||||
$entry->save();
|
||||
|
||||
Notification::make()
|
||||
->title('Gate Pass Processed')
|
||||
->body('Gate pass has been successfully processed. Visitor marked as exited.')
|
||||
->success()
|
||||
->send();
|
||||
$this->filters['scan_out_gate_pass'] = '';
|
||||
}
|
||||
} else {
|
||||
Notification::make()
|
||||
->title('Invalid Gate Pass')
|
||||
|
||||
Reference in New Issue
Block a user