Browse Source

Merge pull request 'dev-wahyu' (#52) from dev-wahyu into staging

Reviewed-on: ordo/adw-backend#52
Reviewed-by: ibnu <ibnu@mail.com>
pull/3/head
ibnu 2 years ago
parent
commit
45e0780a46
  1. 14
      app/Helpers/MasterFunctionsHelper.php
  2. 2
      app/Http/Controllers/AssignMaterialController.php

14
app/Helpers/MasterFunctionsHelper.php

@ -71,12 +71,14 @@ class MasterFunctionsHelper {
// foreach ($gantt as $key => $value) { // foreach ($gantt as $key => $value) {
// Log::info('gantt '.$value.' index '.$key); // Log::info('gantt '.$value.' index '.$key);
// } // }
if($gantt['calculation_type'] == 'simple') { if (isset($gantt['calculation_type'])) {
// to do if($gantt['calculation_type'] == 'simple') {
return MasterFunctionsHelper::calculateProgressBasedOnSimple($gantt); // to do
} else { return MasterFunctionsHelper::calculateProgressBasedOnSimple($gantt);
return MasterFunctionsHelper::calculateProgressBasedOnReportMaterial($gantt); } else {
} return MasterFunctionsHelper::calculateProgressBasedOnReportMaterial($gantt);
}
}
} }
} }

2
app/Http/Controllers/AssignMaterialController.php

@ -42,7 +42,7 @@ class AssignMaterialController extends Controller
$data['budget'] = $checkStock->price; $data['budget'] = $checkStock->price;
$data['qty_planning'] = $this->sanitizeDecimal($data['qty_planning']); $data['qty_planning'] = $this->sanitizeDecimal($data['qty_planning']);
if ($planDate > $startDate) { if ($planDate >= $startDate) {
$result = AssignMaterial::create($data); $result = AssignMaterial::create($data);
return response()->json(['status'=>'success','message'=>'Data added!', 'code'=>200], 200); return response()->json(['status'=>'success','message'=>'Data added!', 'code'=>200], 200);
}else{ }else{

Loading…
Cancel
Save