changed logic by default loading of of data in table list of asrs
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 53s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m5s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 40s
Laravel Pint / pint (pull_request) Successful in 10m23s
Laravel Larastan / larastan (pull_request) Failing after 17m59s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 53s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 1m5s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 40s
Laravel Pint / pint (pull_request) Successful in 10m23s
Laravel Larastan / larastan (pull_request) Failing after 17m59s
This commit is contained in:
@@ -285,27 +285,27 @@ class AsrsItemValidationResource extends Resource
|
|||||||
|
|
||||||
$status = $data['status'] ?? 'NotUpdated';
|
$status = $data['status'] ?? 'NotUpdated';
|
||||||
// Hide all records initially if no filters are applied
|
// Hide all records initially if no filters are applied
|
||||||
// if (empty($data['Plant']) && empty($data['item_code']) && empty($data['status']) && empty($data['created_from']) && empty($data['created_to'])) {
|
if (empty($data['Plant']) && empty($data['item_code']) && empty($data['uom']) && empty($data['status']) && empty($data['created_from']) && empty($data['created_to'])) {
|
||||||
// // return $query->whereRaw('1 = 0');
|
return $query->whereRaw('1 = 0');
|
||||||
// $query->where('status', 'NotUpdated');
|
// $query->where('status', 'NotUpdated');
|
||||||
// }
|
|
||||||
|
|
||||||
if (
|
|
||||||
empty($data['Plant']) &&
|
|
||||||
empty($data['item_code']) &&
|
|
||||||
empty($data['uom']) &&
|
|
||||||
empty($data['status']) &&
|
|
||||||
empty($data['created_from']) &&
|
|
||||||
empty($data['created_to'])
|
|
||||||
) {
|
|
||||||
// $query->where('status', 'NotUpdated');
|
|
||||||
$query->where(function ($q) {
|
|
||||||
$q->where('status', 'NotUpdated')
|
|
||||||
->orWhereNull('status')
|
|
||||||
->orWhere('status', '');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (
|
||||||
|
// empty($data['Plant']) &&
|
||||||
|
// empty($data['item_code']) &&
|
||||||
|
// empty($data['uom']) &&
|
||||||
|
// empty($data['status']) &&
|
||||||
|
// empty($data['created_from']) &&
|
||||||
|
// empty($data['created_to'])
|
||||||
|
// ) {
|
||||||
|
// // $query->where('status', 'NotUpdated');
|
||||||
|
// $query->where(function ($q) {
|
||||||
|
// $q->where('status', 'NotUpdated')
|
||||||
|
// ->orWhereNull('status')
|
||||||
|
// ->orWhere('status', '');
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
if (! empty($data['Plant'])) {
|
if (! empty($data['Plant'])) {
|
||||||
$query->where('plant_id', $data['Plant']);
|
$query->where('plant_id', $data['Plant']);
|
||||||
}
|
}
|
||||||
@@ -387,11 +387,12 @@ class AsrsItemValidationResource extends Resource
|
|||||||
Tables\Actions\ViewAction::make(),
|
Tables\Actions\ViewAction::make(),
|
||||||
Tables\Actions\EditAction::make(),
|
Tables\Actions\EditAction::make(),
|
||||||
// ->hidden(function ($record): bool {
|
// ->hidden(function ($record): bool {
|
||||||
// if (auth()->user()?->hasRole('SuperAdmin')) {
|
// if (auth()->user()?->hasRole('Super Admin')) {
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
|
// else{
|
||||||
// return trim(strtolower($record->status)) == 'updated';
|
// return trim(($record->status)) == 'Updated';
|
||||||
|
// }
|
||||||
// }),
|
// }),
|
||||||
// ->visible(function ($record): bool {
|
// ->visible(function ($record): bool {
|
||||||
// return auth()->user()?->hasRole('SuperAdmin')
|
// return auth()->user()?->hasRole('SuperAdmin')
|
||||||
|
|||||||
Reference in New Issue
Block a user