Quality Validation - Dashboard - Production Quantity Validation and Plan Quantity Updation

This commit is contained in:
dhanabalan
2025-03-31 19:10:13 +05:30
parent a93fe806bb
commit 29687b109c
7 changed files with 483 additions and 120 deletions

View File

@@ -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);
}
})