@ -127,6 +127,13 @@ class Activity extends Model
if($parent = Activity::find($this->parent_id)){
$parentActWeight = $parent->bobot_planning;
if ($parentActWeight == 0) {
$parent->update([
"persentase_progress" => 0
]);
return;
}
$totalChildProportionalProgress = 0;
$childs = Activity::where("parent_id", $parent->id)->get();
foreach($childs as $child){
@ -50,6 +50,9 @@ class UserToActivity extends Model
$activity->rencana_biaya -= $salary;
if ($activity->rencana_biaya < 0) {
$activity->rencana_biaya = 0;
$activity->save();
});