Added filter panel box serial number in invoice validations
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Pint / pint (pull_request) Successful in 3m27s
Laravel Larastan / larastan (pull_request) Failing after 6m31s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Pint / pint (pull_request) Successful in 3m27s
Laravel Larastan / larastan (pull_request) Failing after 6m31s
This commit is contained in:
@@ -327,6 +327,7 @@ class InvoiceValidationResource extends Resource
|
|||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('panel_box_serial_number')
|
Tables\Columns\TextColumn::make('panel_box_serial_number')
|
||||||
->label('Panel Box Serial Number')
|
->label('Panel Box Serial Number')
|
||||||
|
->searchable()
|
||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('load_rate')
|
Tables\Columns\TextColumn::make('load_rate')
|
||||||
->label('Load Rate')
|
->label('Load Rate')
|
||||||
@@ -1278,15 +1279,16 @@ class InvoiceValidationResource extends Resource
|
|||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
$pId = $get('Plant');
|
$pId = $get('Plant');
|
||||||
|
|
||||||
// if (empty($pId)) {
|
if (! $pId) {
|
||||||
// return [];
|
return [];
|
||||||
// }
|
} else {
|
||||||
return Item::whereHas('stickerMasters', function ($query) use ($pId) {
|
return Item::whereHas('stickerMasters', function ($query) use ($pId) {
|
||||||
if ($pId) {
|
if ($pId) {
|
||||||
$query->where('plant_id', $pId);
|
$query->where('plant_id', $pId);
|
||||||
}
|
}
|
||||||
$query->whereHas('invoiceValidations');
|
$query->whereHas('invoiceValidations');
|
||||||
})->pluck('code', 'id');
|
})->pluck('code', 'id');
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
Select::make('scanned_status')
|
Select::make('scanned_status')
|
||||||
->label('Scanned Status')
|
->label('Scanned Status')
|
||||||
@@ -1393,8 +1395,9 @@ class InvoiceValidationResource extends Resource
|
|||||||
$query->where('operator_id', $data['operator_id']);
|
$query->where('operator_id', $data['operator_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($data['sticker_master_id'])) {
|
if (! empty($data['sticker_master_id']) && ! empty($data['Plant'])) {
|
||||||
$stickerMasterIds = StickerMaster::where('item_id', $data['sticker_master_id'])
|
$stickerMasterIds = StickerMaster::where('item_id', $data['sticker_master_id'])
|
||||||
|
->where('plant_id', $data['Plant'])
|
||||||
->pluck('id')
|
->pluck('id')
|
||||||
->toArray();
|
->toArray();
|
||||||
|
|
||||||
@@ -1424,7 +1427,7 @@ class InvoiceValidationResource extends Resource
|
|||||||
$indicators[] = 'Serial Number: '.$data['serial_number'];
|
$indicators[] = 'Serial Number: '.$data['serial_number'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($data['sticker_master_id'])) {
|
if (! empty($data['sticker_master_id']) && ! empty($data['Plant'])) {
|
||||||
$itemCode = Item::find($data['sticker_master_id'])->code ?? 'Unknown';
|
$itemCode = Item::find($data['sticker_master_id'])->code ?? 'Unknown';
|
||||||
$indicators[] = 'Item Code: '.$itemCode;
|
$indicators[] = 'Item Code: '.$itemCode;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user