ranjith-dev #865
@@ -3,8 +3,10 @@
|
||||
namespace App\Filament\Resources\VisitorEntryResource\Pages;
|
||||
|
||||
use App\Filament\Resources\VisitorEntryResource;
|
||||
use App\Models\DealerVisitPlan;
|
||||
use App\Models\EmployeeMaster;
|
||||
use App\Models\VisitorEntry;
|
||||
use Carbon\Carbon;
|
||||
use Filament\Actions;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
@@ -139,6 +141,18 @@ class CreateVisitorEntry extends CreateRecord
|
||||
else{
|
||||
\Log::warning('No email found for employee ID: ' . $visitor->employee_master_id);
|
||||
}
|
||||
|
||||
|
||||
if ($visitor->type == 'Dealer') {
|
||||
DealerVisitPlan::where('name', $visitor->name)
|
||||
->where('company', $visitor->company)
|
||||
->where('mobile_number', $visitor->mobile_number)
|
||||
->whereDate('visit_plan_date', today())
|
||||
->where('status', 'Planned')
|
||||
->update([
|
||||
'status' => 'Completed',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
|
||||
Reference in New Issue
Block a user