$model->load(Yii::$app->request->get());
$service = new AutoPlannogrammaService();
- $isEditable = date($model->year . '-' . $model->month . '-d') > date('Y-m-d') && (
- (date('d') < 27) || (date('Y-m-d', strtotime('-2 month', strtotime(date($model->year . '-' . $model->month . '-d')))) > date('Y-m-d')));
- //$isEditable = true;
+ $deadline = date(
+ 'Y-m-d',
+ strtotime("{$model->year}-{$model->month}-27 -2 months")
+ );
+ $isEditable = date('Y-m-d') < $deadline;
+
$categoryPlan = CategoryPlan::find()->where(['year' => $model->year, 'month' => $model->month, 'store_id' => $model->store_id])->indexBy('category')->asArray()->all();
$types = [];
$table = [];