Added logic for gate out entry for out time #726
@@ -54,6 +54,17 @@ class GateOutEntry extends Page implements HasForms
|
|||||||
$entry = VisitorEntry::where('register_id', $gatePass)->first();
|
$entry = VisitorEntry::where('register_id', $gatePass)->first();
|
||||||
|
|
||||||
if ($entry) {
|
if ($entry) {
|
||||||
|
|
||||||
|
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->out_time = now();
|
||||||
$entry->save();
|
$entry->save();
|
||||||
|
|
||||||
@@ -63,6 +74,7 @@ class GateOutEntry extends Page implements HasForms
|
|||||||
->success()
|
->success()
|
||||||
->send();
|
->send();
|
||||||
$this->filters['scan_out_gate_pass'] = '';
|
$this->filters['scan_out_gate_pass'] = '';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Invalid Gate Pass')
|
->title('Invalid Gate Pass')
|
||||||
|
|||||||
Reference in New Issue
Block a user