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(),
|
||||
Tables\Columns\TextColumn::make('panel_box_serial_number')
|
||||
->label('Panel Box Serial Number')
|
||||
->searchable()
|
||||
->alignCenter(),
|
||||
Tables\Columns\TextColumn::make('load_rate')
|
||||
->label('Load Rate')
|
||||
@@ -1278,15 +1279,16 @@ class InvoiceValidationResource extends Resource
|
||||
->options(function (callable $get) {
|
||||
$pId = $get('Plant');
|
||||
|
||||
// if (empty($pId)) {
|
||||
// return [];
|
||||
// }
|
||||
return Item::whereHas('stickerMasters', function ($query) use ($pId) {
|
||||
if ($pId) {
|
||||
$query->where('plant_id', $pId);
|
||||
}
|
||||
$query->whereHas('invoiceValidations');
|
||||
})->pluck('code', 'id');
|
||||
if (! $pId) {
|
||||
return [];
|
||||
} else {
|
||||
return Item::whereHas('stickerMasters', function ($query) use ($pId) {
|
||||
if ($pId) {
|
||||
$query->where('plant_id', $pId);
|
||||
}
|
||||
$query->whereHas('invoiceValidations');
|
||||
})->pluck('code', 'id');
|
||||
}
|
||||
}),
|
||||
Select::make('scanned_status')
|
||||
->label('Scanned Status')
|
||||
@@ -1393,8 +1395,9 @@ class InvoiceValidationResource extends Resource
|
||||
$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'])
|
||||
->where('plant_id', $data['Plant'])
|
||||
->pluck('id')
|
||||
->toArray();
|
||||
|
||||
@@ -1424,7 +1427,7 @@ class InvoiceValidationResource extends Resource
|
||||
$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';
|
||||
$indicators[] = 'Item Code: '.$itemCode;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user