Browse Source

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

Reviewed-on: ordo/adw-backend#141
pull/3/head
ibnu 1 year ago
parent
commit
5b151b89e6
  1. 1
      app/Helpers/MasterFunctionsHelper.php
  2. 4
      app/Http/Controllers/ActivityController.php
  3. 5
      app/Http/Controllers/ProjectController.php

1
app/Helpers/MasterFunctionsHelper.php

@ -201,7 +201,6 @@ class MasterFunctionsHelper
->max("a.planned_end"); // plan date overlapped with assign_material_to_activity's, it should be m_activity'
$maxDate = max(new \DateTime($plannedMaxDate), new \DateTime($actualMaxDate));
$end = $maxDate;
$end->modify('last month');
$interval = new \DateInterval('P7D');
}
$period = new \DatePeriod($begin, $interval, $end);

4
app/Http/Controllers/ActivityController.php

@ -216,7 +216,9 @@ class ActivityController extends Controller
$data['created_by'] = $this->currentName;
$max = Activity::where('version_gantt_id', $request->version_gantt_id)->max('sortorder');
$data['sortorder'] = $max + 1;
$data['type_activity'] = "task";
if (!isset($data['type_activity'])) {
$data['type_activity'] = "task";
}
$parent = $data['parent_id'] ?? null;
if ($parent) {

5
app/Http/Controllers/ProjectController.php

@ -340,7 +340,10 @@ class ProjectController extends Controller
public static function setSyncDate($activity_id, $activity, $report) {
$status = AssignMaterial::select('status_activity')->where('activity_id', $activity_id)->first();
if (isset($status->status_activity) && $status->status_activity != 'done') {
if (!isset($status->status_activity)) {
$status->status_activity = 'open';
}
if ($status->status_activity != 'done') {
$minDate = date_create($report->report_date);
$maxDate = date_create($report->report_date);
date_add($maxDate, date_interval_create_from_date_string($activity->duration . " days"));

Loading…
Cancel
Save