|
|
|
@ -166,13 +166,15 @@ class AssignMaterialController extends Controller
|
|
|
|
|
); |
|
|
|
|
$materialResource->update($dataUpdate); |
|
|
|
|
} |
|
|
|
|
$activity = Activity::where('id', $data->activity_id)->first(); |
|
|
|
|
$activity->rencana_biaya -= $data->budget * $data->qty_planning; |
|
|
|
|
$activity->save(); |
|
|
|
|
$delete = $data->delete(); |
|
|
|
|
}else{ |
|
|
|
|
return response()->json(['status'=>'failed','message'=>'Data Assign material not found!','code'=>400], 400); |
|
|
|
|
die(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($delete){ |
|
|
|
|
return response()->json(['status'=>'success','message'=>'Assign material successfully deleted!','code'=>200], 200); |
|
|
|
|
}else{ |
|
|
|
|