perbaikan print out dan penambahan nomor laporan

This commit is contained in:
majid
2024-12-27 11:29:55 +07:00
parent 66d0226d55
commit b70b3b730f
6 changed files with 620 additions and 304 deletions

View File

@@ -7,6 +7,7 @@ use Barryvdh\DomPDF\Facade\Pdf; // https://github.com/barryvdh/laravel-dompdf
use Modules\Lpj\Models\Permohonan;
use Modules\Lpj\Models\Inspeksi;
use Modules\Lpj\Models\Penilai;
use Modules\Lpj\Models\Laporan;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Maatwebsite\Excel\Facades\Excel;
@@ -17,6 +18,7 @@ use Modules\Location\Models\City;
use Modules\Location\Models\District;
use Modules\Location\Models\Village;
use Illuminate\Support\Facades\Log;
use App\Helpers\Lpj;
class PenilaiController extends Controller
{
@@ -597,6 +599,17 @@ class PenilaiController extends Controller
$inspeksi = Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first();
$lpj = Penilai::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first();
$laporan = Laporan::firstOrCreate(
[
'permohonan_id' => $permohonanId,
'dokumen_jaminan_id' => $documentId,
],
[
'nomor_laporan' => generateLpjUniqueCode(6),
]
);
$nomorLaporan = $laporan->nomor_laporan;
$forminspeksi = null;
$lpjData = null;
$formFoto = null;
@@ -646,7 +659,8 @@ class PenilaiController extends Controller
'lpj',
'statusLpj',
'alamat',
'dataPembanding'
'dataPembanding',
'nomorLaporan'
));
} else {
$pdf = PDF::loadView('lpj::' . $viewLaporan, compact(
@@ -659,7 +673,8 @@ class PenilaiController extends Controller
'lpj',
'statusLpj',
'alamat',
'dataPembanding'
'dataPembanding',
'nomorLaporan'
));
$pdf->setPaper('A4', 'portrait');