Merge branch 'staging' into feature/senior-officer
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
use Modules\Lpj\Models\JenisJaminan;
|
||||
use Modules\Lpj\Models\JenisLegalitasJaminan;
|
||||
use Modules\Lpj\Models\PemilikJaminan;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Collection;
|
||||
use ZipArchive;
|
||||
|
||||
class DokumenJaminanController extends Controller
|
||||
@@ -223,55 +225,64 @@
|
||||
$document = DokumenJaminan::find($jaminan);
|
||||
$document->update($validate);
|
||||
|
||||
// Get existing detail documents
|
||||
$existingDetails = DetailDokumenJaminan::where('dokumen_jaminan_id', $document->id)->get()->keyBy('id');
|
||||
|
||||
if ($request->detail_dokumen_jaminan_id) {
|
||||
foreach ($request->detail_dokumen_jaminan_id as $key => $value) {
|
||||
if (isset($request->dokumen_jaminan[$key])) {
|
||||
$file = $request->dokumen_jaminan[$key];
|
||||
if ($file) {
|
||||
$file_name = $file->getClientOriginalName();
|
||||
}
|
||||
if($request->jenis_legalitas_jaminan_id){
|
||||
foreach($request->jenis_legalitas_jaminan_id as $key => $value){
|
||||
$detailData = [
|
||||
'dokumen_jaminan_id' => $document->id,
|
||||
'jenis_legalitas_jaminan_id' => $value,
|
||||
'name' => $request->name[$key],
|
||||
'keterangan' => $request->keterangan[$key],
|
||||
];
|
||||
|
||||
if (isset($file_name)) {
|
||||
$file->storeAs(
|
||||
'public/jaminan/' . $debitur->id . '/' . $document->id . '/',
|
||||
$file_name,
|
||||
);
|
||||
|
||||
$detail = [
|
||||
'dokumen_jaminan_id' => $document->id,
|
||||
'jenis_legalitas_jaminan_id' => $request->jenis_legalitas_jaminan_id[$key],
|
||||
'dokumen_jaminan' => 'jaminan/' . $debitur->id . '/' . $document->id . '/' . $file_name,
|
||||
'name' => $request->name[$key],
|
||||
'keterangan' => $request->keterangan[$key],
|
||||
];
|
||||
if (isset($request->detail_dokumen_jaminan_id[$key])) {
|
||||
$detailDocument = DetailDokumenJaminan::find(
|
||||
$request->detail_dokumen_jaminan_id[$key],
|
||||
$dokumenJaminan = [];
|
||||
if (isset($request->dokumen_jaminan[$key]) && is_array($request->dokumen_jaminan[$key])) {
|
||||
foreach($request->dokumen_jaminan[$key] as $file) {
|
||||
if ($file) {
|
||||
$file_name = $file->getClientOriginalName();
|
||||
$file->storeAs(
|
||||
'public/jaminan/' . $debitur->id . '/' . $document->id . '/',
|
||||
$file_name
|
||||
);
|
||||
|
||||
$detailDocument->update($detail);
|
||||
$detailDocument->save();
|
||||
$dokumenJaminan[] = 'jaminan/' . $debitur->id . '/' . $document->id . '/' . $file_name;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$detail = [
|
||||
'dokumen_jaminan_id' => $document->id,
|
||||
'jenis_legalitas_jaminan_id' => $request->jenis_legalitas_jaminan_id[$key],
|
||||
'name' => $request->name[$key],
|
||||
'keterangan' => $request->keterangan[$key],
|
||||
];
|
||||
}
|
||||
|
||||
if (isset($request->detail_dokumen_jaminan_id[$key])) {
|
||||
$detailDocument = DetailDokumenJaminan::find(
|
||||
$request->detail_dokumen_jaminan_id[$key],
|
||||
);
|
||||
$detailDocument->update($detail);
|
||||
if (!empty($dokumenJaminan)) {
|
||||
$detailData['dokumen_jaminan'] = json_encode($dokumenJaminan);
|
||||
}
|
||||
|
||||
if (isset($request->detail_dokumen_jaminan_id[$key])) {
|
||||
$detailId = $request->detail_dokumen_jaminan_id[$key];
|
||||
$detailDocument = $existingDetails->get($detailId);
|
||||
if ($detailDocument) {
|
||||
// Merge new files with existing ones
|
||||
if (!empty($dokumenJaminan)) {
|
||||
$existingFiles = json_decode($detailDocument->dokumen_jaminan, true) ?: [];
|
||||
$mergedFiles = array_merge($existingFiles, $dokumenJaminan);
|
||||
$detailData['dokumen_jaminan'] = json_encode($mergedFiles);
|
||||
}
|
||||
$detailDocument->update($detailData);
|
||||
$existingDetails->forget($detailId);
|
||||
}
|
||||
} else {
|
||||
DetailDokumenJaminan::create($detailData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete any remaining existing details that weren't updated
|
||||
foreach ($existingDetails as $detail) {
|
||||
$files = json_decode($detail->dokumen_jaminan, true) ?: [];
|
||||
foreach ($files as $file) {
|
||||
Storage::delete('public/' . $file);
|
||||
}
|
||||
$detail->delete();
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
return redirect()->route('debitur.jaminan.index', $id)->with(
|
||||
'success',
|
||||
@@ -290,13 +301,29 @@
|
||||
) {
|
||||
$document = DokumenJaminan::find($jaminan);
|
||||
$details = DetailDokumenJaminan::where('dokumen_jaminan_id', $document->id)->get();
|
||||
|
||||
$debitur = Debiture::find($document->debiture_id);
|
||||
$provinces = Province::all();
|
||||
$cities = City::where('province_code', $document->province_code)->get();
|
||||
$districts = District::where('city_code', $document->city_code)->get();
|
||||
$villages = Village::where('district_code', $document->district_code)->get();
|
||||
|
||||
|
||||
$jenisJaminan = JenisJaminan::all();
|
||||
$jenisLegalitasJaminan = JenisLegalitasJaminan::all();
|
||||
|
||||
$_jenisJaminan = JenisJaminan::find($document->jenis_jaminan_id);
|
||||
$legalitasJaminan = json_decode($_jenisJaminan->jenis_legalitas_jaminan_id, true);
|
||||
|
||||
$currentLegalitasJaminan = JenisLegalitasJaminan::whereIn('id',$document->detail->pluck('jenis_legalitas_jaminan_id')->toArray())->get();
|
||||
|
||||
|
||||
|
||||
// Remove values from $legalitasJaminan that are in $currentLegalitasJaminan
|
||||
$legalitasJaminan = array_diff($legalitasJaminan, $currentLegalitasJaminan->pluck('code')->toArray());
|
||||
|
||||
$legalitas = JenisLegalitasJaminan::whereIn('code', $legalitasJaminan)->get();
|
||||
|
||||
$pemilikJaminan = PemilikJaminan::where('debiture_id', $document->debiture_id)->get();
|
||||
$hubunganPemilik = HubunganPemilikJaminan::all();
|
||||
|
||||
@@ -314,6 +341,7 @@
|
||||
'villages',
|
||||
'pemilikJaminan',
|
||||
'hubunganPemilik',
|
||||
'legalitas'
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -379,10 +407,11 @@
|
||||
{
|
||||
$dokumen = request()->get('dokumen');
|
||||
$document = DetailDokumenJaminan::find($dokumen);
|
||||
return response()->download(storage_path('app/public/' . $document->dokumen_jaminan));
|
||||
$file = is_array(json_decode($document->dokumen_jaminan)) ? json_decode($document->dokumen_jaminan) : [$document->dokumen_jaminan];
|
||||
return response()->download(storage_path('app/public/' . $file[request()->get('index')]));
|
||||
}
|
||||
|
||||
public function legalitasJaminan($id, $jaminan)
|
||||
public function legalitasJaminan($id)
|
||||
{
|
||||
$jenisJaminan = JenisJaminan::find($id);
|
||||
$legalitasJaminan = $jenisJaminan->jenis_legalitas_jaminan_id;
|
||||
@@ -390,4 +419,60 @@
|
||||
$legalitas = JenisLegalitasJaminan::whereIn('code', json_decode($legalitasJaminan, true))->get();
|
||||
echo json_encode($legalitas);
|
||||
}
|
||||
|
||||
|
||||
public function getLegalitasJaminan($id = 10, $jenisJaminanId = 1) : JsonResponse
|
||||
{
|
||||
|
||||
$jenisJaminan = JenisJaminan::findOrFail($jenisJaminanId);
|
||||
$legalitasJaminan = $jenisJaminan->jenis_legalitas_jaminan_id;
|
||||
$newLegalitasJaminan = JenisLegalitasJaminan::whereIn('code', json_decode($legalitasJaminan, true))->get();
|
||||
|
||||
$existingLegalitas = [];
|
||||
$newLegalitas = [];
|
||||
|
||||
// Create a set of new jenis_legalitas_jaminan_ids for quick lookup
|
||||
$newLegalitasIds = $newLegalitasJaminan->pluck('id')->toArray();
|
||||
|
||||
if($id>0) {
|
||||
$document = DokumenJaminan::findOrFail($id);
|
||||
if ($document && $document->detail) {
|
||||
foreach ($document->detail as $detail) {
|
||||
// Only include existing legalitas if its id is in the new set
|
||||
if (in_array($detail->jenis_legalitas_jaminan_id, $newLegalitasIds)) {
|
||||
$existingLegalitas[] = [
|
||||
'id' => $detail->id,
|
||||
'jenis_legalitas_jaminan_id' => $detail->jenis_legalitas_jaminan_id,
|
||||
'name' => $detail->jenisLegalitasJaminan->name,
|
||||
'dokumen_jaminan' => json_decode($detail->dokumen_jaminan) ?? $detail->dokumen_jaminan,
|
||||
'custom_field' => $detail->jenisLegalitasJaminan->custom_field,
|
||||
'custom_field_type' => $detail->jenisLegalitasJaminan->custom_field_type,
|
||||
'details' => $detail->details,
|
||||
'keterangan' => $detail->keterangan,
|
||||
'is_existing' => true
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($newLegalitasJaminan as $legalitas) {
|
||||
if (!Collection::make($existingLegalitas)->contains('jenis_legalitas_jaminan_id', $legalitas->id)) {
|
||||
$newLegalitas[] = [
|
||||
'id' => null,
|
||||
'jenis_legalitas_jaminan_id' => $legalitas->id,
|
||||
'name' => $legalitas->name,
|
||||
'dokumen_jaminan' => null,
|
||||
'custom_field' => $legalitas->custom_field,
|
||||
'custom_field_type' => $legalitas->custom_field_type,
|
||||
'details' => null,
|
||||
'keterangan' => null,
|
||||
'is_existing' => false
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$combinedLegalitas = array_merge($existingLegalitas, $newLegalitas);
|
||||
return response()->json($combinedLegalitas);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,25 +33,20 @@
|
||||
|
||||
public function store(PermohonanRequest $request)
|
||||
{
|
||||
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
try {
|
||||
// Save to database
|
||||
Permohonan::create($validate);
|
||||
return redirect()
|
||||
->route('permohonan.index')
|
||||
->with('success', 'Permohonan created successfully');
|
||||
->route('permohonan.index')->with('success', 'Permohonan created successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('permohonan.create')
|
||||
->with('error', 'Failed to create permohonan' . $e->getMessage());
|
||||
->route('permohonan.create')->with('error', 'Failed to create permohonan' . $e->getMessage());
|
||||
}
|
||||
} else {
|
||||
return redirect()
|
||||
->route('permohonan.create')
|
||||
->with('success', 'error naon iye')
|
||||
->withInput();
|
||||
->route('permohonan.create')->with('success', 'error naon iye')->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,14 +113,15 @@
|
||||
try {
|
||||
// Update in database
|
||||
$permohonan = Permohonan::find($id);
|
||||
if ($permohonan->status == 'revisi') {
|
||||
$validate['status'] = 'order';
|
||||
}
|
||||
$permohonan->update($validate);
|
||||
return redirect()
|
||||
->route('permohonan.index')
|
||||
->with('success', 'Permohonan updated successfully');
|
||||
->route('permohonan.index')->with('success', 'Permohonan updated successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('permohonan.edit', $id)
|
||||
->with('error', 'Failed to update permohonan');
|
||||
->route('permohonan.edit', $id)->with('error', 'Failed to update permohonan');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -313,11 +309,12 @@
|
||||
return view('lpj::permohonan.show', compact('permohonan'));
|
||||
}
|
||||
|
||||
public function print($id){
|
||||
public function print($id)
|
||||
{
|
||||
$permohonan = Permohonan::find($id);
|
||||
return view('lpj::permohonan.print', compact('permohonan'));
|
||||
|
||||
// $pdf = Pdf::loadView('lpj::permohonan.print', compact('permohonan'));
|
||||
// return $pdf->stream();
|
||||
// $pdf = Pdf::loadView('lpj::permohonan.print', compact('permohonan'));
|
||||
// return $pdf->stream();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
// use Modules\Lpj\Exports\TujuanPenilaianExport;
|
||||
// use Modules\Lpj\Http\Requests\TujuanPenilaianRequest;
|
||||
// use Modules\Lpj\Models\TujuanPenilaian;
|
||||
use Carbon\Carbon;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Barryvdh\DomPDF\Facade\Pdf;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
// use Modules\Lpj\Exports\TujuanPenilaianExport;
|
||||
// use Modules\Lpj\Http\Requests\TujuanPenilaianRequest;
|
||||
// use Modules\Lpj\Models\TujuanPenilaian;
|
||||
use Modules\Lpj\Models\PenawaranTender;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class SpkController extends Controller
|
||||
{
|
||||
@@ -19,10 +27,212 @@
|
||||
return view('lpj::spk.index');
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query =Permohonan::query()
|
||||
->leftJoin('penawaran', 'penawaran.nomor_registrasi','=','permohonan.nomor_registrasi')
|
||||
->leftJoin('tujuan_penilaian_kjpp', 'tujuan_penilaian_kjpp.id','=','penawaran.tujuan_penilaian_kjpp_id')
|
||||
->where('permohonan.status','=','spk')
|
||||
->select('penawaran.*', 'tujuan_penilaian_kjpp.name as tujuan_penilaian_kjpp_name', 'permohonan.dokumen as dokumenSPK');
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
//$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||
|
||||
$data = $query->get();
|
||||
|
||||
$i=0;
|
||||
foreach($data as $obj)
|
||||
{
|
||||
if($obj->tanggal_penilaian_sebelumnya)
|
||||
{
|
||||
$data[$i]->tanggal_penilaian_sebelumnya = Carbon::parse($obj->tanggal_penilaian_sebelumnya)->format('d F Y H:i:s');
|
||||
}
|
||||
|
||||
if($obj->biaya_kjpp_sebelumnya)
|
||||
{
|
||||
$data[$i]->biaya_kjpp_sebelumnya = formatRupiah($obj->biaya_kjpp_sebelumnya);
|
||||
|
||||
}
|
||||
|
||||
// date_range
|
||||
if($obj->start_date && $obj->end_date)
|
||||
{
|
||||
$data[$i]->date_range = Carbon::parse($obj->start_date)->format('d M Y').' - '.Carbon::parse($obj->end_date)->format('d M Y');
|
||||
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = 0 + 1;
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewSpk()
|
||||
{
|
||||
// return Excel::download(new TujuanPenilaianExport, 'tujuan_penilaian.xlsx');
|
||||
|
||||
return view('lpj::spk.view');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$penawaran = PenawaranTender::find($id);
|
||||
// return view('lpj::spk.show', compact('id','permohonan'));
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$penawaran = PenawaranTender::leftJoin('detail_penawaran', 'detail_penawaran.penawaran_id','=','penawaran.id')
|
||||
->leftJoin('jenis_laporan', 'jenis_laporan.id','=','penawaran.jenis_laporan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id','=','detail_penawaran.kjpp_rekanan_id')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->where('penawaran.id','=', $id)
|
||||
->select('penawaran.*', 'detail_penawaran.attachment as attachmentku',
|
||||
'detail_penawaran.biaya_penawaran as detail_penawaran_biaya_penawaran',
|
||||
'kjpp.name as kjpp_name',
|
||||
'kjpp.address as kjpp_address',
|
||||
'jenis_laporan.name as jenis_laporan_name'
|
||||
)->first();
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi','=',$penawaran->nomor_registrasi)
|
||||
->leftJoin('dokumen_jaminan', 'dokumen_jaminan.permohonan_id','=','permohonan.id')
|
||||
->leftJoin('jenis_jaminan', 'jenis_jaminan.id','=','dokumen_jaminan.jenis_jaminan_id')
|
||||
->select('permohonan.*', 'jenis_jaminan.name as jenis_jaminan_name',
|
||||
'dokumen_jaminan.address as dokumen_jaminan_address');
|
||||
|
||||
$data = $permohonan->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->first();
|
||||
|
||||
return view('lpj::spk.edit', compact('data', 'penawaran'));
|
||||
}
|
||||
|
||||
public function update(Request $request, $id): JsonResponse
|
||||
{
|
||||
// init
|
||||
$data1 = array();
|
||||
$dataPermohonan = array();
|
||||
// data
|
||||
|
||||
$penawaran = PenawaranTender::leftJoin('detail_penawaran', 'detail_penawaran.penawaran_id','=','penawaran.id')
|
||||
->leftJoin('jenis_laporan', 'jenis_laporan.id','=','penawaran.jenis_laporan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id','=','detail_penawaran.kjpp_rekanan_id')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->where('penawaran.id','=', $id)
|
||||
->select('penawaran.*', 'detail_penawaran.attachment as attachmentku',
|
||||
'kjpp.name as kjpp_name',
|
||||
'kjpp.address as kjpp_address',
|
||||
'jenis_laporan.name as jenis_laporan_name'
|
||||
)->first();
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi','=',$penawaran->nomor_registrasi)
|
||||
->leftJoin('dokumen_jaminan', 'dokumen_jaminan.permohonan_id','=','permohonan.id')
|
||||
->leftJoin('jenis_jaminan', 'jenis_jaminan.id','=','dokumen_jaminan.jenis_jaminan_id')
|
||||
->select('permohonan.*', 'jenis_jaminan.name as jenis_jaminan_name');
|
||||
|
||||
$data = $permohonan->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->first();
|
||||
|
||||
$folderPath = 'uploads/spk/';
|
||||
$extension = '.pdf';
|
||||
$newFileName = "SPK_".$penawaran->nomor_registrasi."_".Auth::user()->id."_".time(). $extension;
|
||||
$newFileNameWithPath = $folderPath . $newFileName;
|
||||
|
||||
// update table permohonan
|
||||
$dataPermohonan=['dokumen' => $newFileNameWithPath];
|
||||
$data->update($dataPermohonan);
|
||||
// update table permohonan
|
||||
|
||||
// pdf path
|
||||
$spkpenawaran_path = Storage::url($newFileNameWithPath);
|
||||
|
||||
$pdf =Pdf::loadView('lpj::spk.documentSPK', compact('data', 'penawaran'));
|
||||
|
||||
$content = $pdf->download()->getOriginalContent();
|
||||
Storage::put('public/'.$newFileNameWithPath,$content);
|
||||
|
||||
$data1['status'] = 'success';
|
||||
$data1['spkpenawaran_path'] = $spkpenawaran_path;
|
||||
$data1['message']['message_success'] = array('Generate SPK PDF successfully');
|
||||
|
||||
return response()->json($data1);
|
||||
}
|
||||
|
||||
public function dokumennya()
|
||||
{
|
||||
// return view('lpj::spk.dokumennya');
|
||||
$id="3";
|
||||
$penawaran = PenawaranTender::leftJoin('detail_penawaran', 'detail_penawaran.penawaran_id','=','penawaran.id')
|
||||
->leftJoin('jenis_laporan', 'jenis_laporan.id','=','penawaran.jenis_laporan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id','=','detail_penawaran.kjpp_rekanan_id')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->where('penawaran.id','=', $id)
|
||||
->select('penawaran.*', 'detail_penawaran.attachment as attachmentku',
|
||||
'detail_penawaran.biaya_penawaran as detail_penawaran_biaya_penawaran',
|
||||
'kjpp.name as kjpp_name',
|
||||
'kjpp.address as kjpp_address',
|
||||
'jenis_laporan.name as jenis_laporan_name'
|
||||
)->first();
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi','=',$penawaran->nomor_registrasi)
|
||||
->leftJoin('dokumen_jaminan', 'dokumen_jaminan.permohonan_id','=','permohonan.id')
|
||||
->leftJoin('jenis_jaminan', 'jenis_jaminan.id','=','dokumen_jaminan.jenis_jaminan_id')
|
||||
->select('permohonan.*', 'jenis_jaminan.name as jenis_jaminan_name',
|
||||
'dokumen_jaminan.address as dokumen_jaminan_address');
|
||||
|
||||
$data = $permohonan->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->first();
|
||||
|
||||
return view('lpj::spk.dokumennya', compact('data', 'penawaran'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
'branch_id' => 'required|exists:branches,id',
|
||||
'tujuan_penilaian_id' => 'required|exists:tujuan_penilaian,id',
|
||||
'debiture_id' => 'required|exists:debitures,id',
|
||||
'status' => 'required|string',
|
||||
'status' => 'nullable|string',
|
||||
'jenis_fasilitas_kredit_id' => 'required|exists:jenis_fasilitas_kredit,id',
|
||||
'nilai_plafond_id' => 'required|exists:nilai_plafond,id',
|
||||
'status_bayar' => 'required|string',
|
||||
|
||||
Reference in New Issue
Block a user