diff --git a/app/Helpers/MasterFunctionsHelper.php b/app/Helpers/MasterFunctionsHelper.php index 86197d7..1224d23 100644 --- a/app/Helpers/MasterFunctionsHelper.php +++ b/app/Helpers/MasterFunctionsHelper.php @@ -71,12 +71,14 @@ class MasterFunctionsHelper { // foreach ($gantt as $key => $value) { // Log::info('gantt '.$value.' index '.$key); // } - if($gantt['calculation_type'] == 'simple') { - // to do - return MasterFunctionsHelper::calculateProgressBasedOnSimple($gantt); - } else { - return MasterFunctionsHelper::calculateProgressBasedOnReportMaterial($gantt); - } + if (isset($gantt['calculation_type'])) { + if($gantt['calculation_type'] == 'simple') { + // to do + return MasterFunctionsHelper::calculateProgressBasedOnSimple($gantt); + } else { + return MasterFunctionsHelper::calculateProgressBasedOnReportMaterial($gantt); + } + } } } diff --git a/app/Http/Controllers/AssignMaterialController.php b/app/Http/Controllers/AssignMaterialController.php index 5a89147..b3f917a 100644 --- a/app/Http/Controllers/AssignMaterialController.php +++ b/app/Http/Controllers/AssignMaterialController.php @@ -42,7 +42,7 @@ class AssignMaterialController extends Controller $data['budget'] = $checkStock->price; $data['qty_planning'] = $this->sanitizeDecimal($data['qty_planning']); - if ($planDate > $startDate) { + if ($planDate >= $startDate) { $result = AssignMaterial::create($data); return response()->json(['status'=>'success','message'=>'Data added!', 'code'=>200], 200); }else{