designed full screen mode for production quantity chart
This commit is contained in:
@@ -11,6 +11,8 @@ class ProductionQuantity extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
public static $importing = false; // Add this flag
|
||||
|
||||
protected $fillable = [
|
||||
"plant_id",
|
||||
"shift_id",
|
||||
@@ -42,6 +44,11 @@ class ProductionQuantity extends Model
|
||||
protected static function booted()
|
||||
{
|
||||
static::created(function ($productionQuantity) {
|
||||
|
||||
if (static::$importing) { // Check flag here
|
||||
return;
|
||||
}
|
||||
|
||||
$productionPlan = ProductionPlan::where('plant_id', $productionQuantity->plant_id)
|
||||
->where('shift_id', $productionQuantity->shift_id)
|
||||
->where('line_id', $productionQuantity->line_id)
|
||||
@@ -53,12 +60,12 @@ class ProductionQuantity extends Model
|
||||
if (!$productionPlan)
|
||||
{
|
||||
$productionPlan = ProductionPlan::where('plant_id', $productionQuantity->plant_id)
|
||||
->where('shift_id', $productionQuantity->shift_id)
|
||||
->where('line_id', $productionQuantity->line_id)
|
||||
->whereDate('created_at', Carbon::yesterday())
|
||||
// ->where('plan_quantity', $productionQuantity->plan_quantity)
|
||||
->latest()
|
||||
->first();
|
||||
->where('shift_id', $productionQuantity->shift_id)
|
||||
->where('line_id', $productionQuantity->line_id)
|
||||
->whereDate('created_at', Carbon::yesterday())
|
||||
// ->where('plan_quantity', $productionQuantity->plan_quantity)
|
||||
->latest()
|
||||
->first();
|
||||
}
|
||||
|
||||
if ($productionPlan) {
|
||||
|
||||
Reference in New Issue
Block a user