create receipt report logic
This commit is contained in:
@@ -15,7 +15,7 @@ use App\Models\RoadItemsProject;
|
||||
use App\Models\RoadObserved;
|
||||
use App\Models\RoadPatrol;
|
||||
use App\Services\NominatimService;
|
||||
use App\Services\Reports\RoadPatrolReportService;
|
||||
use App\Services\Cartables\RoadPatrolTableService;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -30,9 +30,9 @@ class RoadPatrolProjectController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
|
||||
public function supervisorIndex(Request $request, RoadPatrolReportService $roadPatrolReportService): JsonResponse
|
||||
public function supervisorIndex(Request $request, RoadPatrolTableService $roadPatrolTableService): JsonResponse
|
||||
{
|
||||
$data = $roadPatrolReportService->supervisorCartableReport($request);
|
||||
$data = $roadPatrolTableService->supervisorCartableReport($request);
|
||||
|
||||
foreach ($data['data'] as $road_patrol) {
|
||||
if (Gate::allows('gate-supervise-road-item', $road_patrol)) {
|
||||
@@ -80,16 +80,16 @@ class RoadPatrolProjectController extends Controller
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function supervisorCartableReport(Request $request, RoadPatrolReportService $roadPatrolReportService): BinaryFileResponse
|
||||
public function supervisorCartableReport(Request $request, RoadPatrolTableService $roadPatrolTableService): BinaryFileResponse
|
||||
{
|
||||
$name = 'گزارش از کارتابل ارزیابی گشت راهداری ' . verta()->now()->format('Y-m-d H:i') . '.xlsx';
|
||||
$data = $roadPatrolReportService->supervisorCartableReport($request, true);
|
||||
$data = $roadPatrolTableService->supervisorCartableReport($request, true);
|
||||
return Excel::download(new SupervisorCartableReport($data['data']), $name);
|
||||
}
|
||||
|
||||
public function operatorIndex(Request $request, RoadPatrolReportService $roadPatrolReportService): JsonResponse
|
||||
public function operatorIndex(Request $request, RoadPatrolTableService $roadPatrolTableService): JsonResponse
|
||||
{
|
||||
$data = $roadPatrolReportService->operatorCartableReport($request);
|
||||
$data = $roadPatrolTableService->operatorCartableReport($request);
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
@@ -322,10 +322,10 @@ class RoadPatrolProjectController extends Controller
|
||||
return $this->successResponse($roadPatrol);
|
||||
}
|
||||
|
||||
public function operatorCartableReport(Request $request, RoadPatrolReportService $roadPatrolReportService): BinaryFileResponse
|
||||
public function operatorCartableReport(Request $request, RoadPatrolTableService $roadPatrolTableService): BinaryFileResponse
|
||||
{
|
||||
$name = 'گزارش از کارتابل عملیات گشت راهداری ' . verta()->now()->format('Y-m-d H:i') . '.xlsx';
|
||||
$data = $roadPatrolReportService->operatorCartableReport($request, true);
|
||||
$data = $roadPatrolTableService->operatorCartableReport($request, true);
|
||||
return Excel::download(new OperatorCartableReport($data['data']), $name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user