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) {
// 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);
}
}
}
}

2
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{

Loading…
Cancel
Save