Browse Source

Merge pull request 'update report datatable' (#314) from dev-wahyu into staging

Reviewed-on: ordo/adw-backend#314
pull/1/head
farhantock 10 months ago
parent
commit
f4fe8dbbda
  1. 2
      app/Http/Controllers/AssignMaterialController.php
  2. 4
      app/Http/Controllers/ReportActivityMaterialController.php

2
app/Http/Controllers/AssignMaterialController.php

@ -145,14 +145,12 @@ class AssignMaterialController extends Controller
DB::raw('SUM(ram.qty) as qty_sum'),
"m.description as material_name",
"assign_material_to_activity.activity_id",
"assign_material_to_activity.material_id",
)
->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")
->join("report_activity_material as ram", "ram.assign_material_id", "=", "assign_material_to_activity.id")
->groupBy("m.description")
->groupBy("ram.activity_id")
->groupBy("assign_material_to_activity.activity_id")
->groupBy("assign_material_to_activity.material_id")
->where("assign_material_to_activity.activity_id", $id_activity)->get();
return Datatables::of($data)
->addIndexColumn()

4
app/Http/Controllers/ReportActivityMaterialController.php

@ -147,7 +147,7 @@ class ReportActivityMaterialController extends Controller
->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")
->where('assign_material_to_activity.activity_id', $id_activity)
->where('assign_material_to_activity.id', $id_am)
->where('m.id', $materialId)
->where('m.description', $materialName)
->orderBy('assign_material_to_activity.id', 'asc')
->get();
if ($baselineDuration > 0) {
@ -176,7 +176,7 @@ class ReportActivityMaterialController extends Controller
->join("m_req_material as m", "m.id", "=", "amta.material_id")
->join("m_users as u", "u.id", "=", "report_activity_material.user_id")
->where('report_activity_material.activity_id', $id_activity)
->where('m.id', $materialId)
->where('m.description', $materialName)
->orderBy('report_activity_material.report_date', 'asc')
->get();
if ($baselineDuration > 0) {

Loading…
Cancel
Save