Added filter in invoice page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 3m57s
Laravel Larastan / larastan (pull_request) Failing after 6m23s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 3m57s
Laravel Larastan / larastan (pull_request) Failing after 6m23s
This commit is contained in:
@@ -1273,6 +1273,12 @@ class InvoiceValidationResource extends Resource
|
||||
TextInput::make('panel_box_serial_number')
|
||||
->label('Panel Box Serial Number')
|
||||
->placeholder(placeholder: 'Enter Panel Box Serial Number'),
|
||||
TextInput::make('panel_box_supplier')
|
||||
->label('Panel Box Supplier')
|
||||
->placeholder(placeholder: 'Enter Panel Box Supplier'),
|
||||
TextInput::make('panel_box_code')
|
||||
->label('Panel Box Code')
|
||||
->placeholder(placeholder: 'Enter Panel Box Code'),
|
||||
Select::make('sticker_master_id')
|
||||
->label('Search by Item Code')
|
||||
->nullable()
|
||||
@@ -1327,7 +1333,7 @@ class InvoiceValidationResource extends Resource
|
||||
])
|
||||
->query(function ($query, array $data) {
|
||||
// Hide all records initially if no filters are applied
|
||||
if (empty($data['invoice_type']) || (empty($data['Plant']) && empty($data['invoice_number']) && empty($data['serial_number']) && empty($data['panel_box_serial_number']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['operator_id']) && empty($data['scanned_status']) && empty($data['sticker_master_id']))) {
|
||||
if (empty($data['invoice_type']) || (empty($data['Plant']) && empty($data['invoice_number']) && empty($data['serial_number']) && empty($data['panel_box_serial_number']) && empty($data['panel_box_supplier']) && empty($data['panel_box_code']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['operator_id']) && empty($data['scanned_status']) && empty($data['sticker_master_id']))) {
|
||||
if (empty($data['invoice_type'])) {
|
||||
Notification::make()
|
||||
->title('Please, choose invoice type to filter.')
|
||||
@@ -1389,6 +1395,14 @@ class InvoiceValidationResource extends Resource
|
||||
$query->where('panel_box_serial_number', 'like', '%'.$data['panel_box_serial_number'].'%');
|
||||
}
|
||||
|
||||
if (! empty($data['panel_box_supplier'])) {
|
||||
$query->where('panel_box_supplier', 'like', '%'.$data['panel_box_supplier'].'%');
|
||||
}
|
||||
|
||||
if (! empty($data['panel_box_code'])) {
|
||||
$query->where('panel_box_code', 'like', '%'.$data['panel_box_code'].'%');
|
||||
}
|
||||
|
||||
if (! empty($data['created_from'])) {
|
||||
$query->where('created_at', '>=', $data['created_from']);
|
||||
}
|
||||
@@ -1437,6 +1451,14 @@ class InvoiceValidationResource extends Resource
|
||||
$indicators[] = 'Panel Box Serial Number: '.$data['panel_box_serial_number'];
|
||||
}
|
||||
|
||||
if (! empty($data['panel_box_supplier'])) {
|
||||
$indicators[] = 'Panel Box Supplier: '.$data['panel_box_supplier'];
|
||||
}
|
||||
|
||||
if (! empty($data['panel_box_code'])) {
|
||||
$indicators[] = 'Panel Box Code: '.$data['panel_box_code'];
|
||||
}
|
||||
|
||||
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