Quality Validation - Dashboard - Production Quantity Validation and Plan Quantity Updation
This commit is contained in:
@@ -15,6 +15,7 @@ use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
|
||||
class ProductionPlanResource extends Resource
|
||||
{
|
||||
@@ -147,6 +148,25 @@ class ProductionPlanResource extends Resource
|
||||
}
|
||||
else
|
||||
{
|
||||
//SELECT COUNT(*) FROM plant_quantity_details WHERE DATE(created_at) = '{DateTime.Now.ToString("yyyy-MM-dd")}' AND shift_id = '{userShiftId}' AND plant_id = '{userPlantId}' AND line_id = '{userLineId}'
|
||||
//Day shift 'Plant Production Quantity' already updated into database
|
||||
|
||||
// $currentPath = url()->current();
|
||||
// $currentPath = $_SERVER['REQUEST_URI'];
|
||||
// dd($currentPath);
|
||||
$exists = ProductionPlan::where('plant_id', $get('plant_id'))
|
||||
->where('shift_id', $get('shift_id'))
|
||||
->where('line_id', $get('line_id'))
|
||||
->whereDate('created_at', today())
|
||||
->exists();
|
||||
|
||||
if ($exists)
|
||||
{
|
||||
$set('line_id', null);
|
||||
$set('ppLineError', $get('shift_id.name').' Production Plan already updated.');
|
||||
return;
|
||||
}
|
||||
|
||||
$set('ppLineError', null);
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user