commented mututae before logic in panel gr amster #932

Merged
jothi merged 1 commits from ranjith-dev into master 2026-08-24 11:05:18 +00:00

View File

@@ -13,26 +13,26 @@ class CreatePanelGrMaster extends CreateRecord
{ {
protected static string $resource = PanelGrMasterResource::class; protected static string $resource = PanelGrMasterResource::class;
protected function mutateFormDataBeforeCreate(array $data): array // protected function mutateFormDataBeforeCreate(array $data): array
{ // {
$exists = PanelGrMaster::where('plant_id', $data['plant_id']) // $exists = PanelGrMaster::where('plant_id', $data['plant_id'])
->where('item_id', $data['item_id']) // ->where('item_id', $data['item_id'])
->where('document_number', $data['document_number']) // ->where('document_number', $data['document_number'])
->where('invoice_number', $data['invoice_number']) // ->where('invoice_number', $data['invoice_number'])
->where('supplier_number', $data['supplier_number']) // ->where('supplier_number', $data['supplier_number'])
->exists(); // ->exists();
if ($exists) { // if ($exists) {
Notification::make() // Notification::make()
->title('Duplicate Record') // ->title('Duplicate Record')
->body('This combination already exists in Master.') // ->body('This combination already exists in Master.')
->danger() // ->danger()
->send(); // ->send();
throw ValidationException::withMessages([ // throw ValidationException::withMessages([
'item_id' => 'This combination already exists in Master.', // 'item_id' => 'This combination already exists in Master.',
]); // ]);
} // }
return $data; // return $data;
} // }
} }