MotivationService::calculateMonthDefect($model->year, $model->month);
MotivationService::calculateMonthSalary($model->year, $model->month);
+
+ MotivationService::calculateMonthDeliveryCurier($model->year, $model->month);
+
+ MotivationService::calculateMonthAccauntingAndTax($model->year, $model->month);
+
+ MotivationService::calculateMonthLegalServices($model->year, $model->month);
}
return $this->controller->render('test-fact', compact('model', 'years', 'months'));
MotivationService::calculateMonthSalary($year, $month);
+ MotivationService::calculateMonthDeliveryCurier($year, $month);
+
+ MotivationService::calculateMonthAccauntingAndTax($year, $month);
+
+ MotivationService::calculateMonthLegalServices($year, $month);
+
//////////////////////////////////////////////
6, 11, "float", $monthlyTotalSalary + $correction);
}
}
+
+ public static function calculateMonthDeliveryCurier($year, $month) {
+ $motivations = Motivation::find()
+ ->where(['year' => $year, 'month' => $month])
+ ->all();
+
+ foreach ($motivations as $motivation) {
+ $correction = self::getMotivationValue($motivation->id, 8, 16);
+ self::saveOrUpdateMotivationValue($motivation->id,
+ 6, 16, "float", $correction);
+ }
+ }
+
+ public static function calculateMonthAccauntingAndTax($year, $month) {
+ $motivations = Motivation::find()
+ ->where(['year' => $year, 'month' => $month])
+ ->all();
+
+ foreach ($motivations as $motivation) {
+ $plan = self::getMotivationValue($motivation->id, 7, 27);
+ self::saveOrUpdateMotivationValue($motivation->id,
+ 6, 27, "float", $plan);
+ }
+ }
+
+ public static function calculateMonthLegalServices($year, $month) {
+ $motivations = Motivation::find()
+ ->where(['year' => $year, 'month' => $month])
+ ->all();
+
+ foreach ($motivations as $motivation) {
+ $plan = self::getMotivationValue($motivation->id, 7, 28);
+ self::saveOrUpdateMotivationValue($motivation->id,
+ 6, 28, "float", $plan);
+ }
+ }
}