debug the reports
This commit is contained in:
@@ -336,4 +336,9 @@ class AccidentReceiptController extends Controller
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function accidentTypes(): JsonResponse
|
||||
{
|
||||
return $this->successResponse(DailyAccidentSettings::query()->where('type', 'accident_type')->get());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ use App\Exports\V3\AccidentReceipt\CityReport;
|
||||
use App\Exports\V3\AccidentReceipt\ProvinceReport;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
use App\Models\City;
|
||||
use App\Models\Province;
|
||||
use App\Services\Cartables\AccidentReceiptTableService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -19,13 +21,19 @@ class AccidentReceiptReportController extends Controller
|
||||
public function provinceReport(Request $request, AccidentReceiptTableService $accidentReceiptTableService): JsonResponse
|
||||
{
|
||||
$data = $accidentReceiptTableService->provinceReport($request);
|
||||
return $this->successResponse($data['data']);
|
||||
return $this->successResponse([
|
||||
'data' => $data['data'],
|
||||
'provinces' => Province::all(['id', 'name_fa']),
|
||||
]);
|
||||
}
|
||||
|
||||
public function cityReport(Request $request, AccidentReceiptTableService $accidentReceiptTableService): JsonResponse
|
||||
{
|
||||
$data = $accidentReceiptTableService->cityReport($request);
|
||||
return $this->successResponse($data['data']);
|
||||
return $this->successResponse([
|
||||
'data' => $data['data'],
|
||||
'cities' => City::all(['id', 'name_fa']),
|
||||
]);
|
||||
}
|
||||
|
||||
public function provinceExcelReport(Request $request, AccidentReceiptTableService $accidentReceiptTableService): BinaryFileResponse
|
||||
|
||||
Reference in New Issue
Block a user