changed pattern for process order wire master
Some checks failed
Gemini PR Review / Gemini PR Review (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Waiting to run
Laravel Larastan / larastan (pull_request) Waiting to run
Laravel Pint / pint (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Gemini PR Review / Gemini PR Review (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Waiting to run
Laravel Larastan / larastan (pull_request) Waiting to run
Laravel Pint / pint (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Resources\WireMasterPackingResource\Pages;
|
||||
|
||||
use App\Filament\Resources\WireMasterPackingResource;
|
||||
use App\Models\CustomerPoMaster;
|
||||
use App\Models\Item;
|
||||
use App\Models\Plant;
|
||||
use App\Models\WireMasterPacking;
|
||||
@@ -81,7 +82,8 @@ class CreateWireMasterPacking extends CreateRecord
|
||||
return;
|
||||
}
|
||||
|
||||
$pattern = '/^([^|]+)\|([^|]+)\|(\d+(\.\d+)?)$/';
|
||||
// $pattern = '/^([^|]+)\|([^|]+)\|(\d+(\.\d+)?)$/';
|
||||
$pattern = '/^([^|]+)\|([^|]+)\|([^|]+)\|(\d+(\.\d+)?)$/';
|
||||
|
||||
if (!preg_match($pattern, $processOrder, $matches))
|
||||
{
|
||||
@@ -182,6 +184,60 @@ class CreateWireMasterPacking extends CreateRecord
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$customerPoRecord = CustomerPoMaster::where('id', $customerPo)
|
||||
->where('plant_id', $plantId)
|
||||
->first();
|
||||
|
||||
$customerPoName = $customerPoRecord->customer_po;
|
||||
|
||||
if ($customerPoRecord) {
|
||||
$customerPoName = $customerPoRecord->customer_po;
|
||||
} else {
|
||||
$customerPoName = null;
|
||||
}
|
||||
|
||||
if(!$customerPoRecord)
|
||||
{
|
||||
Notification::make()
|
||||
->title("PO Not Found")
|
||||
->body("Customer PO '$customerPoName' for Item '$materialCode' not found against Plant '$plantcode'")
|
||||
->danger()
|
||||
->duration(5000)
|
||||
->send();
|
||||
|
||||
$this->form->fill([
|
||||
'process_order' => null,
|
||||
'plant_id' => $plantId,
|
||||
'customer_po_master_id' => $customerPo,
|
||||
'wire_packing_number' => $wirePackNo,
|
||||
'Sno_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
if($weight > $customerPoRecord->quantity)
|
||||
{
|
||||
Notification::make()
|
||||
->title("Scanned Weight Exceeds PO Quantity")
|
||||
->body("Scanned weight '$weight' exceeds allowed quantity '{$customerPoRecord->quantity}' for PO '$customerPo' and Item '$materialCode'")
|
||||
->danger()
|
||||
->duration(5000)
|
||||
->send();
|
||||
|
||||
$this->form->fill([
|
||||
'process_order' => null,
|
||||
'plant_id' => $plantId,
|
||||
'customer_po_master_id' => $customerPo,
|
||||
'wire_packing_number' => $wirePackNo,
|
||||
'Sno_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
'scanned_by' => $operatorName,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
$existingPallet = WireMasterPacking::where('plant_id', $plantId)
|
||||
|
||||
Reference in New Issue
Block a user