From d213049fdd55a990351fb5dbb1997f2dde412995 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 8 Jul 2026 09:53:08 +0530 Subject: [PATCH] added one more validation in customer po master --- app/Filament/Imports/CustomerPoMasterImporter.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Filament/Imports/CustomerPoMasterImporter.php b/app/Filament/Imports/CustomerPoMasterImporter.php index bf089bf..d211729 100644 --- a/app/Filament/Imports/CustomerPoMasterImporter.php +++ b/app/Filament/Imports/CustomerPoMasterImporter.php @@ -111,6 +111,13 @@ class CustomerPoMasterImporter extends Importer $warnMsg[] = "Customer PO '{$this->data['customer_po']}' is already mapped to customer '{$existingPo->customer_name}'."; } + $existingPoItem = CustomerPoMaster::where('plant_id', $plant->id)->where('item_id', $item->id)->where('customer_po', $this->data['customer_po'])->where('customer_name', $this->data['customer_name'])->first(); + + if ($existingPoItem) + { + $warnMsg[] = "Customer PO '{$this->data['customer_po']}' is already exist with item code '{$this->data['item']}' and customer name '{$this->data['customer_name']}'."; + } + // $user = User::where('name', $this->data['created_by'])->first(); // if (! $user) { // $warnMsg[] = 'User not found';