Compare commits
53 Commits
40c3d84efc
...
1caa7ebfdd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1caa7ebfdd | ||
|
|
8666a0c58b | ||
|
|
99bc711954 | ||
|
|
627d7f9b40 | ||
|
|
8a5bf21982 | ||
|
|
2433aacfbc | ||
|
|
ba29f5ee8e | ||
|
|
eb784a982f | ||
|
|
2173a36564 | ||
|
|
ee079a8aa8 | ||
|
|
b4aba1a02a | ||
|
|
32baffe636 | ||
|
|
19fb39b02f | ||
|
|
bc7fef05f6 | ||
|
|
4d8b72e33a | ||
|
|
cf0059fe66 | ||
|
|
d7e5df569a | ||
|
|
cd46a3b0dc | ||
|
|
3486b97aee | ||
|
|
dc6e326122 | ||
|
|
4459b70271 | ||
|
|
57dece449c | ||
|
|
5e7368ebcf | ||
|
|
cbdd4bd99e | ||
|
|
d0cc62f8c0 | ||
|
|
0c2c0c9e20 | ||
|
|
274addb069 | ||
|
|
5c3a93c49b | ||
|
|
36ac1370d7 | ||
|
|
3eb402ae08 | ||
|
|
07589370df | ||
|
|
8220466f03 | ||
|
|
5c57b9cb58 | ||
|
|
a72515bc30 | ||
|
|
e79b8c6449 | ||
|
|
e63f9e7359 | ||
|
|
d0f3ffa93a | ||
|
|
37874aff3a | ||
|
|
44ff9d4ac6 | ||
|
|
5e8f979d05 | ||
|
|
ae15e1983f | ||
|
|
28513100f4 | ||
|
|
e72e82ea55 | ||
|
|
47bf7ab59b | ||
|
|
4ee42f38b9 | ||
|
|
60dd90a9ed | ||
|
|
3f979aef05 | ||
|
|
4bb808b341 | ||
|
|
887478c751 | ||
|
|
2708dead53 | ||
|
|
644f1da871 | ||
|
|
e32c73cdb2 | ||
|
|
e85ed55598 |
232
app/Exports/LaporanUserLimitExport.php
Normal file
232
app/Exports/LaporanUserLimitExport.php
Normal file
@@ -0,0 +1,232 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Maatwebsite\Excel\Concerns\WithTitle;
|
||||
use Maatwebsite\Excel\Concerns\WithCustomStartCell;
|
||||
use Maatwebsite\Excel\Concerns\WithEvents;
|
||||
use Maatwebsite\Excel\Events\AfterSheet;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\Branch;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class LaporanUserLimitExport implements FromCollection, WithHeadings, WithMapping, WithTitle, WithCustomStartCell, WithEvents
|
||||
{
|
||||
protected $request;
|
||||
|
||||
public function __construct($request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function collection()
|
||||
{
|
||||
$query = Permohonan::query();
|
||||
$query = $query->where('status', 'done');
|
||||
|
||||
// Apply date range filter if provided
|
||||
if ($this->request->has('start_date') || $this->request->has('end_date')) {
|
||||
$startDate = $this->request->start_date ?? '1900-01-01';
|
||||
$endDate = $this->request->end_date ?? now()->toDateString();
|
||||
|
||||
$query->where(function ($q) use ($startDate, $endDate) {
|
||||
|
||||
$q->whereHas('penilaian', function ($q2) use ($startDate, $endDate) {
|
||||
$q2->whereBetween('tanggal_kunjungan', [$startDate, $endDate]);
|
||||
});
|
||||
|
||||
// OR check if has penawaran with date in range
|
||||
$q->orWhereHas('penawaran', function ($q3) use ($startDate, $endDate) {
|
||||
$q3->whereBetween('tanggal_penilaian_sebelumnya', [$startDate, $endDate]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Apply branch filter if provided
|
||||
if ($this->request->has('branch_id') && !empty($this->request->branch_id)) {
|
||||
$query->where('branch_id', $this->request->branch_id);
|
||||
}
|
||||
|
||||
if ($this->request->has('penilai_id') && !empty($this->request->penilai_id)) {
|
||||
$request = $this->request; // Store in a local variable
|
||||
$query->whereHas('penilaian._user_penilai.userPenilaiTeam', function ($q) use ($request) {
|
||||
$q->where('user_id', $request->penilai_id);
|
||||
});
|
||||
}
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($this->request->has('search') && !empty($this->request->search)) {
|
||||
$search = $this->request->search;
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('debiture', DB::raw('LOWER(name)'), 'LIKE', '%' . strtolower($search) . '%');
|
||||
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('jenisFasilitasKredit', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
|
||||
// Default ordering
|
||||
$query->orderBy('nomor_registrasi', 'asc');
|
||||
|
||||
return $query->get();
|
||||
}
|
||||
|
||||
protected $rowNumber = 0;
|
||||
|
||||
public function map($permohonan): array
|
||||
{
|
||||
$this->rowNumber++;
|
||||
$npw = 0;
|
||||
|
||||
if (isset($permohonan->penilai->lpj)) {
|
||||
$lpj = json_decode($permohonan->penilai->lpj, true);
|
||||
$npw = str_replace('.', '', $lpj['total_nilai_pasar_wajar'] ?? 0);
|
||||
}
|
||||
|
||||
return [
|
||||
$this->rowNumber,
|
||||
$permohonan->nomor_registrasi,
|
||||
$permohonan->debiture->branch->name ?? '',
|
||||
$permohonan->debiture->name ?? '',
|
||||
$permohonan->user->name ?? $permohonan->mig_nama_ao ?? '',
|
||||
$permohonan->tanggal_permohonan ?? '',
|
||||
$permohonan->penilaian->_user_penilai->userPenilaiTeam->name ?? '',
|
||||
$permohonan->penilaian && $permohonan->penilaian->tanggal_kunjungan
|
||||
? formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan)
|
||||
: '',
|
||||
formatRupiah($npw, 2),
|
||||
];
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'No',
|
||||
'Nomor Registrasi',
|
||||
'Cabang',
|
||||
'Nama Debitur',
|
||||
'Pemohon',
|
||||
'Tanggal Permohonan',
|
||||
'Nama Penilai',
|
||||
'Tanggal Laporan',
|
||||
'Nilai Pasar Wajar',
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function title(): string
|
||||
{
|
||||
return 'Laporan User Limit';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function startCell(): string
|
||||
{
|
||||
return 'A7';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function registerEvents(): array
|
||||
{
|
||||
return [
|
||||
AfterSheet::class => function (AfterSheet $event) {
|
||||
// Get the sheet
|
||||
$sheet = $event->sheet->getDelegate();
|
||||
|
||||
// Set the title
|
||||
$sheet->setCellValue('A1', 'LAPORAN PENILAIAN JAMINAN');
|
||||
$sheet->getStyle('A1')->getFont()->setBold(true)->setSize(16);
|
||||
|
||||
// Merge cells for title
|
||||
$sheet->mergeCells('A1:AH1');
|
||||
$sheet->getStyle('A1')->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
|
||||
|
||||
// Set the branch information if filtered
|
||||
$branchInfo = '';
|
||||
if ($this->request->has('branch_id') && !empty($this->request->branch_id)) {
|
||||
$branch = Branch::find($this->request->branch_id);
|
||||
if ($branch) {
|
||||
$branchInfo = 'Cabang: ' . $branch->name;
|
||||
$sheet->setCellValue('A2', $branchInfo);
|
||||
$sheet->mergeCells('A2:AH2');
|
||||
$sheet->getStyle('A2')->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
|
||||
$sheet->getStyle('A2')->getFont()->setBold(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the period
|
||||
$startDate = $this->request->start_date ?? '';
|
||||
$endDate = $this->request->end_date ?? '';
|
||||
|
||||
$rowIndex = $branchInfo ? 3 : 2;
|
||||
|
||||
if ($startDate && $endDate) {
|
||||
$startDateFormatted = Carbon::parse($startDate)->format('d F Y');
|
||||
$endDateFormatted = Carbon::parse($endDate)->format('d F Y');
|
||||
$sheet->setCellValue('A' . $rowIndex, 'Periode: ' . $startDateFormatted . ' - ' . $endDateFormatted);
|
||||
} else {
|
||||
$sheet->setCellValue('A' . $rowIndex, 'Periode: Semua Data');
|
||||
}
|
||||
$sheet->mergeCells('A' . $rowIndex . ':AH' . $rowIndex);
|
||||
$sheet->getStyle('A' . $rowIndex)->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
|
||||
|
||||
// Set the date of export
|
||||
$rowIndex++;
|
||||
$sheet->setCellValue('A' . $rowIndex, 'Tanggal Export: ' . Carbon::now()->format('d F Y H:i:s'));
|
||||
|
||||
// Set the user who exported
|
||||
$rowIndex++;
|
||||
$userName = Auth::user() ? Auth::user()->name : 'System';
|
||||
$sheet->setCellValue('A' . $rowIndex, 'Diexport oleh: ' . $userName);
|
||||
|
||||
// Add a blank line
|
||||
$rowIndex++;
|
||||
$sheet->setCellValue('A' . $rowIndex, '');
|
||||
|
||||
// Style the header row
|
||||
$headerRange = 'A7:' . $sheet->getHighestColumn() . '7';
|
||||
$sheet->getStyle($headerRange)->getFont()->setBold(true);
|
||||
$sheet->getStyle($headerRange)->getFill()
|
||||
->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)
|
||||
->getStartColor()->setARGB('FFCCCCCC');
|
||||
|
||||
// Auto-size columns - fixed to handle columns beyond Z
|
||||
$highestColumn = $sheet->getHighestColumn();
|
||||
$highestColumnIndex = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString($highestColumn);
|
||||
|
||||
for ($i = 1; $i <= $highestColumnIndex; $i++) {
|
||||
$currentColumn = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex($i);
|
||||
$sheet->getColumnDimension($currentColumn)->setAutoSize(true);
|
||||
}
|
||||
|
||||
// Add borders to all cells with data
|
||||
$dataRange = 'A7:' . $sheet->getHighestColumn() . $sheet->getHighestRow();
|
||||
$sheet->getStyle($dataRange)->getBorders()->getAllBorders()->setBorderStyle(\PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN);
|
||||
|
||||
// Center align the header row
|
||||
$sheet->getStyle($headerRange)->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
|
||||
|
||||
// Set text wrap for header cells
|
||||
$sheet->getStyle($headerRange)->getAlignment()->setWrapText(true);
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
209
app/Http/Controllers/BucokController.php
Normal file
209
app/Http/Controllers/BucokController.php
Normal file
@@ -0,0 +1,209 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Imports\BucokImport;
|
||||
use Modules\Lpj\Models\Bucok;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Controller untuk mengelola data Bucok
|
||||
*
|
||||
* @package Modules\Lpj\Http\Controllers
|
||||
*/
|
||||
class BucokController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Menampilkan halaman index bucok
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::bucok.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Menampilkan detail bucok
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$bucok = Bucok::findOrFail($id);
|
||||
return view('lpj::bucok.show', compact('bucok'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Data untuk datatables dengan server-side processing
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('bucok.view')) {
|
||||
// abort(403, 'Sorry! You are not allowed to view bucok.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = Bucok::query();
|
||||
|
||||
// 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_tiket', 'LIKE', "%$search%")
|
||||
->orWhere('deskripsi', 'LIKE', "%$search%")
|
||||
->orWhere('nomor_coa', 'LIKE', "%$search%")
|
||||
->orWhere('nama_coa', 'LIKE', "%$search%")
|
||||
->orWhere('cost_center', 'LIKE', "%$search%")
|
||||
->orWhere('nama_sub_direktorat', 'LIKE', "%$search%")
|
||||
->orWhere('nama_direktorat_cabang', 'LIKE', "%$search%")
|
||||
->orWhere('penyelesaian', 'LIKE', "%$search%")
|
||||
->orWhere('keterangan_gantung', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
// Apply date range filter
|
||||
if ($request->has('start_date') && !empty($request->get('start_date'))) {
|
||||
$query->whereDate('tanggal', '>=', $request->get('start_date'));
|
||||
}
|
||||
if ($request->has('end_date') && !empty($request->get('end_date'))) {
|
||||
$query->whereDate('tanggal', '<=', $request->get('end_date'));
|
||||
}
|
||||
|
||||
// Apply year filter
|
||||
if ($request->has('year') && !empty($request->get('year'))) {
|
||||
$query->byYear($request->get('year'));
|
||||
}
|
||||
|
||||
// Apply month filter
|
||||
if ($request->has('month') && !empty($request->get('month'))) {
|
||||
$query->byMonth($request->get('month'));
|
||||
}
|
||||
|
||||
// Apply cost center filter
|
||||
if ($request->has('cost_center') && !empty($request->get('cost_center'))) {
|
||||
$query->byCostCenter($request->get('cost_center'));
|
||||
}
|
||||
|
||||
// Apply completion status filter
|
||||
if ($request->has('completion_status') && $request->get('completion_status') !== '') {
|
||||
$isCompleted = $request->get('completion_status') == '1';
|
||||
$query->byCompletionStatus($isCompleted);
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField', 'created_at');
|
||||
$query->orderBy($column, $order);
|
||||
} else {
|
||||
$query->orderBy('created_at', 'desc');
|
||||
}
|
||||
|
||||
// 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 with relationships
|
||||
$data = $query->get();
|
||||
|
||||
// Transform data untuk datatables
|
||||
$transformedData = $data->map(function ($item) {
|
||||
return [
|
||||
'id' => $item->id,
|
||||
'no' => $item->no,
|
||||
'tanggal' => $item->tanggal ? dateFormat($item->tanggal,true) : '-',
|
||||
'bulan' => $item->bulan,
|
||||
'tahun' => $item->tahun,
|
||||
'nomor_tiket' => $item->nomor_tiket,
|
||||
'nomor_coa' => $item->nomor_coa,
|
||||
'nama_coa' => $item->nama_coa,
|
||||
'deskripsi' => $item->deskripsi,
|
||||
'nominal' => $item->nominal_formatted,
|
||||
'penyelesaian' => $item->penyelesaian,
|
||||
'umur_aging' => $item->umur_aging,
|
||||
'cost_center' => $item->cost_center,
|
||||
'nama_sub_direktorat' => $item->nama_sub_direktorat,
|
||||
'nama_direktorat_cabang' => $item->nama_direktorat_cabang,
|
||||
'tanggal_penyelesaian' => $item->tanggal_penyelesaian ? dateFormat($item->tanggal_penyelesaian,true) : '-',
|
||||
'nominal_penyelesaian' => $item->nominal_penyelesaian_formatted,
|
||||
'status_penyelesaian' => $item->status_penyelesaian,
|
||||
'status_badge' => $item->status_badge,
|
||||
'created_by' => $item->creator?->name ?? '-',
|
||||
'created_at' => dateFormat($item->created_at,true)
|
||||
];
|
||||
});
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / ($request->get('size', 10)));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = $request->get('page', 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' => $transformedData,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Import data bucok dari Excel
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function import(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'file' => 'required|mimes:xlsx,xls,csv|max:10240' // Max 10MB
|
||||
]);
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
Log::info('Importing Bucok data', ['user_id' => Auth::id(), 'filename' => $request->file('file')->getClientOriginalName()]);
|
||||
|
||||
$import = new BucokImport();
|
||||
Excel::import($import, $request->file('file'));
|
||||
$statistics = $import->getImportStatistics();
|
||||
|
||||
DB::commit();
|
||||
Log::info('Bucok data imported successfully', ['user_id' => Auth::id()]);
|
||||
|
||||
return redirect()->back()->with('success', 'Data Bucok berhasil diimport. Total: ' . $statistics['total_processed'] . ', Created: ' . $statistics['created'] . ', Updated: ' . $statistics['updated'] . ', Skipped: ' . $statistics['skipped'] . ', Errors: ' . $statistics['errors']);
|
||||
} catch (Exception $e) {
|
||||
DB::rollback();
|
||||
Log::error('Failed to import Bucok data', ['error' => $e->getMessage(), 'user_id' => Auth::id()]);
|
||||
|
||||
return redirect()->back()->with('error', 'Gagal import data: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
152
app/Http/Controllers/CategoryDaftarPustakaController.php
Normal file
152
app/Http/Controllers/CategoryDaftarPustakaController.php
Normal file
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Models\CategoryDaftarPustaka;
|
||||
use Modules\Lpj\Http\Requests\CategoryDaftarPustakaRequest;
|
||||
|
||||
class CategoryDaftarPustakaController extends Controller
|
||||
{
|
||||
public $user;
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::category-daftar-pustaka.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::category-daftar-pustaka.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(CategoryDaftarPustakaRequest $request)
|
||||
{
|
||||
$validated = $request->validated();
|
||||
if ($validated) {
|
||||
try {
|
||||
CategoryDaftarPustaka::create($validated);
|
||||
return redirect()->route('category-daftar-pustaka.index')->with('success', 'Data Berhasil Disimpan');
|
||||
} catch (\Throwable $th) {
|
||||
return redirect()->route('category-daftar-pustaka.index')->with('error', $th->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$category = CategoryDaftarPustaka::where('id', $id)->first();
|
||||
return view('lpj::category-daftar-pustaka.show', compact('category'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('lpj::category-daftar-pustaka.create', ['category' => CategoryDaftarPustaka::where('id', $id)->first()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(CategoryDaftarPustakaRequest $request, $id)
|
||||
{
|
||||
$validated = $request->validated();
|
||||
if ($validated) {
|
||||
try {
|
||||
CategoryDaftarPustaka::where('id', $id)->update($validated);
|
||||
return redirect()->route('category-daftar-pustaka.index')->with('success', 'Data Berhasil Disimpan');
|
||||
} catch (\Throwable $th) {
|
||||
return redirect()->route('category-daftar-pustaka.index')->with('error', $th->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
CategoryDaftarPustaka::where('id', $id)->delete();
|
||||
return response()->json(['success' => true, 'message' => 'Data Berhasil Dihapus']);
|
||||
} catch (\Throwable $th) {
|
||||
return response()->json(['success' => false, 'message' => $th->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('jenis_aset.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = CategoryDaftarPustaka::query();
|
||||
|
||||
// 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('code', 'LIKE', "%$search%");
|
||||
$q->orWhere('name', '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->get();
|
||||
|
||||
// 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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
129
app/Http/Controllers/DaftarPustakaController.php
Normal file
129
app/Http/Controllers/DaftarPustakaController.php
Normal file
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Models\CategoryDaftarPustaka;
|
||||
use Modules\Lpj\Services\DaftarPustakaService;
|
||||
use Modules\Lpj\Http\Requests\DaftarPustakaRequest;
|
||||
|
||||
class DaftarPustakaController extends Controller
|
||||
{
|
||||
private $daftarPustaka;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->daftarPustaka = app(DaftarPustakaService::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$categories = CategoryDaftarPustaka::all();
|
||||
$daftar_pustaka = $this->daftarPustaka->getAllDaftarPustaka($request);
|
||||
|
||||
return view('lpj::daftar-pustaka.index', [
|
||||
'categories' => $categories,
|
||||
'daftar_pustaka' => $daftar_pustaka,
|
||||
'page' => $daftar_pustaka->currentPage(),
|
||||
'pageCount' => $daftar_pustaka->lastPage(),
|
||||
'limit' => $daftar_pustaka->perPage(),
|
||||
'total' => $daftar_pustaka->total(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$categories = CategoryDaftarPustaka::all();
|
||||
// dd($categories);
|
||||
return view('lpj::daftar-pustaka.create', compact('categories'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(DaftarPustakaRequest $request)
|
||||
{
|
||||
|
||||
$validate = $request->validated();
|
||||
// dd($validate);
|
||||
$file = $request->file('attachment');
|
||||
if ($validate) {
|
||||
try {
|
||||
// Save to database
|
||||
$this->daftarPustaka->storeDaftarPustaka($validate, $file);
|
||||
return redirect()
|
||||
->route('daftar-pustaka.index')
|
||||
->with('success', 'Daftar Pustaka created successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('daftar-pustaka.create')
|
||||
->with('error', 'Failed to create daftar pustaka');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$daftarPustaka = $this->daftarPustaka->getDaftarPustakaById($id);
|
||||
$categories = CategoryDaftarPustaka::all();
|
||||
|
||||
return view('lpj::daftar-pustaka.show', compact('daftarPustaka', 'categories'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$daftarPustaka = $this->daftarPustaka->getDaftarPustakaById($id);
|
||||
$categories = CategoryDaftarPustaka::all();
|
||||
return view('lpj::daftar-pustaka.create', compact('daftarPustaka', 'categories'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(DaftarPustakaRequest $request, $id)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
try {
|
||||
// Save to database
|
||||
$file = $request->file('attachment');
|
||||
$this->daftarPustaka->updateDaftarPustaka($validate, $file, $id);
|
||||
return redirect()
|
||||
->route('daftar-pustaka.index')
|
||||
->with('success', 'Daftar Pustaka updated successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('daftar-pustaka.create')
|
||||
->with('error', 'Failed to update daftar pustaka');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
$this->daftarPustaka->deleteDaftarPustaka($id);
|
||||
return response()->json(['success' => true, 'message' => 'Daftar Pustaka deleted successfully']);
|
||||
} catch (Exception $e) {
|
||||
return response()->json(['success' => false, 'message' => 'Failed to delete daftar pustaka']);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
app/Http/Controllers/DashboardController.php
Normal file
36
app/Http/Controllers/DashboardController.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Services\DashboardService;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public $dashboardService;
|
||||
public function __construct(DashboardService $dashboardService)
|
||||
{
|
||||
$this->dashboardService = $dashboardService;
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
// nilai default
|
||||
$start_date = $request->input('start_date', now()->startOfYear()->format('Y-m-d'));
|
||||
$end_date = $request->input('end_date', now()->format('Y-m-d'));
|
||||
|
||||
$validate = $request->validate([
|
||||
'start_date' => 'nullable|date_format:Y-m-d',
|
||||
'end_date' => 'nullable|date_format:Y-m-d',
|
||||
]);
|
||||
|
||||
$dashboard = $this->dashboardService->getDashboardData($start_date, $end_date);
|
||||
|
||||
// dd($dashboard);
|
||||
return view('lpj::dashboard.index', compact('dashboard'));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class LaporanBiayaInternalExternalController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function showLaporanBiayaInternal()
|
||||
{
|
||||
return view('lpj::laporan-biaya.internal');
|
||||
}
|
||||
|
||||
public function showLaporanBiayaExternal()
|
||||
{
|
||||
return view('lpj::laporan-biaya.external');
|
||||
}
|
||||
|
||||
}
|
||||
33
app/Http/Controllers/LaporanDebitureController.php
Normal file
33
app/Http/Controllers/LaporanDebitureController.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Models\Debiture;
|
||||
use Modules\Lpj\Services\LaporanDebitureService;
|
||||
|
||||
class LaporanDebitureController extends Controller
|
||||
{
|
||||
private $laporanDebitureService;
|
||||
public function __construct()
|
||||
{
|
||||
$this->laporanDebitureService = app(LaporanDebitureService::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$debiture = Debiture::all();
|
||||
return view('lpj::laporan-debiture.index', compact('debiture'));
|
||||
}
|
||||
|
||||
|
||||
public function dataTableForDebiture(Request $request)
|
||||
{
|
||||
return $this->laporanDebitureService->dataForDatatables($request);
|
||||
}
|
||||
|
||||
}
|
||||
43
app/Http/Controllers/LaporanMonitoringSoController.php
Normal file
43
app/Http/Controllers/LaporanMonitoringSoController.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Services\LaporanMonitoringSoService;
|
||||
|
||||
class LaporanMonitoringSoController extends Controller
|
||||
{
|
||||
|
||||
private $laporanMonitoringSoService;
|
||||
|
||||
public function __construct(LaporanMonitoringSoService $laporanMonitoringSoService)
|
||||
{
|
||||
$this->laporanMonitoringSoService = $laporanMonitoringSoService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$user = auth()->user()->load('roles');
|
||||
$result = $this->laporanMonitoringSoService->progresPengerjaanLaporan($user);
|
||||
return view('lpj::laporan-monitoring.index', compact('result'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show details data.
|
||||
* @return Response
|
||||
*/
|
||||
|
||||
public function show($id){
|
||||
return view('lpj::laporan-monitoring.show', compact('id'));
|
||||
}
|
||||
|
||||
|
||||
public function dataForDatatablePenilai(Request $request, $id){
|
||||
return $this->laporanMonitoringSoService->showDetailsPermohonan($request, $id);
|
||||
}
|
||||
|
||||
}
|
||||
32
app/Http/Controllers/LaporanSLAPenilaiController.php
Normal file
32
app/Http/Controllers/LaporanSLAPenilaiController.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Services\LaporanSLAPenilaiService;
|
||||
|
||||
class LaporanSLAPenilaiController extends Controller
|
||||
{
|
||||
private $laporanSLAPenilaiService;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->laporanSLAPenilaiService = app(LaporanSLAPenilaiService::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::laporan-sla-penilai.index');
|
||||
}
|
||||
|
||||
public function dataForDatatableSLaPenilai(Request $request)
|
||||
{
|
||||
return $this->laporanSLAPenilaiService->dataForDatatables($request);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
51
app/Http/Controllers/LaporanUserController.php
Normal file
51
app/Http/Controllers/LaporanUserController.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Exports\LaporanUserLimitExport;
|
||||
use Modules\Lpj\Services\LaporanUserService;
|
||||
|
||||
class LaporanUserController extends Controller
|
||||
{
|
||||
|
||||
|
||||
private $laporanUserService;
|
||||
|
||||
public function __construct(LaporanUserService $laporanUserService)
|
||||
{
|
||||
$this->laporanUserService = $laporanUserService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// $user = $this->laporanUserService->getUserPemohon();
|
||||
return view('lpj::laporan-user.index');
|
||||
}
|
||||
|
||||
public function searchUserPemohon(Request $request)
|
||||
{
|
||||
$search = $request->get('search');
|
||||
$user = $this->laporanUserService->getUserPemohon($search);
|
||||
return response()->json($user);
|
||||
}
|
||||
|
||||
public function dataTableForUserPemohon(Request $request)
|
||||
{
|
||||
return $this->laporanUserService->dataForDatatables($request);
|
||||
}
|
||||
|
||||
public function export(Request $request)
|
||||
{
|
||||
$startDate = $request->start_date;
|
||||
$endDate = $request->end_date;
|
||||
// name of the file
|
||||
$fileName = 'laporan_user_limit' . $startDate . '_' . $endDate . '.xlsx';
|
||||
return Excel::download(new LaporanUserLimitExport($request), $fileName);
|
||||
}
|
||||
}
|
||||
558
app/Http/Controllers/MemoController.php
Normal file
558
app/Http/Controllers/MemoController.php
Normal file
@@ -0,0 +1,558 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use Exception;
|
||||
use Modules\Lpj\Models\Noc;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Barryvdh\DomPDF\Facade\Pdf;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class MemoController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Menampilkan halaman index memo penyelesaian
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
Log::info('MemoController: Mengakses halaman index memo penyelesaian');
|
||||
return view('lpj::memo.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Menampilkan form untuk membuat memo penyelesaian dengan data yang dipilih
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function create(Request $request)
|
||||
{
|
||||
Log::info('MemoController: Mengakses halaman create memo penyelesaian');
|
||||
|
||||
$selectedIds = $request->get('selected_ids', []);
|
||||
|
||||
// Pastikan $selectedIds selalu berupa array
|
||||
if (is_string($selectedIds)) {
|
||||
$selectedIds = explode(',', $selectedIds);
|
||||
}
|
||||
|
||||
// Filter array untuk menghilangkan nilai kosong
|
||||
$selectedIds = array_filter($selectedIds, function($id) {
|
||||
return !empty(trim($id));
|
||||
});
|
||||
|
||||
$permohonanList = [];
|
||||
$totalBiayaPJ = 0;
|
||||
|
||||
if (!empty($selectedIds) && count($selectedIds) > 0) {
|
||||
try {
|
||||
$permohonanList = Permohonan::with([
|
||||
'user',
|
||||
'debiture',
|
||||
'branch',
|
||||
'tujuanPenilaian',
|
||||
'penilaian',
|
||||
'jenisFasilitasKredit',
|
||||
'documents.inspeksi',
|
||||
'penilai',
|
||||
'documents.detail',
|
||||
'noc'
|
||||
])->whereIn('id', $selectedIds)->get();
|
||||
|
||||
// Hitung total biaya PJ dari nominal_bayar di tabel NOC
|
||||
$totalBiayaPJ = Noc::whereIn('permohonan_id', $selectedIds)
|
||||
->sum('nominal_bayar');
|
||||
|
||||
Log::info('MemoController: Total Biaya PJ dihitung: ' . $totalBiayaPJ);
|
||||
|
||||
} catch (Exception $e) {
|
||||
Log::error('MemoController: Error saat mengambil data permohonan - ' . $e->getMessage());
|
||||
return redirect()->back()->with('error', 'Terjadi kesalahan saat memuat data');
|
||||
}
|
||||
}
|
||||
|
||||
return view('lpj::memo.create', compact('permohonanList', 'totalBiayaPJ'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Menyimpan memo penyelesaian yang telah dibuat
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
Log::info('MemoController: Memulai proses penyimpanan memo penyelesaian');
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
try {
|
||||
// Validasi input
|
||||
$request->validate([
|
||||
'permohonan_ids' => 'required|array',
|
||||
'permohonan_ids.*' => 'exists:permohonan,id',
|
||||
'memo_number' => 'required|string|max:255',
|
||||
'payment_date' => 'required|date',
|
||||
'memo_date' => 'required|date'
|
||||
]);
|
||||
|
||||
$permohonanIds = $request->permohonan_ids;
|
||||
$memoNumber = $request->memo_number;
|
||||
$paymentDate = $request->payment_date;
|
||||
$memoDate = $request->memo_date;
|
||||
|
||||
// Update status permohonan yang dipilih
|
||||
foreach ($permohonanIds as $permohonanId) {
|
||||
$permohonan = Permohonan::find($permohonanId);
|
||||
if ($permohonan) {
|
||||
$permohonan->status = 'memo-penyelesaian';
|
||||
$permohonan->memo_penyelesaian_number = $memoNumber;
|
||||
$permohonan->memo_penyelesaian_date = $memoDate;
|
||||
$permohonan->memo_penyelesaian_payment_date = $paymentDate;
|
||||
$permohonan->memo_penyelesaian_created_at = now();
|
||||
//$permohonan->save();
|
||||
|
||||
Log::info('MemoController: Berhasil update permohonan ID: ' . $permohonanId);
|
||||
}
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
Log::info('MemoController: Berhasil menyimpan memo penyelesaian untuk ' . count($permohonanIds) . ' permohonan');
|
||||
|
||||
return redirect()->route('memo.index')
|
||||
->with('success', 'Memo penyelesaian berhasil dibuat untuk ' . count($permohonanIds) . ' permohonan');
|
||||
|
||||
} catch (Exception $e) {
|
||||
DB::rollback();
|
||||
Log::error('MemoController: Error saat menyimpan memo penyelesaian - ' . $e->getMessage());
|
||||
|
||||
return redirect()->back()
|
||||
->withInput()
|
||||
->with('error', 'Terjadi kesalahan saat menyimpan memo penyelesaian: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Menampilkan detail memo penyelesaian
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
Log::info('MemoController: Mengakses detail memo penyelesaian ID: ' . $id);
|
||||
|
||||
$permohonan = Permohonan::with([
|
||||
'user',
|
||||
'debiture',
|
||||
'branch',
|
||||
'tujuanPenilaian',
|
||||
'penilaian',
|
||||
'jenisFasilitasKredit',
|
||||
'documents.inspeksi',
|
||||
'penilai',
|
||||
'documents.detail',
|
||||
'noc'
|
||||
])->findOrFail($id);
|
||||
|
||||
return view('lpj::memo.show', compact('permohonan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Mengambil data untuk datatables pada halaman memo penyelesaian
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
Log::info('MemoController: Mengambil data untuk datatables');
|
||||
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
Log::warning('MemoController: User tidak memiliki permission untuk melihat data');
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Mengambil data dari database dengan kondisi yang sama seperti LaporanController
|
||||
$query = Permohonan::query()
|
||||
->whereIn('status', ['proses-laporan', 'done', 'paparan', 'proses-paparan', 'memo-penyelesaian'])
|
||||
/*->whereNotNull('approval_so_at')
|
||||
->whereNotNull('approval_eo_at')
|
||||
->where(function ($q) {
|
||||
$q->whereIn('nilai_plafond_id', [1, 4])
|
||||
->whereNotNull('approval_dd_at')
|
||||
->orWhereIn('nilai_plafond_id', [2, 3]);
|
||||
})*/
|
||||
->whereHas('noc'); // Hanya tampilkan permohonan yang memiliki NOC
|
||||
|
||||
|
||||
$query = $query->orderBy('nomor_registrasi', 'desc');
|
||||
|
||||
// Apply search filter jika ada
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$searchParams = explode('|', $request->get('search'));
|
||||
|
||||
$filterJenisPenilaian = $searchParams[0] ?? '';
|
||||
$searchTerm = $searchParams[1] ?? '';
|
||||
|
||||
// Filter berdasarkan jenis penilaian
|
||||
if (!empty($filterJenisPenilaian)) {
|
||||
$query->where('jenis_penilaian_id', $filterJenisPenilaian);
|
||||
Log::info('Applied jenis penilaian filter', ['filter' => $filterJenisPenilaian]);
|
||||
}
|
||||
|
||||
$query->where(function ($q) use ($searchTerm) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $searchTerm . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $searchTerm . '%');
|
||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $searchTerm . '%');
|
||||
$q->orWhereRelation('debiture', 'name', 'LIKE', '%' . $searchTerm . '%');
|
||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $searchTerm . '%');
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $searchTerm . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $searchTerm . '%');
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting jika ada
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Mendapatkan total count records
|
||||
$totalRecords = $query->count();
|
||||
$size = $request->get('size', 10);
|
||||
if ($size == 0) {
|
||||
$size = 10;
|
||||
}
|
||||
|
||||
// Apply pagination jika ada
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size;
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Mendapatkan filtered count records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Mendapatkan data untuk halaman saat ini
|
||||
$data = $query->with([
|
||||
'user',
|
||||
'debiture',
|
||||
'branch',
|
||||
'tujuanPenilaian',
|
||||
'jenisPenilaian',
|
||||
'penilaian',
|
||||
'jenisFasilitasKredit',
|
||||
'documents.inspeksi',
|
||||
'penilai',
|
||||
'documents.detail',
|
||||
'noc'
|
||||
])->get();
|
||||
|
||||
// Menghitung page count
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
|
||||
// Menghitung current page number
|
||||
$currentPage = max(1, $request->get('page', 1));
|
||||
|
||||
Log::info('MemoController: Berhasil mengambil data datatables - Total: ' . $totalRecords . ', Filtered: ' . $filteredRecords);
|
||||
|
||||
// Return response data sebagai JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mengambil total biaya PJ berdasarkan permohonan yang dipilih
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function getTotalBiayaPJ(Request $request)
|
||||
{
|
||||
Log::info('MemoController: Mengambil total biaya PJ');
|
||||
|
||||
try {
|
||||
$permohonanIds = $request->get('permohonan_ids', []);
|
||||
|
||||
// Pastikan $permohonanIds selalu berupa array
|
||||
if (is_string($permohonanIds)) {
|
||||
$permohonanIds = explode(',', $permohonanIds);
|
||||
}
|
||||
|
||||
// Filter array untuk menghilangkan nilai kosong
|
||||
$permohonanIds = array_filter($permohonanIds, function($id) {
|
||||
return !empty(trim($id));
|
||||
});
|
||||
|
||||
$totalBiayaPJ = 0;
|
||||
|
||||
if (!empty($permohonanIds) && count($permohonanIds) > 0) {
|
||||
// Hitung total biaya PJ dari nominal_bayar di tabel NOC
|
||||
$totalBiayaPJ = \Modules\Lpj\Models\Noc::whereIn('permohonan_id', $permohonanIds)
|
||||
->sum('nominal_bayar');
|
||||
}
|
||||
|
||||
Log::info('MemoController: Total Biaya PJ berhasil dihitung: ' . $totalBiayaPJ);
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'total_biaya_pj' => $totalBiayaPJ,
|
||||
'total_biaya_pj_formatted' => 'Rp ' . number_format($totalBiayaPJ, 0, ',', '.')
|
||||
]);
|
||||
|
||||
} catch (Exception $e) {
|
||||
Log::error('MemoController: Error saat menghitung total biaya PJ - ' . $e->getMessage());
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Terjadi kesalahan saat menghitung total biaya PJ'
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Menampilkan preview memo penyelesaian sebelum menyimpan
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function preview(Request $request)
|
||||
{
|
||||
Log::info('MemoController: Mengakses halaman preview memo penyelesaian');
|
||||
|
||||
|
||||
$permohonanIds = $request->permohonan_ids;
|
||||
$memoNumber = $request->memo_number;
|
||||
$paymentDate = $request->payment_date;
|
||||
$memoDate = $request->memo_date;
|
||||
|
||||
try {
|
||||
// Ambil data permohonan yang dipilih
|
||||
$permohonanList = Permohonan::with([
|
||||
'user',
|
||||
'debiture',
|
||||
'branch',
|
||||
'penilaian',
|
||||
'jenisPenilaian',
|
||||
'jenisFasilitasKredit',
|
||||
'documents.inspeksi',
|
||||
'penilai',
|
||||
'documents.detail',
|
||||
'noc'
|
||||
])->whereIn('id', $permohonanIds);
|
||||
|
||||
// Hitung total biaya PJ dari nominal_bayar di tabel NOC
|
||||
$totalBiayaPJ = Noc::whereIn('permohonan_id', $permohonanIds)
|
||||
->sum('nominal_bayar');
|
||||
|
||||
// Data untuk template memo
|
||||
$memoData = [
|
||||
'memo_number' => $memoNumber,
|
||||
'memo_date' => $memoDate,
|
||||
'payment_date' => $paymentDate,
|
||||
'total_biaya_pj' => $totalBiayaPJ,
|
||||
'permohonan_list' => $permohonanList->get(),
|
||||
'debitur_count' => $permohonanList->get()->count(),
|
||||
'jaminan_info' => $this->getJaminanInfo($permohonanList->get()),
|
||||
'jenisPenilaian' => $permohonanList->pluck('jenis_penilaian_id')->first()
|
||||
];
|
||||
|
||||
$permohonanList= $permohonanList->get();
|
||||
|
||||
Log::info('MemoController: Data preview memo berhasil disiapkan');
|
||||
|
||||
return view('lpj::memo.preview', compact('memoData', 'permohonanList', 'totalBiayaPJ'));
|
||||
|
||||
} catch (Exception $e) {
|
||||
Log::error('MemoController: Error saat menyiapkan preview memo - ' . $e->getMessage());
|
||||
return redirect()->back()
|
||||
->withInput()
|
||||
->with('error', 'Terjadi kesalahan saat menyiapkan preview memo: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate PDF memo penyelesaian dan simpan ke database
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function generatePdf(Request $request)
|
||||
{
|
||||
Log::info('MemoController: Memulai generate PDF memo penyelesaian');
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
try {
|
||||
// Validasi input
|
||||
|
||||
$permohonanIds = $request->permohonan_ids;
|
||||
$memoNumber = $request->memo_number;
|
||||
$paymentDate = $request->payment_date;
|
||||
$memoDate = $request->memo_date;
|
||||
|
||||
// Ambil data permohonan yang dipilih
|
||||
$permohonanList = Permohonan::with([
|
||||
'user',
|
||||
'debiture',
|
||||
'branch',
|
||||
'penilaian',
|
||||
'jenisPenilaian',
|
||||
'jenisFasilitasKredit',
|
||||
'documents.inspeksi',
|
||||
'penilai',
|
||||
'documents.detail',
|
||||
'noc'
|
||||
])->whereIn('id', $permohonanIds);
|
||||
|
||||
// Hitung total biaya PJ dari nominal_bayar di tabel NOC
|
||||
$totalBiayaPJ = Noc::whereIn('permohonan_id', $permohonanIds)
|
||||
->sum('nominal_bayar');
|
||||
|
||||
// Data untuk template memo
|
||||
$memoData = [
|
||||
'memo_number' => $memoNumber,
|
||||
'memo_date' => $memoDate,
|
||||
'payment_date' => $paymentDate,
|
||||
'total_biaya_pj' => $totalBiayaPJ,
|
||||
'permohonan_list' => $permohonanList->get(),
|
||||
'debitur_count' => $permohonanList->get()->count(),
|
||||
'jaminan_info' => $this->getJaminanInfo($permohonanList->get()),
|
||||
'jenisPenilaian' => $permohonanList->pluck('jenis_penilaian_id')->first()
|
||||
];
|
||||
|
||||
$permohonanList= $permohonanList->get();
|
||||
|
||||
// Generate PDF dari template
|
||||
$pdf = Pdf::loadView('lpj::memo.pdf-template', compact('memoData', 'permohonanList', 'totalBiayaPJ'))
|
||||
->setPaper('a4', 'portrait')
|
||||
->setOptions([
|
||||
'defaultFont' => 'Times-Roman',
|
||||
'isRemoteEnabled' => true,
|
||||
'isHtml5ParserEnabled' => true,
|
||||
'isPhpEnabled' => true,
|
||||
'dpi' => 150,
|
||||
'defaultPaperSize' => 'a4',
|
||||
'chroot' => public_path(),
|
||||
]);
|
||||
|
||||
// Nama file PDF
|
||||
$fileName = 'memo-penyelesaian-' . str_replace(['/', ' '], ['-', '-'], $memoNumber) . '-' . date('Y-m-d-H-i-s') . '.pdf';
|
||||
$filePath = 'memo-penyelesaian/' . $fileName;
|
||||
|
||||
// Simpan PDF ke storage
|
||||
Storage::disk('public')->put($filePath, $pdf->output());
|
||||
|
||||
// Update status permohonan yang dipilih
|
||||
// Update data di tabel NOC untuk setiap permohonan
|
||||
foreach ($permohonanIds as $permohonanId) {
|
||||
// Cari NOC berdasarkan permohonan_id
|
||||
$noc = Noc::where('permohonan_id', $permohonanId)->first();
|
||||
|
||||
if ($noc) {
|
||||
// Update field memo penyelesaian di tabel NOC
|
||||
$noc->memo_penyelesaian = $filePath;
|
||||
$noc->memo_penyelesaian_number = $memoNumber;
|
||||
$noc->memo_penyelesaian_date = $memoDate;
|
||||
$noc->memo_penyelesaian_payment_date = $paymentDate;
|
||||
$noc->memo_penyelesaian_created_at = now();
|
||||
$noc->save();
|
||||
|
||||
Log::info('MemoController: Berhasil update NOC untuk permohonan ID: ' . $permohonanId);
|
||||
} else {
|
||||
Log::warning('MemoController: NOC tidak ditemukan untuk permohonan ID: ' . $permohonanId);
|
||||
}
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
Log::info('MemoController: Berhasil generate PDF dan menyimpan memo penyelesaian untuk ' . count($permohonanIds) . ' permohonan');
|
||||
|
||||
// Return PDF untuk download
|
||||
return $pdf->download('memo-penyelesaian-' . $memoNumber . '.pdf');
|
||||
|
||||
} catch (Exception $e) {
|
||||
DB::rollback();
|
||||
Log::error('MemoController: Error saat generate PDF memo penyelesaian - ' . $e->getMessage());
|
||||
|
||||
return redirect()->back()
|
||||
->with('error', 'Terjadi kesalahan saat generate PDF memo penyelesaian: ' . $e->getMessage())
|
||||
->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function untuk mendapatkan informasi jaminan
|
||||
*
|
||||
* @param $permohonanList
|
||||
* @return string
|
||||
*/
|
||||
private function getJaminanInfo($permohonanList)
|
||||
{
|
||||
$jaminanTypes = [];
|
||||
foreach ($permohonanList as $permohonan) {
|
||||
if ($permohonan->tujuanPenilaian) {
|
||||
$jaminanTypes[] = $permohonan->tujuanPenilaian->name;
|
||||
}
|
||||
}
|
||||
|
||||
$uniqueJaminan = array_unique($jaminanTypes);
|
||||
return implode(' & ', $uniqueJaminan);
|
||||
}
|
||||
/**
|
||||
* Download PDF memo penyelesaian
|
||||
*
|
||||
* @param int $id - ID permohonan
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function downloadPdf($id)
|
||||
{
|
||||
Log::info('MemoController: Download PDF memo penyelesaian untuk permohonan ID: ' . $id);
|
||||
|
||||
try {
|
||||
// Cari NOC berdasarkan permohonan_id
|
||||
$noc = Noc::where('permohonan_id', $id)->first();
|
||||
|
||||
if (!$noc || !$noc->memo_penyelesaian) {
|
||||
Log::warning('MemoController: PDF memo penyelesaian tidak ditemukan untuk permohonan ID: ' . $id);
|
||||
return redirect()->back()->with('error', 'File PDF memo penyelesaian tidak ditemukan.');
|
||||
}
|
||||
|
||||
// Cek apakah file ada di storage
|
||||
if (!Storage::disk('public')->exists($noc->memo_penyelesaian)) {
|
||||
Log::warning('MemoController: File PDF tidak ada di storage: ' . $noc->memo_penyelesaian);
|
||||
return redirect()->back()->with('error', 'File PDF tidak ditemukan di server.');
|
||||
}
|
||||
|
||||
// Download file
|
||||
$fileName = 'memo-penyelesaian-' . $noc->memo_penyelesaian_number . '.pdf';
|
||||
|
||||
Log::info('MemoController: Berhasil download PDF memo penyelesaian: ' . $fileName);
|
||||
|
||||
return Storage::disk('public')->download($noc->memo_penyelesaian, $fileName);
|
||||
|
||||
} catch (Exception $e) {
|
||||
Log::error('MemoController: Error saat download PDF memo penyelesaian - ' . $e->getMessage());
|
||||
return redirect()->back()->with('error', 'Terjadi kesalahan saat mengunduh file PDF.');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,6 @@
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Modules\Lpj\Http\Requests\NocRequest;
|
||||
use Modules\Lpj\Models\Noc;
|
||||
use Modules\Lpj\Models\PenawaranTender;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\PersetujuanPenawaran;
|
||||
|
||||
class NocController extends Controller
|
||||
@@ -19,9 +17,20 @@
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return redirect()->route('noc.pembayaran.index');
|
||||
}
|
||||
|
||||
public function pembayaran()
|
||||
{
|
||||
$persetujuanPenawarans = PersetujuanPenawaran::all();
|
||||
return view('lpj::noc.index', compact('persetujuanPenawarans'));
|
||||
return view('lpj::noc.pembayaran', compact('persetujuanPenawarans'));
|
||||
}
|
||||
|
||||
public function penyelesaian()
|
||||
{
|
||||
$persetujuanPenawarans = PersetujuanPenawaran::all();
|
||||
return view('lpj::noc.penyelesaian', compact('persetujuanPenawarans'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,9 +56,15 @@
|
||||
|
||||
$dataNoc = [
|
||||
'nominal_bayar' => $validated['nominal_bayar'],
|
||||
'total_pembukuan' => $validated['total_pembukuan'],
|
||||
'tanggal_pembayaran' => $validated['tanggal_pembayaran'] ?? date('Y-m-d'),
|
||||
'status_bayar' => $validated['nominal_bayar'] < $validated['total_harus_bayar'] ? false : true,
|
||||
'catatan_noc' => $validated['catatan_noc'],
|
||||
'catatan_noc' => $validated['catatan_noc'] ?? '',
|
||||
'status_kurang_bayar' => $validated['status_kurang_bayar'] ?? '0',
|
||||
'status_lebih_bayar' => $validated['status_lebih_bayar'] ?? '0',
|
||||
'nominal_kurang_bayar' => $validated['nominal_kurang_bayar'] ?? '0',
|
||||
'nominal_lebih_bayar' => $validated['nominal_lebih_bayar'] ?? '0',
|
||||
'bukti_pengembalian' => $validated['bukti_pengembalian'] ?? '',
|
||||
];
|
||||
$noc = Noc::updateOrCreate(
|
||||
[
|
||||
@@ -69,7 +84,7 @@
|
||||
}
|
||||
$noc->save();
|
||||
|
||||
// Update the status of the related permohonan to 'spk'
|
||||
/* Update the status of the related permohonan to 'spk'
|
||||
$permohonan = Permohonan::find(request()->get('permohonan_id'));
|
||||
if ($permohonan) {
|
||||
$permohonan->status_bayar = request()->get('status_pembayar');
|
||||
@@ -88,7 +103,7 @@
|
||||
]);
|
||||
}
|
||||
// andy add, update status penawaran.status='spk'
|
||||
}
|
||||
}*/
|
||||
|
||||
return redirect()
|
||||
->route('noc.index')->with('success', 'NOC berhasil disimpan.');
|
||||
@@ -122,6 +137,7 @@
|
||||
->route('laporan.index')->with('success', 'Memo Penyelesaian updated successfully');
|
||||
}
|
||||
$dataNoc = [
|
||||
'total_pembukuan' => $validated['total_pembukuan'],
|
||||
'nominal_penyelesaian' => $validated['nominal_penyelesaian'],
|
||||
'tanggal_penyelesaian' => $validated['tanggal_penyelesaian'] ?? date('Y-m-d'),
|
||||
'status_pelunasan' => ((int)$validated['nominal_bayar'] + (int)$validated['nominal_penyelesaian']) === (int)$validated['total_harus_bayar'] ? true : false,
|
||||
@@ -131,6 +147,7 @@
|
||||
|
||||
$noc = Noc::updateOrCreate(
|
||||
[
|
||||
'permohonan_id' => $validated['permohonan_id'],
|
||||
'permohonan_id' => $validated['permohonan_id'],
|
||||
'persetujuan_penawaran_id' => $validated['persetujuan_penawaran_id'],
|
||||
],
|
||||
@@ -163,9 +180,7 @@
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(Request $request) {
|
||||
$noc = Noc::find($request->get('id'));
|
||||
|
||||
public function show(Noc $noc) {
|
||||
return view('lpj::noc.memo', compact('noc'));
|
||||
}
|
||||
|
||||
@@ -190,6 +205,12 @@
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
// Redirect to pembayaran datatables by default
|
||||
return $this->dataForDatatablesPembayaran($request);
|
||||
}
|
||||
|
||||
public function dataForDatatablesPembayaran(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('noc.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view persetujuan penawaran.');
|
||||
@@ -198,6 +219,98 @@
|
||||
// Retrieve data from the database
|
||||
$query = PersetujuanPenawaran::query();
|
||||
|
||||
// Filter for pembayaran (where memo_penyelesaian is null)
|
||||
$query->whereDoesntHave('noc', function($q) {
|
||||
$q->whereNotNull('memo_penyelesaian');
|
||||
});
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->orWhereRelation('penawaran', 'nomor_registrasi', '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->get();
|
||||
|
||||
$data = $data->map(function ($persetujuanPenawaran) {
|
||||
return [
|
||||
'id' => $persetujuanPenawaran->id,
|
||||
'nomor_registrasi' => $persetujuanPenawaran->permohonan->nomor_registrasi ?? $persetujuanPenawaran->penawaran->nomor_registrasi,
|
||||
'nama_debitur' => $persetujuanPenawaran->permohonan->debiture->name ?? $persetujuanPenawaran->penawaran->permohonan->debiture->name,
|
||||
'kode_cabang' => $persetujuanPenawaran->permohonan->branch->code ?? $persetujuanPenawaran->penawaran->permohonan->branch->code,
|
||||
'cabang' => $persetujuanPenawaran->permohonan->branch->name ?? $persetujuanPenawaran->penawaran->permohonan->branch->name,
|
||||
'tanggal_pembayaran' => dateFormat(
|
||||
$persetujuanPenawaran->noc->tanggal_pembayaran ?? $persetujuanPenawaran->noc?->created_at,
|
||||
true,
|
||||
),
|
||||
'nominal_bayar' => currencyFormat($persetujuanPenawaran->nominal_bayar ?? 0,
|
||||
),
|
||||
'nominal_diterima' => currencyFormat(
|
||||
$persetujuanPenawaran->noc->nominal_bayar ?? 0,
|
||||
),
|
||||
'bukti_ksl' => $persetujuanPenawaran->noc->bukti_ksl ?? $persetujuanPenawaran->bukti_ksl ?? null,
|
||||
'bukti_bayar' => $persetujuanPenawaran->bukti_bayar ?? null,
|
||||
'updated_at' => dateFormat($persetujuanPenawaran->updated_at, true),
|
||||
];
|
||||
})->sortBy('updated_at', 1)->values();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = $request->get('page', 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 dataForDatatablesPenyelesaian(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('noc.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view persetujuan penawaran.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = PersetujuanPenawaran::query();
|
||||
|
||||
// Filter for penyelesaian (where memo_penyelesaian is not null)
|
||||
$query->whereHas('noc', function($q) {
|
||||
$q->whereNotNull('memo_penyelesaian');
|
||||
});
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
@@ -243,11 +356,11 @@
|
||||
),
|
||||
'nominal_bayar' => currencyFormat($persetujuanPenawaran->nominal_bayar ?? 0,
|
||||
),
|
||||
'nominal_diterima' => currencyFormat(
|
||||
'nominal_diterima' => currencyFormat(
|
||||
$persetujuanPenawaran->noc->nominal_bayar ?? 0,
|
||||
),
|
||||
'bukti_ksl' => $persetujuanPenawaran->noc->bukti_ksl ?? $persetujuanPenawaran->bukti_ksl ?? null,
|
||||
'bukti_bayar' => $persetujuanPenawaran->bukti_bayar ?? null,
|
||||
'bukti_bayar' => $persetujuanPenawaran->bukti_bayar ?? null,
|
||||
'memo_penyelesaian' => $persetujuanPenawaran->noc->memo_penyelesaian ?? $persetujuanPenawaran->memo_penyelesaian ?? null,
|
||||
'nominal_penyelesaian' => currencyFormat(
|
||||
$persetujuanPenawaran->noc->nominal_penyelesaian ?? $persetujuanPenawaran->nominal_penyelesaian ?? 0,
|
||||
|
||||
@@ -2,22 +2,16 @@
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Modules\Lpj\Models\Noc;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Http\Requests\PersetujuanPenawaranRequest;
|
||||
use Modules\Lpj\Models\PenawaranTender;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Modules\Lpj\Models\PenawaranTender;
|
||||
use Modules\Lpj\Models\PersetujuanPenawaran;
|
||||
|
||||
// use Modules\Lpj\Models\JenisPenilaian;
|
||||
|
||||
// use Modules\Lpj\Models\Regions;
|
||||
|
||||
use Modules\Lpj\Http\Requests\PersetujuanPenawaranRequest;
|
||||
class PembayaranController extends Controller
|
||||
{
|
||||
public $user;
|
||||
@@ -27,6 +21,14 @@ class PembayaranController extends Controller
|
||||
return view('lpj::pembayaran.index');
|
||||
}
|
||||
|
||||
public function kurang(){
|
||||
return view('lpj::pembayaran.kurang');
|
||||
}
|
||||
|
||||
public function lebih(){
|
||||
return view('lpj::pembayaran.lebih');
|
||||
}
|
||||
|
||||
public function approval()
|
||||
{
|
||||
return view('lpj::pembayaran.approval');
|
||||
@@ -35,13 +37,13 @@ class PembayaranController extends Controller
|
||||
public function dataApprovalForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('noc.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view persetujuan penawaran.');
|
||||
//abort(403, 'Sorry! You are not allowed to view persetujuan penawaran.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
// Retrieve data from the database
|
||||
$query = PersetujuanPenawaran::query();
|
||||
|
||||
// Apply search filter if provided
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
@@ -49,29 +51,29 @@ class PembayaranController extends Controller
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
// 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
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
// 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
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
// Get the data for the current page
|
||||
$data = $query
|
||||
->with(
|
||||
[
|
||||
@@ -89,13 +91,13 @@ class PembayaranController extends Controller
|
||||
)->get();
|
||||
|
||||
|
||||
// Calculate the page count
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
// Calculate the current page number
|
||||
$currentPage = $request->get('page', 1);
|
||||
|
||||
// Return the response data as a JSON object
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
@@ -115,26 +117,68 @@ class PembayaranController extends Controller
|
||||
return view('lpj::pembayaran.form', compact('permohonan', 'persetujuanPenawaran'));
|
||||
}
|
||||
|
||||
public function editKurang($id){
|
||||
$noc = Noc::find($id);
|
||||
$permohonan = Permohonan::find($noc->permohonan_id);
|
||||
$persetujuanPenawaran = PersetujuanPenawaran::where('permohonan_id', $permohonan->id)->first();
|
||||
return view('lpj::pembayaran.form-kurang', compact('noc','permohonan','persetujuanPenawaran'));
|
||||
}
|
||||
|
||||
public function editLebih($id){
|
||||
$noc = Noc::find($id);
|
||||
$permohonan = Permohonan::find($noc->permohonan_id);
|
||||
$persetujuanPenawaran = PersetujuanPenawaran::where('permohonan_id', $permohonan->id)->first();
|
||||
return view('lpj::pembayaran.form-lebih', compact('noc','permohonan','persetujuanPenawaran'));
|
||||
}
|
||||
public function store(PersetujuanPenawaranRequest $request)
|
||||
{
|
||||
if($req['type'] == 'kurang_bayar'){
|
||||
$noc = Noc::find($req['noc_id']);
|
||||
$noc->nominal_pelunasan = $req['nominal_pelunasan'];
|
||||
if (request()->hasFile('bukti_ksl_kurang_bayar')) {
|
||||
$folderPath = 'persetujuan_penawaran/bukti_ksl_kurang_bayar/' . $req['noc_id'];
|
||||
$noc->bukti_ksl_kurang_bayar = $request->file('bukti_ksl_kurang_bayar')->store($folderPath, 'public');
|
||||
}
|
||||
$noc->save();
|
||||
|
||||
$persetujuanPenawaran = PersetujuanPenawaran::find($noc->persetujuan_penawaran_id);
|
||||
$persetujuanPenawaran->bukti_ksl_kurang_bayar = $noc->bukti_ksl_kurang_bayar;
|
||||
$persetujuanPenawaran->nominal_kurang_bayar = $req['nominal_pelunasan'];
|
||||
$persetujuanPenawaran->save();
|
||||
return redirect()
|
||||
->route('pembayaran.kurang.index')->with('success', 'Pelunasan Kurang Bayar berhasil disimpan.');
|
||||
}
|
||||
|
||||
if($req['type'] == 'lebih_bayar'){
|
||||
$noc = Noc::find($req['noc_id']);
|
||||
if (request()->hasFile('bukti_ksl_lebih_bayar')) {
|
||||
$folderPath = 'persetujuan_penawaran/bukti_ksl_lebih_bayar/' . $req['noc_id'];
|
||||
$noc->bukti_ksl_lebih_bayar = $request->file('bukti_ksl_lebih_bayar')->store($folderPath, 'public');
|
||||
}
|
||||
$noc->save();
|
||||
|
||||
return redirect()
|
||||
->route('pembayaran.lebih.index')->with('success', 'Pengembalian Lebih Bayar berhasil disimpan.');
|
||||
}
|
||||
|
||||
$validated = $request->validated();
|
||||
$validated['created_by'] = Auth::id();
|
||||
$validated['status'] = '0';
|
||||
|
||||
$persetujuanPenawaran = PersetujuanPenawaran::where('permohonan_id', $validated['permohonan_id'] ?? null)->first();
|
||||
$permohonan = Permohonan::find(request()->get('permohonan_id'));
|
||||
$permohonan = Permohonan::find(request()->get('permohonan_id'));
|
||||
if ($persetujuanPenawaran) {
|
||||
// if (isset($validated['penawaran_id'])) {
|
||||
// if (isset($validated['penawaran_id'])) {
|
||||
|
||||
// $persetujuanPenawaran = PersetujuanPenawaran::create(
|
||||
// ['penawaran_id' => $validated['penawaran_id']],
|
||||
// $validated,
|
||||
// );
|
||||
// $persetujuanPenawaran = PersetujuanPenawaran::create(
|
||||
// ['penawaran_id' => $validated['penawaran_id']],
|
||||
// $validated,
|
||||
// );
|
||||
|
||||
$persetujuanPenawaran->fill($validated);
|
||||
|
||||
if ($request->hasFile('bukti_bayar')) {
|
||||
$folderPath = 'persetujuan_penawaran/' . $validated['penawaran_id'];
|
||||
$folderPath = 'persetujuan_penawaran/' . $validated['penawaran_id'];
|
||||
$persetujuanPenawaran->bukti_bayar = $request->file('bukti_bayar')->store($folderPath, 'public');
|
||||
}
|
||||
|
||||
@@ -142,13 +186,22 @@ class PembayaranController extends Controller
|
||||
|
||||
$permohonan->approve_bayar_by = null;
|
||||
$permohonan->approve_bayar_at = null;
|
||||
$permohonan->status = 'done';
|
||||
$permohonan->status = 'done';
|
||||
$permohonan->save();
|
||||
} else {
|
||||
$persetujuanPenawaran = PersetujuanPenawaran::create(
|
||||
$validated
|
||||
);
|
||||
|
||||
if(isset($validated['nomor_tiket'])){
|
||||
$noc = Noc::where('nomor_tiket',$validated['nomor_tiket'])->first();
|
||||
if($noc){
|
||||
$noc->persetujuan_penawaran_id = $persetujuanPenawaran->id;
|
||||
$noc->permohonan_id = $validated['permohonan_id'];
|
||||
$noc->save();
|
||||
}
|
||||
}
|
||||
|
||||
$folderPath = 'persetujuan_penawaran/' . $validated['penawaran_id'];
|
||||
|
||||
if ($request->hasFile('bukti_bayar')) {
|
||||
@@ -157,20 +210,20 @@ class PembayaranController extends Controller
|
||||
$persetujuanPenawaran->save();
|
||||
}
|
||||
|
||||
// Update the status of the related permohonan to 'spk'
|
||||
// Update the status of the related permohonan to 'spk'
|
||||
|
||||
if ($permohonan) {
|
||||
$permohonan->status_bayar = request()->get('status_bayar');
|
||||
$permohonan->save();
|
||||
|
||||
// andy add, update status penawaran.status='spk'
|
||||
// $penawaran = PenawaranTender::where('nomor_registrasi',$permohonan->nomor_registrasi)->first();
|
||||
// andy add, update status penawaran.status='spk'
|
||||
// $penawaran = PenawaranTender::where('nomor_registrasi',$permohonan->nomor_registrasi)->first();
|
||||
PenawaranTender::where('nomor_registrasi', $permohonan->nomor_registrasi)->update([
|
||||
'status' => 'noc',
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
// andy add, update status penawaran.status='spk'
|
||||
// andy add, update status penawaran.status='spk'
|
||||
|
||||
}
|
||||
|
||||
@@ -180,7 +233,7 @@ class PembayaranController extends Controller
|
||||
|
||||
public function update(Request $request, $id): JsonResponse
|
||||
{
|
||||
// init
|
||||
// init
|
||||
$data = [];
|
||||
$output = [];
|
||||
$tindakan = null;
|
||||
@@ -196,22 +249,22 @@ class PembayaranController extends Controller
|
||||
}
|
||||
$output['data'] = $data;
|
||||
|
||||
// Update the status of the related permohonan to 'spk'
|
||||
// Update the status of the related permohonan to 'spk'
|
||||
$permohonan = Permohonan::find($id);
|
||||
|
||||
if ($permohonan) {
|
||||
|
||||
if ($request->type === 'revisi') {
|
||||
$data['status'] = 'revisi-pembayaran';
|
||||
$data['status'] = 'revisi-pembayaran';
|
||||
$data['status_bayar'] = 'belum_bayar';
|
||||
} else {
|
||||
$data['status_bayar'] = 'sudah_bayar';
|
||||
$data['status'] = 'proses-laporan';
|
||||
$data['status'] = 'proses-laporan';
|
||||
}
|
||||
|
||||
if ($permohonan->jenis_penilaian_id == 2) {
|
||||
$data['status_bayar'] = 'sudah_bayar';
|
||||
$data['status'] = 'spk';
|
||||
$data['status'] = 'spk';
|
||||
}
|
||||
|
||||
if ($permohonan->jenis_penilaian_id == 1) {
|
||||
@@ -251,7 +304,7 @@ class PembayaranController extends Controller
|
||||
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.');
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
$query = Permohonan::query()->where(function ($query) {
|
||||
@@ -267,7 +320,7 @@ class PembayaranController extends Controller
|
||||
});
|
||||
|
||||
|
||||
// Pencarian berdasarkan parameter search
|
||||
// Pencarian berdasarkan parameter search
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
@@ -281,17 +334,17 @@ class PembayaranController extends Controller
|
||||
});
|
||||
}
|
||||
|
||||
// Sorting berdasarkan sortField dan sortOrder
|
||||
// Sorting berdasarkan sortField dan sortOrder
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Hitung total records
|
||||
// Hitung total records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Pagination (default page size 10)
|
||||
// Pagination (default page size 10)
|
||||
$size = $request->get('size', 10);
|
||||
if ($size == 0) {
|
||||
$size = 10;
|
||||
@@ -304,20 +357,158 @@ class PembayaranController extends Controller
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Filtered records
|
||||
// Filtered records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Ambil data dengan relasi
|
||||
// Ambil data dengan relasi
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'jenisPenilaian'])->get();
|
||||
|
||||
|
||||
// Hitung jumlah halaman
|
||||
// Hitung jumlah halaman
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
|
||||
// Ambil current page
|
||||
// Ambil current page
|
||||
$currentPage = max(1, $request->get('page', 1));
|
||||
|
||||
// Return JSON response
|
||||
// Return JSON response
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function dataForDatatablesKurang(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
$query = Noc::query()->where(function ($query) {
|
||||
$query->where(['status_kurang_bayar' => '1'])
|
||||
->where('bukti_ksl_kurang_bayar',null);
|
||||
});
|
||||
|
||||
// Sorting berdasarkan sortField dan sortOrder
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Hitung total records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Pagination (default page size 10)
|
||||
$size = $request->get('size', 10);
|
||||
if ($size == 0) {
|
||||
$size = 10;
|
||||
}
|
||||
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page', 1);
|
||||
$offset = ($page - 1) * $size;
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Filtered records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Ambil data dengan relasi
|
||||
$data = $query->get();
|
||||
|
||||
$data = $data->map(function ($item) {
|
||||
return [
|
||||
'id' => $item->id,
|
||||
'permohonan' => $item->permohonan,
|
||||
'pemohon' => $item->permohonan->user,
|
||||
'branch' => $item->permohonan->branch,
|
||||
'debiture' => $item->permohonan->debiture,
|
||||
'nominal_kurang_bayar' => formatRupiah($item->nominal_kurang_bayar,2)
|
||||
];
|
||||
});
|
||||
|
||||
// Hitung jumlah halaman
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
|
||||
// Ambil current page
|
||||
$currentPage = max(1, $request->get('page', 1));
|
||||
|
||||
// Return JSON response
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function dataForDatatablesLebih(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
$query = Noc::query()->where(function ($query) {
|
||||
$query->where(['status_lebih_bayar' => '1'])
|
||||
->where('bukti_ksl_lebih_bayar',null);
|
||||
});
|
||||
|
||||
// Sorting berdasarkan sortField dan sortOrder
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Hitung total records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Pagination (default page size 10)
|
||||
$size = $request->get('size', 10);
|
||||
if ($size == 0) {
|
||||
$size = 10;
|
||||
}
|
||||
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page', 1);
|
||||
$offset = ($page - 1) * $size;
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Filtered records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Ambil data dengan relasi
|
||||
$data = $query->get();
|
||||
|
||||
$data = $data->map(function ($item) {
|
||||
return [
|
||||
'id' => $item->id,
|
||||
'permohonan' => $item->permohonan,
|
||||
'pemohon' => $item->permohonan->user,
|
||||
'branch' => $item->permohonan->branch,
|
||||
'debiture' => $item->permohonan->debiture,
|
||||
'nominal_lebih_bayar' => formatRupiah($item->nominal_lebih_bayar,2)
|
||||
];
|
||||
});
|
||||
|
||||
// Hitung jumlah halaman
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
|
||||
// Ambil current page
|
||||
$currentPage = max(1, $request->get('page', 1));
|
||||
|
||||
// Return JSON response
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
|
||||
@@ -1125,8 +1125,7 @@ class PenilaiController extends Controller
|
||||
$penilai = Penilai::updateOrCreate(
|
||||
[
|
||||
'permohonan_id' => $request->permohonanId,
|
||||
'dokument_id' => $request->documentId,
|
||||
|
||||
'dokument_id' => $request->input('dokument_id'),
|
||||
],
|
||||
[
|
||||
'lpj' => json_encode($data),
|
||||
|
||||
22
app/Http/Controllers/RekapHarianSoController.php
Normal file
22
app/Http/Controllers/RekapHarianSoController.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Models\TujuanPenilaian;
|
||||
|
||||
class RekapHarianSoController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$total_laporan_debitur = 0;
|
||||
$tujuan_penilaian = TujuanPenilaian::all();
|
||||
return view('lpj::rekap-harian-so.index', compact('tujuan_penilaian', 'total_laporan_debitur'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
33
app/Http/Requests/CategoryDaftarPustakaRequest.php
Normal file
33
app/Http/Requests/CategoryDaftarPustakaRequest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CategoryDaftarPustakaRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|max:255',
|
||||
];
|
||||
|
||||
if ($this->method() == 'PUT') {
|
||||
$rules['code'] = 'required|max:50|unique:category_daftar_pustaka,code,' . $this->id;
|
||||
} else {
|
||||
$rules['code'] = 'required|max:50|unique:category_daftar_pustaka,code';
|
||||
}
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
38
app/Http/Requests/DaftarPustakaRequest.php
Normal file
38
app/Http/Requests/DaftarPustakaRequest.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class DaftarPustakaRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
$rules = [
|
||||
'judul' => 'required|max:255',
|
||||
'category_id' => 'required',
|
||||
'deskripsi' => 'nullable',
|
||||
];
|
||||
|
||||
if ($this->method() == 'PUT') {
|
||||
$rules['attachment'] = 'nullable|mimes:pdf,jpg,jpeg,png,gif';
|
||||
} else {
|
||||
$rules['attachment'] = 'required|mimes:pdf,jpg,jpeg,png,gif';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -72,10 +72,16 @@
|
||||
return [
|
||||
'total_harus_bayar' => 'nullable|numeric|min:0',
|
||||
'nominal_bayar' => 'nullable|numeric|min:0',
|
||||
'total_pembukuan' => 'nullable|numeric|min:0',
|
||||
'bukti_ksl' => $fileRule,
|
||||
'bukti_bayar' => $fileRule,
|
||||
'status_bayar' => 'nullable|boolean',
|
||||
'tanggal_pembayaran' => 'nullable|date',
|
||||
'status_kurang_bayar' => 'nullable|boolean',
|
||||
'status_lebih_bayar' => 'nullable|boolean',
|
||||
'nominal_kurang_bayar' => 'nullable|numeric|min:0',
|
||||
'nominal_lebih_bayar' => 'nullable|numeric|min:0',
|
||||
'bukti_pengembalian' => 'nullable|file|mimes:pdf,jpg,jpeg,png|max:2048',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -89,12 +95,16 @@
|
||||
$fileRule = 'nullable|file|mimes:' . self::ALLOWED_FILE_TYPES . '|max:' . self::MAX_FILE_SIZE;
|
||||
|
||||
return [
|
||||
'nominal_penyelesaian' => 'nullable|numeric|min:0',
|
||||
'status_penyelesaian' => 'nullable|boolean',
|
||||
'tanggal_penyelesaian' => 'nullable|date',
|
||||
'bukti_penyelesaian' => $fileRule,
|
||||
'memo_penyelesaian' => $fileRule,
|
||||
'catatan_noc' => 'nullable|string',
|
||||
'nominal_penyelesaian' => 'nullable|numeric|min:0',
|
||||
'status_penyelesaian' => 'nullable|boolean',
|
||||
'tanggal_penyelesaian' => 'nullable|date',
|
||||
'bukti_penyelesaian' => $fileRule,
|
||||
'memo_penyelesaian' => $fileRule,
|
||||
'catatan_noc' => 'nullable|string',
|
||||
'nomor_tiket' => 'nullable|string',
|
||||
'nomor_rekening_lebih_bayar' => 'nullable|string',
|
||||
'bukti_ksl_lebih_bayar' => 'nullable|string',
|
||||
'bukti_ksl_kurang_bayar' => 'nullable|string'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -148,6 +158,11 @@
|
||||
'authorized_status.boolean' => 'Status Otorisasi harus berupa boolean',
|
||||
'authorized_at.date' => 'Format Tanggal Otorisasi tidak valid',
|
||||
'authorized_by.exists' => 'User Otorisasi tidak valid',
|
||||
'status_kurang_bayar.boolean' => 'Status Kurang Bayar harus berupa boolean',
|
||||
'status_lebih_bayar.boolean' => 'Status Lebih Bayar harus berupa boolean',
|
||||
'nominal_kurang_bayar.numeric' => 'Nominal Kurang Bayar harus berupa angka',
|
||||
'nominal_kurang_bayar.min' => 'Nominal Kurang Bayar minimal 0',
|
||||
'nominal_lebih_bayar.numeric' => 'Nominal Lebih Bayar harus berupa angka',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,49 +14,54 @@
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'permohonan_id' => 'nullable|exists:permohonan,id',
|
||||
'penawaran_id' => 'nullable|exists:penawaran,id',
|
||||
'nomor_proposal_penawaran' => 'nullable|string|max:255',
|
||||
'tanggal_proposal_penawaran' => 'nullable|date',
|
||||
'biaya_final' => 'nullable|numeric|min:0',
|
||||
'sla_resume' => 'nullable|numeric|min:0',
|
||||
'sla_final' => 'nullable|numeric|min:0',
|
||||
'file_persetujuan_penawaran' => 'nullable|file|mimes:pdf,doc,docx|max:10240',
|
||||
'surat_representasi' => 'nullable|file|mimes:pdf,doc,docx|max:10240',
|
||||
'status' => 'nullable|boolean',
|
||||
'authorized_status' => 'boolean',
|
||||
'authorized_at' => 'nullable|date',
|
||||
'authorized_by' => 'nullable|exists:users,id',
|
||||
'catatan' => 'nullable|string',
|
||||
];
|
||||
'permohonan_id' => 'nullable|exists:permohonan,id',
|
||||
'penawaran_id' => 'nullable|exists:penawaran,id',
|
||||
'nomor_proposal_penawaran' => 'nullable|string|max:255',
|
||||
'nomor_tiket' => 'nullable|string|max:100',
|
||||
'nominal_kurang_bayar' => 'nullable|string|max:100',
|
||||
'bukti_ksl_kurang_bayar' => 'nullable|file|mimes:pdf,doc,docx|max:10240',
|
||||
'tanggal_proposal_penawaran' => 'nullable|date',
|
||||
'biaya_final' => 'nullable|numeric|min:0',
|
||||
'sla_resume' => 'nullable|numeric|min:0',
|
||||
'sla_final' => 'nullable|numeric|min:0',
|
||||
'file_persetujuan_penawaran' => 'nullable|file|mimes:pdf,doc,docx|max:10240',
|
||||
'surat_representasi' => 'nullable|file|mimes:pdf,doc,docx|max:10240',
|
||||
'status' => 'nullable|boolean',
|
||||
'authorized_status' => 'boolean',
|
||||
'authorized_at' => 'nullable|date',
|
||||
'authorized_by' => 'nullable|exists:users,id',
|
||||
'catatan' => 'nullable|string',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'penawaran_id.required' => 'Penawaran ID wajib diisi.',
|
||||
'penawaran_id.exists' => 'Penawaran ID tidak valid.',
|
||||
'nomor_proposal_penawaran.required' => 'Nomor proposal penawaran wajib diisi.',
|
||||
'tanggal_proposal_penawaran.required' => 'Tanggal proposal penawaran wajib diisi.',
|
||||
'tanggal_proposal_penawaran.date' => 'Tanggal proposal penawaran harus berupa tanggal yang valid.',
|
||||
'biaya_final.required' => 'Biaya final wajib diisi.',
|
||||
'biaya_final.numeric' => 'Biaya final harus berupa angka.',
|
||||
'biaya_final.min' => 'Biaya final tidak boleh kurang dari 0.',
|
||||
'sla_resume.required' => 'SLA Resume wajib diisi.',
|
||||
'sla_final.required' => 'SLA Final wajib diisi.',
|
||||
'file_persetujuan_penawaran.file' => 'File Persetujuan Penawaran harus berupa file.',
|
||||
'file_persetujuan_penawaran.mimes' => 'File Persetujuan Penawaran harus berupa file PDF, DOC, atau DOCX.',
|
||||
'file_persetujuan_penawaran.max' => 'Ukuran File Persetujuan Penawaran tidak boleh lebih dari 10MB.',
|
||||
'surat_representasi.file' => 'Surat Representasi harus berupa file.',
|
||||
'surat_representasi.mimes' => 'Surat Representasi harus berupa file PDF, DOC, atau DOCX.',
|
||||
'surat_representasi.max' => 'Ukuran Surat Representasi tidak boleh lebih dari 10MB.',
|
||||
'region_id.required' => 'Region ID wajib diisi.',
|
||||
'region_id.exists' => 'Region ID tidak valid.',
|
||||
'status.required' => 'Status wajib diisi.',
|
||||
'status.boolean' => 'Status harus berupa nilai boolean.',
|
||||
'authorized_status.boolean' => 'Status otorisasi harus berupa nilai boolean.',
|
||||
'authorized_at.date' => 'Tanggal otorisasi harus berupa tanggal yang valid.',
|
||||
'authorized_by.exists' => 'ID pengguna yang mengotorisasi tidak valid.',
|
||||
];
|
||||
'penawaran_id.required' => 'Penawaran ID wajib diisi.',
|
||||
'penawaran_id.exists' => 'Penawaran ID tidak valid.',
|
||||
'nomor_proposal_penawaran.required' => 'Nomor proposal penawaran wajib diisi.',
|
||||
'nomor_tiket.string' => 'Nomor tiket harus berupa teks.',
|
||||
'nomor_tiket.max' => 'Nomor tiket tidak boleh lebih dari 100 karakter.',
|
||||
'tanggal_proposal_penawaran.required' => 'Tanggal proposal penawaran wajib diisi.',
|
||||
'tanggal_proposal_penawaran.date' => 'Tanggal proposal penawaran harus berupa tanggal yang valid.',
|
||||
'biaya_final.required' => 'Biaya final wajib diisi.',
|
||||
'biaya_final.numeric' => 'Biaya final harus berupa angka.',
|
||||
'biaya_final.min' => 'Biaya final tidak boleh kurang dari 0.',
|
||||
'sla_resume.required' => 'SLA Resume wajib diisi.',
|
||||
'sla_final.required' => 'SLA Final wajib diisi.',
|
||||
'file_persetujuan_penawaran.file' => 'File Persetujuan Penawaran harus berupa file.',
|
||||
'file_persetujuan_penawaran.mimes' => 'File Persetujuan Penawaran harus berupa file PDF, DOC, atau DOCX.',
|
||||
'file_persetujuan_penawaran.max' => 'Ukuran File Persetujuan Penawaran tidak boleh lebih dari 10MB.',
|
||||
'surat_representasi.file' => 'Surat Representasi harus berupa file.',
|
||||
'surat_representasi.mimes' => 'Surat Representasi harus berupa file PDF, DOC, atau DOCX.',
|
||||
'surat_representasi.max' => 'Ukuran Surat Representasi tidak boleh lebih dari 10MB.',
|
||||
'region_id.required' => 'Region ID wajib diisi.',
|
||||
'region_id.exists' => 'Region ID tidak valid.',
|
||||
'status.required' => 'Status wajib diisi.',
|
||||
'status.boolean' => 'Status harus berupa nilai boolean.',
|
||||
'authorized_status.boolean' => 'Status otorisasi harus berupa nilai boolean.',
|
||||
'authorized_at.date' => 'Tanggal otorisasi harus berupa tanggal yang valid.',
|
||||
'authorized_by.exists' => 'ID pengguna yang mengotorisasi tidak valid.',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
341
app/Imports/BucokImport.php
Normal file
341
app/Imports/BucokImport.php
Normal file
@@ -0,0 +1,341 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Imports;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Maatwebsite\Excel\Concerns\ToCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithStartRow;
|
||||
use Maatwebsite\Excel\Concerns\WithValidation;
|
||||
use Maatwebsite\Excel\Concerns\WithBatchInserts;
|
||||
use Maatwebsite\Excel\Concerns\WithChunkReading;
|
||||
use Modules\Lpj\Models\Bucok;
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Kelas untuk mengimpor data Excel ke tabel bucoks
|
||||
* Menggunakan Laravel Excel dengan validasi dan batch processing
|
||||
* Data dimulai dari baris ke-5 tanpa header
|
||||
*/
|
||||
class BucokImport implements ToCollection, WithStartRow, WithValidation, WithBatchInserts, WithChunkReading
|
||||
{
|
||||
private $importedCount = 0;
|
||||
private $skippedCount = 0;
|
||||
private $createdCount = 0;
|
||||
private $updatedCount = 0;
|
||||
private $errors = [];
|
||||
|
||||
/**
|
||||
* Menentukan baris mulai membaca data (baris ke-5)
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function startRow(): int
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
/**
|
||||
* Memproses koleksi data dari Excel
|
||||
*
|
||||
* @param Collection $collection
|
||||
* @return void
|
||||
*/
|
||||
public function collection(Collection $collection)
|
||||
{
|
||||
DB::beginTransaction();
|
||||
|
||||
try {
|
||||
foreach ($collection as $rowIndex => $row) {
|
||||
// Log setiap baris yang diproses
|
||||
Log::info('Processing Bucok import row', [
|
||||
'row_number' => $rowIndex + 5, // +5 karena mulai dari baris 5
|
||||
'row_data' => $row->toArray()
|
||||
]);
|
||||
|
||||
// Konversi row ke array dengan indeks numerik
|
||||
$rowArray = $row->toArray();
|
||||
|
||||
// Skip baris kosong
|
||||
if (empty(array_filter($rowArray))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Validasi data baris
|
||||
$mappedData = $this->mapRowToBucok($rowArray, $rowIndex + 5);
|
||||
|
||||
// Update atau create berdasarkan nomor_tiket
|
||||
if (!empty($mappedData['nomor_tiket'])) {
|
||||
// Update atau create berdasarkan nomor_tiket
|
||||
$bucok = Bucok::updateOrCreate(
|
||||
['nomor_tiket' => $mappedData['nomor_tiket']], // Kondisi pencarian
|
||||
array_merge($mappedData, ['updated_by' => auth()->id()]) // Data yang akan diupdate/create
|
||||
);
|
||||
|
||||
// Log dan tracking apakah data di-update atau di-create
|
||||
if ($bucok->wasRecentlyCreated) {
|
||||
$this->createdCount++;
|
||||
Log::info('Bucok created successfully', [
|
||||
'row_number' => $rowIndex + 5,
|
||||
'nomor_tiket' => $mappedData['nomor_tiket'],
|
||||
'action' => 'created'
|
||||
]);
|
||||
} else {
|
||||
$this->updatedCount++;
|
||||
Log::info('Bucok updated successfully', [
|
||||
'row_number' => $rowIndex + 5,
|
||||
'nomor_tiket' => $mappedData['nomor_tiket'],
|
||||
'action' => 'updated'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->importedCount++;
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
|
||||
// Log summary
|
||||
Log::info('Bucok import completed', [
|
||||
'imported' => $this->importedCount,
|
||||
'skipped' => $this->skippedCount,
|
||||
'total_errors' => count($this->errors)
|
||||
]);
|
||||
|
||||
} catch (Exception $e) {
|
||||
DB::rollback();
|
||||
Log::error('Bucok import failed', ['error' => $e->getMessage()]);
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mapping data Excel berdasarkan indeks kolom ke struktur model Bucok
|
||||
* Kolom dimulai dari indeks 0 (A=0, B=1, C=2, dst.)
|
||||
*
|
||||
* @param array $row
|
||||
* @param int $rowNumber
|
||||
* @return array
|
||||
*/
|
||||
private function mapRowToBucok(array $row, int $rowNumber): array
|
||||
{
|
||||
return [
|
||||
'no' => $row[0] ?? null, // Kolom A
|
||||
'tanggal' => !empty($row[1]) ? $this->parseDate($row[1]) : null, // Kolom B
|
||||
'bulan' => $row[2] ?? null, // Kolom C
|
||||
'tahun' => $row[3] ?? null, // Kolom D
|
||||
'tanggal_penuh' => !empty($row[4]) ? $this->parseDate($row[4]) : null, // Kolom E
|
||||
'nomor_categ' => $row[5] ?? null, // Kolom F
|
||||
'coa_summary' => $row[6] ?? null, // Kolom G
|
||||
'nomor_coa' => $row[7] ?? null, // Kolom H
|
||||
'nama_coa' => $row[8] ?? null, // Kolom I
|
||||
'nomor_tiket' => $row[9] ?? null, // Kolom J - Auto-generate jika kosong
|
||||
'deskripsi' => $row[10] ?? null, // Kolom K
|
||||
'nominal' => $this->parseNumeric($row[11] ?? 0), // Kolom L
|
||||
'penyelesaian' => $row[12] ?? 'Belum Selesai', // Kolom M
|
||||
'umur_aging' => $this->parseNumeric($row[13] ?? 0), // Kolom N
|
||||
'cost_center' => $row[14] ?? null, // Kolom O
|
||||
'nama_sub_direktorat' => $row[15] ?? null, // Kolom P
|
||||
'nama_direktorat_cabang' => $row[16] ?? null, // Kolom Q
|
||||
'tanggal_penyelesaian' => !empty($row[17]) ? $this->parseDate($row[17]) : null, // Kolom R
|
||||
'nominal_penyelesaian' => $this->parseNumeric($row[18] ?? 0), // Kolom S
|
||||
'nominal_berjalan' => $this->parseNumeric($row[19] ?? 0), // Kolom T
|
||||
'amortisasi_berjalan' => $this->parseNumeric($row[20] ?? 0), // Kolom U
|
||||
'sistem_berjalan' => $this->parseNumeric($row[21] ?? 0), // Kolom V
|
||||
'lainnya_berjalan' => $this->parseNumeric($row[22] ?? 0), // Kolom W
|
||||
'nominal_gantung' => $this->parseNumeric($row[23] ?? 0), // Kolom X
|
||||
'aset_gantung' => $this->parseNumeric($row[24] ?? 0), // Kolom Y
|
||||
'keterangan_gantung' => $row[25] ?? null, // Kolom Z
|
||||
'lainnya_satu' => $row[26] ?? null, // Kolom AA
|
||||
'lainnya_dua' => $row[27] ?? null, // Kolom AB
|
||||
'created_by' => auth()->id(),
|
||||
'updated_by' => auth()->id()
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse tanggal dari berbagai format
|
||||
*
|
||||
* @param mixed $dateValue
|
||||
* @return Carbon|null
|
||||
*/
|
||||
private function parseDate($dateValue)
|
||||
{
|
||||
if (empty($dateValue)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
// Jika berupa angka Excel date serial
|
||||
if (is_numeric($dateValue)) {
|
||||
return Carbon::createFromFormat('Y-m-d', \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue)->format('Y-m-d'));
|
||||
}
|
||||
|
||||
// Jika berupa string tanggal
|
||||
return Carbon::parse($dateValue);
|
||||
} catch (Exception $e) {
|
||||
Log::warning('Failed to parse date', ['value' => $dateValue, 'error' => $e->getMessage()]);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse nilai numerik dari berbagai format
|
||||
*
|
||||
* @param mixed $numericValue
|
||||
* @return float
|
||||
*/
|
||||
private function parseNumeric($numericValue): float
|
||||
{
|
||||
if (empty($numericValue)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Hapus karakter non-numerik kecuali titik dan koma
|
||||
$cleaned = preg_replace('/[^0-9.,\-]/', '', $numericValue);
|
||||
|
||||
// Ganti koma dengan titik untuk decimal
|
||||
$cleaned = str_replace(',', '.', $cleaned);
|
||||
|
||||
return (float) $cleaned;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validasi data yang sudah dimapping
|
||||
*
|
||||
* @param array $data
|
||||
* @return \Illuminate\Validation\Validator
|
||||
*/
|
||||
private function validateMappedData(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'no' => 'nullable|integer',
|
||||
'tanggal' => 'nullable|date',
|
||||
'bulan' => 'nullable|integer|between:1,12',
|
||||
'tahun' => 'nullable|integer|min:2000|max:2099',
|
||||
'tanggal_penuh' => 'nullable|date',
|
||||
'nomor_categ' => 'nullable|string|max:50',
|
||||
'coa_summary' => 'nullable|string|max:255',
|
||||
'nomor_coa' => 'nullable|string|max:50',
|
||||
'nama_coa' => 'nullable|string|max:255',
|
||||
'nomor_tiket' => 'nullable|string|max:50',
|
||||
'deskripsi' => 'nullable|string',
|
||||
'nominal' => 'nullable|numeric|min:0',
|
||||
'penyelesaian' => 'nullable|in:Selesai,Belum Selesai,Dalam Proses',
|
||||
'umur_aging' => 'nullable|integer|min:0',
|
||||
'cost_center' => 'nullable|string|max:100',
|
||||
'nama_sub_direktorat' => 'nullable|string|max:255',
|
||||
'nama_direktorat_cabang' => 'nullable|string|max:255',
|
||||
'tanggal_penyelesaian' => 'nullable|date',
|
||||
'nominal_penyelesaian' => 'nullable|numeric|min:0',
|
||||
'nominal_berjalan' => 'nullable|numeric|min:0',
|
||||
'amortisasi_berjalan' => 'nullable|numeric|min:0',
|
||||
'sistem_berjalan' => 'nullable|numeric|min:0',
|
||||
'lainnya_berjalan' => 'nullable|numeric|min:0',
|
||||
'nominal_gantung' => 'nullable|numeric|min:0',
|
||||
'aset_gantung' => 'nullable|numeric|min:0',
|
||||
'keterangan_gantung' => 'nullable|string',
|
||||
'lainnya_satu' => 'nullable|string',
|
||||
'lainnya_dua' => 'nullable|string'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Aturan validasi untuk seluruh file Excel (tidak digunakan karena tanpa header)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Ukuran batch untuk insert
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function batchSize(): int
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ukuran chunk untuk membaca file
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function chunkSize(): int
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mendapatkan jumlah data yang berhasil diimpor
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getImportedCount(): int
|
||||
{
|
||||
return $this->importedCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mendapatkan jumlah data yang berhasil dibuat
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCreatedCount(): int
|
||||
{
|
||||
return $this->createdCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mendapatkan jumlah data yang berhasil diupdate
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getUpdatedCount(): int
|
||||
{
|
||||
return $this->updatedCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mendapatkan statistik lengkap import
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getImportStatistics(): array
|
||||
{
|
||||
return [
|
||||
'total_processed' => $this->importedCount,
|
||||
'created' => $this->createdCount,
|
||||
'updated' => $this->updatedCount,
|
||||
'skipped' => $this->skippedCount,
|
||||
'errors' => count($this->errors)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Mendapatkan jumlah data yang dilewati
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSkippedCount(): int
|
||||
{
|
||||
return $this->skippedCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mendapatkan daftar error yang terjadi
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getErrors(): array
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\Activitylog\LogOptions;
|
||||
use Spatie\Activitylog\Traits\LogsActivity;
|
||||
use Wildside\Userstamps\Userstamps;
|
||||
use Mattiverse\Userstamps\Traits\Userstamps;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
|
||||
|
||||
113
app/Models/Bucok.php
Normal file
113
app/Models/Bucok.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Foundation\Auth\User;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* Model Bucok untuk mengelola data bucok
|
||||
*
|
||||
* @property int $id
|
||||
* @property int|null $no
|
||||
* @property string|null $tanggal
|
||||
* @property string|null $bulan
|
||||
* @property int|null $tahun
|
||||
* @property string|null $tanggal_penuh
|
||||
* @property string|null $nomor_categ
|
||||
* @property string|null $coa_summary
|
||||
* @property string|null $nomor_coa
|
||||
* @property string|null $nama_coa
|
||||
* @property string $nomor_tiket
|
||||
* @property string|null $deskripsi
|
||||
* @property float|null $nominal
|
||||
* @property string|null $penyelesaian
|
||||
* @property int|null $umur_aging
|
||||
* @property string|null $cost_center
|
||||
* @property string|null $nama_sub_direktorat
|
||||
* @property string|null $nama_direktorat_cabang
|
||||
* @property string|null $tanggal_penyelesaian
|
||||
* @property float|null $nominal_penyelesaian
|
||||
* @property float|null $nominal_berjalan
|
||||
* @property float|null $amortisasi_berjalan
|
||||
* @property float|null $sistem_berjalan
|
||||
* @property float|null $lainnya_berjalan
|
||||
* @property float|null $nominal_gantung
|
||||
* @property float|null $aset_gantung
|
||||
* @property string|null $keterangan_gantung
|
||||
* @property string|null $lainnya_satu
|
||||
* @property string|null $lainnya_dua
|
||||
*/
|
||||
class Bucok extends Base
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Nama tabel yang digunakan oleh model
|
||||
*/
|
||||
protected $table = 'bucoks';
|
||||
|
||||
/**
|
||||
* Field yang dapat diisi secara mass assignment
|
||||
*/
|
||||
protected $fillable = [
|
||||
'no',
|
||||
'tanggal',
|
||||
'bulan',
|
||||
'tahun',
|
||||
'tanggal_penuh',
|
||||
'nomor_categ',
|
||||
'coa_summary',
|
||||
'nomor_coa',
|
||||
'nama_coa',
|
||||
'nomor_tiket',
|
||||
'deskripsi',
|
||||
'nominal',
|
||||
'penyelesaian',
|
||||
'umur_aging',
|
||||
'cost_center',
|
||||
'nama_sub_direktorat',
|
||||
'nama_direktorat_cabang',
|
||||
'tanggal_penyelesaian',
|
||||
'nominal_penyelesaian',
|
||||
'nominal_berjalan',
|
||||
'amortisasi_berjalan',
|
||||
'sistem_berjalan',
|
||||
'lainnya_berjalan',
|
||||
'nominal_gantung',
|
||||
'aset_gantung',
|
||||
'keterangan_gantung',
|
||||
'lainnya_satu',
|
||||
'lainnya_dua',
|
||||
];
|
||||
|
||||
/**
|
||||
* Casting tipe data untuk field tertentu
|
||||
*/
|
||||
protected $casts = [
|
||||
'no' => 'integer',
|
||||
'tanggal' => 'date',
|
||||
'tahun' => 'integer',
|
||||
'tanggal_penuh' => 'date',
|
||||
'nominal' => 'decimal:2',
|
||||
'umur_aging' => 'integer',
|
||||
'tanggal_penyelesaian' => 'date',
|
||||
'nominal_penyelesaian' => 'decimal:2',
|
||||
'nominal_berjalan' => 'decimal:2',
|
||||
'amortisasi_berjalan' => 'decimal:2',
|
||||
'sistem_berjalan' => 'decimal:2',
|
||||
'lainnya_berjalan' => 'decimal:2',
|
||||
'nominal_gantung' => 'decimal:2',
|
||||
'aset_gantung' => 'decimal:2',
|
||||
];
|
||||
|
||||
/**
|
||||
* Field yang akan di-hidden saat serialization
|
||||
*/
|
||||
protected $hidden = [
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
}
|
||||
27
app/Models/CategoryDaftarPustaka.php
Normal file
27
app/Models/CategoryDaftarPustaka.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\CategoryDaftarPustakaFactory;
|
||||
|
||||
class CategoryDaftarPustaka extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'category_daftar_pustaka';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'name',
|
||||
'code',
|
||||
];
|
||||
|
||||
public function daftarPustaka(){
|
||||
return $this->hasMany(DaftarPustaka::class);
|
||||
}
|
||||
|
||||
}
|
||||
29
app/Models/DaftarPustaka.php
Normal file
29
app/Models/DaftarPustaka.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\DaftarPustakaFactory;
|
||||
|
||||
class DaftarPustaka extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'daftar_pustaka';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'category_id',
|
||||
'judul',
|
||||
'attachment',
|
||||
'deskripsi',
|
||||
];
|
||||
|
||||
public function category(){
|
||||
return $this->belongsTo(CategoryDaftarPustaka::class);
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,7 @@
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\NocFactory;
|
||||
use Illuminate\Foundation\Auth\User;
|
||||
|
||||
class Noc extends Base
|
||||
{
|
||||
@@ -13,9 +11,16 @@ class Noc extends Base
|
||||
protected $fillable = [
|
||||
'permohonan_id',
|
||||
'persetujuan_penawaran_id',
|
||||
'nomor_tiket',
|
||||
'bukti_bayar',
|
||||
'nominal_bayar',
|
||||
'total_pembukuan',
|
||||
'status_bayar',
|
||||
'status_kurang_bayar',
|
||||
'nominal_kurang_bayar',
|
||||
'status_lebih_bayar',
|
||||
'nominal_lebih_bayar',
|
||||
'bukti_pengembalian',
|
||||
'tanggal_pembayaran',
|
||||
'nominal_penyelesaian',
|
||||
'status_penyelesaiaan',
|
||||
@@ -23,20 +28,34 @@ class Noc extends Base
|
||||
'bukti_penyelesaian',
|
||||
'bukti_ksl',
|
||||
'memo_penyelesaian',
|
||||
'memo_penyelesaian_number',
|
||||
'memo_penyelesaian_date',
|
||||
'memo_penyelesaian_payment_date',
|
||||
'memo_penyelesaian_created_at',
|
||||
'catatan_noc',
|
||||
'status',
|
||||
'authorized_status',
|
||||
'authorized_at',
|
||||
'authorized_by',
|
||||
'nomor_rekening_lebih_bayar',
|
||||
'bukti_ksl_lebih_bayar',
|
||||
'bukti_ksl_kurang_bayar'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'nominal_bayar' => 'decimal:2',
|
||||
'status_bayar' => 'boolean',
|
||||
'status_kurang_bayar' => 'boolean',
|
||||
'nominal_kurang_bayar' => 'decimal:2',
|
||||
'status_lebih_bayar' => 'boolean',
|
||||
'nominal_lebih_bayar' => 'decimal:2',
|
||||
'tanggal_pembayaran' => 'date',
|
||||
'nominal_penyelesaian' => 'decimal:2',
|
||||
'status_penyelesaiaan' => 'boolean',
|
||||
'tanggal_penyelesaian' => 'date',
|
||||
'memo_penyelesaian_date' => 'date',
|
||||
'memo_penyelesaian_payment_date' => 'date',
|
||||
'memo_penyelesaian_created_at' => 'datetime',
|
||||
'status' => 'boolean',
|
||||
'authorized_status' => 'boolean',
|
||||
'authorized_at' => 'datetime',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Modules\Usermanagemenet\Models\User;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
class PersetujuanPenawaran extends Base
|
||||
{
|
||||
@@ -13,6 +13,9 @@
|
||||
'permohonan_id',
|
||||
'penawaran_id',
|
||||
'nomor_proposal_penawaran',
|
||||
'nomor_tiket',
|
||||
'nominal_kurang_bayar',
|
||||
'bukti_ksl_kurang_bayar',
|
||||
'tanggal_proposal_penawaran',
|
||||
'biaya_final',
|
||||
'sla_resume',
|
||||
@@ -46,12 +49,6 @@
|
||||
return $this->belongsTo(Permohonan::class, 'permohonan_id');
|
||||
}
|
||||
|
||||
// Relationship with Region
|
||||
public function region()
|
||||
{
|
||||
return $this->belongsTo(Region::class);
|
||||
}
|
||||
|
||||
// Relationship with User (for authorized_by)
|
||||
public function authorizedBy()
|
||||
{
|
||||
|
||||
94
app/Services/DaftarPustakaService.php
Normal file
94
app/Services/DaftarPustakaService.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Services;
|
||||
|
||||
use Modules\Lpj\Models\DaftarPustaka;
|
||||
|
||||
class DaftarPustakaService
|
||||
{
|
||||
public function storeDaftarPustaka(array $data, $file)
|
||||
{
|
||||
if ($file) {
|
||||
$data['attachment'] = $this->handleUpload($file);
|
||||
}
|
||||
return DaftarPustaka::create($data);
|
||||
}
|
||||
|
||||
public function updateDaftarPustaka($data, $file, $id)
|
||||
{
|
||||
// Ambil data inputan yang diperlukan saja
|
||||
|
||||
$daftarPustaka = DaftarPustaka::findOrFail($id);
|
||||
|
||||
// Jika ada file baru yang diupload
|
||||
if ($file) {
|
||||
// (Opsional) Hapus file lama
|
||||
if ($daftarPustaka->attachment && file_exists(public_path($daftarPustaka->attachment))) {
|
||||
unlink(public_path($daftarPustaka->attachment));
|
||||
}
|
||||
|
||||
// Upload file baru
|
||||
$data['attachment'] = $this->handleUpload($file);
|
||||
}
|
||||
|
||||
// Update data
|
||||
$daftarPustaka->update($data);
|
||||
|
||||
return $daftarPustaka;
|
||||
}
|
||||
|
||||
|
||||
public function deleteDaftarPustaka($id)
|
||||
{
|
||||
return DaftarPustaka::where('id', $id)->delete();
|
||||
}
|
||||
|
||||
public function getDaftarPustakaById($id)
|
||||
{
|
||||
return DaftarPustaka::where('id', $id)->first();
|
||||
}
|
||||
|
||||
// get all with pagination
|
||||
public function getAllDaftarPustaka($request)
|
||||
{
|
||||
$query = DaftarPustaka::query();
|
||||
|
||||
// Filter pencarian
|
||||
if (!empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->orWhere('judul', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
// Filter kategori
|
||||
if (!empty($request->get('category'))) {
|
||||
$category = explode(',', $request->input('category'));
|
||||
$query->whereIn('category_id', $category);
|
||||
}
|
||||
|
||||
// Default pagination
|
||||
$page = (int) $request->get('page', 1);
|
||||
$size = (int) $request->get('size', 10);
|
||||
|
||||
return $query->paginate($size, ['*'], 'page', $page);
|
||||
}
|
||||
|
||||
|
||||
private function handleUpload($file)
|
||||
{
|
||||
$today = now();
|
||||
$folderPath = 'daftar_pustaka/' . $today->format('Y/m/d');
|
||||
|
||||
if (!file_exists(public_path($folderPath))) {
|
||||
mkdir(public_path($folderPath), 0755, true);
|
||||
}
|
||||
|
||||
$fileName = $file->getClientOriginalName();
|
||||
$file->move(public_path($folderPath), $fileName);
|
||||
|
||||
return $folderPath . '/' . $fileName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
179
app/Services/DashboardService.php
Normal file
179
app/Services/DashboardService.php
Normal file
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Services;
|
||||
|
||||
use Modules\Lpj\Models\Laporan;
|
||||
use Modules\Lpj\Models\Noc;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
class DashboardService
|
||||
{
|
||||
public function getDashboardData($start_date, $end_date)
|
||||
{
|
||||
$countLpjInternal = $this->getTotalLpjInternal($start_date, $end_date);
|
||||
$countLpjExternal = $this->getTotalLpjEksternal($start_date, $end_date);
|
||||
$countResume = $this->getResumeCabang($start_date, $end_date);
|
||||
$countPendapatan = $this->getPendapatanAppraisal($start_date, $end_date);
|
||||
|
||||
return [
|
||||
'count_lpj_internal' => $countLpjInternal,
|
||||
'count_lpj_eksternal' => $countLpjExternal,
|
||||
'count_resume' => $countResume,
|
||||
'count_pendapatan' => $countPendapatan
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getTotalLpjInternal($start_date, $end_date)
|
||||
{
|
||||
$months = $this->getMonthly();
|
||||
$regions = $this->getRegion();
|
||||
$data = [];
|
||||
|
||||
foreach ($months as $index => $month) {
|
||||
$monthNumber = $index + 1;
|
||||
$data[$month] = [];
|
||||
|
||||
foreach ($regions as $region) {
|
||||
if ($monthNumber > now()->month) {
|
||||
|
||||
$data[$month][$region] = [
|
||||
'total_laporan' => 0,
|
||||
'total_debiture' => 0,
|
||||
];
|
||||
} else {
|
||||
|
||||
$totalLaporan = Laporan::whereBetween('created_at', [$start_date, $end_date])
|
||||
->count();
|
||||
$totalDebitur = Permohonan::whereBetween('created_at', [$start_date, $end_date])
|
||||
->where('status', 'done')
|
||||
->distinct()
|
||||
->count('debiture_id');
|
||||
|
||||
|
||||
|
||||
$data[$month][$region] = [
|
||||
'total_laporan' => $totalLaporan,
|
||||
'total_debiture' => $totalDebitur,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getPendapatanAppraisal($start_date, $end_date)
|
||||
{
|
||||
$months = $this->getMonthly();
|
||||
$data = [];
|
||||
|
||||
foreach ($months as $index => $month) {
|
||||
$monthNumber = $index + 1;
|
||||
|
||||
if ($monthNumber > now()->month) {
|
||||
// Bulan belum terjadi
|
||||
$data[$month] = [
|
||||
'total_jumlah' => 0,
|
||||
'total_akumulasi' => 0,
|
||||
];
|
||||
} else {
|
||||
// Hitung jumlah nominal_bayar pada bulan ini
|
||||
$totalJumlah = Noc::whereYear('tanggal_pembayaran', now()->year)
|
||||
->whereMonth('tanggal_pembayaran', $monthNumber)
|
||||
->sum('nominal_bayar');
|
||||
|
||||
|
||||
$data[$month] = [
|
||||
'total_jumlah' => $totalJumlah,
|
||||
'total_akumulasi' => $totalJumlah,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getResumeCabang($start_date, $end_date)
|
||||
{
|
||||
$regions = $this->getRegion();
|
||||
$status = ['batal', 'done'];
|
||||
$data = [];
|
||||
|
||||
foreach ($status as $item) {
|
||||
$data[$item] = [];
|
||||
foreach ($regions as $region) {
|
||||
$totalLaporan = DB::table('laporan')
|
||||
->join('permohonan', 'laporan.permohonan_id', '=', 'permohonan.id')
|
||||
->where('permohonan.status', $item)
|
||||
->whereBetween('laporan.created_at', [$start_date, $end_date])
|
||||
->count();
|
||||
|
||||
$data[$item][$region] = [
|
||||
'count_report' => $totalLaporan,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
||||
}
|
||||
public function getTotalLpjEksternal($start_date, $end_date)
|
||||
{
|
||||
$months = $this->getMonthly();
|
||||
$data = [];
|
||||
foreach ($months as $index => $month) {
|
||||
$monthNumber = $index + 1;
|
||||
if ($monthNumber > now()->month) {
|
||||
$data[$month] = [
|
||||
'total_laporan' => 0,
|
||||
'total_debiture' => 0,
|
||||
];
|
||||
} else {
|
||||
$totalLaporan = Laporan::where('created_at', '>=', $start_date)->where('created_at', '<=', $end_date)->count();
|
||||
|
||||
$totalDebitur = Permohonan::whereBetween('created_at', [$start_date, $end_date])
|
||||
->where('status', 'done')
|
||||
->distinct()
|
||||
->count('debiture_id');
|
||||
|
||||
$data[$month] = [
|
||||
'total_laporan' => $totalLaporan,
|
||||
'total_debiture' => $totalDebitur,
|
||||
];
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function getMonthly()
|
||||
{
|
||||
return [
|
||||
'januari',
|
||||
'februari',
|
||||
'maret',
|
||||
'april',
|
||||
'mei',
|
||||
'juni',
|
||||
'juli',
|
||||
'agustus',
|
||||
'september',
|
||||
'oktober',
|
||||
'november',
|
||||
'desember',
|
||||
];
|
||||
}
|
||||
|
||||
private function getRegion()
|
||||
{
|
||||
return [
|
||||
'jabodetabek',
|
||||
'non-jabodetabek',
|
||||
];
|
||||
}
|
||||
}
|
||||
21
app/Services/LaporanBiayaService.php
Normal file
21
app/Services/LaporanBiayaService.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Services;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
|
||||
class LaporanBiayaService
|
||||
{
|
||||
public function buildDataTableQuery(array $data){
|
||||
$query = Permohonan::with([
|
||||
'noc'
|
||||
]);
|
||||
|
||||
if($data['search']){
|
||||
|
||||
}
|
||||
|
||||
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
182
app/Services/LaporanDebitureService.php
Normal file
182
app/Services/LaporanDebitureService.php
Normal file
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Services;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Illuminate\Http\Request;
|
||||
class LaporanDebitureService
|
||||
{
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = Permohonan::query();
|
||||
$query = $query->where('status', 'done');
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = json_decode($request->get('search'));
|
||||
|
||||
if (isset($search->start_date) || isset($search->end_date)) {
|
||||
$query->whereBetween('tanggal_permohonan', [
|
||||
$search->start_date ?? '1900-01-01',
|
||||
$search->end_date ?? now()->toDateString()
|
||||
]);
|
||||
}
|
||||
|
||||
// Filter by branch if provided
|
||||
if (isset($search->debiture_id) && !empty($search->debiture_id)) {
|
||||
$query->where('debiture_id', $search->debiture_id);
|
||||
}
|
||||
|
||||
if (isset($search->search)) {
|
||||
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('jenisFasilitasKredit', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search->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(['debiture.branch'])->get();
|
||||
|
||||
$data = $data->map(function ($permohonan) {
|
||||
$luas_tanah = 0;
|
||||
$luas_bangunan = 0;
|
||||
$nilai_tanah = 0;
|
||||
$nilai_bangunan = 0;
|
||||
$npw = 0;
|
||||
$nilai_liquidasi = 0;
|
||||
|
||||
if (isset($permohonan->penilai->lpj)) {
|
||||
$lpj = json_decode($permohonan->penilai->lpj, true);
|
||||
$npw = str_replace('.', '', $lpj['total_nilai_pasar_wajar'] ?? 0);
|
||||
|
||||
$luas_tanah = $lpj['luas_tanah'] ?? 0;
|
||||
$luas_bangunan = $lpj['luas_bangunan'] ?? 0;
|
||||
// Calculate nilai_tanah dynamically by looking for all keys that start with 'nilai_tanah_'
|
||||
$nilai_tanah = str_replace('.', '', $lpj['nilai_tanah_2'] ?? 0);
|
||||
|
||||
$nilai_bangunan = str_replace('.', '', $lpj['nilai_bangunan_2'] ?? 0);
|
||||
$nilai_liquidasi = str_replace('.', '', $lpj['likuidasi_nilai_2'] ?? 0);
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => $permohonan->id,
|
||||
'nomor_registrasi' => $permohonan->nomor_registrasi,
|
||||
'jenis_penilaian' => $permohonan->jenisPenilaian?->name,
|
||||
'tujuan_penilaian' => $permohonan->tujuanPenilaian?->name,
|
||||
'jenis_fasilitas_kredit' => $permohonan->jenisFasilitasKredit?->name,
|
||||
'branch' => $permohonan->debiture->branch?->name,
|
||||
'pemohon' => $permohonan->creator?->name,
|
||||
'cif' => $permohonan->debiture->cif,
|
||||
'name' => $permohonan->debiture?->name,
|
||||
'jenis_agunan' => $permohonan->documents?->pluck('jenisJaminan.name')
|
||||
->unique()
|
||||
->implode(', '),
|
||||
'alamat_agunan' => $permohonan->documents?->map(function ($document) {
|
||||
return formatAlamat($document);
|
||||
})->unique()->implode(', '),
|
||||
'bukti_kepemilikan' => (function () use ($permohonan) {
|
||||
$legalitasItems = $permohonan->documents?->flatMap(function ($document) {
|
||||
return $document->detail->map(function ($detail) {
|
||||
// Jika tidak ada jenis legalitas jaminan, lewati
|
||||
if (empty($detail->jenisLegalitasJaminan)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Hanya tampilkan detail yang memiliki dokumen_jaminan
|
||||
if (empty($detail->dokumen_jaminan)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Tampilkan nama legalitas jaminan saja
|
||||
return $detail->jenisLegalitasJaminan->name ?? '';
|
||||
});
|
||||
})->filter()->unique()->values()->toArray();
|
||||
|
||||
// Buat daftar bernomor
|
||||
$result = '';
|
||||
foreach ($legalitasItems as $index => $item) {
|
||||
$result .= ($index + 1) . '. ' . $item . "\n";
|
||||
}
|
||||
|
||||
return $result;
|
||||
})(),
|
||||
'nama_pemilik' => $permohonan->documents?->pluck('pemilik.name')
|
||||
->unique()
|
||||
->implode(', '),
|
||||
'luas_tanah' => $luas_tanah . ' m²',
|
||||
'nilai_tanah' => formatRupiah($nilai_tanah, 2),
|
||||
'luas_bangunan' => $luas_bangunan . ' m²',
|
||||
'nilai_bangunan' => formatRupiah($nilai_bangunan, 2),
|
||||
'nilai_njop' => formatRupiah($permohonan->nilai_njop, 2),
|
||||
'nilai_pasar_wajar' => formatRupiah($npw, 2),
|
||||
'nilai_likuidasi' => formatRupiah($nilai_liquidasi, 2),
|
||||
'tanggal_documen_diterima' => $permohonan->documents?->map(function ($document) {
|
||||
return $document->created_at->format('d-m-Y');
|
||||
}),
|
||||
'tanggal_spk' => '',
|
||||
'nomor_spk' => '',
|
||||
'tanggal_rencana_kunjunagn' => '',
|
||||
'tanggal_kunjungan' => '',
|
||||
'taggal_delivered' => '',
|
||||
'jangka_waktu_sla' => '',
|
||||
'nama_penilai' => $permohonan->penilaian?->_user_penilai?->userPenilaiTeam?->name,
|
||||
'nama_team_leader' => $permohonan->penilaian?->teams,
|
||||
'saran' => '',
|
||||
'catatan' => '',
|
||||
|
||||
|
||||
'tanggal_permohonan' => $permohonan->tanggal_permohonan,
|
||||
'tanggal_laporan' => $permohonan->approval_dd_at ?? $permohonan->approval_eo_at ?? '',
|
||||
'tanggal_review' => $permohonan->penilaian?->tanggal_kunjungan ?? '',
|
||||
];
|
||||
});
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = $request->get('page') ?: 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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
228
app/Services/LaporanMonitoringSoService.php
Normal file
228
app/Services/LaporanMonitoringSoService.php
Normal file
@@ -0,0 +1,228 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Services;
|
||||
use Modules\Lpj\Models\TeamsUsers;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
use Modules\Lpj\Models\Debiture;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
use Modules\Lpj\Models\StatusPermohonan;
|
||||
use Carbon\Carbon;
|
||||
class LaporanMonitoringSoService
|
||||
{
|
||||
|
||||
public function progresPengerjaanLaporan($user){
|
||||
|
||||
// Inisialisasi regionId dan teamId
|
||||
$regionId = $teamId = null;
|
||||
|
||||
if ($user->roles->pluck('name')->contains('senior-officer')) {
|
||||
$userTeam = TeamsUsers::with('team')->firstWhere('user_id', $user->id);
|
||||
$regionId = $userTeam?->team->regions_id;
|
||||
$teamId = $userTeam?->teams_id;
|
||||
}
|
||||
|
||||
|
||||
$teamsActivity = TeamsUsers::with(['user', 'team', 'team.regions', 'user.roles'])
|
||||
->whereHas('team', function ($q) use ($regionId, $teamId) {
|
||||
$q->when($regionId, fn ($q) => $q->where('regions_id', $regionId))
|
||||
->when($teamId, fn ($q) => $q->where('id', $teamId));
|
||||
})
|
||||
->where('user_id', '!=', $user->id)
|
||||
->whereHas('user.roles', fn ($q) => $q->whereIn('name', ['surveyor', 'surveyor-penilai']))
|
||||
->get();
|
||||
|
||||
$teamId = is_array($teamId) ? $teamId : [$teamId];
|
||||
|
||||
$teamPenilai = Teams::with(['regions', 'teamsUsers', 'teamsUsers.user'])->whereNotIn(
|
||||
'id',
|
||||
$teamId
|
||||
)->get();
|
||||
|
||||
return [
|
||||
'teamsActivity' => $teamsActivity,
|
||||
'teamPenilai' => $teamPenilai,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function showDetailsPermohonan($request,$id)
|
||||
{
|
||||
$query = Penilaian::with([
|
||||
'permohonan',
|
||||
'permohonan.debiture',
|
||||
'permohonan.tujuanPenilaian',
|
||||
'permohonan.debiture.documents.jenisJaminan',
|
||||
'userPenilai' => function ($query) use ($id) {
|
||||
$query->where('user_id', $id);
|
||||
},
|
||||
'permohonan.penilai',
|
||||
'permohonan.approveEo',
|
||||
'permohonan.approveDd',
|
||||
'permohonan.approveSo',
|
||||
|
||||
])
|
||||
->whereHas('userPenilai', function ($q) use ($id) {
|
||||
$q->where('user_id', $id);
|
||||
})
|
||||
->whereHas('permohonan', function ($q) {
|
||||
$q->whereIn('status', [
|
||||
'assign',
|
||||
'survey-completed',
|
||||
'proses-laporan',
|
||||
'paparan',
|
||||
'proses-paparan',
|
||||
'revisi-laporan',
|
||||
'revisi-paparan',
|
||||
'survey',
|
||||
'proses-survey',
|
||||
'request-reschedule',
|
||||
'reschedule',
|
||||
'rejected-reschedule',
|
||||
'approved-reschedule',
|
||||
'revisi-survey',
|
||||
'revisi-pembayaran'
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Filter pencarian
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', "%$search%")
|
||||
->orWhere('status', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
// Sorting
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Hitung total records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Pagination
|
||||
$size = $request->get('size', 10);
|
||||
$page = $request->get('page', 1);
|
||||
$offset = ($page - 1) * $size;
|
||||
|
||||
// Ambil data dengan pagination
|
||||
$data = $query->skip($offset)->take($size)->get();
|
||||
|
||||
$data = $data->map(function ($item) {
|
||||
$jeniAsset = null;
|
||||
$statusPembayaran = trim(strtolower($item->permohonan->status_bayar ?? ''));
|
||||
$tujuanPenilaian = $item->permohonan->tujuanPenilaian->name ?? null;
|
||||
$plafond = $item->permohonan->nilaiPlafond->name ?? null;
|
||||
|
||||
$now = Carbon::now();
|
||||
$type_report = $item->permohonan->penilai->type ?? "";
|
||||
|
||||
$hari = $hariPaparan = 0;
|
||||
|
||||
if ($type_report == "sederhana") {
|
||||
$hari = 2;
|
||||
$item->paparan = 'Tidak Ada';
|
||||
} else {
|
||||
if ($plafond == '< 2M') {
|
||||
$item->paparan = 'Tidak Ada';
|
||||
$hari = 3;
|
||||
} elseif ($plafond == '2 M - 5 M') {
|
||||
$hari = 3;
|
||||
$hariPaparan = 2;
|
||||
} else {
|
||||
$hari = 5;
|
||||
$hariPaparan = 3;
|
||||
}
|
||||
}
|
||||
|
||||
if ($tujuanPenilaian == 'RAP') {
|
||||
$hari = 2;
|
||||
$hariPaparan = 2;
|
||||
}
|
||||
|
||||
|
||||
if ($item->permohonan && $item->permohonan->debiture) {
|
||||
$jeniAsset = $item->permohonan->debiture->documents->first() ?? null;
|
||||
}
|
||||
|
||||
/*$hariTambahan = 0;
|
||||
|
||||
if ($tujuanPenilaian == 'RAP') {
|
||||
$hariTambahan = 2;
|
||||
} else {
|
||||
if ($statusPembayaran == 'sudah_bayar') {
|
||||
$hariTambahan = 1; // H+1 untuk yang sudah bayar
|
||||
} else {
|
||||
$hariTambahan = 2; // H+2 untuk yang belum bayar
|
||||
}
|
||||
}*/
|
||||
|
||||
$tanggalMulai = $item->waktu_penilaian;
|
||||
|
||||
if ($tanggalMulai) {
|
||||
if (!$tanggalMulai instanceof Carbon) {
|
||||
$tanggalMulai = Carbon::parse($tanggalMulai);
|
||||
}
|
||||
$hariKerjaBerikutnya = hitungHariKerja($tanggalMulai->toDateString(), $tanggalMulai->copy()->addDays(1));
|
||||
$hariKerjaBerikutnya = max($hariKerjaBerikutnya, 1);
|
||||
$tanggalMulai = $tanggalMulai->copy()->addDays($hariKerjaBerikutnya);
|
||||
|
||||
// Konversi string tanggal ke objek Carbon jika belum
|
||||
if (!$tanggalMulai instanceof Carbon) {
|
||||
$tanggalMulai = Carbon::parse($tanggalMulai);
|
||||
}
|
||||
|
||||
// Hitung tanggal selesai berdasarkan hari tambahan
|
||||
$tanggalSelesai = $tanggalMulai->copy()->addDays($hari);
|
||||
$tanggalPaparan = $tanggalMulai->copy()->addDays($hariPaparan);
|
||||
|
||||
// Hitung hari kerja
|
||||
$hariKerja = hitungHariKerja($tanggalMulai->toDateString(), $tanggalSelesai->toDateString());
|
||||
$hariKerja = max($hariKerja, $hari);
|
||||
|
||||
$hariKerjaPaparan = hitungHariKerja($tanggalMulai->toDateString(), $tanggalPaparan->toDateString());
|
||||
$hariKerjaPaparan = max($hariKerjaPaparan, $hariPaparan);
|
||||
|
||||
// Set due date SLA
|
||||
$dueDateSla = $tanggalMulai->copy()->addDays($hariKerja);
|
||||
$dueDateSlaPaparan = $tanggalMulai->copy()->addDays($hariKerjaPaparan);
|
||||
|
||||
// Cek apakah sudah melewati due date
|
||||
/*if ($now->greaterThan($dueDateSla)) {
|
||||
$item->due_date_sla = null;
|
||||
} else {
|
||||
$item->due_date_sla = $dueDateSla->toDateString();
|
||||
}*/
|
||||
|
||||
$item->due_date_sla = $dueDateSla->toDateString();
|
||||
$item->paparan = $dueDateSlaPaparan->toDateString();
|
||||
} else {
|
||||
$item->due_date_sla = null;
|
||||
$item->paparan = null;
|
||||
|
||||
}
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
$filteredRecords = $data->count();
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
|
||||
// Return data dalam bentuk JSON
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $page,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data
|
||||
]);
|
||||
}
|
||||
}
|
||||
123
app/Services/LaporanSLAPenilaiService.php
Normal file
123
app/Services/LaporanSLAPenilaiService.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Services;
|
||||
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
use Illuminate\Http\Request;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class LaporanSLAPenilaiService
|
||||
{
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
// Retrieve data from the database
|
||||
$query = Permohonan::query();
|
||||
$query = $query->where('status', 'done');
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = json_decode($request->get('search'));
|
||||
|
||||
if (isset($search->start_date) || isset($search->end_date)) {
|
||||
$query->whereBetween('tanggal_permohonan', [
|
||||
$search->start_date ?? '1900-01-01',
|
||||
$search->end_date ?? now()->toDateString()
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
if (isset($search->penilai_id) && !empty($search->penilai_id)) {
|
||||
$query->whereHas('penilaian._user_penilai.userPenilaiTeam', function ($q) use ($search) {
|
||||
$q->where('user_id', $search->penilai_id);
|
||||
});
|
||||
}
|
||||
|
||||
if (isset($search->search)) {
|
||||
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('jenisFasilitasKredit', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search->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(['documents','debiture.branch'])->get();
|
||||
|
||||
$data = $data->map(function ($permohonan) {
|
||||
|
||||
$tgl_kunjungan = $permohonan->penilaian?->tanggal_kunjungan;
|
||||
$tgl_otorisator = $permohonan->approval_dd_at ?? $permohonan->approval_eo_at ?? $permohonan->approval_so_at;
|
||||
$jangkaWaktu = $this->hitungTotalJangkaWaktuSla($tgl_kunjungan, $tgl_otorisator);
|
||||
|
||||
|
||||
|
||||
return [
|
||||
'id' => $permohonan->id,
|
||||
'nomor_registrasi' => $permohonan->nomor_registrasi,
|
||||
'tanggal_permohonan' => $permohonan->tanggal_permohonan,
|
||||
'branch' => $permohonan->debiture?->branch?->name,
|
||||
'name' => $permohonan->debiture?->name,
|
||||
'pemohon' => $permohonan->creator?->name,
|
||||
'tujuan_penilaian' => $permohonan->tujuanPenilaian?->name,
|
||||
'tanggal_laporan' => $permohonan->approval_dd_at ?? $permohonan->approval_eo_at ?? '',
|
||||
'tanggal_approval' => $permohonan->approval_dd_at ?? $permohonan->approval_eo_at ?? '',
|
||||
'tanggal_kunjungan' => $permohonan->penilaian?->tanggal_kunjungan ?? '',
|
||||
'nama_penilai' => $permohonan->penilaian?->_user_penilai?->userPenilaiTeam?->name,
|
||||
'jangka_waktu' => $jangkaWaktu,
|
||||
'keterangan' => $permohonan->keterangan
|
||||
];
|
||||
});
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = $request->get('page', 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,
|
||||
]);
|
||||
}
|
||||
|
||||
private function hitungTotalJangkaWaktuSla($tgl_kunjungan,$tgl_otorisator){
|
||||
$countHariKerja = hitungHariKerja($tgl_kunjungan, $tgl_otorisator);
|
||||
return $countHariKerja;
|
||||
}
|
||||
}
|
||||
127
app/Services/LaporanUserService.php
Normal file
127
app/Services/LaporanUserService.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Services;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class LaporanUserService
|
||||
{
|
||||
public function getUserPemohon($search = null)
|
||||
{
|
||||
return Permohonan::join('users', 'users.id', '=', 'permohonan.user_id')
|
||||
->whereNotNull('permohonan.nomor_registrasi')
|
||||
->when($search, function ($query) use ($search) {
|
||||
$query->where('users.name', 'like', "%$search%");
|
||||
})
|
||||
->select('users.id', 'users.name')
|
||||
->distinct()
|
||||
->orderBy('users.name')
|
||||
->limit(20)
|
||||
->get();
|
||||
}
|
||||
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = Permohonan::query();
|
||||
$query = $query->where('status', 'done');
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = json_decode($request->get('search'));
|
||||
|
||||
if (isset($search->start_date) || isset($search->end_date)) {
|
||||
$query->whereBetween('tanggal_permohonan', [
|
||||
$search->start_date ?? '1900-01-01',
|
||||
$search->end_date ?? now()->toDateString()
|
||||
]);
|
||||
}
|
||||
|
||||
// Filter by branch if provided
|
||||
if (isset($search->user_id) && !empty($search->user_id)) {
|
||||
$query->where('user_id', $search->user_id);
|
||||
}
|
||||
|
||||
if (isset($search->search)) {
|
||||
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('jenisFasilitasKredit', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search->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(['debiture.branch'])->get();
|
||||
|
||||
$data = $data->map(function ($permohonan) {
|
||||
|
||||
$npw = 0;
|
||||
|
||||
|
||||
if (isset($permohonan->penilai->lpj)) {
|
||||
$lpj = json_decode($permohonan->penilai->lpj, true);
|
||||
$npw = str_replace('.', '', $lpj['total_nilai_pasar_wajar'] ?? 0);
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => $permohonan->id,
|
||||
'nomor_registrasi' => $permohonan->nomor_registrasi,
|
||||
'branch' => $permohonan->debiture->branch?->name,
|
||||
'name' => $permohonan->debiture?->name,
|
||||
'pemohon' => $permohonan->creator?->name,
|
||||
'tanggal_permohonan' => $permohonan->tanggal_permohonan,
|
||||
'nama_penilai' => $permohonan->penilaian?->_user_penilai?->userPenilaiTeam?->name,
|
||||
'tanggal_laporan' => $permohonan->approval_dd_at ?? $permohonan->approval_eo_at ?? '',
|
||||
'nilai_pasar_wajar' => formatRupiah($npw, 2)
|
||||
];
|
||||
});
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = $request->get('page') ?: 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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
63
app/Services/RekapHarianService.php
Normal file
63
app/Services/RekapHarianService.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Services;
|
||||
|
||||
class RekapHarianService
|
||||
{
|
||||
public function getRekapHarian()
|
||||
{
|
||||
// return $id;
|
||||
}
|
||||
|
||||
public function totalLaporan()
|
||||
{
|
||||
$jenis_penilaian = JenisPenilaian::all();
|
||||
$laporan = [];
|
||||
$grandTotal = [];
|
||||
|
||||
foreach ($jenis_penilaian as $index => $jenis) {
|
||||
|
||||
$totalLaporanDebiture = $this->totalLaporanDebiture();
|
||||
$totalKunjunganDebiture = $this->totalKunjunganDebiture();
|
||||
$totalKunjunganLokasi = $this->totalKunjunganLokasi();
|
||||
|
||||
|
||||
$grandTotal = [
|
||||
'laporan_debiture' => 0,
|
||||
'debiture' => 0,
|
||||
'lokasi' => 0,
|
||||
'pipeline' => 0
|
||||
];
|
||||
}
|
||||
return $grandTotal;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private function totalLaporanDebiture()
|
||||
{
|
||||
$query = [
|
||||
'jenis_penilaian_id' => 1,
|
||||
'total' => 2
|
||||
];
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function totalKunjunganDebiture()
|
||||
{
|
||||
$query = [
|
||||
'jenis_penilaian_id' => 1,
|
||||
'total' => 2
|
||||
];
|
||||
return $query;
|
||||
}
|
||||
|
||||
public function totalKunjunganLokasi()
|
||||
{
|
||||
$query = [
|
||||
'jenis_penilaian_id' => 1,
|
||||
'total' => 2
|
||||
];
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('category_daftar_pustaka', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code')->unique()->index();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->softDeletes();
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('category_daftar_pustaka');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('daftar_pustaka', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('judul');
|
||||
$table->string('attachment')->nullable();
|
||||
$table->text('deskripsi');
|
||||
$table->unsignedBigInteger('category_id');
|
||||
$table->foreign('category_id')->references('id')->on('category_daftar_pustaka');
|
||||
$table->timestamps();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->softDeletes();
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('daftar_pustaka');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('noc', function (Blueprint $table) {
|
||||
// Field untuk informasi memo penyelesaian
|
||||
$table->string('memo_penyelesaian_number')->nullable()->after('memo_penyelesaian');
|
||||
$table->date('memo_penyelesaian_date')->nullable()->after('memo_penyelesaian_number');
|
||||
$table->date('memo_penyelesaian_payment_date')->nullable()->after('memo_penyelesaian_date');
|
||||
$table->timestamp('memo_penyelesaian_created_at')->nullable()->after('memo_penyelesaian_date');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('noc', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'memo_penyelesaian_number',
|
||||
'memo_penyelesaian_date',
|
||||
'memo_penyelesaian_payment_date',
|
||||
'memo_penyelesaian_created_at'
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('noc', function (Blueprint $table) {
|
||||
$table->decimal('total_pembukuan', 10, 2)->after('nominal_bayar');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('noc', function (Blueprint $table) {
|
||||
$table->dropColumn('total_pembukuan');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Menjalankan migration untuk menambahkan field status pembayaran
|
||||
* Field yang ditambahkan: status_kurang_bayar, nominal_kurang_bayar,
|
||||
* status_lebih_bayar, nominal_lebih_bayar, bukti_pengembalian
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('noc', function (Blueprint $table) {
|
||||
// Field untuk status kurang bayar
|
||||
$table->boolean('status_kurang_bayar')->default(false)->after('status_bayar');
|
||||
$table->decimal('nominal_kurang_bayar', 15, 2)->nullable()->after('status_kurang_bayar');
|
||||
|
||||
// Field untuk status lebih bayar
|
||||
$table->boolean('status_lebih_bayar')->default(false)->after('nominal_kurang_bayar');
|
||||
$table->decimal('nominal_lebih_bayar', 15, 2)->nullable()->after('status_lebih_bayar');
|
||||
|
||||
// Field untuk bukti pengembalian jika lebih bayar
|
||||
$table->string('bukti_pengembalian')->nullable()->after('nominal_lebih_bayar');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Rollback migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('noc', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'status_kurang_bayar',
|
||||
'nominal_kurang_bayar',
|
||||
'status_lebih_bayar',
|
||||
'nominal_lebih_bayar',
|
||||
'bukti_pengembalian'
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('bucoks', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('no')->nullable(); // Nomor urut
|
||||
$table->string('tanggal')->nullable(); // Tanggal
|
||||
$table->string('bulan')->nullable(); // Bulan
|
||||
$table->string('tahun')->nullable(); // Tahun
|
||||
$table->string('tanggal_penuh')->nullable(); // Tanggal lengkap
|
||||
$table->string('nomor_categ')->nullable(); // Nomor kategori
|
||||
$table->string('coa_summary')->nullable(); // COA Summary
|
||||
$table->string('nomor_coa')->nullable(); // Nomor COA
|
||||
$table->string('nama_coa')->nullable(); // Nama COA
|
||||
$table->string('nomor_tiket')->unique(); // Nomor tiket (unique)
|
||||
$table->string('deskripsi')->nullable(); // Deskripsi
|
||||
$table->string('nominal')->nullable(); // Nominal
|
||||
$table->string('penyelesaian')->nullable(); // Penyelesaian
|
||||
$table->string('umur_aging')->nullable(); // Umur aging
|
||||
$table->string('cost_center')->nullable(); // Cost center
|
||||
$table->string('nama_sub_direktorat')->nullable(); // Nama sub direktorat
|
||||
$table->string('nama_direktorat_cabang')->nullable(); // Nama direktorat cabang
|
||||
$table->string('tanggal_penyelesaian')->nullable(); // Tanggal penyelesaian
|
||||
$table->string('nominal_penyelesaian')->nullable(); // Nominal penyelesaian
|
||||
$table->string('nominal_berjalan')->nullable(); // Nominal berjalan
|
||||
$table->string('amortisasi_berjalan')->nullable(); // Amortisasi berjalan
|
||||
$table->string('sistem_berjalan')->nullable(); // Sistem berjalan
|
||||
$table->string('lainnya_berjalan')->nullable(); // Lainnya berjalan
|
||||
$table->string('nominal_gantung')->nullable(); // Nominal gantung
|
||||
$table->string('aset_gantung')->nullable(); // Aset gantung
|
||||
$table->string('keterangan_gantung')->nullable(); // Keterangan gantung
|
||||
$table->string('lainnya_satu')->nullable(); // Lainnya satu
|
||||
$table->string('lainnya_dua')->nullable(); // Lainnya dua
|
||||
|
||||
// Standard Laravel fields
|
||||
$table->timestamps();
|
||||
$table->string('created_by')->nullable();
|
||||
$table->string('updated_by')->nullable();
|
||||
$table->string('deleted_by')->nullable();
|
||||
$table->softDeletes();
|
||||
|
||||
// Indexes untuk performa
|
||||
$table->index(['nomor_tiket']);
|
||||
$table->index(['tanggal']);
|
||||
$table->index(['tahun']);
|
||||
$table->index(['nomor_coa']);
|
||||
$table->index(['cost_center']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('bucoks');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
* Menambahkan kolom nomor_tiket ke tabel persetujuan_penawaran
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('persetujuan_penawaran', function (Blueprint $table) {
|
||||
// Menambahkan kolom nomor_tiket setelah nomor_proposal_penawaran
|
||||
$table->string('nomor_tiket', 100)->nullable()->after('nomor_proposal_penawaran')
|
||||
->comment('Nomor tiket untuk tracking persetujuan penawaran');
|
||||
$table->string('nominal_kurang_bayar')->nullable()->after('nomor_proposal_penawaran');
|
||||
$table->string('bukti_ksl_kurang_bayar')->nullable()->after('nominal_kurang_bayar');
|
||||
|
||||
});
|
||||
|
||||
Schema::table('noc', function (Blueprint $table) {
|
||||
// Menambahkan kolom nomor_tiket setelah nomor_proposal_penawaran
|
||||
$table->string('nomor_tiket', 100)->nullable()->after('persetujuan_penawaran_id')
|
||||
->comment('Nomor tiket untuk tracking persetujuan penawaran');
|
||||
$table->string('nomor_rekening_lebih_bayar',20)->nullable()->after('nominal_lebih_bayar');
|
||||
$table->string('bukti_ksl_lebih_bayar')->nullable()->after('nomor_rekening_lebih_bayar');
|
||||
$table->string('bukti_ksl_kurang_bayar')->nullable()->after('bukti_ksl_lebih_bayar');
|
||||
$table->string('nominal_pelunasan')->nullable()->after('bukti_ksl_kurang_bayar');
|
||||
$table->string('debiture_id')->nullable()->after('persetujuan_penawaran_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
* Menghapus kolom nomor_tiket dari tabel persetujuan_penawaran
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('persetujuan_penawaran', function (Blueprint $table) {
|
||||
// Menghapus kolom nomor_tiket
|
||||
$table->dropColumn('nomor_tiket');
|
||||
$table->dropColumn('nominal_kurang_bayar');
|
||||
$table->dropColumn('bukti_ksl_kurang_bayar');
|
||||
});
|
||||
|
||||
Schema::table('noc', function (Blueprint $table) {
|
||||
// Menghapus kolom nomor_tiket
|
||||
$table->dropColumn('nomor_tiket');
|
||||
$table->dropColumn('nomor_rekening_lebih_bayar');
|
||||
$table->dropColumn('bukti_ksl_lebih_bayar');
|
||||
$table->dropColumn('bukti_ksl_kurang_bayar');
|
||||
$table->dropColumn('nominal_pelunasan');
|
||||
$table->dropColumn('debiture_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
267
module.json
267
module.json
@@ -115,6 +115,122 @@
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Rekap Harian So",
|
||||
"path": "rekap-harian-so",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"senior-officer"
|
||||
]
|
||||
}, {
|
||||
"title": "Laporan Biaya Lpj",
|
||||
"path": "laporan-biaya",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao",
|
||||
"pemohon-eo",
|
||||
"admin",
|
||||
"DD Appraisal",
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
],
|
||||
"sub": [
|
||||
{
|
||||
"title": "Intenal",
|
||||
"path": "laporan-biaya.internal",
|
||||
"icon": "ki-filled ki-two-credit-cart text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao",
|
||||
"pemohon-eo",
|
||||
"admin",
|
||||
"DD Appraisal",
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "External",
|
||||
"path": "laporan-biaya.external",
|
||||
"icon": "ki-filled ki-two-credit-cart text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao",
|
||||
"pemohon-eo",
|
||||
"admin",
|
||||
"DD Appraisal",
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
}
|
||||
]
|
||||
},{
|
||||
"title": "Laporan Debitur",
|
||||
"path": "laporan-debiture",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Laporan User",
|
||||
"path": "laporan-user",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Laporan Monitoring so",
|
||||
"path": "laporan-monitoring",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Laporan SLA Penilai",
|
||||
"path": "laporan-sla-penilai",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao",
|
||||
"pemohon-eo",
|
||||
"admin",
|
||||
"DD Appraisal",
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
}
|
||||
],
|
||||
"otorisator": [
|
||||
@@ -263,15 +379,103 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "NOC",
|
||||
"path": "noc",
|
||||
"icon": "ki-filled ki-two-credit-cart text-lg text-primary",
|
||||
"title": "Pembayaran",
|
||||
"path": "pembayaran",
|
||||
"icon": "ki-filled ki-credit-cart text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao"
|
||||
],
|
||||
"sub": [
|
||||
{
|
||||
"title": "Pembayaran",
|
||||
"path": "pembayaran",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Kurang Bayar",
|
||||
"path": "pembayaran.kurang",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Lebih Bayar",
|
||||
"path": "pembayaran.lebih",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "NOC",
|
||||
"path": "noc",
|
||||
"icon": "ki-filled ki-briefcase text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"admin",
|
||||
"noc"
|
||||
],
|
||||
"sub": [
|
||||
{
|
||||
"title": "Pembukuan",
|
||||
"path": "noc.pembayaran",
|
||||
"icon": "ki-filled ki-two-credit-cart text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"noc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Penyelesaian",
|
||||
"path": "noc.penyelesaian",
|
||||
"icon": "ki-filled ki-two-credit-cart text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"admin",
|
||||
"noc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Bucok",
|
||||
"path": "bucok",
|
||||
"icon": "ki-filled ki-two-credit-cart text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"admin",
|
||||
"noc"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -358,18 +562,6 @@
|
||||
"admin"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Pembayaran",
|
||||
"path": "pembayaran",
|
||||
"icon": "ki-filled ki-credit-cart text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Data Debitur",
|
||||
"path": "debitur",
|
||||
@@ -465,6 +657,40 @@
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Daftar Pustaka",
|
||||
"path": "daftar-pustaka",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao",
|
||||
"pemohon-eo",
|
||||
"admin",
|
||||
"DD Appraisal",
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Memo Penyelesaian",
|
||||
"path": "memo",
|
||||
"icon": "ki-filled ki-document text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao",
|
||||
"pemohon-eo",
|
||||
"admin",
|
||||
"DD Appraisal",
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
}
|
||||
],
|
||||
"master": [
|
||||
@@ -1007,6 +1233,17 @@
|
||||
"administrator",
|
||||
"admin"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Kategori Daftar Pustaka",
|
||||
"path": "category-daftar-pustaka",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -261,37 +261,67 @@
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
const status = data.status; // Anggap status berada di dalam objek data
|
||||
const dokumenjaminan = data.dokumenjaminan || [];
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
const status = data.status; // Anggap status berada di dalam objek data
|
||||
const dokumenjaminan = data.dokumenjaminan || [];
|
||||
|
||||
return `
|
||||
return `
|
||||
<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="activity/${data.id}/show" title="Lihat Detail">
|
||||
<a class="btn btn-sm btn-icon ${status === 'freeze' ? 'btn-light' : 'btn-warning btn-clear'}" href="activity/${data.id}/show" title="Lihat Detail">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
${
|
||||
['survey', 'done', 'proses-laporan', 'laporan', 'paparan'].includes(status) ?
|
||||
dokumenjaminan.map(dokumen => {
|
||||
return `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="surveyor/print-out-inspeksi/${data.id}/${dokumen.id}/${dokumen.jenis_jaminan_id}" title="Print Inspeksi Permohonan">
|
||||
<i class="ki-outline ki-printer"></i>
|
||||
</a>
|
||||
`;
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="surveyor/print-out-inspeksi/${data.id}/${dokumen.id}/${dokumen.jenis_jaminan_id}" title="Print Inspeksi Permohonan">
|
||||
<i class="ki-outline ki-printer"></i>
|
||||
</a>
|
||||
`;
|
||||
}).join('') : ''
|
||||
}
|
||||
</div>
|
||||
`;
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
function highlightFreezeRows() {
|
||||
const table = document.querySelector('#permohonan-table table[data-datatable-table="true"]');
|
||||
if (!table) return;
|
||||
|
||||
const rows = table.querySelectorAll('tbody tr');
|
||||
|
||||
rows.forEach(row => {
|
||||
const statusCell = row.cells[7];
|
||||
if (!statusCell) return;
|
||||
|
||||
const statusText = statusCell.textContent.trim().toLowerCase();
|
||||
|
||||
if (statusText === 'freeze') {
|
||||
row.classList.add('bg-red-400', 'text-white');
|
||||
} else {
|
||||
row.classList.remove('bg-red-400', 'text-white');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Polling setiap 1 detik untuk sementara
|
||||
setInterval(() => {
|
||||
highlightFreezeRows();
|
||||
}, 500);
|
||||
|
||||
|
||||
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
342
resources/views/bucok/index.blade.php
Normal file
342
resources/views/bucok/index.blade.php
Normal file
@@ -0,0 +1,342 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('bucok') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="bucok-table" data-api-url="{{ route('bucok.datatables') }}">
|
||||
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Data Bucok
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<i class="ki-filled ki-magnifier"></i>
|
||||
<input placeholder="Search Bucok" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
|
||||
<!-- Filter Tahun -->
|
||||
<select class="select select-sm" id="year-filter">
|
||||
<option value="">Semua Tahun</option>
|
||||
@for($year = date('Y'); $year >= 2020; $year--)
|
||||
<option value="{{ $year }}">{{ $year }}</option>
|
||||
@endfor
|
||||
</select>
|
||||
|
||||
<!-- Filter Bulan -->
|
||||
<select class="select select-sm" id="month-filter">
|
||||
<option value="">Semua Bulan</option>
|
||||
@for($month = 1; $month <= 12; $month++)
|
||||
<option value="{{ $month }}">{{ DateTime::createFromFormat('!m', $month)->format('F') }}</option>
|
||||
@endfor
|
||||
</select>
|
||||
|
||||
<!-- Filter Status Penyelesaian -->
|
||||
<select class="select select-sm" id="completion-status-filter">
|
||||
<option value="">Semua Status</option>
|
||||
<option value="1">Selesai</option>
|
||||
<option value="0">Belum Selesai</option>
|
||||
</select>
|
||||
|
||||
<!-- Import Excel -->
|
||||
<button class="btn btn-sm btn-success" data-modal-toggle="#import-modal">
|
||||
<i class="ki-filled ki-file-up"></i> Import Excel
|
||||
</button>
|
||||
|
||||
<a class="btn btn-sm btn-light" href="#" id="export-excel">
|
||||
<i class="ki-filled ki-file-down"></i> Export Excel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[80px]" data-datatable-column="no">
|
||||
<span class="sort">
|
||||
<span class="sort-label">No</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[100px]" data-datatable-column="tanggal">
|
||||
<span class="sort">
|
||||
<span class="sort-label">Tanggal</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[120px]" data-datatable-column="nomor_tiket">
|
||||
<span class="sort">
|
||||
<span class="sort-label">Nomor Tiket</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[100px]" data-datatable-column="nomor_coa">
|
||||
<span class="sort">
|
||||
<span class="sort-label">Nomor COA</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_coa">
|
||||
<span class="sort">
|
||||
<span class="sort-label">Nama COA</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[200px]" data-datatable-column="deskripsi">
|
||||
<span class="sort">
|
||||
<span class="sort-label">Deskripsi</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[120px]" data-datatable-column="nominal">
|
||||
<span class="sort">
|
||||
<span class="sort-label">Nominal</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[100px]" data-datatable-column="cost_center">
|
||||
<span class="sort">
|
||||
<span class="sort-label">Cost Center</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[100px]" data-datatable-column="status_penyelesaian">
|
||||
<span class="sort">
|
||||
<span class="sort-label">Status</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||
<div class="flex gap-2 items-center">
|
||||
Show
|
||||
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex gap-4 items-center">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Import Excel -->
|
||||
<div class="modal" data-modal="true" id="import-modal">
|
||||
<div class="modal-content max-w-[500px] top-[15%]">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Import Data Bucok</h3>
|
||||
<button class="btn btn-sm btn-icon btn-light btn-clear shrink-0" data-modal-dismiss="true">
|
||||
<i class="ki-filled ki-cross"></i>
|
||||
</button>
|
||||
</div>
|
||||
<form action="{{ route('bucok.import') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<div class="flex flex-col gap-5">
|
||||
<div class="flex flex-col gap-2.5">
|
||||
<label class="text-gray-900 form-label">File Excel</label>
|
||||
<input type="file" name="file" class="file-input" accept=".xlsx,.xls,.csv" required>
|
||||
<div class="text-gray-600 text-2sm">
|
||||
Format yang didukung: .xlsx, .xls, .csv (Maksimal 10MB)
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-3 bg-yellow-100 rounded border border-yellow-300">
|
||||
<div class="text-sm text-yellow-800">
|
||||
<strong>Catatan:</strong>
|
||||
<ul class="mt-1 list-disc list-inside">
|
||||
<li>Data akan dimulai dari baris ke-5</li>
|
||||
<li>File Excel tidak perlu header</li>
|
||||
<li>Data akan di-update jika nomor tiket sudah ada</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="flex gap-4">
|
||||
<button type="button" class="btn btn-light" data-modal-dismiss="true">Batal</button>
|
||||
<button type="submit" class="btn btn-primary">Import</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
/**
|
||||
* Fungsi untuk menghapus data Bucok
|
||||
* @param {number} data - ID data yang akan dihapus
|
||||
*/
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: "Data yang dihapus tidak dapat dikembalikan!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, hapus!',
|
||||
cancelButtonText: 'Batal'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`bucok/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
Swal.fire('Terhapus!', 'Data Bucok berhasil dihapus.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
Swal.fire('Error!', error.responseJSON.message, 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
/**
|
||||
* Inisialisasi DataTable untuk Bucok menggunakan KTDataTable
|
||||
*/
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const element = document.querySelector('#bucok-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const yearFilter = document.getElementById('year-filter');
|
||||
const monthFilter = document.getElementById('month-filter');
|
||||
const completionStatusFilter = document.getElementById('completion-status-filter');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
|
||||
// Konfigurasi DataTable menggunakan KTDataTable
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 10,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
no: {
|
||||
title: 'No',
|
||||
},
|
||||
tanggal: {
|
||||
title: 'Tanggal',
|
||||
},
|
||||
nomor_tiket: {
|
||||
title: 'Nomor Tiket',
|
||||
},
|
||||
nomor_coa: {
|
||||
title: 'Nomor COA',
|
||||
},
|
||||
nama_coa: {
|
||||
title: 'Nama COA',
|
||||
},
|
||||
deskripsi: {
|
||||
title: 'Deskripsi',
|
||||
render: (item, data) => {
|
||||
const desc = data.deskripsi || '-';
|
||||
return desc.length > 50 ? desc.substring(0, 50) + '...' : desc;
|
||||
},
|
||||
},
|
||||
nominal: {
|
||||
title: 'Nominal',
|
||||
},
|
||||
cost_center: {
|
||||
title: 'Cost Center',
|
||||
},
|
||||
status_badge: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return data.status_badge || '-';
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
title: 'Aksi',
|
||||
render: (item, data) => {
|
||||
return data.actions || '';
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// Inisialisasi DataTable
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
dataTable.showSpinner();
|
||||
|
||||
// Fungsi pencarian
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
|
||||
// Filter berdasarkan tahun
|
||||
yearFilter.addEventListener('change', function() {
|
||||
const yearValue = this.value;
|
||||
// Implementasi filter tahun - perlu disesuaikan dengan API endpoint
|
||||
dataTable.setParam('year', yearValue);
|
||||
dataTable.reload();
|
||||
});
|
||||
|
||||
// Filter berdasarkan bulan
|
||||
monthFilter.addEventListener('change', function() {
|
||||
const monthValue = this.value;
|
||||
// Implementasi filter bulan - perlu disesuaikan dengan API endpoint
|
||||
dataTable.setParam('month', monthValue);
|
||||
dataTable.reload();
|
||||
});
|
||||
|
||||
// Filter berdasarkan status penyelesaian
|
||||
completionStatusFilter.addEventListener('change', function() {
|
||||
const statusValue = this.value;
|
||||
// Implementasi filter status - perlu disesuaikan dengan API endpoint
|
||||
dataTable.setParam('completion_status', statusValue);
|
||||
dataTable.reload();
|
||||
});
|
||||
|
||||
// Export Excel functionality
|
||||
document.getElementById('export-excel').addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Build export URL with current filters
|
||||
const params = new URLSearchParams();
|
||||
if (searchInput.value) params.append('search', searchInput.value);
|
||||
if (yearFilter.value) params.append('year', yearFilter.value);
|
||||
if (monthFilter.value) params.append('month', monthFilter.value);
|
||||
if (completionStatusFilter.value) params.append('completion_status', completionStatusFilter.value);
|
||||
|
||||
const exportUrl = '{{ route("bucok.export") }}?' + params.toString();
|
||||
window.open(exportUrl, '_blank');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
236
resources/views/bucok/show.blade.php
Normal file
236
resources/views/bucok/show.blade.php
Normal file
@@ -0,0 +1,236 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('bucok.show', $bucok) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid gap-5 lg:gap-7.5">
|
||||
<!-- Header Card -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Detail Bucok #{{ $bucok->nomor_tiket }}</h3>
|
||||
<div class="flex gap-2">
|
||||
<a href="{{ route('bucok.index') }}" class="btn btn-sm btn-light">
|
||||
<i class="ki-filled ki-left"></i> Kembali
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Detail Information -->
|
||||
<div class="grid gap-5 lg:grid-cols-2 lg:gap-7.5">
|
||||
<!-- Informasi Dasar -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Informasi Dasar</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="grid gap-5">
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">No</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->no ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Tanggal</div>
|
||||
<div class="text-gray-700 text-2sm">
|
||||
{{ $bucok->tanggal ? dateFormat($bucok->tanggal, true) : '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Bulan</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->bulan ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Tahun</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->tahun ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Nomor Tiket</div>
|
||||
<div class="font-medium text-gray-700 text-2sm">{{ $bucok->nomor_tiket }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Status Penyelesaian</div>
|
||||
<div class="text-2sm">{!! $bucok->status_badge !!}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Informasi COA -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Informasi COA</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="grid gap-5">
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Nomor COA</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->nomor_coa ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Nama COA</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->nama_coa ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Deskripsi</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->deskripsi ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Nominal</div>
|
||||
<div class="font-medium text-gray-700 text-2sm">{{ $bucok->nominal_formatted }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Informasi Organisasi -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Informasi Organisasi</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="grid gap-5 lg:grid-cols-3">
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Cost Center</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->cost_center ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Sub Direktorat</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->nama_sub_direktorat ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Direktorat/Cabang</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->nama_direktorat_cabang ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Informasi Penyelesaian -->
|
||||
@if ($bucok->tanggal_penyelesaian || $bucok->nominal_penyelesaian || $bucok->penyelesaian)
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Informasi Penyelesaian</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="grid gap-5 lg:grid-cols-2">
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Tanggal Penyelesaian</div>
|
||||
<div class="text-gray-700 text-2sm">
|
||||
{{ $bucok->tanggal_penyelesaian ? dateFormat($bucok->tanggal_penyelesaian, true) : '-' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Nominal Penyelesaian</div>
|
||||
<div class="font-medium text-gray-700 text-2sm">
|
||||
{{ $bucok->nominal_penyelesaian_formatted }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Penyelesaian</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->penyelesaian ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Umur Aging</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->umur_aging ?? '-' }} hari</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($bucok->keterangan_gantung)
|
||||
<div class="flex justify-between items-center py-2.5">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Keterangan Gantung</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->keterangan_gantung }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Informasi Audit -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Informasi Audit</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="grid gap-5 lg:grid-cols-2">
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Dibuat Oleh</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->creator?->name ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Tanggal Dibuat</div>
|
||||
<div class="text-gray-700 text-2sm">{{ dateFormat($bucok->created_at, true) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5 border-b border-gray-200">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Diperbarui Oleh</div>
|
||||
<div class="text-gray-700 text-2sm">{{ $bucok->updater?->name ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center py-2.5">
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="text-sm font-medium text-gray-900">Tanggal Diperbarui</div>
|
||||
<div class="text-gray-700 text-2sm">{{ dateFormat($bucok->updated_at, true) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
64
resources/views/category-daftar-pustaka/create.blade.php
Normal file
64
resources/views/category-daftar-pustaka/create.blade.php
Normal file
@@ -0,0 +1,64 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render(request()->route()->getName()) }} --}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<form
|
||||
action="{{ isset($category->id) ? route('category-daftar-pustaka.update', $category->id) : route('category-daftar-pustaka.store') }}"
|
||||
method="POST">
|
||||
@csrf
|
||||
@if (isset($category->id))
|
||||
@method('PUT')
|
||||
<input type="text" name="id" value="{{ $category->id }}" hidden class="hidden">
|
||||
@endif
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Tambah
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('category-daftar-pustaka.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
||||
name="code" value="{{ $category->code ?? old('code') }}"
|
||||
{{ isset($category->id) ? 'readonly' : '' }}>
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input input-file @error('name') border-danger bg-danger-light @enderror"
|
||||
type="text" name="name" value="{{ $category->name ?? old('name') }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
147
resources/views/category-daftar-pustaka/index.blade.php
Normal file
147
resources/views/category-daftar-pustaka/index.blade.php
Normal file
@@ -0,0 +1,147 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render('basicdata.jenis-aset') }} --}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="category-daftar-pustaka-table" data-api-url="{{ route('category-daftar-pustaka.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Kategori Daftar Pustaka
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Kategori Daftar Pustaka" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href=""> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('category-daftar-pustaka.create') }}"> Tambah Kategori </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Code </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Name </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`category-daftar-pustaka/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#category-daftar-pustaka-table ');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Code',
|
||||
},
|
||||
name: {
|
||||
title: 'Name',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="category-daftar-pustaka/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
113
resources/views/daftar-pustaka/create.blade.php
Normal file
113
resources/views/daftar-pustaka/create.blade.php
Normal file
@@ -0,0 +1,113 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render(request()->route()->getName()) }} --}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<form
|
||||
action="{{ isset($daftarPustaka->id) ? route('daftar-pustaka.update', $daftarPustaka->id) : route('daftar-pustaka.store') }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@if (isset($daftarPustaka->id))
|
||||
<input type="hidden" name="id" value="{{ $daftarPustaka->id }}">
|
||||
@method('PUT')
|
||||
@endif
|
||||
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($daftarPustaka->id) ? 'Edit' : 'Tambah' }} Daftar Pustaka
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('daftar-pustaka.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Judul
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('judul') border-danger bg-danger-light @enderror" type="text"
|
||||
name="judul" value="{{ $daftarPustaka->judul ?? old('judul') }}">
|
||||
@error('judul')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Upload File
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('attachment') border-danger bg-danger-light @enderror" type="file"
|
||||
name="attachment">
|
||||
@error('attachment')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@if (isset($daftarPustaka->attachment))
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
File
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
{{-- ambil nama file pathnya hilangkan --}}
|
||||
<a href="{{ asset($daftarPustaka->attachment) }}" class="badge badge-outline badge-md badge-info">{{ basename($daftarPustaka->attachment) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Kategori
|
||||
</label>
|
||||
|
||||
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="select tomselect w-full" name="category_id">
|
||||
<option value="">Pilih Kategori</option>
|
||||
@if (isset($categories))
|
||||
@foreach ($categories as $item)
|
||||
<option value="{{ $item->id }}"
|
||||
{{ old('category_id', $daftarPustaka->category_id ?? '') == $item->id ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('category_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Deskripsi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" class="textarea" id="" cols="30" rows="10">{{ $daftarPustaka->deskripsi ?? old('deskripsi') }}</textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ isset($daftarPustaka->id) ? 'Update' : 'Simpan' }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
296
resources/views/daftar-pustaka/index.blade.php
Normal file
296
resources/views/daftar-pustaka/index.blade.php
Normal file
@@ -0,0 +1,296 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render('basicdata.ijin_usaha') }} --}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<style>
|
||||
@media (max-width: 768px) {
|
||||
#previewContent {
|
||||
height: 400px;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="flex flex-col items-stretch gap-7">
|
||||
<div class="flex items-center gap-3 w-full">
|
||||
<div class="input w-full">
|
||||
<i class="ki-filled ki-magnifier">
|
||||
</i>
|
||||
<input id="search" placeholder="Search Daftar Pustaka, Judul" type="text">
|
||||
<span class="badge badge-outline -me-1.5">
|
||||
⌘ K
|
||||
</span>
|
||||
</div>
|
||||
<!--Filter-->
|
||||
<a class="btn btn-info" id="search_filter" onclick="filterSearch()">
|
||||
<i class="ki-filled ki-filter">
|
||||
</i>
|
||||
Filter
|
||||
</a>
|
||||
<a class="btn btn-light" id="reset_filter" onclick="resetFilter()">
|
||||
<i class="ki-filled ki-arrow-circle-left"></i>
|
||||
Reset Filter
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-5 justify-between mt-3">
|
||||
<h3 class="text-sm text-mono font-medium">
|
||||
page {{ $page }} of {{ $pageCount }} — {{ $limit }} items per page, total
|
||||
{{ $total }} items.
|
||||
</h3>
|
||||
<div class="flex gap-2.5">
|
||||
<select id="category_id" name="category_id" class="select tomselect w-[300px]" multiple>
|
||||
<option value="" selected disabled>Filter by Category</option>
|
||||
@foreach ($categories as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="flex toggle-group" data-kt-tabs="true" data-kt-tabs-initialized="true">
|
||||
<a class="btn btn-icon active selected" data-kt-tab-toggle="#daftar_pustaka_grid" onclick="showGrid()"
|
||||
href="javascript:void(0)">
|
||||
<i class="ki-filled ki-category"></i>
|
||||
</a>
|
||||
<a class="btn btn-icon" data-kt-tab-toggle="#daftar_pustaka_list" onclick="showList()"
|
||||
href="javascript:void(0)">
|
||||
<i class="ki-filled ki-row-horizontal"></i>
|
||||
</a>
|
||||
@if (auth()->user()->hasRole(['administrator', 'admin']))
|
||||
<a href="{{ route('daftar-pustaka.create') }}" class="btn btn-primary">
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
Tambah
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4 " id="daftar_pustaka_grid">
|
||||
@if (isset($daftar_pustaka))
|
||||
@foreach ($daftar_pustaka as $item)
|
||||
<div class="card border shadow-none ">
|
||||
<a class="show-pustaka h-[300px] bg-gray-200 w-full block" href="{{ route('daftar-pustaka.show', $item->id) }}"
|
||||
data-url="{{ $item->attachment }}">
|
||||
<div class="p-4 h-full w-full flex items-center justify-center overflow-hidden">
|
||||
<div class=" text-red-500 flex items-center justify-center rounded">
|
||||
<i class="ki-filled ki-document text-3xl"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="card-body">
|
||||
<a href="{{ route('daftar-pustaka.show', $item->id) }}">
|
||||
|
||||
<h3 class="text-md font-medium text-gray-900 hover:text-primary cursor-pointer">
|
||||
{{ $item->judul }}</h3>
|
||||
<p class="text-2sm text-gray-700">
|
||||
{{-- batasi panjang deskripsi 50 --}}
|
||||
{{ substr($item->deskripsi, 0, 50) }}
|
||||
</p>
|
||||
</a>
|
||||
<div class="flex justify-between items-center gap-2.5 mt-2">
|
||||
<p class="badge rounded-full badge-xs badge-outline badge-success text-xs text-gray-700">
|
||||
# {{ $item->category->name }}</p>
|
||||
|
||||
@auth
|
||||
@if (auth()->user()->hasRole(['administrator', 'admin']))
|
||||
<div>
|
||||
<a class="btn btn-xs btn-danger" onclick="deleteData({{ $item->id }})">
|
||||
<i class="ki-filled ki-trash">
|
||||
</i>
|
||||
Hapus
|
||||
</a>
|
||||
<a class="btn btn-xs btn-info"
|
||||
href="{{ route('daftar-pustaka.edit', $item->id) }}">
|
||||
<i class="ki-filled ki-pencil">
|
||||
</i>
|
||||
Edit
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
@endauth
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
<div class="grid grid-cols-1 gap-4 hidden" id="daftar_pustaka_list">
|
||||
@if (isset($daftar_pustaka))
|
||||
@foreach ($daftar_pustaka as $item)
|
||||
<div class="card">
|
||||
<div class="card-body flex items-center flex-wrap justify-between p-2 pe-5 gap-4.5">
|
||||
<div class="flex items-center gap-3.5">
|
||||
<div
|
||||
class="card bg-gray-200 flex items-center justify-center bg-accent/50 h-[70px] w-[90px] shadow-none">
|
||||
<a class="show-pustaka h-[90px] w-full block"
|
||||
href="{{ route('daftar-pustaka.show', $item->id) }}"
|
||||
data-url="{{ $item->attachment }}">
|
||||
<div class="p-4 h-full w-full flex items-center justify-center overflow-hidden">
|
||||
<div class=" text-red-500 flex items-center justify-center rounded">
|
||||
<i class="ki-filled ki-document text-3xl"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<a href="{{ route('daftar-pustaka.show', $item->id) }}">
|
||||
<div class="flex flex-col gap-2 cursor-pointer">
|
||||
<div class="flex items-center mt-1">
|
||||
<a class="hover:text-primary text-sm font-medium text-mono leading-5.5">
|
||||
{{ $item->judul }}
|
||||
</div>
|
||||
</a>
|
||||
<div class="flex items-center flex-wrap gap-3">
|
||||
<span class="kt-badge kt-badge-warning kt-badge-sm rounded-full gap-1">
|
||||
<span class="text-xs font-medium text-foreground">
|
||||
{{ substr($item->deskripsi, 0, 50) }}
|
||||
</span>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="flex items-center gap-1.5">
|
||||
<p class="badge rounded-full badge-sm badge-outline badge-success text-xs text-gray-700">
|
||||
# {{ $item->category->name }}</p>
|
||||
@auth
|
||||
@if (auth()->user()->hasRole(['administrator', 'admin']))
|
||||
<div>
|
||||
<a class="btn btn-sm btn-danger" onclick="deleteData({{ $item->id }})">
|
||||
<i class="ki-filled ki-trash">
|
||||
</i>
|
||||
Hapus
|
||||
</a>
|
||||
<a class="btn btn-sm btn-info"
|
||||
href="{{ route('daftar-pustaka.edit', $item->id) }}">
|
||||
<i class="ki-filled ki-pencil">
|
||||
</i>
|
||||
Edit
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
@endauth
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pagination flex gap-2 justify-center mt-5">
|
||||
@if ($daftar_pustaka->onFirstPage())
|
||||
<span class="btn disabled"><i class="ki-filled ki-black-left"></i></span>
|
||||
@else
|
||||
<a href="{{ $daftar_pustaka->previousPageUrl() }}" class="btn">
|
||||
<i class="ki-filled ki-black-left"></i>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@foreach ($daftar_pustaka->getUrlRange(1, $daftar_pustaka->lastPage()) as $page => $url)
|
||||
<a href="{{ $url }}" class="btn {{ $page == $daftar_pustaka->currentPage() ? 'active' : '' }}">
|
||||
{{ $page }}
|
||||
</a>
|
||||
@endforeach
|
||||
|
||||
@if ($daftar_pustaka->hasMorePages())
|
||||
<a href="{{ $daftar_pustaka->nextPageUrl() }}" class="btn">
|
||||
<i class="ki-filled ki-black-right"></i>
|
||||
</a>
|
||||
@else
|
||||
<span class="btn disabled"><i class="ki-filled ki-black-right"></i></span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`daftar-pustaka/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function showGrid() {
|
||||
document.getElementById("daftar_pustaka_grid").classList.remove("hidden");
|
||||
document.getElementById("daftar_pustaka_grid").classList.add("active");
|
||||
|
||||
document.getElementById("daftar_pustaka_list").classList.add("hidden");
|
||||
document.getElementById("daftar_pustaka_list").classList.remove("active");
|
||||
|
||||
// Update button active class
|
||||
document.querySelectorAll(".toggle-group a").forEach(btn => btn.classList.remove("selected", "active"));
|
||||
event.currentTarget.classList.add("selected", "active");
|
||||
}
|
||||
|
||||
function showList() {
|
||||
document.getElementById("daftar_pustaka_list").classList.remove("hidden");
|
||||
document.getElementById("daftar_pustaka_list").classList.add("active");
|
||||
|
||||
document.getElementById("daftar_pustaka_grid").classList.add("hidden");
|
||||
document.getElementById("daftar_pustaka_grid").classList.remove("active");
|
||||
|
||||
// Update button active class
|
||||
document.querySelectorAll(".toggle-group a").forEach(btn => btn.classList.remove("selected", "active"));
|
||||
event.currentTarget.classList.add("selected", "active");
|
||||
}
|
||||
|
||||
function filterSearch() {
|
||||
const search = document.getElementById('search')?.value || '';
|
||||
|
||||
const select = document.getElementById('category_id');
|
||||
const selectedCategories = Array.from(select.selectedOptions).map(option => option.value);
|
||||
|
||||
const categoryParam = selectedCategories.join(',');
|
||||
|
||||
const url = "{{ route('daftar-pustaka.index') }}?search=" + encodeURIComponent(search) + "&category=" +
|
||||
encodeURIComponent(categoryParam);
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
|
||||
function resetFilter() {
|
||||
const url = "{{ route('daftar-pustaka.index') }}";
|
||||
window.location.href = url;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
96
resources/views/daftar-pustaka/show.blade.php
Normal file
96
resources/views/daftar-pustaka/show.blade.php
Normal file
@@ -0,0 +1,96 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render(request()->route()->getName()) }} --}}
|
||||
@endsection
|
||||
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<form
|
||||
action="{{ isset($daftarPustaka->id) ? route('daftar-pustaka.update', $daftarPustaka->id) : route('daftar-pustaka.store') }}"
|
||||
method="POST">
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ $daftarPustaka->judul ?? '' }}
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('daftar-pustaka.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class=" min-w-3xl">
|
||||
<div class="p-4 h-full flex flex-col">
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<a href="{{ asset('storage/' . $daftarPustaka->attachment)}}" class="btn btn-primary btn-sm">
|
||||
<i class="ki-duotone ki-cloud-download me-1"><span class="path1"></span><span
|
||||
class="path2"></span></i>
|
||||
Download File
|
||||
</a>
|
||||
</div>
|
||||
@php
|
||||
|
||||
$fileExtension = pathinfo($daftarPustaka->attachment, PATHINFO_EXTENSION);
|
||||
// cek extension
|
||||
$isPdf = $fileExtension == 'pdf';
|
||||
$imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp'];
|
||||
$isImage = in_array(strtolower($fileExtension), $imageExtensions);
|
||||
$fileUrl = asset('storage/' . $daftarPustaka->attachment);
|
||||
@endphp
|
||||
|
||||
@if ($isPdf)
|
||||
<iframe src="{{$fileUrl}}"
|
||||
width="100%" height="600px" frameborder="0"></iframe>
|
||||
@elseif ($isImage)
|
||||
<img src="{{ $fileUrl }}" class="w-full object-contain rounded" />
|
||||
@else
|
||||
<p class="text-red-500">File tidak bisa ditampilkan, silakan <a href="{{ $fileUrl }}"
|
||||
class="text-blue-500 underline" download>unduh di sini</a>.</p>
|
||||
@endif
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="border border-t">
|
||||
</div>
|
||||
<div>
|
||||
{{ $daftarPustaka->deskripsi ?? '' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
{{-- @push('scripts')
|
||||
<script src="{{ asset('vendor/pdfobject.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let url = @json($daftarPustaka->attachment);
|
||||
console.log(url);
|
||||
|
||||
const fileExtension = url.split('.').pop().toLowerCase();
|
||||
const previewContent = document.getElementById('previewContent');
|
||||
|
||||
if (['pdf'].includes(fileExtension)) {
|
||||
if (window.innerWidth < 768) {
|
||||
document.getElementById('pdfFrame').style.display = 'block';
|
||||
document.getElementById('pdfFrame').src = urlStorage;
|
||||
} else {
|
||||
PDFObject.embed(urlStorage, "#previewContent");
|
||||
}
|
||||
} else if (['jpg', 'jpeg', 'png', 'gif'].includes(fileExtension)) {
|
||||
previewContent.innerHTML =
|
||||
`<img src="${url}" alt="Preview" class="max-w-full max-h-full object-contain">`;
|
||||
} else {
|
||||
previewContent.innerHTML = '<p class="text-center">Unsupported file type</p>';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush --}}
|
||||
293
resources/views/dashboard/index.blade.php
Normal file
293
resources/views/dashboard/index.blade.php
Normal file
@@ -0,0 +1,293 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-6 mx-auto">
|
||||
<!-- Header Section -->
|
||||
<div class="flex flex-wrap items-center lg:items-end justify-between gap-5 pb-8">
|
||||
<div class="flex flex-col justify-center gap-3">
|
||||
<h1 class="text-2xl font-bold leading-none text-gray-800">
|
||||
Dashboard
|
||||
</h1>
|
||||
<div class="flex items-center gap-2 text-sm font-medium text-gray-600">
|
||||
<i class="ki-filled ki-clipboard"></i>
|
||||
Selamat datang, <span class="text-primary font-semibold">{{ auth()->user()->name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-3 w-[30%]">
|
||||
<div class="flex items-center gap-2 w-full">
|
||||
<input type="date" class="input" name="start_date" id="start_date">
|
||||
<input type="date" class="input" name="end_date" id="end_date">
|
||||
</div>
|
||||
<button class="btn btn-primary" id="filter" type="button" onclick="filterDashboard()">
|
||||
<i class="ki-outline ki-filter fs-2 me-1"></i>
|
||||
Filter</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Stats Cards -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
|
||||
@foreach ($dashboard['count_resume'] as $status => $count)
|
||||
@php
|
||||
|
||||
$gradientFrom = $status === 'batal' ? 'from-red-50' : 'from-amber-50';
|
||||
$gradientTo = $status === 'batal' ? 'to-red-100' : 'to-amber-100';
|
||||
$borderColor = $status === 'batal' ? 'border-red-200' : 'border-amber-200';
|
||||
$iconBg = $status === 'batal' ? 'bg-red-500' : 'bg-amber-500';
|
||||
$iconColor = $status === 'batal' ? 'text-red-500' : 'text-amber-500';
|
||||
$textColor = $status === 'batal' ? 'text-red-800' : 'text-amber-800';
|
||||
$cardTitle = $status === 'batal' ? 'Batal dari Cabang' : 'Menunggu Keputusan Cabang';
|
||||
@endphp
|
||||
|
||||
<div class="card bg-gradient-to-br {{ $gradientFrom }} {{ $gradientTo }} {{ $borderColor }}">
|
||||
<div class="card-header border-b {{ $borderColor }}">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-10 h-10 {{ $iconBg }} rounded-lg flex items-center justify-center">
|
||||
<i
|
||||
class="ki-filled {{ $status === 'batal' ? 'ki-cross-circle text-white' : 'ki-time text-white' }}"></i>
|
||||
</div>
|
||||
<h3 class="card-title {{ $textColor }} font-semibold">{{ $cardTitle }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div
|
||||
class="bg-white rounded-xl p-4 shadow-sm border {{ $borderColor }} hover:shadow-md transition-shadow">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h4 class="text-sm font-semibold text-gray-700 mb-1">Jabodetabek</h4>
|
||||
<span
|
||||
class="text-2xl font-bold {{ $status === 'batal' ? 'text-red-600' : 'text-amber-600' }}">
|
||||
{{ $count['jabodetabek']['count_report'] ?? 0 }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="w-8 h-8 {{ $gradientFrom }} rounded-full flex items-center justify-center">
|
||||
<i class="ki-filled {{ $iconColor }}"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="bg-white rounded-xl p-4 shadow-sm border {{ $borderColor }} hover:shadow-md transition-shadow">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h4 class="text-sm font-semibold text-gray-700 mb-1">Luar Jabodetabek</h4>
|
||||
<span
|
||||
class="text-2xl font-bold {{ $status === 'batal' ? 'text-red-600' : 'text-amber-600' }}">
|
||||
{{ $count['non-jabodetabek']['count_report'] ?? 0 }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="w-8 h-8 {{ $gradientFrom }} rounded-full flex items-center justify-center">
|
||||
<i class="ki-filled {{ $iconColor }}"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
<!-- Chart Section -->
|
||||
<div class="card ">
|
||||
<div class="card-header border-b border-blue-200">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-blue-500 rounded-lg flex items-center justify-center">
|
||||
<i class="ki-filled ki-chart-simple-2 text-white"></i>
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-blue-800">Pendapatan Appraisal</h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="bg-white rounded-xl p-4 shadow-sm">
|
||||
<table class="table table-auto w-full">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th
|
||||
class="px-4 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||
Bulan
|
||||
</th>
|
||||
<th
|
||||
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||
Jumlah
|
||||
</th>
|
||||
<th
|
||||
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider">
|
||||
Akumulasi
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200">
|
||||
@foreach ($dashboard['count_pendapatan'] as $month => $data)
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<!-- Kolom Nama month -->
|
||||
<td class="px-4 py-3 text-sm font-medium text-gray-900 border-r border-gray-200">
|
||||
{{ ucfirst($month) }}
|
||||
</td>
|
||||
|
||||
<!-- Kolom Total Laporan -->
|
||||
<td class="px-4 py-3 text-sm text-gray-700 text-center border-r border-gray-200">
|
||||
{{ $data['total_jumlah'] ?? '-' }}
|
||||
</td>
|
||||
|
||||
<!-- Kolom Total Debitur -->
|
||||
<td class="px-4 py-3 text-sm text-gray-700 text-center border-r border-gray-200">
|
||||
{{ $data['total_akumulasi'] ?? '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<!-- Add more rows as needed -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tables Section -->
|
||||
<div class="flex w-full gap-6">
|
||||
<!-- Laporan Internal -->
|
||||
<div class="card w-[60%] ">
|
||||
<div class="card-header border-b border-green-200">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-green-500 rounded-lg flex items-center justify-center">
|
||||
<i class="ki-filled ki-document text-white"></i>
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-green-800">Laporan Internal</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="bg-white rounded-xl overflow-hidden shadow-sm">
|
||||
<table class="table table-auto w-full">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th rowspan="2"
|
||||
class="px-4 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||
Bulan
|
||||
</th>
|
||||
<th colspan="2"
|
||||
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||
Jabodetabek
|
||||
</th>
|
||||
<th colspan="2"
|
||||
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider">
|
||||
Luar Jabodetabek
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="border-t border-gray-200">
|
||||
<th
|
||||
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||
Laporan
|
||||
</th>
|
||||
<th
|
||||
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||
Debitur
|
||||
</th>
|
||||
<th
|
||||
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||
Laporan
|
||||
</th>
|
||||
<th
|
||||
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider">
|
||||
Debitur
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200">
|
||||
@foreach ($dashboard['count_lpj_internal'] as $month => $regions)
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-4 py-2 text-sm font-medium text-gray-900">
|
||||
{{ ucfirst($month) }}
|
||||
</td>
|
||||
<td class="px-4 py-2 text-sm text-center text-gray-700">
|
||||
{{ $regions['jabodetabek']['total_laporan'] ?? '-' }}
|
||||
</td>
|
||||
<td class="px-4 py-2 text-sm text-center text-gray-700">
|
||||
{{ $regions['jabodetabek']['total_debiture'] ?? '-' }}
|
||||
</td>
|
||||
<td class="px-4 py-2 text-sm text-center text-gray-700">
|
||||
{{ $regions['non-jabodetabek']['total_laporan'] ?? '-' }}
|
||||
</td>
|
||||
<td class="px-4 py-2 text-sm text-center text-gray-700">
|
||||
{{ $regions['non-jabodetabek']['total_debiture'] ?? '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<!-- Add more rows as needed -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Laporan Eksternal -->
|
||||
<div class="card w-[40%]">
|
||||
<div class="card-header border-b border-purple-200">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-10 h-10 bg-purple-500 rounded-lg flex items-center justify-center">
|
||||
<i class="ki-filled ki-tab-tablet text-white"></i>
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-purple-800">Laporan Eksternal</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="bg-white rounded-xl overflow-hidden shadow-sm">
|
||||
<table class="table table-auto w-full">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th
|
||||
class="px-4 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||
Bulan
|
||||
</th>
|
||||
<th
|
||||
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||
Laporan
|
||||
</th>
|
||||
<th
|
||||
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider">
|
||||
Debitur
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200">
|
||||
@foreach ($dashboard['count_lpj_eksternal'] as $month => $data)
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<!-- Kolom Nama month -->
|
||||
<td class="px-4 py-3 text-sm font-medium text-gray-900 border-r border-gray-200">
|
||||
{{ ucfirst($month) }}
|
||||
</td>
|
||||
|
||||
<!-- Kolom Total Laporan -->
|
||||
<td class="px-4 py-3 text-sm text-gray-700 text-center border-r border-gray-200">
|
||||
{{ $data['total_laporan'] ?? '-' }}
|
||||
</td>
|
||||
|
||||
<!-- Kolom Total Debitur -->
|
||||
<td class="px-4 py-3 text-sm text-gray-700 text-center border-r border-gray-200">
|
||||
{{ $data['total_debiture'] ?? '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<!-- Add more rows as needed -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Chart.js CDN -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>
|
||||
|
||||
<script>
|
||||
function filterDashboard() {
|
||||
const start_date = document.getElementById('start_date').value;
|
||||
const end_date = document.getElementById('end_date').value;
|
||||
window.location.href = `?start_date=${start_date}&end_date=${end_date}`;
|
||||
}
|
||||
</script>
|
||||
<!-- Chart initialization script -->
|
||||
|
||||
@endsection
|
||||
310
resources/views/laporan-biaya/external.blade.php
Normal file
310
resources/views/laporan-biaya/external.blade.php
Normal file
@@ -0,0 +1,310 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-hasil-penilaian-jaminan-internal-external') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<!-- Filter Card -->
|
||||
<div class="card border border-agi-100">
|
||||
<div class="card-header bg-agi-50 py-5">
|
||||
<h3 class="card-title">Filter Laporan</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-4">
|
||||
<!-- Search field at the top, full width -->
|
||||
<div class="flex flex-col w-full">
|
||||
<label class="text-sm font-medium mb-1">Pencarian</label>
|
||||
<label class="input input-sm">
|
||||
<i class="ki-filled ki-magnifier"></i>
|
||||
<input placeholder="Search Laporan Hasil Penilaian Jaminan Internal & External" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Other filter fields in grid layout -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Awal</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Akhir</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Cabang</label>
|
||||
<select class="select tomselect" id="branch_filter">
|
||||
<option value="">Semua Cabang</option>
|
||||
@foreach(\Modules\Basicdata\Models\Branch::where('status', 1)->get() as $branch)
|
||||
<option value="{{ $branch->id }}">{{ $branch->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Buttons row at the bottom -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-2">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">
|
||||
<i class="ki-outline ki-filter fs-2 me-1"></i>
|
||||
Terapkan Filter
|
||||
</button>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-hasil-penilaian-jaminan-internal-external.export') }}" id="export-btn">
|
||||
<i class="ki-outline ki-file-down fs-2 me-1"></i>
|
||||
Export to Excel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Data Table Card -->
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-hasil-penilaian-jaminan-internal-external-table" data-api-url="{{ route('laporan-hasil-penilaian-jaminan-internal-external.data') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Rekap Penyelesaian External
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="pemohon">
|
||||
<span class="sort"> <span class="sort-label"> Nomor KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cif">
|
||||
<span class="sort"> <span class="sort-label"> Nominal KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_penilaian">
|
||||
<span class="sort"> <span class="sort-label">Tanggal Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Nominal Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_fasilitas_kredit">
|
||||
<span class="sort"> <span class="sort-label"> No. Rekening (Tujuan Akhir) </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_fasilitas_kredit">
|
||||
<span class="sort"> <span class="sort-label"> Sisa KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Memo </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="alamat_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Status</span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="catatan">
|
||||
<span class="sort"> <span class="sort-label"> Catatan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-hasil-penilaian-jaminan-internal-external-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const startDateInput = document.getElementById('start_date');
|
||||
const endDateInput = document.getElementById('end_date');
|
||||
const branchFilter = document.getElementById('branch_filter');
|
||||
const penilaiFilter = document.getElementById('penilai_filter');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const exportBtn = document.getElementById('export-btn');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
branch: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
name: {
|
||||
title: 'Nama Debitur',
|
||||
},
|
||||
tanggal_ksl: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_permohonan ? window.formatTanggalIndonesia(data.tanggal_permohonan) : '-';
|
||||
},
|
||||
},
|
||||
nomor_ksl: {
|
||||
title: 'CIF',
|
||||
},
|
||||
nominal_ksl: {
|
||||
title: 'Jenis Penilaian',
|
||||
},
|
||||
tanggal_penyelesaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
},
|
||||
nominal_penyelesaian: {
|
||||
title: 'Jenis Fasilitas Kredit',
|
||||
},
|
||||
nomor_rekening: {
|
||||
title: 'Nomor Rekening',
|
||||
},
|
||||
sisa_ksl: {
|
||||
title: 'Jenis Agunan',
|
||||
},
|
||||
memo: {
|
||||
title: 'Memo',
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
},
|
||||
catatan: {
|
||||
title: 'Catatan',
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const startDate = startDateInput.value;
|
||||
const endDate = endDateInput.value;
|
||||
const branch = branchFilter.value;
|
||||
const penilai = penilaiFilter.value;
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
filters.start_date = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
filters.end_date = endDate;
|
||||
}
|
||||
|
||||
if (branch) {
|
||||
filters.branch_id = branch;
|
||||
}
|
||||
|
||||
if (penilai) {
|
||||
filters.penilai_id = penilai;
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Update export URL with filters
|
||||
function updateExportUrl() {
|
||||
dataTable.goPage(1);
|
||||
let url = new URL(exportBtn.href);
|
||||
|
||||
if (startDateInput.value) {
|
||||
url.searchParams.set('start_date', startDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('start_date');
|
||||
}
|
||||
|
||||
if (endDateInput.value) {
|
||||
url.searchParams.set('end_date', endDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('end_date');
|
||||
}
|
||||
|
||||
if (branchFilter.value) {
|
||||
url.searchParams.set('branch_id', branchFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('branch_id');
|
||||
}
|
||||
|
||||
if (penilaiFilter.value) {
|
||||
url.searchParams.set('penilai_id', penilaiFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('penilai_id');
|
||||
}
|
||||
|
||||
if (searchInput.value) {
|
||||
url.searchParams.set('search', searchInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('search');
|
||||
}
|
||||
|
||||
exportBtn.href = url.toString();
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
filterTanggalButton.addEventListener('click', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
// Initial update of export URL
|
||||
updateExportUrl();
|
||||
</script>
|
||||
@endpush
|
||||
304
resources/views/laporan-biaya/internal.blade.php
Normal file
304
resources/views/laporan-biaya/internal.blade.php
Normal file
@@ -0,0 +1,304 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-hasil-penilaian-jaminan-internal-external') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">S
|
||||
<!-- Filter Card -->
|
||||
<div class="card border border-agi-100">
|
||||
<div class="card-header bg-agi-50 py-5">
|
||||
<h3 class="card-title">Filter Laporan</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-4">
|
||||
<!-- Search field at the top, full width -->
|
||||
<div class="flex flex-col w-full">
|
||||
<label class="text-sm font-medium mb-1">Pencarian</label>
|
||||
<label class="input input-sm">
|
||||
<i class="ki-filled ki-magnifier"></i>
|
||||
<input placeholder="Search Laporan Hasil Penilaian Jaminan Internal & External" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Other filter fields in grid layout -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Awal</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Akhir</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Cabang</label>
|
||||
<select class="select tomselect" id="branch_filter">
|
||||
<option value="">Semua Cabang</option>
|
||||
@foreach(\Modules\Basicdata\Models\Branch::where('status', 1)->get() as $branch)
|
||||
<option value="{{ $branch->id }}">{{ $branch->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Buttons row at the bottom -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-2">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">
|
||||
<i class="ki-outline ki-filter fs-2 me-1"></i>
|
||||
Terapkan Filter
|
||||
</button>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-hasil-penilaian-jaminan-internal-external.export') }}" id="export-btn">
|
||||
<i class="ki-outline ki-file-down fs-2 me-1"></i>
|
||||
Export to Excel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Data Table Card -->
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-hasil-penilaian-jaminan-internal-external-table" data-api-url="{{ route('laporan-hasil-penilaian-jaminan-internal-external.data') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Rekap Penyelesaian Internal
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="pemohon">
|
||||
<span class="sort"> <span class="sort-label"> Nomor KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cif">
|
||||
<span class="sort"> <span class="sort-label"> Nominal KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_penilaian">
|
||||
<span class="sort"> <span class="sort-label">Tanggal Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Nominal Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_fasilitas_kredit">
|
||||
<span class="sort"> <span class="sort-label"> Sisa KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Memo </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="alamat_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Status</span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="catatan">
|
||||
<span class="sort"> <span class="sort-label"> Catatan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-hasil-penilaian-jaminan-internal-external-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const startDateInput = document.getElementById('start_date');
|
||||
const endDateInput = document.getElementById('end_date');
|
||||
const branchFilter = document.getElementById('branch_filter');
|
||||
const penilaiFilter = document.getElementById('penilai_filter');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const exportBtn = document.getElementById('export-btn');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
branch: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
name: {
|
||||
title: 'Nama Debitur',
|
||||
},
|
||||
tanggal_ksl: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_permohonan ? window.formatTanggalIndonesia(data.tanggal_permohonan) : '-';
|
||||
},
|
||||
},
|
||||
nomor_ksl: {
|
||||
title: 'CIF',
|
||||
},
|
||||
nominal_ksl: {
|
||||
title: 'Jenis Penilaian',
|
||||
},
|
||||
tanggal_penyelesaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
},
|
||||
nominal_penyelesaian: {
|
||||
title: 'Jenis Fasilitas Kredit',
|
||||
},
|
||||
sisa_ksl: {
|
||||
title: 'Jenis Agunan',
|
||||
},
|
||||
memo: {
|
||||
title: 'Memo',
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
},
|
||||
catatan: {
|
||||
title: 'Catatan',
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const startDate = startDateInput.value;
|
||||
const endDate = endDateInput.value;
|
||||
const branch = branchFilter.value;
|
||||
const penilai = penilaiFilter.value;
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
filters.start_date = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
filters.end_date = endDate;
|
||||
}
|
||||
|
||||
if (branch) {
|
||||
filters.branch_id = branch;
|
||||
}
|
||||
|
||||
if (penilai) {
|
||||
filters.penilai_id = penilai;
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Update export URL with filters
|
||||
function updateExportUrl() {
|
||||
dataTable.goPage(1);
|
||||
let url = new URL(exportBtn.href);
|
||||
|
||||
if (startDateInput.value) {
|
||||
url.searchParams.set('start_date', startDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('start_date');
|
||||
}
|
||||
|
||||
if (endDateInput.value) {
|
||||
url.searchParams.set('end_date', endDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('end_date');
|
||||
}
|
||||
|
||||
if (branchFilter.value) {
|
||||
url.searchParams.set('branch_id', branchFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('branch_id');
|
||||
}
|
||||
|
||||
if (penilaiFilter.value) {
|
||||
url.searchParams.set('penilai_id', penilaiFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('penilai_id');
|
||||
}
|
||||
|
||||
if (searchInput.value) {
|
||||
url.searchParams.set('search', searchInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('search');
|
||||
}
|
||||
|
||||
exportBtn.href = url.toString();
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
filterTanggalButton.addEventListener('click', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
// Initial update of export URL
|
||||
updateExportUrl();
|
||||
</script>
|
||||
@endpush
|
||||
480
resources/views/laporan-debiture/index.blade.php
Normal file
480
resources/views/laporan-debiture/index.blade.php
Normal file
@@ -0,0 +1,480 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-debiture') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<!-- Filter Card -->
|
||||
<div class="card border border-agi-100">
|
||||
<div class="card-header bg-agi-50 py-5">
|
||||
<h3 class="card-title">Filter Laporan Debiture</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-4">
|
||||
<!-- Search field at the top, full width -->
|
||||
<div class="flex flex-col w-full">
|
||||
<label class="text-sm font-medium mb-1">Pencarian</label>
|
||||
<label class="input input-sm">
|
||||
<i class="ki-filled ki-magnifier"></i>
|
||||
<input placeholder="Search Laporan Debiture " id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Other filter fields in grid layout -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Awal</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Akhir</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Debiture</label>
|
||||
<select class="select tomselect" id="debiture_id">
|
||||
<option value="">Semua Debiture</option>
|
||||
@if (isset($debiture))
|
||||
@foreach ($debiture as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Buttons row at the bottom -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-2">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">
|
||||
<i class="ki-outline ki-filter fs-2 me-1"></i>
|
||||
Terapkan Filter
|
||||
</button>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-hasil-penilaian-jaminan-internal-external.export') }}" id="export-btn">
|
||||
<i class="ki-outline ki-file-down fs-2 me-1"></i>
|
||||
Export to Excel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Data Table Card -->
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-debiture-table" data-api-url="{{ route('laporan-debiture.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Laporan Debiture
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="pemohon">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cif">
|
||||
<span class="sort"> <span class="sort-label"> CIF </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_fasilitas_kredit">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Fasilitas Kredit </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Agunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="alamat_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Alamat Agunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_kepemilikan">
|
||||
<span class="sort"> <span class="sort-label"> Bukti Kepemilikan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_pemilik">
|
||||
<span class="sort"> <span class="sort-label"> Nama Pemilik </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="luas_tanah">
|
||||
<span class="sort"> <span class="sort-label"> Luas Tanah </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_tanah">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Tanah </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="luas_bangunan">
|
||||
<span class="sort"> <span class="sort-label"> Luas Bangunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_bangunan">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Bangunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_njop">
|
||||
<span class="sort"> <span class="sort-label"> Nilai NJOP </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_pasar_wajar">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Pasar Wajar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_likuidasi">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Likuidasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_documen_diterima">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Dokumen Diterima </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_spk">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal SPK </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_spk">
|
||||
<span class="sort"> <span class="sort-label"> Nomor SPK </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_rencana_kunjunagn">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Rencana Kunjungan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_kunjungan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Kunjungan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="taggal_delivered">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Delivered </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jangka_waktu_sla">
|
||||
<span class="sort"> <span class="sort-label"> Jangka Waktu SLA </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_laporan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Laporan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_review">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Review </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_penilai">
|
||||
<span class="sort"> <span class="sort-label"> Nama Penilai </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_team_leader">
|
||||
<span class="sort"> <span class="sort-label"> Nama Team Leader </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="saran">
|
||||
<span class="sort"> <span class="sort-label"> Saran </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="catatan">
|
||||
<span class="sort"> <span class="sort-label"> Catatan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-debiture-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const startDateInput = document.getElementById('start_date');
|
||||
const endDateInput = document.getElementById('end_date');
|
||||
const debitureFilter = document.getElementById('debiture_id');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const exportBtn = document.getElementById('export-btn');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_permohonan ? window.formatTanggalIndonesia(data.tanggal_permohonan) : '-';
|
||||
},
|
||||
},
|
||||
branch: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
pemohon: {
|
||||
title: 'Pemohon',
|
||||
},
|
||||
cif: {
|
||||
title: 'CIF',
|
||||
},
|
||||
name: {
|
||||
title: 'Nama Debitur',
|
||||
},
|
||||
jenis_penilaian: {
|
||||
title: 'Jenis Penilaian',
|
||||
},
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
},
|
||||
jenis_fasilitas_kredit: {
|
||||
title: 'Jenis Fasilitas Kredit',
|
||||
},
|
||||
jenis_agunan: {
|
||||
title: 'Jenis Agunan',
|
||||
},
|
||||
alamat_agunan: {
|
||||
title: 'Alamat Agunan',
|
||||
},
|
||||
bukti_kepemilikan: {
|
||||
title: 'Bukti Kepemilikan',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_kepemilikan) {
|
||||
// Ganti karakter baris baru dengan tag <br> untuk HTML
|
||||
return data.bukti_kepemilikan.split('\n').join('<br>');
|
||||
}
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
nama_pemilik: {
|
||||
title: 'Nama Pemilik',
|
||||
},
|
||||
luas_tanah: {
|
||||
title: 'Luas Tanah',
|
||||
},
|
||||
nilai_tanah: {
|
||||
title: 'Nilai Tanah',
|
||||
render: (item, data) => {
|
||||
return data.nilai_tanah ?? '-';
|
||||
},
|
||||
},
|
||||
luas_bangunan: {
|
||||
title: 'Luas Bangunan',
|
||||
},
|
||||
nilai_bangunan: {
|
||||
title: 'Nilai Bangunan',
|
||||
render: (item, data) => {
|
||||
return data.nilai_bangunan ?? '-';
|
||||
},
|
||||
},
|
||||
nilai_njop: {
|
||||
title: 'Nilai NJOP',
|
||||
render: (item, data) => {
|
||||
return data.nilai_njop ?? '-';
|
||||
},
|
||||
},
|
||||
nilai_pasar_wajar: {
|
||||
title: 'Nilai Pasar Wajar',
|
||||
render: (item, data) => {
|
||||
return data.nilai_pasar_wajar ?? '-';
|
||||
},
|
||||
},
|
||||
nilai_likuidasi: {
|
||||
title: 'Nilai Likuidasi',
|
||||
render: (item, data) => {
|
||||
return data.nilai_likuidasi ?? '-';
|
||||
},
|
||||
},
|
||||
tanggal_documen_diterima: {
|
||||
title: 'Tanggal Dokumen Diterima',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_documen_diterima ? window.formatTanggalIndonesia(data.tanggal_documen_diterima) : '-';
|
||||
},
|
||||
},
|
||||
tanggal_spk: {
|
||||
title: 'Tanggal SPK',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_spk ? window.formatTanggalIndonesia(data.tanggal_spk) : '-';
|
||||
},
|
||||
},
|
||||
nomor_spk: {
|
||||
title: 'Nomor SPK',
|
||||
},
|
||||
tanggal_rencana_kunjunagn: {
|
||||
title: 'Tanggal Rencana Kunjungan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_rencana_kunjunagn ? window.formatTanggalIndonesia(data.tanggal_rencana_kunjunagn) : '-';
|
||||
},
|
||||
},
|
||||
tanggal_kunjungan: {
|
||||
title: 'Tanggal Kunjungan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_kunjungan ? window.formatTanggalIndonesia(data.tanggal_kunjungan) : '-';
|
||||
},
|
||||
},
|
||||
taggal_delivered: {
|
||||
title: 'Tanggal Delivered',
|
||||
render: (item, data) => {
|
||||
return data.taggal_delivered ? window.formatTanggalIndonesia(data.taggal_delivered) : '-';
|
||||
},
|
||||
},
|
||||
jangka_waktu_sla: {
|
||||
title: 'Jangka Waktu SLA',
|
||||
},
|
||||
tanggal_laporan: {
|
||||
title: 'Tanggal Laporan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_laporan ? window.formatTanggalIndonesia(data.tanggal_laporan) : '-';
|
||||
},
|
||||
},
|
||||
tanggal_review: {
|
||||
title: 'Tanggal Review',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_review ? window.formatTanggalIndonesia(data.tanggal_review) : '-';
|
||||
},
|
||||
},
|
||||
nama_penilai: {
|
||||
title: 'Nama Penilai',
|
||||
},
|
||||
nama_team_leader: {
|
||||
title: 'Nama Team Leader',
|
||||
},
|
||||
saran: {
|
||||
title: 'Saran',
|
||||
},
|
||||
catatan: {
|
||||
title: 'Catatan',
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const startDate = startDateInput.value;
|
||||
const endDate = endDateInput.value;
|
||||
const debiture = debitureFilter.value;
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
filters.start_date = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
filters.end_date = endDate;
|
||||
}
|
||||
|
||||
if (debiture) {
|
||||
filters.debiture_id = debiture;
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Update export URL with filters
|
||||
function updateExportUrl() {
|
||||
dataTable.goPage(1);
|
||||
let url = new URL(exportBtn.href);
|
||||
|
||||
if (startDateInput.value) {
|
||||
url.searchParams.set('start_date', startDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('start_date');
|
||||
}
|
||||
|
||||
if (endDateInput.value) {
|
||||
url.searchParams.set('end_date', endDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('end_date');
|
||||
}
|
||||
|
||||
if (debitureFilter.value) {
|
||||
url.searchParams.set('debiture_id', debitureFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('debiture_id');
|
||||
}
|
||||
|
||||
if (searchInput.value) {
|
||||
url.searchParams.set('search', searchInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('search');
|
||||
}
|
||||
|
||||
exportBtn.href = url.toString();
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
filterTanggalButton.addEventListener('click', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
// Initial update of export URL
|
||||
updateExportUrl();
|
||||
</script>
|
||||
@endpush
|
||||
89
resources/views/laporan-monitoring/index.blade.php
Normal file
89
resources/views/laporan-monitoring/index.blade.php
Normal file
@@ -0,0 +1,89 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-monitoring') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<!-- Filter Card -->
|
||||
|
||||
<!-- Data Table Card -->
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="laporan-hasil-penilaian-jaminan-internal-external-table"
|
||||
data-api-url="{{ route('laporan-hasil-penilaian-jaminan-internal-external.data') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Rekap Progres Pengerjaan Laporan Penilai
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_penilai">
|
||||
<span class="sort"> <span class="sort-label"> Nama Penilai </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="total_task">
|
||||
<span class="sort"> <span class="sort-label"> Total Task </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="actions">
|
||||
<span class="sort"> <span class="sort-label"> Aksi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@php
|
||||
$sortedTeamsActivity = $result['teamsActivity']->sortBy(function ($item) {
|
||||
return $item->team->regions->penilaiTeam
|
||||
->filter(function ($penilaiTeam) {
|
||||
$permohonan = optional($penilaiTeam->penilaian)->permohonan;
|
||||
return $permohonan !== null;
|
||||
})
|
||||
->count();
|
||||
});
|
||||
@endphp
|
||||
<tbody>
|
||||
@foreach ($sortedTeamsActivity as $teamActivity)
|
||||
@php
|
||||
$totalTask = countPermohonanForUser($teamActivity->user->id);
|
||||
@endphp
|
||||
<tr>
|
||||
<td class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</td>
|
||||
<td class="min-w-[150px]">
|
||||
{{ $teamActivity->user->name }}
|
||||
</td>
|
||||
<td class="min-w-[150px]">
|
||||
{{ $totalTask }}
|
||||
</td>
|
||||
|
||||
<td class="min-w-[150px]">
|
||||
<a href="{{ route('laporan-monitoring.show', $teamActivity->user->id) }}"
|
||||
class="btn btn-sm btn-primary">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
Lihat
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
203
resources/views/laporan-monitoring/show.blade.php
Normal file
203
resources/views/laporan-monitoring/show.blade.php
Normal file
@@ -0,0 +1,203 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="laporan-penilai-table"
|
||||
data-api-url="{{ route('laporan-monitoring.datatables', ['id' => $id]) }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Penilaian {{ $nama_penilai ?? '' }}
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
|
||||
<a class="btn btn-sm btn-light" href=""> Export to Excel </a>
|
||||
|
||||
<a class="btn btn-sm btn-info" href="{{ route('laporan-monitoring.index') }}">
|
||||
<i class="ki-duotone ki-arrow-left fs-2"></i>
|
||||
Back</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto align-middle text-gray-700 font-medium text-sm mb-4"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="min-w-[100px]">Nama Debitur</th>
|
||||
<th class="min-w-[100px]">Cabang</th>
|
||||
<th class="min-w-[100px]">Lokasi Jaminan</th>
|
||||
<th class="min-w-[100px]">TUjuan Penilaian</th>
|
||||
<th class="min-w-[100px]">Tgl Kunjungan</th>
|
||||
<th class="min-w-[100px]">Tgl Lpj Done</th>
|
||||
<th class="min-w-[100px]">SLA Buku Kjpp</th>
|
||||
<th class="min-w-[100px]">Status</th>
|
||||
<th class="min-w-[100px]">Poin</th>
|
||||
<th class="min-w-[100px]">SLA INTERNAL</th>
|
||||
<th class="min-w-[100px]">SLA PENDAMPINGAN KJPP</th>
|
||||
<th class="min-w-[100px]">Absensi</th>
|
||||
<th class="min-w-[100px]">Zabtu</th>
|
||||
<th class="min-w-[50px] text-center">Keterangan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"></select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"></span>
|
||||
<div class="pagination" data-datatable-pagination="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-penilai-table');
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
order: [{
|
||||
column: 'nomor_registrasi',
|
||||
dir: 'asc'
|
||||
}],
|
||||
columns: {
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.debiture?.name}`
|
||||
},
|
||||
},
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.tujuan_penilaian?.name || ''}`;
|
||||
},
|
||||
},
|
||||
status_bayar: {
|
||||
title: 'Status Bayar',
|
||||
render: (item, data) => {
|
||||
const status = data.permohonan.status_bayar.replace(
|
||||
/_/g,
|
||||
' ');
|
||||
const statusClass = data.permohonan.status_bayar ===
|
||||
'belum_bayar' ? 'text-red-600' :
|
||||
'text-green-600';
|
||||
return `<span class="badge badge-sm badge-default font-bold ${statusClass} uppercase">
|
||||
${status}
|
||||
</span>`;
|
||||
},
|
||||
},
|
||||
jenis_asset: {
|
||||
title: 'Jenis Asset',
|
||||
render: (item, data) =>
|
||||
`${data.permohonan.debiture?.documents?.map(d => d.jenis_jaminan.name) || ''}`,
|
||||
},
|
||||
penugasan: {
|
||||
title: 'Penugasan',
|
||||
render: (item, data) => {
|
||||
|
||||
const roles = data.user_penilai?.map(d => d.role).join(
|
||||
'<br>') || '-';
|
||||
return roles;
|
||||
},
|
||||
},
|
||||
jenis_report: {
|
||||
title: 'Jenis Report',
|
||||
render: (item, data) => {
|
||||
return data.permohonan.penilai?.type_penilai || '-';
|
||||
},
|
||||
},
|
||||
register: {
|
||||
title: 'Register',
|
||||
render: (item, data) =>
|
||||
`${window.formatTanggalIndonesia(data.permohonan.created_at) || ''}`,
|
||||
|
||||
},
|
||||
assign: {
|
||||
title: 'Assign',
|
||||
render: (item, data) =>
|
||||
`${window.formatTanggalIndonesia(data.created_at)}`,
|
||||
},
|
||||
|
||||
tanggal_kunjungan: {
|
||||
title: 'Tgl Kunjungan',
|
||||
render: (item, data) =>
|
||||
`${window.formatTanggalIndonesia(data.waktu_penilaian) || ''}`,
|
||||
},
|
||||
tanggal_reported: {
|
||||
title: 'Tgl Kunjungan',
|
||||
render: (item, data) =>
|
||||
`${window.formatTanggalIndonesia(data.waktu_penilaian) || ''}`,
|
||||
},
|
||||
progress: {
|
||||
title: 'Progress',
|
||||
render: (item, data) => {
|
||||
return `<span class="badge badge-sm badge-default uppercase flex justify-center ">${data.permohonan.status}</span>`;
|
||||
}
|
||||
},
|
||||
// tanggal kunjungan h+2 jika plafon di
|
||||
due_date: {
|
||||
title: 'Due Date',
|
||||
render: (item, data) => {
|
||||
if (!data.due_date_sla) {
|
||||
return ``;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.due_date_sla)}`;
|
||||
}
|
||||
},
|
||||
due_date: {
|
||||
title: 'Due Date SLA',
|
||||
render: (item, data) => {
|
||||
if (!data.due_date_sla) {
|
||||
return `-`;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.due_date_sla)}`;
|
||||
},
|
||||
},
|
||||
|
||||
paparan: {
|
||||
title: 'Paparan',
|
||||
render: (item, data) => {
|
||||
if (!data.due_date_sla) {
|
||||
return `-`;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.paparan)}`;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
keterangan: {
|
||||
title: 'Keterangan',
|
||||
render: (item, data) => `${data.keterangan || ''}`,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
304
resources/views/laporan-sla-penilai/index.blade.php
Normal file
304
resources/views/laporan-sla-penilai/index.blade.php
Normal file
@@ -0,0 +1,304 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-sla-penilai') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<!-- Filter Card -->
|
||||
<div class="card border border-agi-100">
|
||||
<div class="card-header bg-agi-50 py-5">
|
||||
<h3 class="card-title">Filter Laporan SLA Penilai</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-4">
|
||||
<!-- Search field at the top, full width -->
|
||||
<div class="flex flex-col w-full">
|
||||
<label class="text-sm font-medium mb-1">Pencarian</label>
|
||||
<label class="input input-sm">
|
||||
<i class="ki-filled ki-magnifier"></i>
|
||||
<input placeholder="Search Laporan Penilaian Jaminan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Other filter fields in grid layout -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Awal</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Akhir</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Penilai</label>
|
||||
<select class="select tomselect" id="penilai_filter">
|
||||
<option value="">Semua Penilai</option>
|
||||
@foreach(\MOdules\Usermanagement\Models\User::role(['penilai','surveyor'])->get() as $penilai)
|
||||
<option value="{{ $penilai->id }}">{{ $penilai->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Buttons row at the bottom -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-2">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">
|
||||
<i class="ki-outline ki-filter fs-2 me-1"></i>
|
||||
Terapkan Filter
|
||||
</button>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-hasil-penilaian-jaminan-internal-external.export') }}" id="export-btn">
|
||||
<i class="ki-outline ki-file-down fs-2 me-1"></i>
|
||||
Export to Excel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Data Table Card -->
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-sla-penilai-table" data-api-url="{{ route('laporan-sla-penilai.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Laporan SLA Penilai
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_penilai">
|
||||
<span class="sort"> <span class="sort-label"> Nama Penilai </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_laporan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Dokuemen </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_review">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Approval </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_review">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Kunjungan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_review">
|
||||
<span class="sort"> <span class="sort-label"> Jangka Waktu </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_review">
|
||||
<span class="sort"> <span class="sort-label"> Keterangan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-sla-penilai-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const startDateInput = document.getElementById('start_date');
|
||||
const endDateInput = document.getElementById('end_date');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const penilaiFilter = document.getElementById('penilai_filter');
|
||||
const exportBtn = document.getElementById('export-btn');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
nama_penilai: {
|
||||
title: 'Nama Penilai',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_permohonan ? window.formatTanggalIndonesia(data.tanggal_permohonan) : '-';
|
||||
},
|
||||
},
|
||||
branch: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
name: {
|
||||
title: 'Nama Debitur',
|
||||
},
|
||||
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
},
|
||||
tanggal_laporan: {
|
||||
title: 'Tanggal Laporan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_laporan ? window.formatTanggalIndonesia(data.tanggal_laporan) : '-';
|
||||
},
|
||||
},
|
||||
tanggal_approval: {
|
||||
title: 'Tanggal Approval',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_approval ? window.formatTanggalIndonesia(data.tanggal_approval) : '-';
|
||||
},
|
||||
},
|
||||
tanggal_kunjungan: {
|
||||
title: 'Tanggal Kunjungan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_kunjungan ? window.formatTanggalIndonesia(data.tanggal_kunjungan) : '-';
|
||||
},
|
||||
},
|
||||
|
||||
jangka_waktu: {
|
||||
title: 'Jangka Waktu',
|
||||
render: (item, data) => {
|
||||
return data.jangka_waktu ?? '-';
|
||||
},
|
||||
},
|
||||
keterangan: {
|
||||
title: 'Keterangan',
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const startDate = startDateInput.value;
|
||||
const endDate = endDateInput.value;
|
||||
const penilai = penilaiFilter.value;
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
filters.start_date = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
filters.end_date = endDate;
|
||||
}
|
||||
|
||||
if (penilai) {
|
||||
filters.penilai_id = penilai;
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Update export URL with filters
|
||||
function updateExportUrl() {
|
||||
let url = new URL(exportBtn.href);
|
||||
|
||||
if (startDateInput.value) {
|
||||
url.searchParams.set('start_date', startDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('start_date');
|
||||
}
|
||||
|
||||
if (endDateInput.value) {
|
||||
url.searchParams.set('end_date', endDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('end_date');
|
||||
}
|
||||
|
||||
|
||||
if (searchInput.value) {
|
||||
url.searchParams.set('search', searchInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('search');
|
||||
}
|
||||
|
||||
if (penilaiFilter.value) {
|
||||
url.searchParams.set('penilai_id', penilaiFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('penilai_id');
|
||||
}
|
||||
|
||||
exportBtn.href = url.toString();
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
filterTanggalButton.addEventListener('click', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
// Initial update of export URL
|
||||
updateExportUrl();
|
||||
</script>
|
||||
@endpush
|
||||
312
resources/views/laporan-user/index.blade.php
Normal file
312
resources/views/laporan-user/index.blade.php
Normal file
@@ -0,0 +1,312 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-user') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<!-- Filter Card -->
|
||||
<div class="card border border-agi-100">
|
||||
<div class="card-header bg-agi-50 py-5">
|
||||
<h3 class="card-title"> Laporan User Penilai</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-4">
|
||||
<!-- Search field at the top, full width -->
|
||||
<div class="flex flex-col w-full">
|
||||
<label class="text-sm font-medium mb-1">Pencarian</label>
|
||||
<label class="input input-sm">
|
||||
<i class="ki-filled ki-magnifier"></i>
|
||||
<input placeholder="Search Laporan User" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Other filter fields in grid layout -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Awal</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">Tanggal Akhir</label>
|
||||
<label class="input">
|
||||
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<label class="text-base font-medium mb-1">User</label>
|
||||
<select class="select tomselect" id="user_id" name="user_id">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Buttons row at the bottom -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-2">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">
|
||||
<i class="ki-outline ki-filter fs-2 me-1"></i>
|
||||
Terapkan Filter
|
||||
</button>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-user.export') }}" id="export-btn">
|
||||
<i class="ki-outline ki-file-down fs-2 me-1"></i>
|
||||
Export to Excel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Data Table Card -->
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-user-table" data-api-url="{{ route('laporan-user.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Laporan User Pemohon
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="pemohon">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Tgl Terima </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Penilai </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="alamat_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Tgl Laporan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="catatan">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Pasar Wajar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-user-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const startDateInput = document.getElementById('start_date');
|
||||
const endDateInput = document.getElementById('end_date');
|
||||
const userFilter = document.getElementById('user_id');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const exportBtn = document.getElementById('export-btn');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
branch: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
name: {
|
||||
title: 'Nama Debitur',
|
||||
},
|
||||
pemohon: {
|
||||
title: 'Pemohon',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_permohonan ? window.formatTanggalIndonesia(data.tanggal_permohonan) : '-';
|
||||
},
|
||||
},
|
||||
nama_penilai: {
|
||||
title: 'Nama Penilai',
|
||||
},
|
||||
|
||||
tanggal_laporan: {
|
||||
title: 'Tanggal Dokumen Diterima',
|
||||
render: (item, data) => {
|
||||
return data.tanggal_laporan ? window.formatTanggalIndonesia(data.tanggal_laporan) : '-';
|
||||
},
|
||||
},
|
||||
nilai_pasar_wajar: {
|
||||
title: 'Nilai Pasar Wajar',
|
||||
render: (item, data) => {
|
||||
return data.nilai_pasar_wajar ?? '-';
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const startDate = startDateInput.value;
|
||||
const endDate = endDateInput.value;
|
||||
const user_id = userFilter.value;
|
||||
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
filters.start_date = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
filters.end_date = endDate;
|
||||
}
|
||||
|
||||
if (user_id) {
|
||||
filters.user_id = user_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Update export URL with filters
|
||||
function updateExportUrl() {
|
||||
dataTable.goPage(1);
|
||||
let url = new URL(exportBtn.href);
|
||||
|
||||
if (startDateInput.value) {
|
||||
url.searchParams.set('start_date', startDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('start_date');
|
||||
}
|
||||
|
||||
if (endDateInput.value) {
|
||||
url.searchParams.set('end_date', endDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('end_date');
|
||||
}
|
||||
|
||||
if (userFilter.value) {
|
||||
url.searchParams.set('user_id', userFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('user_id');
|
||||
}
|
||||
|
||||
|
||||
if (searchInput.value) {
|
||||
url.searchParams.set('search', searchInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('search');
|
||||
}
|
||||
|
||||
exportBtn.href = url.toString();
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
filterTanggalButton.addEventListener('click', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
// Initial update of export URL
|
||||
updateExportUrl();
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let userSelect = document.querySelector('#user_id');
|
||||
|
||||
if (userSelect) {
|
||||
// Jika sudah ada instance TomSelect, destroy dulu
|
||||
if (userSelect.tomselect) {
|
||||
userSelect.tomselect.destroy();
|
||||
}
|
||||
|
||||
// Inisialisasi TomSelect dengan konfigurasi yang benar
|
||||
new TomSelect(userSelect, {
|
||||
valueField: 'id',
|
||||
labelField: 'name',
|
||||
searchField: 'name',
|
||||
placeholder: 'Pilih User',
|
||||
load: function(query, callback) {
|
||||
if (!query.length) return callback();
|
||||
|
||||
$.ajax({
|
||||
url: "{{ route('laporan-user.api.user-pemohon') }}",
|
||||
method: 'GET',
|
||||
data: {
|
||||
search: query
|
||||
},
|
||||
success: function(response) {
|
||||
console.log('Response data:', response);
|
||||
callback(response);
|
||||
},
|
||||
error: function() {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -6,10 +6,10 @@
|
||||
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="laporan-table" data-api-url="{{ route('laporan.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Laporan
|
||||
</h3>
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -74,13 +74,13 @@
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||
<div class="flex gap-2 items-center">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="flex gap-4 items-center">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
@@ -108,7 +108,7 @@
|
||||
'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'
|
||||
];
|
||||
return months[month -
|
||||
1];
|
||||
1];
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
@@ -186,7 +186,7 @@
|
||||
tanggal_survei: {
|
||||
title: 'Tanggal Survei',
|
||||
render: (item, data) => {
|
||||
if(data.penilaian.waktu_penilaian){
|
||||
if (data.penilaian.waktu_penilaian) {
|
||||
return `${formatDate(new Date(data.penilaian.waktu_penilaian))}`;
|
||||
}
|
||||
return `${formatDate(new Date(data.penilaian.created_at))}`;
|
||||
@@ -199,19 +199,19 @@
|
||||
const tipe_laporan = data.penilai?.type;
|
||||
const nilai_plafond = data.penilaian.nilaiPlafond?.name;
|
||||
let waktu_penilaian = new Date(data.penilaian.created_at);
|
||||
if(data.penilaian.waktu_penilaian){
|
||||
if (data.penilaian.waktu_penilaian) {
|
||||
waktu_penilaian = new Date(data.penilaian.waktu_penilaian);
|
||||
}
|
||||
|
||||
if(tujuan_penilaian.name==="RAP"){
|
||||
if (tujuan_penilaian.name === "RAP") {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else {
|
||||
if(tipe_laporan==="sederhana"){
|
||||
if (tipe_laporan === "sederhana") {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 2);
|
||||
} else if(tipe_laporan==="standar"){
|
||||
if(nilai_plafond==="2 M - 5 M"){
|
||||
} else if (tipe_laporan === "standar") {
|
||||
if (nilai_plafond === "2 M - 5 M") {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else if(nilai_plafond==="< 2M"){
|
||||
} else if (nilai_plafond === "< 2M") {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 5);
|
||||
@@ -224,7 +224,7 @@
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<span class="badge badge-sm badge-default uppercase flex justify-center">${data.status}</span>`;
|
||||
return `<span class="flex justify-center uppercase badge badge-sm badge-default">${data.status}</span>`;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@@ -239,32 +239,23 @@
|
||||
let resumeButton = '';
|
||||
let penyelesaian = '';
|
||||
|
||||
|
||||
if(data.noc) {
|
||||
if (!data.noc?.tanggal_penyelesaian && !data.noc?.memo_penyelesaian) {
|
||||
penyelesaian = `
|
||||
<a href="{{ route('noc.penyelesaian') }}?id=${data.noc.id}&permohonanId=${data.noc.permohonan_id}&persetujuanPenawaranId=${data.noc.persetujuan_penawaran_id}" class="btn btn-sm btn-warning">
|
||||
Penyelesaian
|
||||
</a>`;
|
||||
}
|
||||
}
|
||||
|
||||
if(data.penilai.resume) {
|
||||
if (data.penilai.resume) {
|
||||
resumeButton = `
|
||||
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0" class="btn btn-sm btn-success">
|
||||
Resume
|
||||
</a>`;
|
||||
}
|
||||
|
||||
if(data.nilai_liquidasi==null) {
|
||||
if (data.nilai_liquidasi == null) {
|
||||
laporanButton = `
|
||||
<a href="laporan/${data.id}" class="btn btn-sm btn-primary">
|
||||
Laporan
|
||||
</a>`;
|
||||
}
|
||||
|
||||
if((data.status_bayar=="sudah_bayar" || data.status_bayar=="tidak_bayar") && data.nilai_liquidasi >0) {
|
||||
if(data.penilai.type_penilai=='resume' && !data.penilai.resume){
|
||||
if ((data.status_bayar == "sudah_bayar" || data.status_bayar == "tidak_bayar") && data
|
||||
.nilai_liquidasi > 0) {
|
||||
if (data.penilai.type_penilai == 'resume' && !data.penilai.resume) {
|
||||
laporanButton = `
|
||||
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0&type=${type}" class="btn btn-sm btn-primary">
|
||||
Laporan
|
||||
@@ -279,7 +270,7 @@
|
||||
}
|
||||
|
||||
|
||||
return `<div class="flex flex-wrap justify-end gap-1.5"> ${penyelesaian} ${resumeButton} ${laporanButton} </div>`;
|
||||
return `<div class="flex flex-wrap gap-1.5 justify-end"> ${penyelesaian} ${resumeButton} ${laporanButton} </div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
306
resources/views/memo/create.blade.php
Normal file
306
resources/views/memo/create.blade.php
Normal file
@@ -0,0 +1,306 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('memo.create') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||
<!-- Form Memo Penyelesaian -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
Buat Memo Penyelesaian
|
||||
</h3>
|
||||
<div class="flex gap-2 items-center">
|
||||
<a href="{{ route('memo.index') }}" class="btn btn-sm btn-light">
|
||||
<i class="ki-filled ki-black-left"></i>
|
||||
Kembali
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('error'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form action="{{ route('memo.preview') }}" method="POST" id="memo-form">
|
||||
@csrf
|
||||
|
||||
<!-- Form Input Memo -->
|
||||
<div class="grid grid-cols-1 gap-5 mb-7 lg:grid-cols-2">
|
||||
<div class="flex flex-col gap-1">
|
||||
<label class="text-gray-900 form-label">Nomor Memo <span class="text-red-500">*</span></label>
|
||||
<input type="text" name="memo_number" class="input"
|
||||
placeholder="Masukkan nomor memo penyelesaian" value="{{ old('memo_number') }}" required>
|
||||
@error('memo_number')
|
||||
<span class="text-sm text-red-500">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-1">
|
||||
<label class="text-gray-900 form-label">Tanggal Pembayaran <span
|
||||
class="text-red-500">*</span></label>
|
||||
<input type="date" name="payment_date" class="input" value="{{ old('payment_date') }}"
|
||||
required>
|
||||
@error('payment_date')
|
||||
<span class="text-sm text-red-500">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-1 lg:col-span-2">
|
||||
<label class="text-gray-900 form-label">Total Biaya PJ</label>
|
||||
<div class="relative">
|
||||
<input type="text" id="total-biaya-pj" class="bg-gray-50 input"
|
||||
value="Rp {{ number_format($totalBiayaPJ ?? 0, 0, ',', '.') }}" readonly>
|
||||
<div class="flex absolute inset-y-0 right-0 items-center pr-3">
|
||||
<i class="text-gray-400 ki-filled ki-calculator"></i>
|
||||
</div>
|
||||
</div>
|
||||
<span class="text-sm text-gray-500">Total biaya dari nominal bayar NOC untuk permohonan yang
|
||||
dipilih</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hidden field untuk tanggal memo otomatis -->
|
||||
<input type="hidden" name="memo_date" value="{{ date('Y-m-d') }}">
|
||||
|
||||
<!-- Daftar Permohonan yang Dipilih -->
|
||||
@if (count($permohonanList) > 0)
|
||||
<div class="mb-7">
|
||||
<h4 class="mb-4 text-lg font-semibold">Daftar Permohonan yang Akan Diproses</h4>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table table-border">
|
||||
<thead>
|
||||
<tr class="bg-gray-50">
|
||||
<th class="w-12 text-center">
|
||||
<input type="checkbox" id="select-all" class="checkbox checkbox-sm" checked
|
||||
disabled>
|
||||
</th>
|
||||
<th>Nomor Registrasi</th>
|
||||
<th>Debitur</th>
|
||||
<th>Cabang</th>
|
||||
<th>AO</th>
|
||||
<th>Tujuan Penilaian</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($permohonanList as $permohonan)
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<input type="checkbox" class="checkbox checkbox-sm permohonan-checkbox"
|
||||
checked disabled>
|
||||
<input type="hidden" name="permohonan_ids[]"
|
||||
value="{{ $permohonan->id }}">
|
||||
</td>
|
||||
<td class="font-medium">{{ $permohonan->nomor_registrasi }}</td>
|
||||
<td>{{ $permohonan->debiture->name ?? '-' }}</td>
|
||||
<td>{{ $permohonan->branch->name ?? '-' }}</td>
|
||||
<td>{{ $permohonan->user->name ?? '-' }}</td>
|
||||
<td>
|
||||
@if ($permohonan->tujuanPenilaian)
|
||||
<span class="badge badge-sm badge-primary">
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
</span>
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<span class="uppercase badge badge-sm badge-warning">
|
||||
{{ $permohonan->status }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="p-4 mt-4 bg-blue-50 rounded-lg">
|
||||
<div class="flex gap-2 items-center">
|
||||
<i class="text-blue-600 ki-filled ki-information"></i>
|
||||
<span class="font-medium text-blue-800">Informasi:</span>
|
||||
</div>
|
||||
<p class="mt-1 text-blue-700">
|
||||
Total <span id="selected-count">{{ count($permohonanList) }}</span> permohonan akan
|
||||
diproses untuk memo penyelesaian.
|
||||
Anda dapat menghapus centang pada permohonan yang tidak ingin diproses.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tombol Submit -->
|
||||
<div class="flex gap-2 justify-end">
|
||||
<a href="{{ route('memo.index') }}" class="btn btn-light">
|
||||
Batal
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary" id="submit-btn">
|
||||
<i class="ki-filled ki-eye"></i>
|
||||
Preview Memo Penyelesaian
|
||||
</button>
|
||||
</div>
|
||||
@else
|
||||
<div class="py-10 text-center">
|
||||
<div class="mb-4">
|
||||
<i class="text-6xl text-gray-400 ki-filled ki-information-2"></i>
|
||||
</div>
|
||||
<h4 class="mb-2 text-lg font-semibold text-gray-600">Tidak Ada Data</h4>
|
||||
<p class="mb-4 text-gray-500">Tidak ada permohonan yang dipilih untuk diproses.</p>
|
||||
<a href="{{ route('memo.index') }}" class="btn btn-primary">
|
||||
Kembali ke Daftar
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const selectAllCheckbox = document.getElementById('select-all');
|
||||
const permohonanCheckboxes = document.querySelectorAll('.permohonan-checkbox');
|
||||
const selectedCountSpan = document.getElementById('selected-count');
|
||||
const submitBtn = document.getElementById('submit-btn');
|
||||
const memoForm = document.getElementById('memo-form');
|
||||
const totalBiayaPJInput = document.getElementById('total-biaya-pj');
|
||||
|
||||
/**
|
||||
* Fungsi untuk mengupdate total biaya PJ
|
||||
*/
|
||||
function updateTotalBiayaPJ() {
|
||||
const checkedBoxes = document.querySelectorAll('.permohonan-checkbox:checked');
|
||||
const permohonanIds = Array.from(checkedBoxes).map(cb => cb.value);
|
||||
|
||||
if (permohonanIds.length === 0) {
|
||||
if (totalBiayaPJInput) {
|
||||
totalBiayaPJInput.value = 'Rp 0';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Kirim AJAX request untuk mendapatkan total biaya PJ
|
||||
fetch('{{ route('memo.total-biaya-pj') }}', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute(
|
||||
'content')
|
||||
},
|
||||
body: JSON.stringify({
|
||||
permohonan_ids: permohonanIds
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success && totalBiayaPJInput) {
|
||||
totalBiayaPJInput.value = data.total_biaya_pj_formatted;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
if (totalBiayaPJInput) {
|
||||
totalBiayaPJInput.value = 'Error menghitung total';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Fungsi untuk mengupdate jumlah item yang dipilih
|
||||
*/
|
||||
function updateSelectedCount() {
|
||||
const checkedBoxes = document.querySelectorAll('.permohonan-checkbox:checked');
|
||||
const count = checkedBoxes.length;
|
||||
|
||||
if (selectedCountSpan) {
|
||||
selectedCountSpan.textContent = count;
|
||||
}
|
||||
|
||||
// Disable submit button jika tidak ada yang dipilih
|
||||
if (submitBtn) {
|
||||
submitBtn.disabled = count === 0;
|
||||
if (count === 0) {
|
||||
submitBtn.innerHTML = '<i class="ki-filled ki-check"></i> Pilih minimal 1 permohonan';
|
||||
submitBtn.classList.add('btn-disabled');
|
||||
} else {
|
||||
submitBtn.innerHTML =
|
||||
`<i class="ki-filled ki-check"></i> Buat Memo Penyelesaian (${count} item)`;
|
||||
submitBtn.classList.remove('btn-disabled');
|
||||
}
|
||||
}
|
||||
|
||||
// Update select all checkbox state
|
||||
if (selectAllCheckbox) {
|
||||
selectAllCheckbox.checked = count === permohonanCheckboxes.length;
|
||||
selectAllCheckbox.indeterminate = count > 0 && count < permohonanCheckboxes.length;
|
||||
}
|
||||
|
||||
// Update total biaya PJ
|
||||
updateTotalBiayaPJ();
|
||||
}
|
||||
|
||||
/**
|
||||
* Event listener untuk select all checkbox
|
||||
*/
|
||||
if (selectAllCheckbox) {
|
||||
selectAllCheckbox.addEventListener('change', function() {
|
||||
const isChecked = this.checked;
|
||||
permohonanCheckboxes.forEach(checkbox => {
|
||||
checkbox.checked = isChecked;
|
||||
});
|
||||
updateSelectedCount();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Event listener untuk individual checkboxes
|
||||
*/
|
||||
permohonanCheckboxes.forEach(checkbox => {
|
||||
checkbox.addEventListener('change', function() {
|
||||
updateSelectedCount();
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Event listener untuk form submission
|
||||
*/
|
||||
if (memoForm) {
|
||||
memoForm.addEventListener('submit', function(e) {
|
||||
const checkedBoxes = document.querySelectorAll('.permohonan-checkbox:checked');
|
||||
|
||||
if (checkedBoxes.length === 0) {
|
||||
e.preventDefault();
|
||||
alert('Pilih minimal 1 permohonan untuk diproses!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Konfirmasi sebelum submit
|
||||
const confirmed = confirm(
|
||||
`Apakah Anda yakin ingin membuat memo penyelesaian untuk ${checkedBoxes.length} permohonan?`
|
||||
);
|
||||
if (!confirmed) {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Disable submit button untuk mencegah double submit
|
||||
if (submitBtn) {
|
||||
submitBtn.disabled = true;
|
||||
submitBtn.innerHTML = '<i class="ki-filled ki-loading"></i> Memproses...';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize count dan total biaya PJ
|
||||
updateSelectedCount();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
421
resources/views/memo/index.blade.php
Normal file
421
resources/views/memo/index.blade.php
Normal file
@@ -0,0 +1,421 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('memo.index') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="memo-table" data-api-url="{{ route('memo.datatables') }}">
|
||||
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Memo Penyelesaian
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex gap-2">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Memo Penyelesaian" id="search" type="text" value="">
|
||||
</label>
|
||||
<select class="select select-sm" id="filter-jenis-penilaian">
|
||||
<option value="">Semua Jenis Penilaian</option>
|
||||
<option value="1">Internal</option>
|
||||
<option value="2">External</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<button class="btn btn-sm btn-primary" id="btn-create-memo" disabled>
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
Buat Memo Penyelesaian
|
||||
</button>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon(Cabang/Direktorat) </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"> <span class="sort-label"> AO </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_penilaian_id">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_fasilitas_kredit_id">
|
||||
<span class="sort"> <span class="sort-label"> Fasilitas Kredit </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_survei">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Survei </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="due_date_sla">
|
||||
<span class="sort"> <span class="sort-label"> Due Date SLA </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="status">Status</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||
<div class="flex gap-2 items-center">
|
||||
Show
|
||||
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex gap-4 items-center">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
/**
|
||||
* Format tanggal ke format Indonesia
|
||||
* @param {Date} date - Tanggal yang akan diformat
|
||||
* @returns {string} - Tanggal dalam format Indonesia
|
||||
*/
|
||||
function formatDate(date) {
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const year = date.getFullYear();
|
||||
|
||||
return `${day} ${getIndonesianMonth(month)} ${year}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mendapatkan nama bulan dalam bahasa Indonesia
|
||||
* @param {string} month - Nomor bulan
|
||||
* @returns {string} - Nama bulan dalam bahasa Indonesia
|
||||
*/
|
||||
function getIndonesianMonth(month) {
|
||||
const months = ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni',
|
||||
'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'
|
||||
];
|
||||
return months[month - 1];
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#memo-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const filterJenisPenilaian = document.getElementById('filter-jenis-penilaian');
|
||||
const btnCreateMemo = document.getElementById('btn-create-memo');
|
||||
let selectedItems = [];
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 10,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
// Cek apakah sudah ada memo penyelesaian
|
||||
const hasMemo = data.noc && data.noc.memo_penyelesaian;
|
||||
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
|
||||
// Disable checkbox jika sudah ada memo
|
||||
if (hasMemo) {
|
||||
checkbox.disabled = true;
|
||||
checkbox.title = 'Permohonan ini sudah memiliki memo penyelesaian';
|
||||
}
|
||||
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => {
|
||||
if (data.debiture) {
|
||||
return `${data.debiture.name.toUpperCase()}`;
|
||||
}
|
||||
return "-";
|
||||
},
|
||||
},
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => {
|
||||
return `${data.branch.name}`;
|
||||
},
|
||||
},
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => {
|
||||
return `${data.user.name}`;
|
||||
},
|
||||
},
|
||||
jenis_penilaian_id: {
|
||||
title: 'Jenis Penilaian',
|
||||
render: (item, data) => {
|
||||
return `${data.jenis_penilaian.name}`;
|
||||
}
|
||||
},
|
||||
tujuan_penilaian_id: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
switch (data.tujuan_penilaian.code) {
|
||||
case "TP0001":
|
||||
return `<span class="badge badge-sm badge-primary">${data.tujuan_penilaian.name}</span>`;
|
||||
case "TP0002":
|
||||
return `<span class="badge badge-sm badge-info">${data.tujuan_penilaian.name}</span>`;
|
||||
case "TP0003":
|
||||
return `<span class="badge badge-sm badge-success">${data.tujuan_penilaian.name}</span>`;
|
||||
case "TP0004":
|
||||
return `<span class="badge badge-sm badge-danger">${data.tujuan_penilaian.name}</span>`;
|
||||
case "TP0005":
|
||||
return `<span class="badge badge-sm badge-warning">${data.tujuan_penilaian.name}</span>`;
|
||||
case "TP0006":
|
||||
return `<span class="badge badge-sm badge-dark">${data.tujuan_penilaian.name}</span>`;
|
||||
case "TP0007":
|
||||
return `<span class="badge badge-sm badge-outline badge-info">${data.tujuan_penilaian.name}</span>`;
|
||||
default:
|
||||
return `<span class="badge badge-sm badge-outline badge-default">${data.tujuan_penilaian.name}</span>`;
|
||||
}
|
||||
},
|
||||
},
|
||||
jenis_fasilitas_kredit_id: {
|
||||
title: 'Fasilitas Kredit',
|
||||
render: (item, data) => {
|
||||
return `${data.jenis_fasilitas_kredit.name}`;
|
||||
}
|
||||
},
|
||||
tanggal_survei: {
|
||||
title: 'Tanggal Survei',
|
||||
render: (item, data) => {
|
||||
if (data.penilaian.waktu_penilaian) {
|
||||
return `${formatDate(new Date(data.penilaian.waktu_penilaian))}`;
|
||||
}
|
||||
return `${formatDate(new Date(data.penilaian.created_at))}`;
|
||||
},
|
||||
},
|
||||
due_date_sla: {
|
||||
title: 'Due Date SLA',
|
||||
render: (item, data) => {
|
||||
const tujuan_penilaian = data.tujuan_penilaian.name;
|
||||
const tipe_laporan = data.penilai?.type;
|
||||
const nilai_plafond = data.penilaian.nilaiPlafond?.name;
|
||||
let waktu_penilaian = new Date(data.penilaian.created_at);
|
||||
if (data.penilaian.waktu_penilaian) {
|
||||
waktu_penilaian = new Date(data.penilaian.waktu_penilaian);
|
||||
}
|
||||
|
||||
if (tujuan_penilaian === "RAP") {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else {
|
||||
if (tipe_laporan === "sederhana") {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 2);
|
||||
} else if (tipe_laporan === "standar") {
|
||||
if (nilai_plafond === "2 M - 5 M") {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else if (nilai_plafond === "< 2M") {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
return formatDate(waktu_penilaian);
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
let badgeClass = 'badge-default';
|
||||
if (data.status === 'memo-penyelesaian') {
|
||||
badgeClass = 'badge-success';
|
||||
} else if (data.status === 'done') {
|
||||
badgeClass = 'badge-primary';
|
||||
} else if (data.status === 'proses-laporan') {
|
||||
badgeClass = 'badge-warning';
|
||||
}
|
||||
return `<span class="flex justify-center uppercase badge badge-sm ${badgeClass}">${data.status}</span>`;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
title: 'Actions',
|
||||
render: (item, data) => {
|
||||
let actionButtons = '';
|
||||
|
||||
// Cek apakah sudah ada memo penyelesaian dengan PDF
|
||||
if (data.noc && data.noc.memo_penyelesaian) {
|
||||
actionButtons = `
|
||||
<div class="flex flex-col gap-1">
|
||||
<a href="memo/memo/download-pdf/${data.id}"
|
||||
class="flex gap-1 items-center btn btn-sm btn-primary"
|
||||
title="Download PDF Memo Penyelesaian">
|
||||
<i class="fas fa-download"></i>
|
||||
Download Memo
|
||||
</a>
|
||||
</div>`;
|
||||
} else {
|
||||
actionButtons = `
|
||||
<span class="text-sm text-gray-500">Belum ada memo</span>`;
|
||||
}
|
||||
|
||||
return `<div class="flex flex-wrap gap-1.5 justify-center">${actionButtons}</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
/**
|
||||
* Fungsi untuk menangani perubahan checkbox
|
||||
* Mengelola state tombol berdasarkan checkbox yang dipilih
|
||||
*/
|
||||
function handleCheckboxChange() {
|
||||
// Hanya ambil checkbox yang tidak disabled dan checked
|
||||
const checkboxes = document.querySelectorAll('input[data-datatable-row-check="true"]:checked:not(:disabled)');
|
||||
selectedItems = Array.from(checkboxes).map(cb => cb.value);
|
||||
|
||||
// Log untuk debugging
|
||||
console.log('Selected items:', selectedItems);
|
||||
|
||||
// Enable/disable tombol berdasarkan jumlah item yang dipilih
|
||||
const hasSelection = selectedItems.length > 0;
|
||||
btnCreateMemo.disabled = !hasSelection;
|
||||
|
||||
// Update text tombol create memo
|
||||
if (hasSelection) {
|
||||
btnCreateMemo.textContent = `Buat Memo Penyelesaian (${selectedItems.length} item)`;
|
||||
} else {
|
||||
btnCreateMemo.textContent = 'Buat Memo Penyelesaian';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fungsi untuk clear semua checkbox yang terpilih
|
||||
* Menghapus semua selection dan reset state tombol
|
||||
*/
|
||||
function clearSelectedCheckboxes() {
|
||||
try {
|
||||
// Uncheck master checkbox juga - gunakan selector yang lebih spesifik
|
||||
const masterCheckbox = document.querySelector('#memo-table thead input[type="checkbox"]');
|
||||
if (masterCheckbox) {
|
||||
masterCheckbox.checked = false;
|
||||
}
|
||||
// Uncheck semua checkbox yang tidak disabled
|
||||
const checkboxes = document.querySelectorAll('input[data-datatable-row-check="true"]:not(:disabled)');
|
||||
checkboxes.forEach(checkbox => {
|
||||
checkbox.checked = false;
|
||||
});
|
||||
|
||||
// Reset selected items array
|
||||
selectedItems = [];
|
||||
|
||||
// Update state tombol
|
||||
btnCreateMemo.disabled = true;
|
||||
btnCreateMemo.textContent = 'Buat Memo Penyelesaian';
|
||||
|
||||
// Log untuk debugging
|
||||
console.log('All checkboxes cleared successfully');
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error clearing checkboxes:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Event listener untuk checkbox changes
|
||||
element.addEventListener('change', function(e) {
|
||||
if (e.target.type === 'checkbox') {
|
||||
handleCheckboxChange();
|
||||
}
|
||||
});
|
||||
|
||||
// Event listener untuk tombol create memo
|
||||
btnCreateMemo.addEventListener('click', function() {
|
||||
if (selectedItems.length > 0) {
|
||||
const selectedIds = selectedItems.join(',');
|
||||
console.log('Creating memo for IDs:', selectedIds);
|
||||
window.location.href = `{{ route('memo.create') }}?selected_ids=${selectedIds}`;
|
||||
}
|
||||
});
|
||||
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
|
||||
/**
|
||||
* Filter berdasarkan jenis penilaian
|
||||
* Menggunakan pola yang sama dengan districts filter
|
||||
*/
|
||||
filterJenisPenilaian.addEventListener('change', function() {
|
||||
const filterValue = this.value;
|
||||
const searchValue = searchInput.value.trim();
|
||||
|
||||
// Gabungkan filter dan search dalam satu parameter
|
||||
const combinedSearch = `${filterValue}|${searchValue}`;
|
||||
|
||||
// Log untuk debugging
|
||||
console.log('Filter jenis penilaian:', filterValue);
|
||||
console.log('Search value:', searchValue);
|
||||
console.log('Combined search:', combinedSearch);
|
||||
|
||||
// Gunakan search method seperti di districts
|
||||
dataTable.search(combinedSearch, true);
|
||||
});
|
||||
|
||||
/**
|
||||
* Update search input handler untuk mendukung filter
|
||||
*/
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
const filterValue = filterJenisPenilaian.value;
|
||||
|
||||
// Gabungkan search dan filter
|
||||
const combinedSearch = `${filterValue}|${searchValue}`;
|
||||
|
||||
// Log untuk debugging
|
||||
console.log('Search input:', searchValue);
|
||||
console.log('Current filter:', filterValue);
|
||||
console.log('Combined search:', combinedSearch);
|
||||
|
||||
dataTable.search(combinedSearch, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
375
resources/views/memo/pdf-template.blade.php
Normal file
375
resources/views/memo/pdf-template.blade.php
Normal file
@@ -0,0 +1,375 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Memo Penyelesaian - {{ $memoData['memo_number'] }}</title>
|
||||
<style>
|
||||
@page {
|
||||
margin: 20mm;
|
||||
size: A4;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Times New Roman', serif;
|
||||
font-size: 12px;
|
||||
line-height: 1.4;
|
||||
color: #000;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.header {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 53.55px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.memo-title {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.memo-info {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.memo-info table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.memo-info td {
|
||||
padding: 2px 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.memo-info .label {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.memo-info .colon {
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
.memo-content {
|
||||
text-align: justify;
|
||||
margin: 20px 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.memo-content table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.memo-content td {
|
||||
padding: 2px 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.memo-content .label {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.memo-content .colon {
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
.signature-section {
|
||||
margin-top: 60px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.signature-box {
|
||||
text-align: center;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.signature-line {
|
||||
border-bottom: 1px solid #000;
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
margin: 0 auto 8px;
|
||||
}
|
||||
|
||||
.lampiran-section {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.lampiran-list {
|
||||
margin: 0;
|
||||
padding-left: 20px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.lampiran-list li {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.page-break {
|
||||
page-break-before: always;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.lampiran-title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.lampiran-subtitle {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin: 8px 0 0 0;
|
||||
}
|
||||
|
||||
.lampiran-memo {
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
margin: 8px 0 0 0;
|
||||
}
|
||||
|
||||
.lampiran-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-top: 20px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.lampiran-table th,
|
||||
.lampiran-table td {
|
||||
border: 1px solid #000;
|
||||
padding: 6px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.lampiran-table th {
|
||||
background-color: #f8f9fa;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.lampiran-table tfoot td {
|
||||
background-color: #f8f9fa;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.font-bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.font-weight-500 {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.font-size-11 {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
hr {
|
||||
border: none;
|
||||
border-top: 1px solid #000;
|
||||
margin: 20px 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Halaman Memo Utama -->
|
||||
<div class="header">
|
||||
<img src="{{ public_path('assets/media/images/logo-arthagraha.png') }}" alt="Logo Bank" class="logo">
|
||||
</div>
|
||||
|
||||
<div class="memo-title">
|
||||
<strong>Memo Instruksi Penyelesaian</strong> Rekening Escrow / <strong>KSL Penilai Jaminan</strong>
|
||||
</div>
|
||||
|
||||
<div class="memo-info">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="label">Kepada</td>
|
||||
<td class="colon">:</td>
|
||||
<td>SUBDIT E-Channel Support & Operation (NOC)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Dari</td>
|
||||
<td class="colon">:</td>
|
||||
<td>SUBDIT Appraisal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Nomor</td>
|
||||
<td class="colon">:</td>
|
||||
<td><strong>{{ $memoData['memo_number'] }}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Tanggal</td>
|
||||
<td class="colon">:</td>
|
||||
<td>{{ \Carbon\Carbon::parse($memoData['memo_date'])->format('d F Y') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Perihal</td>
|
||||
<td class="colon">:</td>
|
||||
<td>Penyelesaian Rekening Escrow / <strong>KSL Penilai Jaminan (PJ)</strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="memo-content">
|
||||
<p style="margin-bottom: 16px;">Sehubungan dengan telah dilakukannya penilaian jaminan dengan keterangan sbb :
|
||||
</p>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td class="label">Nama Debitur</td>
|
||||
<td class="colon">:</td>
|
||||
<td>Terlampir ({{ $memoData['debitur_count'] }} Debitur)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Jaminan</td>
|
||||
<td class="colon">:</td>
|
||||
<td>Tanah & Bangunan</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Total Biaya PJ</td>
|
||||
<td class="colon">:</td>
|
||||
<td><strong>Rp {{ number_format($memoData['total_biaya_pj'], 0, ',', '.') }},-</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td class="font-size-11">({{ terbilang($memoData['total_biaya_pj']) }} Rupiah)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Pembayaran Tanggal</td>
|
||||
<td class="colon">:</td>
|
||||
<td>{{ \Carbon\Carbon::parse($memoData['payment_date'])->format('d F Y') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">LPJ selesai dikirim</td>
|
||||
<td class="colon">:</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Jenis Penilaian</td>
|
||||
<td class="colon">:</td>
|
||||
<td><strong>
|
||||
@if ($memoData['jenisPenilaian'] == 2)
|
||||
KJPP
|
||||
@else
|
||||
Internal
|
||||
@endif
|
||||
</strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p style="margin-bottom: 16px;">Kami menginstruksikan kepada Sentra Operasi untuk menyelesaikan Rekening Escrow
|
||||
/ <strong>KSL Penilai Jaminan</strong> atas nama debitur tersebut diatas ke
|
||||
|
||||
@if ($memoData['jenisPenilaian'] == 2)
|
||||
<strong>KJPP (terlampir)</strong>.
|
||||
@else
|
||||
<strong>PDPT-Lainnya Penilaian Jaminan KPNO (IDR 57557)</strong>.
|
||||
@endif
|
||||
</p>
|
||||
|
||||
<p style="margin-bottom: 16px;">Demikian kami sampaikan, atas perhatian dan kerjasamanya kami ucapkan terima
|
||||
kasih.</p>
|
||||
</div>
|
||||
|
||||
<div class="signature-section">
|
||||
<table style="width: 100%; border-collapse: collapse; margin-top: 0px;">
|
||||
<tr>
|
||||
<td style="width: 33.33%; text-align: center; vertical-align: top; padding: 0 10px;">
|
||||
<p style="margin-bottom: 40px;">Salam</p>
|
||||
<div style="border-bottom: 1px solid #000; width: 120px; height: 40px; margin: 0 auto 8px;"></div>
|
||||
<p style="font-weight: 500; margin: 0;">Innawati Sulina</p>
|
||||
<p style="font-size: 11px; margin: 0;">DD Operation 2</p>
|
||||
</td>
|
||||
<td style="width: 33.33%; text-align: center; vertical-align: top; padding: 0 10px;">
|
||||
<p style="margin-bottom: 40px;"> </p>
|
||||
<div style="border-bottom: 1px solid #000; width: 120px; height: 40px; margin: 0 auto 8px;"></div>
|
||||
<p style="font-weight: 500; margin: 0;">Wahab N. Wibawa</p>
|
||||
<p style="font-size: 11px; margin: 0;">Pgs EO Subdit Appraisal</p>
|
||||
</td>
|
||||
<td style="width: 33.33%; text-align: center; vertical-align: top; padding: 0 10px;">
|
||||
<p style="margin-bottom: 40px;"> </p>
|
||||
<div style="border-bottom: 1px solid #000; width: 120px; height: 40px; margin: 0 auto 8px;"></div>
|
||||
<p style="font-weight: 500; margin: 0;">Sumurung P. Siahaan</p>
|
||||
<p style="font-size: 11px; margin: 0;"> </p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="lampiran-section">
|
||||
<p class="font-weight-500" style="margin-bottom: 8px;">Lampiran :</p>
|
||||
<ul class="lampiran-list">
|
||||
<li>Rekap permohonan penyelesaian biaya KJPP (Eksternal)</li>
|
||||
<li>Asli Invoice & Faktur Pajak KJPP (Eksternal)</li>
|
||||
<li>Copy Tiket Debet (KSL)</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Halaman Lampiran -->
|
||||
<div class="page-break">
|
||||
<div class="lampiran-title">LAMPIRAN</div>
|
||||
<div class="lampiran-subtitle">REKAP PERMOHONAN PENYELESAIAN BIAYA KJPP</div>
|
||||
<p class="lampiran-memo">Memo No: {{ $memoData['memo_number'] }}</p>
|
||||
|
||||
<table class="lampiran-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Nomor Registrasi</th>
|
||||
<th>Debitur</th>
|
||||
<th>Cabang</th>
|
||||
<th>AO</th>
|
||||
<th>Tujuan Penilaian</th>
|
||||
<th>Biaya PJ</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($permohonanList as $index => $permohonan)
|
||||
<tr>
|
||||
<td class="text-center">{{ $index + 1 }}</td>
|
||||
<td class="font-weight-500">{{ $permohonan->nomor_registrasi }}</td>
|
||||
<td>{{ $permohonan->debiture->name ?? '-' }}</td>
|
||||
<td>{{ $permohonan->branch->name ?? '-' }}</td>
|
||||
<td>{{ $permohonan->user->name ?? '-' }}</td>
|
||||
<td>{{ $permohonan->tujuanPenilaian->name ?? '-' }}</td>
|
||||
<td class="text-right font-weight-500">Rp
|
||||
{{ number_format($permohonan->noc->nominal_bayar ?? 0, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="6" class="font-bold text-right">Total Biaya PJ:</td>
|
||||
<td class="font-bold text-right">Rp {{ number_format($totalBiayaPJ, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
373
resources/views/memo/preview.blade.php
Normal file
373
resources/views/memo/preview.blade.php
Normal file
@@ -0,0 +1,373 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('memo.create') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full">
|
||||
<!-- Preview Memo Penyelesaian -->
|
||||
<div class="bg-white">
|
||||
<!-- Header Controls - Hidden saat print -->
|
||||
<div class="p-4 border-b bg-agi-50 no-print">
|
||||
<div class="flex justify-between items-center mx-auto">
|
||||
<h3 class="text-lg font-semibold text-gray-800">
|
||||
Preview Memo Penyelesaian
|
||||
</h3>
|
||||
<div class="flex gap-2">
|
||||
<button onclick="history.back()" class="btn btn-sm btn-light">
|
||||
<i class="ki-filled ki-black-left"></i>
|
||||
Kembali Edit
|
||||
</button>
|
||||
<button type="button" onclick="window.print()" class="btn btn-sm btn-secondary">
|
||||
<i class="ki-filled ki-printer"></i>
|
||||
Print Preview
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (session('error'))
|
||||
<div class="m-4 no-print alert alert-danger">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Halaman 1: Memo Utama -->
|
||||
<div class="p-5 w-full bg-white page-memo">
|
||||
<!-- Header Bank -->
|
||||
<div class="flex items-center mb-3">
|
||||
<img class="default-logo min-h-[22px] max-w-none" style="height: 53.55px;"
|
||||
src="assets/media/images/logo-arthagraha.png" />
|
||||
</div>
|
||||
|
||||
<!-- Judul Memo -->
|
||||
<div class="mb-8 text-left">
|
||||
<h4 class="text-base font-semibold" style="margin: 0;"><strong>Memo Instruksi Penyelesaian</strong>
|
||||
Rekening Escrow / <strong>KSL Penilai Jaminan</strong></h4>
|
||||
</div>
|
||||
|
||||
<!-- Informasi Memo -->
|
||||
<div class="mb-8">
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="width: 80px; padding: 2px 0; vertical-align: top;">Kepada</td>
|
||||
<td style="width: 10px; padding: 2px 0; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">SUBDIT E-Channel Support & Operation (NOC)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px 0; vertical-align: top;">Dari</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">SUBDIT Appraisal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px 0; vertical-align: top;">Nomor</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;"><strong>{{ $memoData['memo_number'] }}</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px 0; vertical-align: top;">Tanggal</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">
|
||||
{{ dateFormat($memoData['memo_date']) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px 0; vertical-align: top;">Perihal</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">Penyelesaian Rekening Escrow / <strong>KSL
|
||||
Penilai Jaminan (PJ)</strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr style="border: none; border-top: 1px solid #000; margin: 20px 0;">
|
||||
|
||||
<!-- Isi Memo -->
|
||||
<div class="mb-8">
|
||||
<p style="margin-bottom: 16px; text-align: justify;">Sehubungan dengan telah dilakukannya penilaian
|
||||
jaminan dengan keterangan sbb :</p>
|
||||
|
||||
<table style="width: 100%; border-collapse: collapse; margin-bottom: 16px;">
|
||||
<tr>
|
||||
<td style="width: 200px; padding: 2px 0; vertical-align: top;">Nama Debitur</td>
|
||||
<td style="width: 10px; padding: 2px 0; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">Terlampir ({{ $memoData['debitur_count'] }}
|
||||
Debitur)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px 0; vertical-align: top;">Jaminan</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">Tanah & Bangunan</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px 0; vertical-align: top;">Total Biaya PJ</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;"><strong>Rp
|
||||
{{ number_format($memoData['total_biaya_pj'], 0, ',', '.') }},-</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td style="padding: 2px 0; vertical-align: top; font-size: 11pt;">
|
||||
({{ terbilang($memoData['total_biaya_pj']) }} Rupiah)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px 0; vertical-align: top;">Pembayaran Tanggal</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">
|
||||
{{ \Carbon\Carbon::parse($memoData['payment_date'])->format('d F Y') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px 0; vertical-align: top;">LPJ selesai dikirim</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px 0; vertical-align: top;">Jenis Penilaian</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px 0; vertical-align: top;">
|
||||
<strong>
|
||||
@if ($memoData['jenisPenilaian'] == 2)
|
||||
KJPP
|
||||
@else
|
||||
Internal
|
||||
@endif
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p style="margin-bottom: 16px; text-align: justify;">
|
||||
Kami menginstruksikan kepada Sentra Operasi untuk menyelesaikan Rekening Escrow /
|
||||
<strong>KSL Penilai Jaminan</strong> atas nama debitur tersebut diatas ke
|
||||
|
||||
@if ($memoData['jenisPenilaian'] == 2)
|
||||
<strong>KJPP (terlampir)</strong>.
|
||||
@else
|
||||
<strong>PDPT-Lainnya Penilaian Jaminan KPNO (IDR 57557)</strong>.
|
||||
@endif
|
||||
</p>
|
||||
|
||||
<p style="margin-bottom: 16px; text-align: justify;">Demikian kami sampaikan, atas perhatian dan
|
||||
kerjasamanya kami ucapkan terima kasih.</p>
|
||||
</div>
|
||||
|
||||
<!-- Tanda Tangan -->
|
||||
<div style="display: flex; justify-content: space-between; margin-top: 60px;">
|
||||
<div style="text-align: center; width: 30%;">
|
||||
<p style="margin-bottom: 80px;">Salam</p>
|
||||
<div style="border-bottom: 1px solid #000; margin: 0 auto 8px; width: 120px;"></div>
|
||||
<p style="font-weight: 500; margin: 0;">Innawati Sulina</p>
|
||||
<p style="font-size: 11pt; margin: 0;">DD Operation 2</p>
|
||||
</div>
|
||||
<div style="text-align: center; width: 30%;">
|
||||
<p style="margin-bottom: 80px;"> </p>
|
||||
<div style="border-bottom: 1px solid #000; margin: 0 auto 8px; width: 120px;"></div>
|
||||
<p style="font-weight: 500; margin: 0;">Wahab N. Wibawa</p>
|
||||
<p style="font-size: 11pt; margin: 0;">Pgs EO Subdit Appraisal</p>
|
||||
</div>
|
||||
<div style="text-align: center; width: 30%;">
|
||||
<p style="margin-bottom: 80px;"> </p>
|
||||
<div style="border-bottom: 1px solid #000; margin: 0 auto 8px; width: 120px;"></div>
|
||||
<p style="font-weight: 500; margin: 0;">Sumurung P. Siahaan</p>
|
||||
<p style="font-size: 11pt; margin: 0;"> </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Lampiran -->
|
||||
<div style="margin-top: 40px;">
|
||||
<p style="font-weight: 500; margin-bottom: 8px;">Lampiran :</p>
|
||||
<ul style="margin: 0; padding-left: 20px; font-size: 11pt;">
|
||||
<li style="margin-bottom: 4px;">Rekap permohonan penyelesaian biaya KJPP (Eksternal)</li>
|
||||
<li style="margin-bottom: 4px;">Asli Invoice & Faktur Pajak KJPP (Eksternal)</li>
|
||||
<li style="margin-bottom: 4px;">Copy Tiket Debet (KSL)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Halaman 2: Lampiran Daftar Permohonan -->
|
||||
<div class="p-5 w-full bg-white page-lampiran">
|
||||
<div style="text-align: center; margin-bottom: 30px;">
|
||||
<h3 style="font-weight: bold; margin: 0; font-size: 14pt;">LAMPIRAN</h3>
|
||||
<h4 style="font-weight: bold; margin: 8px 0 0 0; font-size: 13pt;">REKAP PERMOHONAN PENYELESAIAN BIAYA
|
||||
KJPP</h4>
|
||||
<p style="margin: 8px 0 0 0; font-size: 11pt;">Memo No: {{ $memoData['memo_number'] }}</p>
|
||||
</div>
|
||||
|
||||
<div style="overflow-x: auto;">
|
||||
<table style="width: 100%; border-collapse: collapse; font-size: 10pt;">
|
||||
<thead>
|
||||
<tr style="background-color: #f8f9fa;">
|
||||
<th style="border: 1px solid #000; padding: 8px; text-align: center; font-weight: bold;">No
|
||||
</th>
|
||||
<th style="border: 1px solid #000; padding: 8px; text-align: left; font-weight: bold;">Nomor
|
||||
Registrasi</th>
|
||||
<th style="border: 1px solid #000; padding: 8px; text-align: left; font-weight: bold;">
|
||||
Debitur</th>
|
||||
<th style="border: 1px solid #000; padding: 8px; text-align: left; font-weight: bold;">
|
||||
Cabang</th>
|
||||
<th style="border: 1px solid #000; padding: 8px; text-align: left; font-weight: bold;">AO
|
||||
</th>
|
||||
<th style="border: 1px solid #000; padding: 8px; text-align: left; font-weight: bold;">
|
||||
Tujuan Penilaian</th>
|
||||
<th style="border: 1px solid #000; padding: 8px; text-align: right; font-weight: bold;">
|
||||
Biaya PJ</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($permohonanList as $index => $permohonan)
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; padding: 6px; text-align: center;">
|
||||
{{ $index + 1 }}</td>
|
||||
<td style="border: 1px solid #000; padding: 6px; font-weight: 500;">
|
||||
{{ $permohonan->nomor_registrasi }}</td>
|
||||
<td style="border: 1px solid #000; padding: 6px;">
|
||||
{{ $permohonan->debiture->name ?? '-' }}</td>
|
||||
<td style="border: 1px solid #000; padding: 6px;">
|
||||
{{ $permohonan->branch->name ?? '-' }}</td>
|
||||
<td style="border: 1px solid #000; padding: 6px;">{{ $permohonan->user->name ?? '-' }}
|
||||
</td>
|
||||
<td style="border: 1px solid #000; padding: 6px;">
|
||||
@if ($permohonan->tujuanPenilaian)
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
<td style="border: 1px solid #000; padding: 6px; text-align: right; font-weight: 500;">
|
||||
Rp {{ number_format($permohonan->noc->nominal_bayar ?? 0, 0, ',', '.') }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr style="background-color: #f8f9fa; font-weight: bold;">
|
||||
<td colspan="6"
|
||||
style="border: 1px solid #000; padding: 8px; text-align: right; font-weight: bold;">
|
||||
Total Biaya PJ:</td>
|
||||
<td style="border: 1px solid #000; padding: 8px; text-align: right; font-weight: bold;">Rp
|
||||
{{ number_format($totalBiayaPJ, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Form untuk Generate PDF - Hidden saat print -->
|
||||
<div class="p-4 bg-gray-50 border-t no-print">
|
||||
<form action="{{ route('memo.generate-pdf') }}" method="POST" id="generate-form" class="mx-auto">
|
||||
@csrf
|
||||
@foreach ($permohonanList as $permohonan)
|
||||
<input type="hidden" name="permohonan_ids[]" value="{{ $permohonan->id }}">
|
||||
@endforeach
|
||||
<input type="hidden" name="memo_number" value="{{ $memoData['memo_number'] }}">
|
||||
<input type="hidden" name="memo_date" value="{{ $memoData['memo_date'] }}">
|
||||
<input type="hidden" name="payment_date" value="{{ $memoData['payment_date'] }}">
|
||||
|
||||
<div class="flex gap-2 justify-end">
|
||||
<button type="submit" class="btn btn-primary" id="generate-btn">
|
||||
<i class="ki-filled ki-file-down"></i>
|
||||
Generate PDF & Simpan
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const generateForm = document.getElementById('generate-form');
|
||||
const generateBtn = document.getElementById('generate-btn');
|
||||
|
||||
/**
|
||||
* Event listener untuk form generate PDF
|
||||
*/
|
||||
if (generateForm) {
|
||||
generateForm.addEventListener('submit', function(e) {
|
||||
// Konfirmasi sebelum generate
|
||||
const confirmed = confirm(
|
||||
'Apakah Anda yakin ingin generate PDF dan menyimpan memo penyelesaian ini?'
|
||||
);
|
||||
if (!confirmed) {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Disable submit button untuk mencegah double submit
|
||||
if (generateBtn) {
|
||||
generateBtn.disabled = true;
|
||||
generateBtn.innerHTML = '<i class="ki-filled ki-loading"></i> Memproses...';
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@push('styles')
|
||||
<style>
|
||||
/* Print Styles */
|
||||
@media print {
|
||||
* {
|
||||
-webkit-print-color-adjust: exact !important;
|
||||
color-adjust: exact !important;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
background: white !important;
|
||||
}
|
||||
|
||||
.no-print {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.page-memo,
|
||||
.page-lampiran {
|
||||
width: 210mm !important;
|
||||
min-height: 297mm !important;
|
||||
margin: 0 !important;
|
||||
padding: 20mm !important;
|
||||
page-break-after: always;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.page-lampiran {
|
||||
page-break-before: always !important;
|
||||
}
|
||||
|
||||
/* Ensure table borders print correctly */
|
||||
table,
|
||||
th,
|
||||
td {
|
||||
border-collapse: collapse !important;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
border: 1px solid #000 !important;
|
||||
}
|
||||
|
||||
/* Ensure background colors print */
|
||||
.bg-gray-50,
|
||||
tr[style*="background-color: #f8f9fa"] {
|
||||
background-color: #f8f9fa !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Screen Styles */
|
||||
@media screen {
|
||||
|
||||
.page-memo,
|
||||
.page-lampiran {
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
313
resources/views/memo/show.blade.php
Normal file
313
resources/views/memo/show.blade.php
Normal file
@@ -0,0 +1,313 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('memo.show') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||
<!-- Header -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
Detail Memo Penyelesaian
|
||||
</h3>
|
||||
<div class="flex gap-2 items-center">
|
||||
<a href="{{ route('memo.index') }}" class="btn btn-sm btn-light">
|
||||
<i class="ki-filled ki-black-left"></i>
|
||||
Kembali
|
||||
</a>
|
||||
<button onclick="window.print()" class="btn btn-sm btn-primary">
|
||||
<i class="ki-filled ki-printer"></i>
|
||||
Cetak
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Detail Memo -->
|
||||
<div class="card">
|
||||
<div class="bg-gray-50 card-header">
|
||||
<h4 class="text-lg card-title">
|
||||
Informasi Memo Penyelesaian
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="grid grid-cols-1 gap-6 mb-8 lg:grid-cols-2">
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Judul Memo:</label>
|
||||
<p class="mt-1 font-semibold text-gray-900">
|
||||
{{ $permohonan->memo_penyelesaian_title ?? 'Belum ada memo' }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Tanggal Memo:</label>
|
||||
<p class="mt-1 text-gray-900">
|
||||
@if ($permohonan->memo_penyelesaian_date)
|
||||
{{ \Carbon\Carbon::parse($permohonan->memo_penyelesaian_date)->format('d F Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Status:</label>
|
||||
<p class="mt-1">
|
||||
@if ($permohonan->status === 'memo-penyelesaian')
|
||||
<span class="uppercase badge badge-success">{{ $permohonan->status }}</span>
|
||||
@else
|
||||
<span class="uppercase badge badge-warning">{{ $permohonan->status }}</span>
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Dibuat Pada:</label>
|
||||
<p class="mt-1 text-gray-900">
|
||||
@if ($permohonan->memo_penyelesaian_created_at)
|
||||
{{ \Carbon\Carbon::parse($permohonan->memo_penyelesaian_created_at)->format('d F Y H:i') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($permohonan->memo_penyelesaian_content)
|
||||
<div class="mb-8">
|
||||
<label class="block mb-3 text-sm font-medium text-gray-600">Isi Memo:</label>
|
||||
<div class="p-4 bg-gray-50 rounded-lg border">
|
||||
<div class="max-w-none prose">
|
||||
{!! nl2br(e($permohonan->memo_penyelesaian_content)) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Detail Permohonan -->
|
||||
<div class="card">
|
||||
<div class="bg-blue-50 card-header">
|
||||
<h4 class="text-lg card-title">
|
||||
Detail Permohonan
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="grid grid-cols-1 gap-6 lg:grid-cols-2">
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Nomor Registrasi:</label>
|
||||
<p class="mt-1 font-semibold text-gray-900">{{ $permohonan->nomor_registrasi }}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Debitur:</label>
|
||||
<p class="mt-1 text-gray-900">{{ $permohonan->debiture->name ?? '-' }}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Cabang/Direktorat:</label>
|
||||
<p class="mt-1 text-gray-900">{{ $permohonan->branch->name ?? '-' }}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Account Officer:</label>
|
||||
<p class="mt-1 text-gray-900">{{ $permohonan->user->name ?? '-' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Tujuan Penilaian:</label>
|
||||
<p class="mt-1">
|
||||
@if ($permohonan->tujuanPenilaian)
|
||||
<span class="badge badge-primary">{{ $permohonan->tujuanPenilaian->name }}</span>
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Fasilitas Kredit:</label>
|
||||
<p class="mt-1 text-gray-900">{{ $permohonan->jenisFasilitasKredit->name ?? '-' }}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Tanggal Permohonan:</label>
|
||||
<p class="mt-1 text-gray-900">
|
||||
@if ($permohonan->tanggal_permohonan)
|
||||
{{ \Carbon\Carbon::parse($permohonan->tanggal_permohonan)->format('d F Y') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@if ($permohonan->nilai_liquidasi)
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Nilai Liquidasi:</label>
|
||||
<p class="mt-1 font-semibold text-gray-900">
|
||||
Rp {{ number_format($permohonan->nilai_liquidasi, 0, ',', '.') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Informasi Penilaian -->
|
||||
@if ($permohonan->penilaian)
|
||||
<div class="card">
|
||||
<div class="bg-green-50 card-header">
|
||||
<h4 class="text-lg card-title">
|
||||
Informasi Penilaian
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="grid grid-cols-1 gap-6 lg:grid-cols-2">
|
||||
<div class="space-y-4">
|
||||
@if ($permohonan->penilaian->waktu_penilaian)
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Waktu Penilaian:</label>
|
||||
<p class="mt-1 text-gray-900">
|
||||
{{ \Carbon\Carbon::parse($permohonan->penilaian->waktu_penilaian)->format('d F Y H:i') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($permohonan->penilai)
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Tipe Penilai:</label>
|
||||
<p class="mt-1">
|
||||
<span
|
||||
class="uppercase badge badge-info">{{ $permohonan->penilai->type_penilai ?? '-' }}</span>
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="space-y-4">
|
||||
@if ($permohonan->penilaian->created_at)
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Dibuat Pada:</label>
|
||||
<p class="mt-1 text-gray-900">
|
||||
{{ \Carbon\Carbon::parse($permohonan->penilaian->created_at)->format('d F Y H:i') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Informasi Approval -->
|
||||
<div class="card">
|
||||
<div class="bg-yellow-50 card-header">
|
||||
<h4 class="text-lg card-title">
|
||||
Status Approval
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="grid grid-cols-1 gap-6 lg:grid-cols-3">
|
||||
<div class="p-4 text-center rounded-lg border">
|
||||
<div class="mb-2">
|
||||
@if ($permohonan->approval_so_at)
|
||||
<i class="text-3xl text-green-500 ki-filled ki-check-circle"></i>
|
||||
@else
|
||||
<i class="text-3xl text-gray-400 ki-filled ki-time"></i>
|
||||
@endif
|
||||
</div>
|
||||
<h5 class="font-semibold text-gray-900">Senior Officer</h5>
|
||||
<p class="mt-1 text-sm text-gray-600">
|
||||
@if ($permohonan->approval_so_at)
|
||||
Disetujui pada<br>
|
||||
{{ \Carbon\Carbon::parse($permohonan->approval_so_at)->format('d F Y H:i') }}
|
||||
@else
|
||||
Menunggu Persetujuan
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="p-4 text-center rounded-lg border">
|
||||
<div class="mb-2">
|
||||
@if ($permohonan->approval_eo_at)
|
||||
<i class="text-3xl text-green-500 ki-filled ki-check-circle"></i>
|
||||
@else
|
||||
<i class="text-3xl text-gray-400 ki-filled ki-time"></i>
|
||||
@endif
|
||||
</div>
|
||||
<h5 class="font-semibold text-gray-900">Executive Officer</h5>
|
||||
<p class="mt-1 text-sm text-gray-600">
|
||||
@if ($permohonan->approval_eo_at)
|
||||
Disetujui pada<br>
|
||||
{{ \Carbon\Carbon::parse($permohonan->approval_eo_at)->format('d F Y H:i') }}
|
||||
@else
|
||||
Menunggu Persetujuan
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="p-4 text-center rounded-lg border">
|
||||
<div class="mb-2">
|
||||
@if ($permohonan->approval_dd_at)
|
||||
<i class="text-3xl text-green-500 ki-filled ki-check-circle"></i>
|
||||
@else
|
||||
<i class="text-3xl text-gray-400 ki-filled ki-time"></i>
|
||||
@endif
|
||||
</div>
|
||||
<h5 class="font-semibold text-gray-900">Deputy Director</h5>
|
||||
<p class="mt-1 text-sm text-gray-600">
|
||||
@if ($permohonan->approval_dd_at)
|
||||
Disetujui pada<br>
|
||||
{{ \Carbon\Carbon::parse($permohonan->approval_dd_at)->format('d F Y H:i') }}
|
||||
@else
|
||||
Menunggu Persetujuan
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<style>
|
||||
@media print {
|
||||
|
||||
.btn,
|
||||
.card-header .flex {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.card {
|
||||
box-shadow: none !important;
|
||||
border: 1px solid #e5e7eb !important;
|
||||
margin-bottom: 1rem !important;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 16px !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
@@ -15,197 +15,357 @@
|
||||
@endphp
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||
<div class="pb-2.5 border card border-agi-100">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
<div class="flex flex-row gap-1.5 card-title">
|
||||
{{ $hasMemo ? 'Proses Penyelesaian NOC' : 'NOC' }}
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('noc.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
<div class="flex gap-2 items-center">
|
||||
<a href="{{ route('noc.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i>
|
||||
Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ !$hasMemo ? route('noc.store') : route('noc.update',$persetujuanPenawaran) }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
<form action="{{ !$hasMemo ? route('noc.store') : route('noc.update', $persetujuanPenawaran) }}"
|
||||
method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@if($hasMemo)
|
||||
@if ($hasMemo)
|
||||
@method('PUT')
|
||||
@endif
|
||||
<input type="hidden" name="penawaran_id" value="{{ $persetujuanPenawaran->penawaran_id ?? old('penawaran_id') }}">
|
||||
<input type="hidden" name="persetujuan_penawaran_id" value="{{ $persetujuanPenawaran->id ?? old('persetujuan_penawaran_id') }}">
|
||||
<input type="hidden" name="permohonan_id" value="{{ $persetujuanPenawaran->penawaran->permohonan->id ?? $persetujuanPenawaran->permohonan->id }}">
|
||||
<input type="hidden" name="penawaran_id"
|
||||
value="{{ $persetujuanPenawaran->penawaran_id ?? old('penawaran_id') }}">
|
||||
<input type="hidden" name="persetujuan_penawaran_id"
|
||||
value="{{ $persetujuanPenawaran->id ?? old('persetujuan_penawaran_id') }}">
|
||||
<input type="hidden" name="permohonan_id"
|
||||
value="{{ $persetujuanPenawaran->penawaran->permohonan->id ?? $persetujuanPenawaran->permohonan->id }}">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Status Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status_pembayar') border-danger bg-danger-light @enderror" name="status_pembayar" id="status_pembayar" {{ $hasMemo ? 'disabled' : '' }}>
|
||||
<select
|
||||
class="input tomselect w-full @error('status_pembayar') border-danger bg-danger-light @enderror"
|
||||
name="status_pembayar" id="status_pembayar" {{ $hasMemo ? 'disabled' : '' }}>
|
||||
<option value="">Pilih Status Bayar</option>
|
||||
<option value="sudah_bayar" {{ (old('status_pembayar') == 'sudah_bayar') || ($persetujuanPenawaran?->penawaran?->permohonan?->status_bayar == 'sudah_bayar') ? 'selected' : '' }}>Sudah Bayar</option>
|
||||
<option value="belum_bayar" {{ (old('status_pembayar') == 'belum_bayar') || ($persetujuanPenawaran?->penawaran?->permohonan?->status_bayar == 'belum_bayar') ? 'selected' : '' }}>Belum Bayar</option>
|
||||
<option value="sudah_bayar"
|
||||
{{ old('status_pembayar') == 'sudah_bayar' || $persetujuanPenawaran?->penawaran?->permohonan?->status_bayar == 'sudah_bayar' ? 'selected' : '' }}>
|
||||
Sudah Bayar</option>
|
||||
<option value="belum_bayar"
|
||||
{{ old('status_pembayar') == 'belum_bayar' || $persetujuanPenawaran?->penawaran?->permohonan?->status_bayar == 'belum_bayar' ? 'selected' : '' }}>
|
||||
Belum Bayar</option>
|
||||
</select>
|
||||
@error('status_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Bukti Pembayaran
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if(!empty($persetujuanPenawaran->bukti_bayar))
|
||||
<div class="mt-2 flex items-center">
|
||||
<a href="{{ Storage::url($persetujuanPenawaran->bukti_bayar) }}" target="_blank" class="badge badge-sm badge-outline badge-warning">
|
||||
<i class="ki-filled ki-eye mr-2"></i> Lihat File
|
||||
@if (!empty($persetujuanPenawaran->bukti_bayar))
|
||||
<div class="flex items-center mt-2">
|
||||
<a href="{{ Storage::url($persetujuanPenawaran->bukti_bayar) }}" target="_blank"
|
||||
class="badge badge-sm badge-outline badge-warning">
|
||||
<i class="mr-2 ki-filled ki-eye"></i> Lihat File
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Nominal Bayar
|
||||
Jumlah Yang Harus Disetor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="number" name="total_harus_bayar" id="total_harus_bayar" class="input w-full @error('total_harus_bayar') border-danger bg-danger-light @enderror" value="{{ old('total_harus_bayar', $persetujuanPenawaran->nominal_bayar ?? '') }}" readonly>
|
||||
<input type="number" name="total_harus_bayar" id="total_harus_bayar"
|
||||
class="input w-full @error('total_harus_bayar') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('total_harus_bayar', $persetujuanPenawaran->nominal_bayar ?? '') }}"
|
||||
readonly>
|
||||
@error('total_harus_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Nominal Diterima
|
||||
Jumlah Yang Disetor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="number" name="nominal_bayar" id="nominal_bayar" class="input w-full @error('nominal_bayar') border-danger bg-danger-light @enderror" value="{{ old('nominal_bayar', $persetujuanPenawaran->noc->nominal_bayar ?? '') }}" placeholder="Masukkan nominal bayar" {{ $hasMemo ? 'readonly' : '' }}>
|
||||
<input type="number" name="nominal_bayar" id="nominal_bayar"
|
||||
class="input w-full @error('nominal_bayar') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('nominal_bayar', $persetujuanPenawaran->noc->nominal_bayar ?? '') }}"
|
||||
placeholder="Masukkan nominal bayar" {{ $hasMemo ? 'readonly' : '' }}>
|
||||
@error('nominal_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Jumlah Pembukuan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="number" name="total_pembukuan" id="total_pembukuan"
|
||||
class="input w-full @error('total_pembukuan') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('total_pembukuan', $persetujuanPenawaran->noc->total_pembukuan ?? '') }}"
|
||||
placeholder="Masukkan total pembukuan" {{ $hasMemo ? 'readonly' : '' }}>
|
||||
@error('total_pembukuan')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Pembayaran
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="date" name="tanggal_pembayaran" id="tanggal_pembayaran" class="input w-full @error('tanggal_pembayaran') border-danger bg-danger-light @enderror" value="{{ old('tanggal_pembayaran', isset($persetujuanPenawaran->noc->tanggal_pembayaran) ? date('Y-m-d', strtotime($persetujuanPenawaran->noc->tanggal_pembayaran)) : '') }}" {{ $hasMemo ? 'readonly' : '' }}>
|
||||
<input type="date" name="tanggal_pembayaran" id="tanggal_pembayaran"
|
||||
class="input w-full @error('tanggal_pembayaran') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('tanggal_pembayaran', isset($persetujuanPenawaran->noc->tanggal_pembayaran) ? date('Y-m-d', strtotime($persetujuanPenawaran->noc->tanggal_pembayaran)) : '') }}"
|
||||
{{ $hasMemo ? 'readonly' : '' }}>
|
||||
@error('tanggal_pembayaran')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<!-- Field Status Kurang Bayar -->
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Bukti KSL
|
||||
Status Kurang Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if(!$hasMemo)
|
||||
<input type="file" name="bukti_ksl" id="bukti_ksl" class="file-input w-full @error('bukti_ksl') border-danger bg-danger-light @enderror" accept=".pdf,.jpg,.jpeg,.png">
|
||||
@error('bukti_ksl')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<div class="flex gap-4 items-center">
|
||||
<label class="checkbox-group">
|
||||
<input class="checkbox checkbox-sm" name="status_kurang_bayar" id="status_kurang_bayar"
|
||||
value="1" type="checkbox"
|
||||
{{ old('status_kurang_bayar', $persetujuanPenawaran->noc->status_kurang_bayar ?? false) ? 'checked' : '' }}
|
||||
{{ $hasMemo ? 'disabled' : '' }}>
|
||||
<span class="checkbox-label">
|
||||
Ya, ada kurang bayar
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
@error('status_kurang_bayar')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Field Nominal Kurang Bayar -->
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap" id="nominal_kurang_bayar_section"
|
||||
style="display: none;">
|
||||
<label class="form-label max-w-56">
|
||||
Nominal Kurang Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="number" name="nominal_kurang_bayar" id="nominal_kurang_bayar"
|
||||
class="input w-full @error('nominal_kurang_bayar') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('nominal_kurang_bayar', $persetujuanPenawaran->noc->nominal_kurang_bayar ?? '') }}"
|
||||
placeholder="Masukkan nominal kurang bayar" {{ $hasMemo ? 'readonly' : '' }}>
|
||||
@error('nominal_kurang_bayar')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Field Status Lebih Bayar -->
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Status Lebih Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex gap-4 items-center">
|
||||
<label class="checkbox-group">
|
||||
<input class="checkbox checkbox-sm" name="status_lebih_bayar" id="status_lebih_bayar"
|
||||
value="1" type="checkbox"
|
||||
{{ old('status_lebih_bayar', $persetujuanPenawaran->noc->status_lebih_bayar ?? false) ? 'checked' : '' }}
|
||||
{{ $hasMemo ? 'disabled' : '' }}>
|
||||
<span class="checkbox-label">Ya, ada lebih bayar </span>
|
||||
</label>
|
||||
</div>
|
||||
@error('status_lebih_bayar')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Field Nominal Lebih Bayar -->
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap" id="nominal_lebih_bayar_section"
|
||||
style="display: none;">
|
||||
<label class="form-label max-w-56">
|
||||
Nominal Lebih Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="number" name="nominal_lebih_bayar" id="nominal_lebih_bayar"
|
||||
class="input w-full @error('nominal_lebih_bayar') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('nominal_lebih_bayar', $persetujuanPenawaran->noc->nominal_lebih_bayar ?? '') }}"
|
||||
placeholder="Masukkan nominal lebih bayar" {{ $hasMemo ? 'readonly' : '' }}>
|
||||
@error('nominal_lebih_bayar')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Field Bukti Pengembalian -->
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap" id="bukti_pengembalian_section"
|
||||
style="display: none;">
|
||||
<label class="form-label max-w-56">
|
||||
Bukti Pengembalian
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (!$hasMemo)
|
||||
<input type="file" name="bukti_pengembalian" id="bukti_pengembalian"
|
||||
class="file-input w-full @error('bukti_pengembalian') border-danger bg-danger-light @enderror"
|
||||
accept=".pdf,.jpg,.jpeg,.png">
|
||||
@error('bukti_pengembalian')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
@endif
|
||||
|
||||
@if(isset($persetujuanPenawaran->noc->bukti_ksl) && !empty($persetujuanPenawaran->noc->bukti_ksl))
|
||||
<div class="mt-2 flex items-center">
|
||||
<a href="{{ Storage::url($persetujuanPenawaran->noc->bukti_ksl) }}" target="_blank" class="badge badge-sm badge-outline badge-warning">
|
||||
<i class="ki-filled ki-eye mr-2"></i> Lihat File
|
||||
@if (isset($persetujuanPenawaran->noc->bukti_pengembalian) && !empty($persetujuanPenawaran->noc->bukti_pengembalian))
|
||||
<div class="flex items-center mt-2">
|
||||
<a href="{{ Storage::url($persetujuanPenawaran->noc->bukti_pengembalian) }}"
|
||||
target="_blank" class="badge badge-sm badge-outline badge-warning">
|
||||
<i class="mr-2 ki-filled ki-eye"></i> Lihat File
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($hasMemo)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Bukti KSL
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (!$hasMemo)
|
||||
<input type="file" name="bukti_ksl" id="bukti_ksl"
|
||||
class="file-input w-full @error('bukti_ksl') border-danger bg-danger-light @enderror"
|
||||
accept=".pdf,.jpg,.jpeg,.png">
|
||||
@error('bukti_ksl')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
@endif
|
||||
|
||||
@if (isset($persetujuanPenawaran->noc->bukti_ksl) && !empty($persetujuanPenawaran->noc->bukti_ksl))
|
||||
<div class="flex items-center mt-2">
|
||||
<a href="{{ Storage::url($persetujuanPenawaran->noc->bukti_ksl) }}" target="_blank"
|
||||
class="badge badge-sm badge-outline badge-warning">
|
||||
<i class="mr-2 ki-filled ki-eye"></i> Lihat File
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($hasMemo)
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Memo Penyelesaian
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex items-center">
|
||||
<a href="{{ Storage::url($persetujuanPenawaran->noc->memo_penyelesaian) }}" target="_blank" class="badge badge-sm badge-outline badge-warning">
|
||||
<i class="ki-filled ki-eye mr-2"></i> Lihat File
|
||||
<a href="{{ Storage::url($persetujuanPenawaran->noc->memo_penyelesaian) }}"
|
||||
target="_blank" class="badge badge-sm badge-outline badge-warning">
|
||||
<i class="mr-2 ki-filled ki-eye"></i> Lihat File
|
||||
</a>
|
||||
<input type="hidden" name="memo_penyelesaian_existing" value="{{ $persetujuanPenawaran->noc->memo_penyelesaian }}">
|
||||
<input type="hidden" name="memo_penyelesaian_existing"
|
||||
value="{{ $persetujuanPenawaran->noc->memo_penyelesaian }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Bukti Penyelesaian
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="file" name="bukti_penyelesaian" id="bukti_penyelesaian" class="file-input w-full @error('bukti_penyelesaian') border-danger bg-danger-light @enderror" accept=".pdf,.jpg,.jpeg,.png">
|
||||
<input type="file" name="bukti_penyelesaian" id="bukti_penyelesaian"
|
||||
class="file-input w-full @error('bukti_penyelesaian') border-danger bg-danger-light @enderror"
|
||||
accept=".pdf,.jpg,.jpeg,.png">
|
||||
@error('bukti_penyelesaian')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
@if(isset($persetujuanPenawaran->noc->bukti_penyelesaian) && !empty($persetujuanPenawaran->noc->bukti_penyelesaian))
|
||||
<div class="mt-2 flex items-center">
|
||||
<a href="{{ Storage::url($persetujuanPenawaran->noc->bukti_penyelesaian) }}" target="_blank" class="badge badge-sm badge-outline badge-warning">
|
||||
<i class="ki-filled ki-eye mr-2"></i> Lihat File
|
||||
@if (isset($persetujuanPenawaran->noc->bukti_penyelesaian) && !empty($persetujuanPenawaran->noc->bukti_penyelesaian))
|
||||
<div class="flex items-center mt-2">
|
||||
<a href="{{ Storage::url($persetujuanPenawaran->noc->bukti_penyelesaian) }}"
|
||||
target="_blank" class="badge badge-sm badge-outline badge-warning">
|
||||
<i class="mr-2 ki-filled ki-eye"></i> Lihat File
|
||||
</a>
|
||||
<input type="hidden" name="bukti_penyelesaian_existing" value="{{ $persetujuanPenawaran->noc->bukti_penyelesaian }}">
|
||||
<input type="hidden" name="bukti_penyelesaian_existing"
|
||||
value="{{ $persetujuanPenawaran->noc->bukti_penyelesaian }}">
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Nominal Penyelesaian
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="number" name="nominal_penyelesaian" id="nominal_penyelesaian" class="input w-full @error('nominal_penyelesaian') border-danger bg-danger-light @enderror" value="{{ old('nominal_penyelesaian', $persetujuanPenawaran->noc->nominal_penyelesaian ?? '') }}" placeholder="Masukkan nominal penyelesaian">
|
||||
<input type="number" name="nominal_penyelesaian" id="nominal_penyelesaian"
|
||||
class="input w-full @error('nominal_penyelesaian') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('nominal_penyelesaian', $persetujuanPenawaran->noc->nominal_penyelesaian ?? '') }}"
|
||||
placeholder="Masukkan nominal penyelesaian">
|
||||
@error('nominal_penyelesaian')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Penyelesaian
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="date" name="tanggal_penyelesaian" id="tanggal_penyelesaian" class="input w-full @error('tanggal_penyelesaian') border-danger bg-danger-light @enderror" value="{{ old('tanggal_penyelesaian', isset($persetujuanPenawaran->noc->tanggal_penyelesaian) ? date('Y-m-d', strtotime($persetujuanPenawaran->noc->tanggal_penyelesaian)) : '') }}">
|
||||
<input type="date" name="tanggal_penyelesaian" id="tanggal_penyelesaian"
|
||||
class="input w-full @error('tanggal_penyelesaian') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('tanggal_penyelesaian', isset($persetujuanPenawaran->noc->tanggal_penyelesaian) ? date('Y-m-d', strtotime($persetujuanPenawaran->noc->tanggal_penyelesaian)) : '') }}">
|
||||
@error('tanggal_penyelesaian')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="catatan" id="catatan" rows="4" class="textarea w-full @error('catatan') border-danger bg-danger-light @enderror" readonly placeholder="Masukkan catatan">{{ old('catatan', $persetujuanPenawaran->catatan ?? '') }}</textarea>
|
||||
<textarea name="catatan" id="catatan" rows="4"
|
||||
class="textarea w-full @error('catatan') border-danger bg-danger-light @enderror" readonly
|
||||
placeholder="Masukkan catatan">{{ old('catatan', $persetujuanPenawaran->catatan ?? '') }}</textarea>
|
||||
@error('catatan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan NOC
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="catatan_noc" id="catatan_noc" rows="4" class="textarea w-full @error('catatan_noc') border-danger bg-danger-light @enderror" placeholder="Masukkan catatan noc">{{ old('catatan_noc', $persetujuanPenawaran->noc->catatan_noc ?? '') }}</textarea>
|
||||
<textarea name="catatan_noc" id="catatan_noc" rows="4"
|
||||
class="textarea w-full @error('catatan_noc') border-danger bg-danger-light @enderror"
|
||||
placeholder="Masukkan catatan noc">{{ old('catatan_noc', $persetujuanPenawaran->noc->catatan_noc ?? '') }}</textarea>
|
||||
@error('catatan_noc')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@@ -220,3 +380,176 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
/**
|
||||
* Fungsi untuk mengelola mutual exclusive selection antara kurang bayar dan lebih bayar
|
||||
* Hanya satu status yang bisa dipilih pada satu waktu
|
||||
*/
|
||||
const statusKurangBayar = document.getElementById('status_kurang_bayar');
|
||||
const statusLebihBayar = document.getElementById('status_lebih_bayar');
|
||||
const nominalKurangBayarSection = document.getElementById('nominal_kurang_bayar_section');
|
||||
const nominalLebihBayarSection = document.getElementById('nominal_lebih_bayar_section');
|
||||
const buktiPengembalianSection = document.getElementById('bukti_pengembalian_section');
|
||||
|
||||
// Field untuk perbandingan nilai
|
||||
const totalHarusBayar = document.getElementById('total_harus_bayar');
|
||||
const nominalBayar = document.getElementById('nominal_bayar');
|
||||
const totalPembukuan = document.getElementById('total_pembukuan');
|
||||
|
||||
/**
|
||||
* Fungsi untuk mengatur enable/disable status checkbox berdasarkan perbandingan nilai
|
||||
* Logika:
|
||||
* - Jika semua nilai sama: kedua checkbox disabled
|
||||
* - Jika nominal_bayar/total_pembukuan < total_harus_bayar: hanya status_kurang_bayar enabled
|
||||
* - Jika nominal_bayar/total_pembukuan > total_harus_bayar: hanya status_lebih_bayar enabled
|
||||
*/
|
||||
function updateCheckboxStatus() {
|
||||
const totalHarus = parseFloat(totalHarusBayar.value) || 0;
|
||||
const nominal = parseFloat(nominalBayar.value) || 0;
|
||||
const pembukuan = parseFloat(totalPembukuan.value) || 0;
|
||||
|
||||
console.log('Updating checkbox status:', {
|
||||
totalHarus,
|
||||
nominal,
|
||||
pembukuan
|
||||
});
|
||||
|
||||
// Reset checkbox states
|
||||
statusKurangBayar.disabled = false;
|
||||
statusLebihBayar.disabled = false;
|
||||
|
||||
// Jika semua nilai sama, disable kedua checkbox
|
||||
if (totalHarus === nominal && nominal === pembukuan && totalHarus > 0) {
|
||||
statusKurangBayar.disabled = true;
|
||||
statusLebihBayar.disabled = true;
|
||||
statusKurangBayar.checked = false;
|
||||
statusLebihBayar.checked = false;
|
||||
nominalKurangBayarSection.style.display = 'none';
|
||||
nominalLebihBayarSection.style.display = 'none';
|
||||
buktiPengembalianSection.style.display = 'none';
|
||||
console.log('Semua nilai sama, kedua checkbox disabled');
|
||||
}
|
||||
// Jika nominal/pembukuan kurang dari total harus bayar
|
||||
else if ((nominal > 0 && nominal < totalHarus) || (pembukuan > 0 && pembukuan < totalHarus)) {
|
||||
statusLebihBayar.disabled = true;
|
||||
statusLebihBayar.checked = false;
|
||||
statusKurangBayar.checked = true;
|
||||
nominalKurangBayarSection.style.display = '';
|
||||
nominalLebihBayarSection.style.display = 'none';
|
||||
buktiPengembalianSection.style.display = 'none';
|
||||
console.log('Kurang bayar, hanya status_kurang_bayar enabled');
|
||||
}
|
||||
// Jika nominal/pembukuan lebih dari total harus bayar
|
||||
else if ((nominal > 0 && nominal > totalHarus) || (pembukuan > 0 && pembukuan > totalHarus)) {
|
||||
statusKurangBayar.disabled = true;
|
||||
statusKurangBayar.checked = false;
|
||||
statusLebihBayar.checked = true;
|
||||
nominalLebihBayarSection.style.display = '';
|
||||
nominalKurangBayarSection.style.display = 'none';
|
||||
console.log('Lebih bayar, hanya status_lebih_bayar enabled');
|
||||
}
|
||||
}
|
||||
|
||||
// Event listeners untuk update otomatis saat nilai berubah
|
||||
if (nominalBayar) {
|
||||
nominalBayar.addEventListener('input', updateCheckboxStatus);
|
||||
nominalBayar.addEventListener('change', updateCheckboxStatus);
|
||||
}
|
||||
|
||||
if (totalPembukuan) {
|
||||
totalPembukuan.addEventListener('input', updateCheckboxStatus);
|
||||
totalPembukuan.addEventListener('change', updateCheckboxStatus);
|
||||
}
|
||||
|
||||
// Initial check saat halaman dimuat
|
||||
updateCheckboxStatus();
|
||||
|
||||
/**
|
||||
* Fungsi untuk reset field dan section visibility
|
||||
* @param {string} type - 'kurang' atau 'lebih'
|
||||
*/
|
||||
function resetFields(type) {
|
||||
if (type === 'kurang') {
|
||||
// Reset field lebih bayar
|
||||
statusLebihBayar.checked = false;
|
||||
nominalLebihBayarSection.style.display = 'none';
|
||||
buktiPengembalianSection.style.display = 'none';
|
||||
document.getElementById('nominal_lebih_bayar').value = '';
|
||||
document.getElementById('bukti_pengembalian').value = '';
|
||||
} else if (type === 'lebih') {
|
||||
// Reset field kurang bayar
|
||||
statusKurangBayar.checked = false;
|
||||
nominalKurangBayarSection.style.display = 'none';
|
||||
document.getElementById('nominal_kurang_bayar').value = '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler untuk status kurang bayar
|
||||
* Menampilkan field nominal kurang bayar dan menyembunyikan field lebih bayar
|
||||
*/
|
||||
if (statusKurangBayar) {
|
||||
// Set initial state
|
||||
if (statusKurangBayar.checked) {
|
||||
nominalKurangBayarSection.style.display = 'flex';
|
||||
resetFields('kurang');
|
||||
}
|
||||
|
||||
statusKurangBayar.addEventListener('change', function() {
|
||||
// Cek apakah checkbox tidak disabled sebelum memproses
|
||||
if (this.disabled) {
|
||||
this.checked = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.checked) {
|
||||
nominalKurangBayarSection.style.display = 'flex';
|
||||
resetFields('kurang');
|
||||
console.log('Status kurang bayar dipilih, field lebih bayar direset');
|
||||
} else {
|
||||
nominalKurangBayarSection.style.display = 'none';
|
||||
document.getElementById('nominal_kurang_bayar').value = '';
|
||||
console.log('Status kurang bayar dibatalkan');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler untuk status lebih bayar
|
||||
* Menampilkan field nominal dan bukti pengembalian, menyembunyikan field kurang bayar
|
||||
*/
|
||||
if (statusLebihBayar) {
|
||||
// Set initial state
|
||||
if (statusLebihBayar.checked) {
|
||||
nominalLebihBayarSection.style.display = 'flex';
|
||||
buktiPengembalianSection.style.display = 'flex';
|
||||
resetFields('lebih');
|
||||
}
|
||||
|
||||
statusLebihBayar.addEventListener('change', function() {
|
||||
// Cek apakah checkbox tidak disabled sebelum memproses
|
||||
if (this.disabled) {
|
||||
this.checked = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.checked) {
|
||||
nominalLebihBayarSection.style.display = 'flex';
|
||||
buktiPengembalianSection.style.display = 'flex';
|
||||
resetFields('lebih');
|
||||
console.log('Status lebih bayar dipilih, field kurang bayar direset');
|
||||
} else {
|
||||
nominalLebihBayarSection.style.display = 'none';
|
||||
buktiPengembalianSection.style.display = 'none';
|
||||
document.getElementById('nominal_lebih_bayar').value = '';
|
||||
document.getElementById('bukti_pengembalian').value = '';
|
||||
console.log('Status lebih bayar dibatalkan');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="noc-table" data-api-url="{{ route('noc.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="noc-table" data-api-url="{{ route('noc.datatables') }}">
|
||||
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Daftar NOC
|
||||
</h3>
|
||||
@@ -27,77 +28,78 @@
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_debitur">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cabang">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_setor">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Nominal bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Bukti Bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_diterima">
|
||||
<span class="sort"> <span class="sort-label"> Nominal Diterima </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_ksl">
|
||||
<span class="sort"> <span class="sort-label"> Bukti KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_pembayaran">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Pembayaran </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="memo_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Memo Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Bukti Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Nominal Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_debitur">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cabang">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_setor">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Nominal bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Bukti Bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_diterima">
|
||||
<span class="sort"> <span class="sort-label"> Nominal Diterima </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_ksl">
|
||||
<span class="sort"> <span class="sort-label"> Bukti KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_pembayaran">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Pembayaran </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="memo_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Memo Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Bukti Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Nominal Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||
<div class="flex gap-2 items-center">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="flex gap-4 items-center">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
@@ -105,140 +107,143 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function prosesData(data) {
|
||||
Swal.fire({
|
||||
title: 'NOC',
|
||||
text: "Apakah Anda yakin ingin menyetujui pembayaran ini?",
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya',
|
||||
cancelButtonText: 'Tidak'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = `noc/${data}/edit`;
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function prosesData(data) {
|
||||
Swal.fire({
|
||||
title: 'NOC',
|
||||
text: "Apakah Anda yakin ingin menyetujui pembayaran ini?",
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya',
|
||||
cancelButtonText: 'Tidak'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = `noc/${data}/edit`;
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
const element = document.querySelector('#noc-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi'
|
||||
},
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
},
|
||||
cabang: {
|
||||
title: 'Cabang',
|
||||
return: (item, data) => {
|
||||
return data.cabang.code + ' - ' + data.cabang.nama;
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
const element = document.querySelector('#noc-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi'
|
||||
},
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
},
|
||||
cabang: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
tanggal_setor: {
|
||||
title: 'Tanggal Setor',
|
||||
},
|
||||
nominal_bayar: {
|
||||
title: 'Nominal Bayar',
|
||||
},
|
||||
bukti_bayar: {
|
||||
title: 'Bukti KSL',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_bayar) {
|
||||
return `<a href="storage/${data.bukti_bayar}" download="storage/${data.bukti_bayar}" target="_blank" class="badge badge-sm badge-outline">
|
||||
},
|
||||
tanggal_setor: {
|
||||
title: 'Tanggal Setor',
|
||||
},
|
||||
nominal_bayar: {
|
||||
title: 'Nominal Bayar',
|
||||
},
|
||||
bukti_bayar: {
|
||||
title: 'Bukti KSL',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_bayar) {
|
||||
return `<a href="storage/${data.bukti_bayar}" download="storage/${data.bukti_bayar}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
nominal_diterima: {
|
||||
title: 'Nominal Diterima',
|
||||
},
|
||||
bukti_ksl: {
|
||||
title: 'Bukti KSL',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_ksl) {
|
||||
return `<a href="storage/${data.bukti_ksl}" download="storage/${data.bukti_ksl}" target="_blank" class="badge badge-sm badge-outline">
|
||||
},
|
||||
nominal_diterima: {
|
||||
title: 'Nominal Diterima',
|
||||
},
|
||||
bukti_ksl: {
|
||||
title: 'Bukti KSL',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_ksl) {
|
||||
return `<a href="storage/${data.bukti_ksl}" download="storage/${data.bukti_ksl}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
tanggal_pembayaran: {
|
||||
title: 'Tanggal Pembayaran',
|
||||
},
|
||||
memo_penyelesaian: {
|
||||
title: 'Memo Penyelesaian',
|
||||
render: (item, data) => {
|
||||
if (data.memo_penyelesaian) {
|
||||
return `<a href="storage/${data.memo_penyelesaian}" download="storage/${data.memo_penyelesaian}" target="_blank" class="badge badge-sm badge-outline">
|
||||
},
|
||||
tanggal_pembayaran: {
|
||||
title: 'Tanggal Pembayaran',
|
||||
},
|
||||
memo_penyelesaian: {
|
||||
title: 'Memo Penyelesaian',
|
||||
render: (item, data) => {
|
||||
if (data.memo_penyelesaian) {
|
||||
return `<a href="storage/${data.memo_penyelesaian}" download="storage/${data.memo_penyelesaian}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
bukti_penyelesaian: {
|
||||
title: 'Bukti Penyelesaian',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_penyelesaian) {
|
||||
return `<a href="storage/${data.bukti_penyelesaian}" download="storage/${data.bukti_penyelesaian}" target="_blank" class="badge badge-sm badge-outline">
|
||||
},
|
||||
bukti_penyelesaian: {
|
||||
title: 'Bukti Penyelesaian',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_penyelesaian) {
|
||||
return `<a href="storage/${data.bukti_penyelesaian}" download="storage/${data.bukti_penyelesaian}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
nominal_penyelesaian: {
|
||||
title: 'Nominal Penyelesaian',
|
||||
},
|
||||
tanggal_penyelesaian: {
|
||||
title: 'Tanggal Penyelesaian',
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
},
|
||||
nominal_penyelesaian: {
|
||||
title: 'Nominal Penyelesaian',
|
||||
},
|
||||
tanggal_penyelesaian: {
|
||||
title: 'Tanggal Penyelesaian',
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-outline btn-info" onclick="prosesData(${data.id})">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
203
resources/views/noc/pembayaran.blade.php
Normal file
203
resources/views/noc/pembayaran.blade.php
Normal file
@@ -0,0 +1,203 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('noc.pembayaran') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="noc-table" data-api-url="{{ route('noc.datatables.pembayaran') }}">
|
||||
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Daftar NOC Pembayaran
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search NOC Pembayaran" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_debitur">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cabang">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_setor">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Nominal bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Bukti Bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_diterima">
|
||||
<span class="sort"> <span class="sort-label"> Nominal Diterima </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_ksl">
|
||||
<span class="sort"> <span class="sort-label"> Bukti KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_pembayaran">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Pembayaran </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||
<div class="flex gap-2 items-center">
|
||||
Show
|
||||
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex gap-4 items-center">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function prosesData(data) {
|
||||
Swal.fire({
|
||||
title: 'NOC Pembayaran',
|
||||
text: "Apakah Anda yakin ingin menyetujui pembayaran ini?",
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya',
|
||||
cancelButtonText: 'Tidak'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = `noc/${data}/edit`;
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
const element = document.querySelector('#noc-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi'
|
||||
},
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
},
|
||||
cabang: {
|
||||
title: 'Cabang',
|
||||
render: (item, data) => {
|
||||
return data.kode_cabang + ' - ' + data.cabang;
|
||||
}
|
||||
},
|
||||
tanggal_setor: {
|
||||
title: 'Tanggal KSL',
|
||||
},
|
||||
nominal_bayar: {
|
||||
title: 'Nominal Bayar',
|
||||
},
|
||||
bukti_bayar: {
|
||||
title: 'Bukti KSL',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_bayar) {
|
||||
return `<a href="storage/${data.bukti_bayar}" download="storage/${data.bukti_bayar}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
},
|
||||
nominal_diterima: {
|
||||
title: 'Nominal Diterima',
|
||||
},
|
||||
bukti_ksl: {
|
||||
title: 'Bukti KSL',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_ksl) {
|
||||
return `<a href="storage/${data.bukti_ksl}" download="storage/${data.bukti_ksl}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
},
|
||||
tanggal_pembayaran: {
|
||||
title: 'Tanggal Pembayaran',
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-outline btn-info" onclick="prosesData(${data.id})">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
244
resources/views/noc/penyelesaian.blade.php
Normal file
244
resources/views/noc/penyelesaian.blade.php
Normal file
@@ -0,0 +1,244 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('noc.penyelesaian') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="noc-table" data-api-url="{{ route('noc.datatables.penyelesaian') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar NOC Penyelesaian
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search NOC Penyelesaian" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_debitur">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cabang">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_setor">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Nominal bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Bukti Bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_diterima">
|
||||
<span class="sort"> <span class="sort-label"> Nominal Diterima </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_ksl">
|
||||
<span class="sort"> <span class="sort-label"> Bukti KSL </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_pembayaran">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Pembayaran </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="memo_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Memo Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Bukti Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nominal_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Nominal Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_penyelesaian">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Penyelesaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function prosesData(data) {
|
||||
Swal.fire({
|
||||
title: 'NOC Penyelesaian',
|
||||
text: "Apakah Anda yakin ingin menyetujui penyelesaian ini?",
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya',
|
||||
cancelButtonText: 'Tidak'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = `noc/${data}/edit`;
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
const element = document.querySelector('#noc-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi'
|
||||
},
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
},
|
||||
cabang: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
tanggal_setor: {
|
||||
title: 'Tanggal Setor',
|
||||
},
|
||||
nominal_bayar: {
|
||||
title: 'Nominal Bayar',
|
||||
},
|
||||
bukti_bayar: {
|
||||
title: 'Bukti KSL',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_bayar) {
|
||||
return `<a href="storage/${data.bukti_bayar}" download="storage/${data.bukti_bayar}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
},
|
||||
nominal_diterima: {
|
||||
title: 'Nominal Diterima',
|
||||
},
|
||||
bukti_ksl: {
|
||||
title: 'Bukti KSL',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_ksl) {
|
||||
return `<a href="storage/${data.bukti_ksl}" download="storage/${data.bukti_ksl}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
},
|
||||
tanggal_pembayaran: {
|
||||
title: 'Tanggal Pembayaran',
|
||||
},
|
||||
memo_penyelesaian: {
|
||||
title: 'Memo Penyelesaian',
|
||||
render: (item, data) => {
|
||||
if (data.memo_penyelesaian) {
|
||||
return `<a href="storage/${data.memo_penyelesaian}" download="storage/${data.memo_penyelesaian}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
},
|
||||
bukti_penyelesaian: {
|
||||
title: 'Bukti Penyelesaian',
|
||||
render: (item, data) => {
|
||||
if (data.bukti_penyelesaian) {
|
||||
return `<a href="storage/${data.bukti_penyelesaian}" download="storage/${data.bukti_penyelesaian}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>`;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
},
|
||||
nominal_penyelesaian: {
|
||||
title: 'Nominal Penyelesaian',
|
||||
},
|
||||
tanggal_penyelesaian: {
|
||||
title: 'Tanggal Penyelesaian',
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-outline btn-info" onclick="prosesData(${data.id})">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -47,7 +47,7 @@ function otorisasiKJPP(penawaran_id, id, kjpp_id, kjppName, biaya_penawaran) {
|
||||
|
||||
//define variable
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.otorisasiPenawaranKJPP','') }}/"+id;
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.otorisasiPenawaranKJPP', ':id') }}".replace(':id', id);
|
||||
let noReg = $("#textReg").text();
|
||||
var input_data = new Object();
|
||||
input_data._token = token;
|
||||
@@ -91,4 +91,4 @@ function otorisasiKJPP(penawaran_id, id, kjpp_id, kjppName, biaya_penawaran) {
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
151
resources/views/pembayaran/form-kurang.blade.php
Normal file
151
resources/views/pembayaran/form-kurang.blade.php
Normal file
@@ -0,0 +1,151 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('pembayaran') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||
<div class="pb-2.5 border card border-agi-100">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="flex flex-row gap-1.5 card-title">
|
||||
Form Pembayaran Kurang Bayar
|
||||
</div>
|
||||
<div class="flex gap-2 items-center">
|
||||
<a href="{{ route('pembayaran.kurang.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<!-- Detail Informasi -->
|
||||
<div class="p-4 mb-6 bg-gray-50 rounded-lg">
|
||||
<h4 class="mb-4 text-lg font-semibold text-gray-800">Detail Pembayaran</h4>
|
||||
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Nomor Registrasi:</label>
|
||||
<p class="text-sm font-bold text-gray-800">{{ $noc->permohonan->nomor_registrasi ?? '-' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Nomor Tiket:</label>
|
||||
<p class="text-sm font-bold text-gray-800">{{ $noc->nomor_tiket ?? '-' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Tanggal Permohonan:</label>
|
||||
<p class="text-sm font-bold text-gray-800">{{ $noc->permohonan->tanggal_permohonan ?? '-' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">User Pemohon:</label>
|
||||
<p class="text-sm font-bold text-gray-800">{{ $noc->permohonan->user->name ?? '-' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Cabang Pemohon:</label>
|
||||
<p class="text-sm font-bold text-gray-800">
|
||||
@if ($noc->permohonan->branch ?? null)
|
||||
{{ $noc->permohonan->branch->code }} - {{ $noc->permohonan->branch->name }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Debitur:</label>
|
||||
<p class="text-sm font-bold text-gray-800">{{ $noc->permohonan->debiture->name ?? '-' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Status Bayar:</label>
|
||||
<p class="text-sm font-bold text-red-600 uppercase">Kurang Bayar</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Nominal Kurang Bayar:</label>
|
||||
<p class="text-sm font-bold text-red-600">{{ formatRupiah($noc->nominal_kurang_bayar ?? 0, 2) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="{{ route('pembayaran.store') }}" method="POST" class="grid gap-5"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<input type="hidden" name="noc_id" value="{{ $noc->id ?? '' }}">
|
||||
<input type="hidden" name="type" value="kurang_bayar">
|
||||
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Nominal Pelunasan <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="number" name="nominal_pelunasan" id="nominal_pelunasan"
|
||||
class="input w-full @error('nominal_pelunasan') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('nominal_pelunasan') }}" placeholder="Masukkan nominal pelunasan" required>
|
||||
@error('nominal_pelunasan')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
<small class="mt-1 text-xs text-gray-500">
|
||||
Nominal kurang bayar: {{ formatRupiah($noc->nominal_kurang_bayar ?? 0, 2) }}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Bukti KSL Kurang Bayar <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="file" name="bukti_ksl_kurang_bayar" id="bukti_ksl_kurang_bayar"
|
||||
class="file-input w-full @error('bukti_ksl_kurang_bayar') border-danger bg-danger-light @enderror"
|
||||
accept=".pdf,.jpg,.jpeg,.png" required>
|
||||
@error('bukti_ksl_kurang_bayar')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
<small class="mt-1 text-xs text-gray-500">
|
||||
Format yang diizinkan: PDF, JPG, JPEG, PNG (Max: 2MB)
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="catatan" id="catatan" rows="4"
|
||||
class="textarea w-full @error('catatan') border-danger bg-danger-light @enderror"
|
||||
placeholder="Masukkan catatan (opsional)">{{ old('catatan') }}</textarea>
|
||||
@error('catatan')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-2 justify-end">
|
||||
<a href="{{ route('pembayaran.kurang.index') }}" class="btn btn-secondary">
|
||||
Batal
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="ki-filled ki-check"></i>
|
||||
Proses Pelunasan
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
// Validasi nominal pelunasan tidak boleh melebihi nominal kurang bayar
|
||||
document.getElementById('nominal_pelunasan').addEventListener('input', function() {
|
||||
const nominalKurangBayar = {{ $noc->nominal_kurang_bayar ?? 0 }};
|
||||
const nominalPelunasan = parseFloat(this.value) || 0;
|
||||
|
||||
if (nominalPelunasan > nominalKurangBayar) {
|
||||
this.setCustomValidity('Nominal pelunasan tidak boleh melebihi nominal kurang bayar');
|
||||
} else if (nominalPelunasan <= 0) {
|
||||
this.setCustomValidity('Nominal pelunasan harus lebih dari 0');
|
||||
} else {
|
||||
this.setCustomValidity('');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
141
resources/views/pembayaran/form-lebih.blade.php
Normal file
141
resources/views/pembayaran/form-lebih.blade.php
Normal file
@@ -0,0 +1,141 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('pembayaran') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||
<div class="pb-2.5 border card border-agi-100">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="flex flex-row gap-1.5 card-title">
|
||||
Form Pembayaran Lebih Bayar
|
||||
</div>
|
||||
<div class="flex gap-2 items-center">
|
||||
<a href="{{ route('pembayaran.lebih.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<!-- Detail Informasi -->
|
||||
<div class="p-4 mb-6 bg-gray-50 rounded-lg">
|
||||
<h4 class="mb-4 text-lg font-semibold text-gray-800">Detail Pembayaran</h4>
|
||||
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Nomor Registrasi:</label>
|
||||
<p class="text-sm font-bold text-gray-800">{{ $noc->permohonan->nomor_registrasi ?? '-' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Nomor Tiket:</label>
|
||||
<p class="text-sm font-bold text-gray-800">{{ $noc->nomor_tiket ?? '-' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Tanggal Permohonan:</label>
|
||||
<p class="text-sm font-bold text-gray-800">{{ $noc->permohonan->tanggal_permohonan ?? '-' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">User Pemohon:</label>
|
||||
<p class="text-sm font-bold text-gray-800">{{ $noc->permohonan->user->name ?? '-' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Cabang Pemohon:</label>
|
||||
<p class="text-sm font-bold text-gray-800">
|
||||
@if ($noc->permohonan->branch ?? null)
|
||||
{{ $noc->permohonan->branch->code }} - {{ $noc->permohonan->branch->name }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Debitur:</label>
|
||||
<p class="text-sm font-bold text-gray-800">{{ $noc->permohonan->debiture->name ?? '-' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Status Bayar:</label>
|
||||
<p class="text-sm font-bold text-green-600 uppercase">Lebih Bayar</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-600">Nominal Lebih Bayar:</label>
|
||||
<p class="text-sm font-bold text-green-600">
|
||||
{{ formatRupiah($noc->nominal_lebih_bayar ?? 0, 2) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="{{ route('pembayaran.store') }}" method="POST" class="grid gap-5"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<input type="hidden" name="noc_id" value="{{ $noc->id ?? '' }}">
|
||||
<input type="hidden" name="type" value="lebih_bayar">
|
||||
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Bukti KSL Lebih Bayar <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="file" name="bukti_ksl_lebih_bayar" id="bukti_ksl_lebih_bayar"
|
||||
class="file-input w-full @error('bukti_ksl_lebih_bayar') border-danger bg-danger-light @enderror"
|
||||
accept=".pdf,.jpg,.jpeg,.png" required>
|
||||
@error('bukti_ksl_lebih_bayar')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
<small class="mt-1 text-xs text-gray-500">
|
||||
Format yang diizinkan: PDF, JPG, JPEG, PNG (Max: 2MB)
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="catatan" id="catatan" rows="4"
|
||||
class="textarea w-full @error('catatan') border-danger bg-danger-light @enderror"
|
||||
placeholder="Masukkan catatan (opsional)">{{ old('catatan') }}</textarea>
|
||||
@error('catatan')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-2 justify-end">
|
||||
<a href="{{ route('pembayaran.lebih.index') }}" class="btn btn-secondary">
|
||||
Batal
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="ki-filled ki-check"></i>
|
||||
Proses Pengembalian
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
// Validasi file upload
|
||||
document.getElementById('bukti_ksl_lebih_bayar').addEventListener('change', function() {
|
||||
const file = this.files[0];
|
||||
if (file) {
|
||||
// Validasi ukuran file (max 2MB)
|
||||
if (file.size > 2 * 1024 * 1024) {
|
||||
alert('Ukuran file tidak boleh lebih dari 2MB');
|
||||
this.value = '';
|
||||
return;
|
||||
}
|
||||
|
||||
// Validasi tipe file
|
||||
const allowedTypes = ['application/pdf', 'image/jpeg', 'image/jpg', 'image/png'];
|
||||
if (!allowedTypes.includes(file.type)) {
|
||||
alert('Format file tidak didukung. Gunakan PDF, JPG, JPEG, atau PNG');
|
||||
this.value = '';
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -5,93 +5,126 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||
<div class="pb-2.5 border card border-agi-100">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
<div class="flex flex-row gap-1.5 card-title">
|
||||
Pembayaran
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('pembayaran.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
<div class="flex gap-2 items-center">
|
||||
<a href="{{ route('pembayaran.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('pembayaran.store') }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
<form action="{{ route('pembayaran.store') }}" method="POST" class="grid gap-5"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
|
||||
<input type="hidden" name="penawaran_id" value="{{ $permohonan->penawaran->id ?? "" }}">
|
||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id ?? '' }}">
|
||||
<input type="hidden" name="penawaran_id" value="{{ $permohonan->penawaran->id ?? '' }}">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Registrasi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input readonly type="text" name="nomor_registrasi" id="nomor_registrasi" class="input w-full @error('nomor_registrasi') border-danger bg-danger-light @enderror" value="{{ old('nomor_registrasi', $permohonan->nomor_registrasi ?? '') }}" placeholder="Nomor Registrasi">
|
||||
<input readonly type="text" name="nomor_registrasi" id="nomor_registrasi"
|
||||
class="input w-full @error('nomor_registrasi') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('nomor_registrasi', $permohonan->nomor_registrasi ?? '') }}"
|
||||
placeholder="Nomor Registrasi">
|
||||
@error('nomor_registrasi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Tiket
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="nomor_tiket" id="nomor_tiket"
|
||||
class="input w-full @error('nomor_tiket') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('nomor_tiket', $permohonan->nomor_tiket ?? '') }}" placeholder="Nomor Tiket">
|
||||
@error('nomor_tiket')
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Debitur
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input readonly type="text" name="debitur" id="debitur" class="input w-full @error('debitur') border-danger bg-danger-light @enderror" value="{{ old('debitur', $permohonan->debiture->name ?? '') }}" placeholder="Debitur">
|
||||
<input readonly type="text" name="debitur" id="debitur"
|
||||
class="input w-full @error('debitur') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('debitur', $permohonan->debiture->name ?? '') }}" placeholder="Debitur">
|
||||
@error('debitur')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 hidden">
|
||||
<div class="flex hidden flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Status Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status_bayar') border-danger bg-danger-light @enderror" name="status_bayar" id="status_bayar">
|
||||
<select
|
||||
class="input tomselect w-full @error('status_bayar') border-danger bg-danger-light @enderror"
|
||||
name="status_bayar" id="status_bayar">
|
||||
<option value="">Pilih Status Bayar</option>
|
||||
<option value="sudah_bayar" {{ (old('status_bayar') == 'sudah_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'sudah_bayar') ? 'selected' : '' }}>Sudah Bayar</option>
|
||||
<option value="belum_bayar" {{ (old('status_bayar') == 'belum_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'belum_bayar') ? 'selected' : '' }}>Belum Bayar</option>
|
||||
<option value="sudah_bayar"
|
||||
{{ old('status_bayar') == 'sudah_bayar' || (isset($permohonan) && $permohonan->status_bayar == 'sudah_bayar') ? 'selected' : '' }}>
|
||||
Sudah Bayar</option>
|
||||
<option value="belum_bayar"
|
||||
{{ old('status_bayar') == 'belum_bayar' || (isset($permohonan) && $permohonan->status_bayar == 'belum_bayar') ? 'selected' : '' }}>
|
||||
Belum Bayar</option>
|
||||
</select>
|
||||
@error('status_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Nominal Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="number" name="nominal_bayar" id="nominal_bayar" class="input w-full @error('nominal_bayar') border-danger bg-danger-light @enderror" value="{{ old('nominal_bayar', $persetujuanPenawaran->nominal_bayar ?? '') }}" placeholder="Masukkan nominal bayar">
|
||||
<input type="number" name="nominal_bayar" id="nominal_bayar"
|
||||
class="input w-full @error('nominal_bayar') border-danger bg-danger-light @enderror"
|
||||
value="{{ old('nominal_bayar', $persetujuanPenawaran->nominal_bayar ?? '') }}"
|
||||
placeholder="Masukkan nominal bayar">
|
||||
@error('nominal_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Bukti Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="file" name="bukti_bayar" id="bukti_bayar" class="file-input w-full @error('bukti_bayar') border-danger bg-danger-light @enderror" accept=".pdf,.jpg,.jpeg,.png">
|
||||
<input type="file" name="bukti_bayar" id="bukti_bayar"
|
||||
class="file-input w-full @error('bukti_bayar') border-danger bg-danger-light @enderror"
|
||||
accept=".pdf,.jpg,.jpeg,.png">
|
||||
@error('bukti_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="catatan" id="catatan" rows="4" class="textarea w-full @error('catatan') border-danger bg-danger-light @enderror" placeholder="Masukkan catatan">{{ old('catatan', $persetujuanPenawaran->catatan ?? '') }}</textarea>
|
||||
<textarea name="catatan" id="catatan" rows="4"
|
||||
class="textarea w-full @error('catatan') border-danger bg-danger-light @enderror" placeholder="Masukkan catatan">{{ old('catatan', $persetujuanPenawaran->catatan ?? '') }}</textarea>
|
||||
@error('catatan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false"
|
||||
id="pembayaran-table" data-api-url="{{ route('pembayaran.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="pembayaran-table" data-api-url="{{ route('pembayaran.datatables') }}">
|
||||
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Daftar Pembayaran
|
||||
</h3>
|
||||
@@ -26,51 +26,55 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"> <span class="sort-label"> User Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px] text-center" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"> <span class="sort-label"> Status Bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_tiket">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Tiket </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"> <span class="sort-label"> User Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px] text-center" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"> <span class="sort-label"> Status Bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||
<div class="flex gap-2 items-center">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
||||
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="flex gap-4 items-center">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
@@ -166,6 +170,9 @@
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
nomor_tiket: {
|
||||
title: 'Nomor Tiket',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan'
|
||||
},
|
||||
@@ -179,7 +186,7 @@
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => {
|
||||
if (data.branch) {
|
||||
return `${data.branch.name}`;
|
||||
return `${data.branch.code} - ${data.branch.name}`;
|
||||
}
|
||||
return '-';
|
||||
},
|
||||
@@ -205,8 +212,8 @@
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex justify-center gap-2">
|
||||
<a class="btn btn-icon btn-clear btn-warning " href="pembayaran/${data.id}/edit" title="Lakukan Pembayaran">
|
||||
return `<div class="flex gap-2 justify-center">
|
||||
<a class="btn btn-icon btn-clear btn-warning" href="pembayaran/${data.id}/edit" title="Lakukan Pembayaran">
|
||||
<i class="ki-outline ki-credit-cart"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
@@ -217,11 +224,10 @@
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
242
resources/views/pembayaran/kurang.blade.php
Normal file
242
resources/views/pembayaran/kurang.blade.php
Normal file
@@ -0,0 +1,242 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('pembayaran') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="pembayaran-table" data-api-url="{{ route('pembayaran.kurang.datatables') }}">
|
||||
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Daftar Pembayaran Kurang Bayar
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Kurang Bayar" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_tiket">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Tiket </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"> <span class="sort-label"> User Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px] text-center" data-datatable-column="status_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Status Bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px] text-center" data-datatable-column="nominal_kurang_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Nominal </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||
<div class="flex gap-2 items-center">
|
||||
Show
|
||||
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex gap-4 items-center">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function pembayaranOtorisator(id) {
|
||||
// alert('hai id = ' + id);
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan approve Pembayaran!`,
|
||||
icon: 'warning',
|
||||
input: 'textarea', // Menambahkan input textarea
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Lain kali',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
let useURL = "{{ URL::to('pembayaran') }}" + "/" + id;
|
||||
const keterangan = result.value || ''; // Ambil pesan dari textarea
|
||||
|
||||
var input_data = new Object();
|
||||
input_data._method = 'PUT';
|
||||
input_data.id = id;
|
||||
input_data.keterangan = keterangan;
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: 'PUT',
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: (response) => {
|
||||
if ('success' == response.status) {
|
||||
Swal.fire('Berhasil!', response.message, 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
} else if ('error' == response.status) {
|
||||
Swal.fire('Error!', response.message, 'error').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan otorisator.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#pembayaran-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan?.nomor_registrasi}`;
|
||||
},
|
||||
},
|
||||
nomor_tiket: {
|
||||
title: 'Nomor Tiket',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan?.tanggal_permohonan}`;
|
||||
},
|
||||
},
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => {
|
||||
return `${data.pemohon?.name}`;
|
||||
},
|
||||
},
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => {
|
||||
if (data.branch) {
|
||||
return `${data.branch.code} - ${data.branch.name}`;
|
||||
}
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.debiture?.name}`;
|
||||
},
|
||||
},
|
||||
status_bayar: {
|
||||
title: 'Status Bayar',
|
||||
render: (item, data) => {
|
||||
return `<span class="font-bold text-red-600 uppercase text-md">
|
||||
Kurang Bayar
|
||||
</span>`;
|
||||
},
|
||||
},
|
||||
nominal_kurang_bayar: {
|
||||
title: 'Kurang Bayar'
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex gap-2 justify-center">
|
||||
<a class="btn btn-icon btn-clear btn-warning" href="pembayaran/${data.id}/kurang" title="Lakukan Pembayaran">
|
||||
<i class="ki-outline ki-credit-cart"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
242
resources/views/pembayaran/lebih.blade.php
Normal file
242
resources/views/pembayaran/lebih.blade.php
Normal file
@@ -0,0 +1,242 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('pembayaran') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="pembayaran-table" data-api-url="{{ route('pembayaran.lebih.datatables') }}">
|
||||
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Daftar Pembayaran Lebih Bayar
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Lebih Bayar" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_tiket">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Tiket </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"> <span class="sort-label"> User Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px] text-center" data-datatable-column="status_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Status Bayar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px] text-center" data-datatable-column="nominal_lebih_bayar">
|
||||
<span class="sort"> <span class="sort-label"> Nominal </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||
<div class="flex gap-2 items-center">
|
||||
Show
|
||||
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex gap-4 items-center">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function pembayaranOtorisator(id) {
|
||||
// alert('hai id = ' + id);
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan approve Pembayaran!`,
|
||||
icon: 'warning',
|
||||
input: 'textarea', // Menambahkan input textarea
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Lain kali',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
let useURL = "{{ URL::to('pembayaran') }}" + "/" + id;
|
||||
const keterangan = result.value || ''; // Ambil pesan dari textarea
|
||||
|
||||
var input_data = new Object();
|
||||
input_data._method = 'PUT';
|
||||
input_data.id = id;
|
||||
input_data.keterangan = keterangan;
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: 'PUT',
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: (response) => {
|
||||
if ('success' == response.status) {
|
||||
Swal.fire('Berhasil!', response.message, 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
} else if ('error' == response.status) {
|
||||
Swal.fire('Error!', response.message, 'error').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan otorisator.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#pembayaran-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan?.nomor_registrasi}`;
|
||||
},
|
||||
},
|
||||
nomor_tiket: {
|
||||
title: 'Nomor Tiket',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan?.tanggal_permohonan}`;
|
||||
},
|
||||
},
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => {
|
||||
return `${data.pemohon?.name}`;
|
||||
},
|
||||
},
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => {
|
||||
if (data.branch) {
|
||||
return `${data.branch.code} - ${data.branch.name}`;
|
||||
}
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.debiture?.name}`;
|
||||
},
|
||||
},
|
||||
status_bayar: {
|
||||
title: 'Status Bayar',
|
||||
render: (item, data) => {
|
||||
return `<span class="font-bold text-green-600 uppercase text-md">
|
||||
Lebih Bayar
|
||||
</span>`;
|
||||
},
|
||||
},
|
||||
nominal_lebih_bayar: {
|
||||
title: 'Lebih Bayar'
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex gap-2 justify-center">
|
||||
<a class="btn btn-icon btn-clear btn-warning" href="pembayaran/${data.id}/lebih" title="Lakukan Pembayaran">
|
||||
<i class="ki-outline ki-credit-cart"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -193,94 +193,7 @@
|
||||
<td>Demikian Kami Sampaikan, atas perhatiannya kami ucapkan terimakasih</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<table style="width: 100%; border-collapse: collapse; text-align: center;">
|
||||
@php
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
|
||||
$imagePathPenilai = storage_path(
|
||||
'app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign,
|
||||
);
|
||||
|
||||
$soUser = User::where('id', $senior_officer->id)->first();
|
||||
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
|
||||
|
||||
$imagePathEO = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('EO Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('EO Appraisal')->first()->sign,
|
||||
);
|
||||
|
||||
$imagePathDD = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('DD Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('DD Appraisal')->first()->sign,
|
||||
);
|
||||
@endphp
|
||||
<tr>
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathPenilai))
|
||||
<img src="{{ $imagePathPenilai }}" alt="{{ $imagePathPenilai }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathSo))
|
||||
<img src="{{ $imagePathSo }}" alt="{{ $imagePathSo }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathEO))
|
||||
<img src="{{ $imagePathEO }}" alt="{{ $imagePathEO }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathDD))
|
||||
<img src="{{ $imagePathDD }}" alt="{{ $imagePathDD }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" padding: 4px;">{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('PENILAI')) }}
|
||||
</span>
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ $senior_officer->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('SENIOR OFFICER')) }}
|
||||
</span>
|
||||
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('EO Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('EXECUTIVE OFFICER')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('DD Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('DEPUTY DIRECTOR')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
@include('lpj::penilai.components.signature-approval')
|
||||
</tr>
|
||||
</table>
|
||||
</main>
|
||||
|
||||
@@ -229,93 +229,7 @@
|
||||
<td>Demikian Kami Sampaikan, atas perhatiannya kami ucapkan terimakasih</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<table style="width: 100%; border-collapse: collapse; text-align: center;">
|
||||
@php
|
||||
use Modules\Usermanagement\Models\User;
|
||||
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
|
||||
$imagePathPenilai = storage_path(
|
||||
'app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign,
|
||||
);
|
||||
|
||||
$soUser = User::where('id', $senior_officer->id)->first();
|
||||
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
|
||||
|
||||
$imagePathEO = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('EO Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('EO Appraisal')->first()->sign,
|
||||
);
|
||||
|
||||
$imagePathDD = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('DD Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('DD Appraisal')->first()->sign,
|
||||
);
|
||||
@endphp
|
||||
<tr>
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathPenilai))
|
||||
<img src="{{ $imagePathPenilai }}" alt="{{ $imagePathPenilai }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathSo))
|
||||
<img src="{{ $imagePathSo }}" alt="{{ $imagePathSo }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathEO))
|
||||
<img src="{{ $imagePathEO }}" alt="{{ $imagePathEO }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathDD))
|
||||
<img src="{{ $imagePathDD }}" alt="{{ $imagePathDD }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" padding: 4px;">{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('PENILAI')) }}
|
||||
</span>
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ $senior_officer->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('SENIOR OFFICER')) }}
|
||||
</span>
|
||||
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('EO Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('EXECUTIVE OFFICER')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('DD Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('DEPUTY DIRECTOR')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
@include('lpj::penilai.components.signature-approval')
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -412,91 +412,6 @@
|
||||
@endisset
|
||||
<p>Demikian kami sampaikan, atas perhatiannya kami ucapkan terima kasih.</p>
|
||||
|
||||
<table style="width: 100%; border-collapse: collapse; text-align: center;">
|
||||
@php
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
|
||||
$imagePathPenilai = storage_path('app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign);
|
||||
|
||||
$soUser = User::where('id', $senior_officer->id)->first();
|
||||
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
|
||||
|
||||
$imagePathEO = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('EO Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('EO Appraisal')->first()->sign,
|
||||
);
|
||||
|
||||
$imagePathDD = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('DD Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('DD Appraisal')->first()->sign,
|
||||
);
|
||||
@endphp
|
||||
<tr>
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathPenilai))
|
||||
<img src="{{ $imagePathPenilai }}" alt="{{ $imagePathPenilai }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathSo))
|
||||
<img src="{{ $imagePathSo }}" alt="{{ $imagePathSo }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathEO))
|
||||
<img src="{{ $imagePathEO }}" alt="{{ $imagePathEO }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathDD))
|
||||
<img src="{{ $imagePathDD }}" alt="{{ $imagePathDD }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" padding: 4px;">{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('PENILAI')) }}
|
||||
</span>
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ $senior_officer->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('SENIOR OFFICER')) }}
|
||||
</span>
|
||||
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('EO Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('EXECUTIVE OFFICER')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('DD Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('DEPUTY DIRECTOR')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
@include('lpj::penilai.components.signature-approval')
|
||||
</main>
|
||||
@include('lpj::penilai.components.footer')
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<tr>
|
||||
<td style=" padding: 2px; vertical-align: top;">Nama Debitur</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ u $permohonan->debiture->name ?? '' }}</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alamat dan Telpon</td>
|
||||
@@ -58,7 +58,7 @@
|
||||
<td style="padding: 2px; vertical-align: top;">Tanggal Survey</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->updated_at) }}</td>
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">User</td>
|
||||
@@ -116,7 +116,7 @@
|
||||
<td style="padding: 2px; vertical-align: top;">Waktu Penyelesaian</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
{{ hitungHariKerja($permohonan->penilaian->updated_at, $tanggalLaporan) }}</td>
|
||||
{{ hitungHariKerja($permohonan->penilaian->tanggal_kunjungan, $tanggalLaporan) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
@@ -204,19 +204,18 @@
|
||||
<table style="vertical-align: top;">
|
||||
<tr>
|
||||
@php
|
||||
$cekHubDebitur = isset($forminspeksi['asset']['hub_cadeb']) &&
|
||||
$forminspeksi['asset']['hub_cadeb'] === 'sesuai'
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
|
||||
$cekHub =
|
||||
isset($forminspeksi['asset']['hub_cadeb']) && $forminspeksi['asset']['hub_cadeb'] === 'sesuai'
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
|
||||
$hubCadeb = $cekHub === 'sesuai'
|
||||
? ($forminspeksi['asset']['hub_cadeb']['sesuai'] ?? null)
|
||||
: ($forminspeksi['asset']['hub_cadeb']['tidak sesuai'] ?? null);
|
||||
@endphp
|
||||
<td style=" padding: 2px; vertical-align: top;">Hubungan Pemilik Jaminan dengan Debitur</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $hubCadeb ?? '' }}</td>
|
||||
$hubCadebDebitur = isset($forminspeksi['asset']['hub_cadeb'][$cekHubDebitur])
|
||||
? $forminspeksi['asset']['hub_cadeb']['tidak sesuai']
|
||||
: $forminspeksi['asset']['hub_cadeb']['sesuai'];
|
||||
@endphp
|
||||
<td style=" width:49%; padding: 2px; vertical-align: top;">Hubungan Pemilik Jaminan dengan Debitur</td>
|
||||
<td style=" width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" width:50%; padding: 2px; vertical-align: top;">{{ $hubCadebDebitur ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@php
|
||||
@@ -504,5 +503,43 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="no-break">
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<div style="margin-top: 20px;">
|
||||
<label style="font-weight: bold;">DISCLAIMER</label>
|
||||
<div>
|
||||
<ol style="padding-left: 20px; list-style-type: decimal; margin-top: 0;">
|
||||
|
||||
<li style="margin-bottom: 5px;">PENILAIAN INI DIBUAT BERDASARKAN ATURAN YANG
|
||||
BERLAKU DI SUBDIT APPRAISAL</li>
|
||||
<li style="margin-bottom: 5px;">LAPORAN INI DIBUAT BERDASARKAN DATA FOTOCOPY
|
||||
DOKUMEN YANG DITERIMA PENILAI DENGAN ASUMSI BAHWA DATA TERSEBUT SESUAI DENGAN
|
||||
DOKUMEN ASLINYA</li>
|
||||
<li style="margin-bottom: 5px;">PENILAI TIDAK MELAKUKAN PEMBUKTIAN LEBIH RINCI ATAU
|
||||
PENGAKUAN TERTULIS DARI PIHAK YANG DITEMUI SAAT PENILAIAN, ATAS INFORMASI YANG
|
||||
DIBERIKAN SECARA LISAN SEHUBUNGAN DENGAN IDENTITAS DIRI DAN HUBUNGAN DI ANTARA
|
||||
PIHAK TERKAIT SAAT MELAKUKAN INSPEKSI OBJEK YANG DINILAI</li>
|
||||
<li style="margin-bottom: 5px;">LAPORAN INI DIGUNAKAN HANYA UNTUK KEPENTINGAN
|
||||
INTERNAL DAN DILARANG MENYEBARKAN KEPADA PIHAK KETIGA</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Demikian laporan penilai jaminan ini di buat secara objektif, tanpa adanya pengaruh baik intern
|
||||
maupun ekstern</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@include('lpj::penilai.components.signature-approval')
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</main>
|
||||
@include('lpj::penilai.components.footer')
|
||||
|
||||
@@ -106,8 +106,13 @@
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Debitur / Wakil Debitur</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $permohonan->debiture->name ?? '' }}
|
||||
</td>
|
||||
@if (isset($forminspeksi['asset']['debitur_perwakilan']))
|
||||
<td>
|
||||
@foreach ($forminspeksi['asset']['debitur_perwakilan'] as $item)
|
||||
{{ $item ?? $permohonan->debiture->name ?? '' }}<br>
|
||||
@endforeach
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Pihak Bank selain Appraisal</td>
|
||||
@@ -179,20 +184,18 @@
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
@php
|
||||
$cekHubDebitur = isset($forminspeksi['asset']['hub_cadeb']) &&
|
||||
$forminspeksi['asset']['hub_cadeb'] === 'sesuai'
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
|
||||
$cekHub =
|
||||
isset($forminspeksi['asset']['hub_cadeb']) && $forminspeksi['asset']['hub_cadeb'] === 'sesuai'
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
|
||||
|
||||
$hubCadeb = $cekHub === 'sesuai'
|
||||
? ($forminspeksi['asset']['hub_cadeb']['sesuai'] ?? null)
|
||||
: ($forminspeksi['asset']['hub_cadeb']['tidak sesuai'] ?? null);
|
||||
@endphp
|
||||
$hubCadebDebitur = isset($forminspeksi['asset']['hub_cadeb'][$cekHubDebitur])
|
||||
? $forminspeksi['asset']['hub_cadeb']['tidak sesuai']
|
||||
: $forminspeksi['asset']['hub_cadeb']['sesuai'];
|
||||
@endphp
|
||||
<td style="width:25%; padding: 2px; vertical-align: top;">Hubungan Pemilik Jaminan dengan Debitur</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $hubCadeb ?? '' }}</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $cekHubDebitur ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@php
|
||||
@@ -371,94 +374,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%; border-collapse: collapse; text-align: center;">
|
||||
@php
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
|
||||
$imagePathPenilai = storage_path(
|
||||
'app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign,
|
||||
);
|
||||
|
||||
$soUser = User::where('id', $senior_officer->id)->first();
|
||||
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
|
||||
|
||||
$imagePathEO = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('EO Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('EO Appraisal')->first()->sign,
|
||||
);
|
||||
|
||||
$imagePathDD = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('DD Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('DD Appraisal')->first()->sign,
|
||||
);
|
||||
@endphp
|
||||
<tr>
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathPenilai))
|
||||
<img src="{{ $imagePathPenilai }}" alt="{{ $imagePathPenilai }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathSo))
|
||||
<img src="{{ $imagePathSo }}" alt="{{ $imagePathSo }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathEO))
|
||||
<img src="{{ $imagePathEO }}" alt="{{ $imagePathEO }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathDD))
|
||||
<img src="{{ $imagePathDD }}" alt="{{ $imagePathDD }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" padding: 4px;">{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('PENILAI')) }}
|
||||
</span>
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ $senior_officer->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('SENIOR OFFICER')) }}
|
||||
</span>
|
||||
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('EO Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('EXECUTIVE OFFICER')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('DD Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('DEPUTY DIRECTOR')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
@include('lpj::penilai.components.signature-approval')
|
||||
</div>
|
||||
<hr />
|
||||
<table style="width: 100%; ">
|
||||
|
||||
105
resources/views/penilai/components/signature-approval.blade.php
Normal file
105
resources/views/penilai/components/signature-approval.blade.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<table style="width: 100%; border-collapse: collapse; text-align: center;">
|
||||
@php
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
|
||||
$imagePathPenilai = storage_path(
|
||||
'app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign,
|
||||
);
|
||||
|
||||
$soUser = User::where('id', $senior_officer->id)->first();
|
||||
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
|
||||
|
||||
$imagePathEO = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('EO Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('EO Appraisal')->first()->sign,
|
||||
);
|
||||
|
||||
$imagePathDD = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('DD Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('DD Appraisal')->first()->sign,
|
||||
);
|
||||
@endphp
|
||||
<tr>
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathPenilai))
|
||||
<img src="{{ $imagePathPenilai }}" alt="{{ $imagePathPenilai }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathSo))
|
||||
<img src="{{ $imagePathSo }}" alt="{{ $imagePathSo }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathEO))
|
||||
<img src="{{ $imagePathEO }}" alt="{{ $imagePathEO }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathDD))
|
||||
<img src="{{ $imagePathDD }}" alt="{{ $imagePathDD }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" padding: 4px;">{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('PENILAI')) }}
|
||||
</span>
|
||||
</br>
|
||||
<span>
|
||||
{{ isset($penilai->updated_at) ? formatTanggalIndonesia($penilai->updated_at) : '' }}
|
||||
</span>
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ $senior_officer->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('SENIOR OFFICER')) }}
|
||||
</span>
|
||||
</br>
|
||||
<span>
|
||||
{{ isset($permohonan->approval_so_at) ? formatTanggalIndonesia($permohonan->approval_so_at) : '' }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('EO Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('EXECUTIVE OFFICER')) }}
|
||||
</span>
|
||||
</br>
|
||||
<span>
|
||||
{{ isset($permohonan->approval_eo_at) ? formatTanggalIndonesia($permohonan->approval_eo_at) : '' }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('DD Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('DEPUTY DIRECTOR')) }}
|
||||
</span>
|
||||
</br>
|
||||
<span>
|
||||
{{
|
||||
isset($permohonan->approval_dd_at) ?
|
||||
formatTanggalIndonesia($permohonan->approval_dd_at) : '' }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
@@ -72,7 +72,7 @@ function updateDataUlang(id, kjpp_id, kjppName){
|
||||
if(passednih)
|
||||
{
|
||||
var file_data = $("#{{$route[1]}}_dokumenPersetujuan_"+id).prop("files")[0];
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.updateulang', '') }}/"+id;
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.updateulang', ':id') }}".replace(':id', id);
|
||||
let formData = new FormData();
|
||||
let token = "{{ csrf_token() }}";
|
||||
formData.append("dokumen_persetujuan", file_data ?? "");
|
||||
@@ -132,7 +132,7 @@ function deleteData(data, kjppName) {
|
||||
|
||||
//define variable
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.updateKJPPStatus','') }}/"+data;
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.updateKJPPStatus', ':id') }}".replace(':id', data);
|
||||
|
||||
var input_data = new Object();
|
||||
input_data._token = token;
|
||||
@@ -334,4 +334,4 @@ function deleteDataUlang(data, kjppName) {
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -1,9 +1,9 @@
|
||||
<script tipe="module">
|
||||
function switchProses(id)
|
||||
{
|
||||
|
||||
|
||||
let c = $('#{{$route[1]}}_check_'+id).val();
|
||||
|
||||
|
||||
if($('input[name="{{$route[1]}}_check_'+id+'"]').is(':checked'))
|
||||
{
|
||||
// checked
|
||||
@@ -16,7 +16,7 @@
|
||||
setNonActiveElement(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function setActiveElement(id)
|
||||
{
|
||||
$('#{{$route[1]}}_biayaPenawaran_'+id).removeAttr('disabled');
|
||||
@@ -24,7 +24,7 @@
|
||||
$('#{{$route[1]}}_icon_update_'+id).removeAttr('disabled');
|
||||
$('#{{$route[1]}}_icon_delete_'+id).removeAttr('disabled');
|
||||
}
|
||||
|
||||
|
||||
function setNonActiveElement(id)
|
||||
{
|
||||
$('#{{$route[1]}}_biayaPenawaran_'+id).attr('disabled', 'disabled');
|
||||
@@ -32,32 +32,32 @@
|
||||
$('#{{$route[1]}}_icon_update_'+id).attr('disabled', 'disabled');
|
||||
$('#{{$route[1]}}_icon_delete_'+id).attr('disabled', 'disabled');
|
||||
}
|
||||
|
||||
|
||||
function updateData(id, kjpp_id, kjppName){
|
||||
// id => detail_penawaran.id
|
||||
removeErrorCssMsg();
|
||||
let no_proposal = $("#{{$route[1]}}_no_proposal_"+id).val();
|
||||
let tgl_proposal = $("#{{$route[1]}}_tgl_proposal_"+id).val();
|
||||
let biaya = $("#{{$route[1]}}_biayaPenawaran_"+id).val();
|
||||
let filepdf = $("#{{$route[1]}}_dokumenPersetujuan_"+id).val();
|
||||
let passednih = true;
|
||||
|
||||
let no_proposal = $("#{{$route[1]}}_no_proposal_"+id).val();
|
||||
let tgl_proposal = $("#{{$route[1]}}_tgl_proposal_"+id).val();
|
||||
let biaya = $("#{{$route[1]}}_biayaPenawaran_"+id).val();
|
||||
let filepdf = $("#{{$route[1]}}_dokumenPersetujuan_"+id).val();
|
||||
let passednih = true;
|
||||
|
||||
if(passednih)
|
||||
{
|
||||
var file_data = $("#{{$route[1]}}_dokumenPersetujuan_"+id).prop("files")[0];
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.update', '') }}/"+id;
|
||||
let formData = new FormData();
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.update', $id) }}";
|
||||
let formData = new FormData();
|
||||
let token = "{{ csrf_token() }}";
|
||||
formData.append("dokumen_persetujuan", file_data ?? "");
|
||||
formData.append("no_proposal", no_proposal);
|
||||
formData.append("tgl_proposal", tgl_proposal);
|
||||
formData.append("biaya_penawaran", biaya);
|
||||
formData.append("biaya_penawaran", biaya);
|
||||
formData.append("kjpp_rekanan_id", kjpp_id);
|
||||
formData.append("_method", "PUT");
|
||||
formData.append("_token", token);
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "POST",
|
||||
type: "POST",
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
@@ -68,7 +68,7 @@
|
||||
// success
|
||||
var message = response.message;
|
||||
toastrku("success", message);
|
||||
setTimeout(function () {
|
||||
setTimeout(function () {
|
||||
location.reload(true);
|
||||
}, 2000);
|
||||
}
|
||||
@@ -78,7 +78,7 @@
|
||||
var message = response.message;
|
||||
toastrku("error", message);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error: function (response, textStatus, errorThrown) {
|
||||
var errors = response.responseJSON.errors;
|
||||
@@ -87,11 +87,11 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function deleteData(data, kjppName) {
|
||||
// data => detail_penawaran.id
|
||||
Swal.fire({
|
||||
@@ -104,10 +104,11 @@
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
|
||||
//define variable
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.updateKJPPStatus','') }}/"+data;
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.updateKJPPStatus', ':id') }}";
|
||||
useURL = useURL.replace(':id', data);
|
||||
var input_data = new Object();
|
||||
input_data._token = token;
|
||||
input_data.id =data;
|
||||
@@ -119,7 +120,7 @@
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
|
||||
|
||||
if('success' == response.status)
|
||||
{
|
||||
swal.fire('Deleted!', response.message.message_success[0], 'success').then(() => {
|
||||
@@ -130,18 +131,18 @@
|
||||
{
|
||||
Swal.fire('Error!', response.message.message_error[0], 'error');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
error: function(response, textStatus, errorThrown) {
|
||||
// var errors = response.responseJSON.errors;
|
||||
// console.log(errors);
|
||||
console.log(response);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
}
|
||||
</script>
|
||||
|
||||
58
resources/views/rekap-harian-so/index.blade.php
Normal file
58
resources/views/rekap-harian-so/index.blade.php
Normal file
@@ -0,0 +1,58 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('rekap-harian-so') }}
|
||||
@endsection
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="jenis-aset-table">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Rekap Harian {{ formatTanggalIndonesia(date('Y-m-d'), false, true) }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2" class="text-center border px-4 py-2">Jenis</th>
|
||||
<th rowspan="2" class="text-center border px-4 py-2">Laporan (Debitur)</th>
|
||||
<th colspan="2" class="text-center border px-4 py-2">Kunjungan</th>
|
||||
<th rowspan="2" class="text-center border px-4 py-2">Pipeline (Proses/Debitur)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center border px-4 py-2">Debitur</th>
|
||||
<th class="text-center border px-4 py-2">Lokasi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($tujuan_penilaian as $jenis)
|
||||
<tr>
|
||||
<td class="text-center border px-4 py-2">{{ $jenis->name }}</td>
|
||||
<td class="text-center border px-4 py-2">{{ 0 }}</td>
|
||||
<td class="text-center border px-4 py-2">{{ 0 }}</td>
|
||||
<td class="text-center border px-4 py-2">{{ 0 }}</td>
|
||||
<td class="text-center border px-4 py-2">{{ 0 }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr class="bg-gray-200">
|
||||
<td class="text-center border px-4 py-2 font-bold">Lokasi</td>
|
||||
<td colspan="4" class="text-center border px-4 py-2"></td>
|
||||
</tr>
|
||||
<tr class="bg-gray-300 font-bold">
|
||||
<td class="text-center border px-4 py-2">TOTAL</td>
|
||||
<td class="text-center border px-4 py-2">{{ $totals['laporan_debitur'] ?? '' }}</td>
|
||||
<td class="text-center border px-4 py-2">{{ $totals['kunjungan_debitur'] ?? '' }}</td>
|
||||
<td class="text-center border px-4 py-2">{{ $totals['kunjungan_lokasi'] ?? '' }}</td>
|
||||
<td class="text-center border px-4 py-2">{{ $totals['pipeline'] ?? '' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -15,11 +15,11 @@
|
||||
</style>
|
||||
|
||||
@include('lpj::assetsku.includenya')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||
<div class="min-w-full border card border-agi-100">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title">Denah</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="flex gap-2 items-center">
|
||||
<a href="{{ route('surveyor.show', ['id' => $permohonan->id]) }}?form=denah" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@@ -41,13 +41,13 @@
|
||||
<div id="denah-container">
|
||||
@if (isset($formDenah['denahs']) && is_array($formDenah['denahs']) && count($formDenah['denahs']) > 0)
|
||||
@foreach ($formDenah['denahs'] as $index => $denah)
|
||||
<div class="denah-item grid gap-5 mb-5 border p-4 rounded">
|
||||
<div class="grid gap-5 p-4 mb-5 rounded border denah-item">
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-baseline flex-wrap lg:flex-nowrap gap-4">
|
||||
<div class="flex flex-wrap gap-4 items-baseline w-full lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Upload Denah (Foto/PDF)</span>
|
||||
</label>
|
||||
<div class="w-full grid gap-5">
|
||||
<div class="grid gap-5 w-full">
|
||||
<!-- Preview Container -->
|
||||
<div class="preview-container-{{ $index }}">
|
||||
@if (isset($denah['foto_denah']))
|
||||
@@ -68,9 +68,9 @@
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<div class="flex gap-2 w-full input-group">
|
||||
<input type="file" name="foto_denah[]"
|
||||
class="file-input file-input-bordered w-full"
|
||||
class="w-full file-input file-input-bordered"
|
||||
data-index="{{ $index }}" accept=".jpg,.jpeg,.png,.pdf"
|
||||
onchange="previewFile(this)">
|
||||
</div>
|
||||
@@ -78,26 +78,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap lg:flex-nowrap w-full gap-4">
|
||||
<div class="flex flex-wrap gap-4 w-full lg:flex-nowrap">
|
||||
<div class="w-full">
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
<div class="flex gap-4 justify-center items-center w-full">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Nama Denah</span>
|
||||
</label>
|
||||
<input type="text" name="nama_denah[]" class="input w-full"
|
||||
<input type="text" name="nama_denah[]" class="w-full input"
|
||||
value="{{ $denah['nama_denah'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
<div class="flex gap-4 justify-center items-center w-full">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label"> Luas</span>
|
||||
</label>
|
||||
<input type="text" name="luas_denah[]"
|
||||
class="input w-full number-format"
|
||||
class="w-full input number-format"
|
||||
value="{{ isset($denah['luas_denah']) ? $denah['luas_denah'] . ' m²' : '' }}"
|
||||
onkeyup="formatNumber(this)">
|
||||
</div>
|
||||
@@ -115,45 +115,45 @@
|
||||
@endforeach
|
||||
@else
|
||||
<!-- Tambahkan satu elemen default jika tidak ada data -->
|
||||
<div class="denah-item grid gap-5 mb-5 border p-4 rounded">
|
||||
<div class="grid gap-5 p-4 mb-5 rounded border denah-item">
|
||||
<!-- Isi dengan elemen default seperti sebelumnya -->
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-baseline flex-wrap lg:flex-nowrap gap-4">
|
||||
<div class="flex flex-wrap gap-4 items-baseline w-full lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Upload Denah (Foto/PDF)</span>
|
||||
</label>
|
||||
<div class="w-full grid gap-5">
|
||||
<div class="grid gap-5 w-full">
|
||||
<div class="preview-container-0">
|
||||
<!-- Preview akan ditampilkan di sini -->
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<div class="flex gap-2 w-full input-group">
|
||||
<input type="file" name="foto_denah[]"
|
||||
class="file-input file-input-bordered w-full" data-index="0"
|
||||
class="w-full file-input file-input-bordered" data-index="0"
|
||||
accept=".jpg,.jpeg,.png,.pdf" onchange="previewFile(this)">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap lg:flex-nowrap w-full gap-4">
|
||||
<div class="flex flex-wrap gap-4 w-full lg:flex-nowrap">
|
||||
<div class="w-full">
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
<div class="flex gap-4 justify-center items-center w-full">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Nama Denah</span>
|
||||
</label>
|
||||
<input type="text" name="nama_denah[]" class="input w-full">
|
||||
<input type="text" name="nama_denah[]" class="w-full input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
<div class="flex gap-4 justify-center items-center w-full">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label"> Luas</span>
|
||||
</label>
|
||||
<input type="text" name="luas_denah[]" class="input w-full number-format"
|
||||
<input type="text" name="luas_denah[]" class="w-full input number-format"
|
||||
onkeyup="formatNumber(this)">
|
||||
</div>
|
||||
</div>
|
||||
@@ -164,18 +164,19 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="w-full p-4">
|
||||
<div class="p-4 w-full">
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
<div class="flex gap-4 justify-center items-center w-full">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Total Luas</span>
|
||||
</label>
|
||||
<input type="text" name="total_luas" id="totalLuas" class="input w-full number-format" readonly>
|
||||
<input type="text" name="total_luas" id="totalLuas"
|
||||
class="w-full input number-format" readonly>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
<div class="flex gap-2 justify-end" style="margin-right: 20px; margin-top: 20px">
|
||||
<button type="button" class="btn btn-success" id="saveButton" onclick="submitDenah()">
|
||||
<span id="saveButtonText">Save</span>
|
||||
</button>
|
||||
@@ -240,23 +241,38 @@
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Menghitung total luas dari semua input denah
|
||||
* Mendukung format angka dengan koma sebagai pemisah desimal
|
||||
* dan menghapus format ribuan (titik) sebelum perhitungan
|
||||
*/
|
||||
function calculateTotalLuas() {
|
||||
let totalLuas = 0;
|
||||
|
||||
const luasInputs = document.querySelectorAll('input[name="luas_denah[]"]');
|
||||
luasInputs.forEach(input => {
|
||||
const value = parseFloat(input.value.replace(/[^0-9.]/g, ''));
|
||||
// Hapus format ribuan (titik) dan spasi
|
||||
let cleanValue = input.value.replace(/\./g, '').replace(/\s/g, '');
|
||||
|
||||
// Ganti koma dengan titik untuk desimal
|
||||
cleanValue = cleanValue.replace(',', '.');
|
||||
|
||||
// Parse ke float
|
||||
const value = parseFloat(cleanValue);
|
||||
if (!isNaN(value)) {
|
||||
totalLuas += value;
|
||||
}
|
||||
});
|
||||
|
||||
const totalLuasInput = document.getElementById('totalLuas');
|
||||
totalLuasInput.value = totalLuas ? `${totalLuas.toLocaleString()} m²` : '';
|
||||
totalLuasInput.value = totalLuas ? `${totalLuas.toLocaleString('id-ID')} m²` : '';
|
||||
|
||||
// Log untuk debugging
|
||||
console.log('Total luas dihitung:', totalLuas);
|
||||
}
|
||||
|
||||
// Tambahkan event listener untuk setiap input luas_denah[]
|
||||
document.addEventListener('input', function (e) {
|
||||
document.addEventListener('input', function(e) {
|
||||
if (e.target && e.target.name === 'luas_denah[]') {
|
||||
calculateTotalLuas();
|
||||
}
|
||||
@@ -271,17 +287,17 @@
|
||||
denahItem.className = 'denah-item grid gap-5 mb-5 border p-4 rounded';
|
||||
denahItem.innerHTML = `
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-baseline flex-wrap lg:flex-nowrap gap-4">
|
||||
<div class="flex flex-wrap gap-4 items-baseline w-full lg:flex-nowrap">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Upload Denah (Foto/PDF)</span>
|
||||
</label>
|
||||
<div class="w-full grid gap-5">
|
||||
<div class="grid gap-5 w-full">
|
||||
<div class="preview-container-${index}">
|
||||
<!-- Preview akan ditampilkan di sini -->
|
||||
</div>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<div class="flex gap-2 w-full input-group">
|
||||
<input type="file" name="foto_denah[]"
|
||||
class="file-input file-input-bordered w-full"
|
||||
class="w-full file-input file-input-bordered"
|
||||
data-index="${index}"
|
||||
accept=".jpg,.jpeg,.png,.pdf"
|
||||
onchange="previewFile(this)">
|
||||
@@ -289,25 +305,25 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap lg:flex-nowrap w-full gap-4">
|
||||
<div class="flex flex-wrap gap-4 w-full lg:flex-nowrap">
|
||||
<div class="w-full">
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
<div class="flex gap-4 justify-center items-center w-full">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Nama Denah</span>
|
||||
</label>
|
||||
<input type="text" name="nama_denah[]" class="input w-full">
|
||||
<input type="text" name="nama_denah[]" class="w-full input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
<div class="flex gap-4 justify-center items-center w-full">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label"> Luas</span>
|
||||
</label>
|
||||
<input type="text" name="luas_denah[]"
|
||||
class="input w-full number-format"
|
||||
class="w-full input number-format"
|
||||
onkeyup="formatNumber(this)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Jakarta {{ formatTanggalIndonesia($permohonan->penilaian->waktu_penilaian) }}
|
||||
{{ $permohonan->debiture->branch->name ?? '' }} {{ formatTanggalIndonesia($permohonan->penilaian->waktu_penilaian) }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -572,7 +572,7 @@ Breadcrumbs::for('otorisator.show', function (BreadcrumbTrail $trail, $id, $type
|
||||
|
||||
|
||||
Breadcrumbs::for('laporan', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Laporan','');
|
||||
$trail->push('Laporan', '');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan.sederhana.index', function (BreadcrumbTrail $trail) {
|
||||
@@ -673,16 +673,23 @@ Breadcrumbs::for('noc', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('NOC', route('noc.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('noc.show', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('NOC', route('noc.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('noc.pembayaran', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('NOC Pembayaran', route('noc.pembayaran.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('noc.penyelesaian', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('NOC Penyelesaian', route('noc.penyelesaian.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('noc.edit', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('noc');
|
||||
$trail->push('Proses NOC');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('noc.penyelesaian', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('noc');
|
||||
$trail->push('Proses Memo Penyelesaian NOC');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-external', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Laporan External', route('laporan-external.index'));
|
||||
});
|
||||
@@ -724,11 +731,11 @@ Breadcrumbs::for('laporan-admin-kredit', function ($trail) {
|
||||
$trail->push('Laporan Admin Kredit', route('laporan-admin-kredit.index'));
|
||||
});
|
||||
|
||||
// Laporan Admin Kredit Edit
|
||||
Breadcrumbs::for('laporan-admin-kredit-edit', function (BreadcrumbTrail $trail, $laporanAdminKredit) {
|
||||
$trail->parent('laporan-admin-kredit');
|
||||
$trail->push('Edit', route('laporan-admin-kredit.edit', $laporanAdminKredit->id));
|
||||
});
|
||||
// Laporan Admin Kredit Edit
|
||||
Breadcrumbs::for('laporan-admin-kredit-edit', function (BreadcrumbTrail $trail, $laporanAdminKredit) {
|
||||
$trail->parent('laporan-admin-kredit');
|
||||
$trail->push('Edit', route('laporan-admin-kredit.edit', $laporanAdminKredit->id));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('bank-data', function ($trail) {
|
||||
$trail->push('Bank Data', route('bank-data.index'));
|
||||
@@ -739,20 +746,75 @@ Breadcrumbs::for('laporan-penilai-jaminan', function ($trail) {
|
||||
$trail->push('Laporan Penilai Jaminan', route('laporan-penilai-jaminan.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-permohonan', function ($trail) {
|
||||
$trail->parent('laporan');
|
||||
$trail->push('Laporan Permohnan', route('laporan-permohonan.index'));
|
||||
});
|
||||
Breadcrumbs::for('laporan-permohonan', function ($trail) {
|
||||
$trail->parent('laporan');
|
||||
$trail->push('Laporan Permohnan', route('laporan-permohonan.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-penilaian-jaminan', function ($trail) {
|
||||
$trail->parent('laporan');
|
||||
$trail->push('Laporan Penilaian Jaminan', route('laporan-penilaian-jaminan.index'));
|
||||
});
|
||||
Breadcrumbs::for('laporan-penilaian-jaminan', function ($trail) {
|
||||
$trail->parent('laporan');
|
||||
$trail->push('Laporan Penilaian Jaminan', route('laporan-penilaian-jaminan.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-hasil-penilaian-jaminan-internal-external', function ($trail) {
|
||||
$trail->parent('laporan');
|
||||
$trail->push('Laporan Hasil Penilaian Jaminan Internal External', route('laporan-hasil-penilaian-jaminan-internal-external.index'));
|
||||
});
|
||||
Breadcrumbs::for('laporan-hasil-penilaian-jaminan-internal-external', function ($trail) {
|
||||
$trail->parent('laporan');
|
||||
$trail->push('Laporan Hasil Penilaian Jaminan Internal External', route('laporan-hasil-penilaian-jaminan-internal-external.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('rekap-harian-so', function ($trail) {
|
||||
$trail->push('Rekap Harian');
|
||||
});
|
||||
|
||||
|
||||
Breadcrumbs::for('laporan-user', function ($trail) {
|
||||
$trail->push('Laporan User Pemohonan', route('laporan-user.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-monitoring', function ($trail) {
|
||||
$trail->push('Laporan Monitoring', route('laporan-monitoring.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-monitoring.show', function ($trail) {
|
||||
$trail->parent('laporan-monitoring');
|
||||
$trail->push('Detail');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-debiture', function ($trail) {
|
||||
$trail->push('Laporan Debiture', route('laporan-debiture.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-sla-penilai', function ($trail) {
|
||||
$trail->push('Laporan SLA Penilai', route('laporan-sla-penilai.index'));
|
||||
});
|
||||
|
||||
|
||||
Breadcrumbs::for('memo.index', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Memo Penyelesaian', route('memo.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('memo.show', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Memo Penyelesaian', route('memo.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('memo.create', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('memo.index');
|
||||
$trail->push('Create', route('memo.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('memo.preview', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('memo.create');
|
||||
$trail->push('Preview', route('memo.index'));
|
||||
});
|
||||
|
||||
// Breadcrumb untuk Bucok
|
||||
Breadcrumbs::for('bucok', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Data Bucok', route('bucok.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('bucok.show', function (BreadcrumbTrail $trail, $bucok) {
|
||||
$trail->parent('bucok');
|
||||
$trail->push('Detail Bucok #' . $bucok->nomor_tiket);
|
||||
});
|
||||
|
||||
// add andy
|
||||
require __DIR__ . '/breadcrumbs_registrasi.php';
|
||||
|
||||
@@ -131,9 +131,16 @@ Route::middleware(['auth'])->group(function () {
|
||||
|
||||
Route::controller(PembayaranController::class)->group(function () {
|
||||
Route::get('/pembayaran', 'index')->name('pembayaran.index');
|
||||
Route::get('/pembayaran/kurang', 'kurang')->name('pembayaran.kurang.index');
|
||||
Route::get('/pembayaran/lebih', 'lebih')->name('pembayaran.lebih.index');
|
||||
Route::get('/pembayaran/{pembayaran}/edit', 'edit')->name('pembayaran.edit');
|
||||
Route::post('pembayaran','store')->name('pembayaran.store');
|
||||
Route::get('/pembayaran/datatables', 'dataForDatatables')->name('pembayaran.datatables');
|
||||
Route::get('/pembayaran/datatables-kurang','dataForDatatablesKurang')->name('pembayaran.kurang.datatables');
|
||||
Route::get('/pembayaran/datatables-lebih','dataForDatatablesLebih')->name('pembayaran.lebih.datatables');
|
||||
|
||||
Route::get('/pembayaran/{pembayaran}/kurang', 'editKurang')->name('pembayaran.kurang');
|
||||
Route::get('/pembayaran/{pembayaran}/lebih', 'editLebih')->name('pembayaran.lebih');
|
||||
|
||||
Route::put('/pembayaran/{pembayaran}', 'update')->name('pembayaran.update');
|
||||
|
||||
|
||||
166
routes/web.php
166
routes/web.php
@@ -1,49 +1,62 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Lpj\Http\Controllers\ActivityController;
|
||||
use Modules\Lpj\Http\Controllers\ArahMataAnginController;
|
||||
use Modules\Lpj\Http\Controllers\BankDataController;
|
||||
use Modules\Lpj\Http\Controllers\CustomFieldController;
|
||||
use Modules\Lpj\Http\Controllers\DebitureController;
|
||||
use Modules\Lpj\Http\Controllers\DokumenJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\HubunganPemilikJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\HubunganPenghuniJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\IjinUsahaController;
|
||||
use Modules\Lpj\Http\Controllers\JenisDokumenController;
|
||||
use Modules\Lpj\Http\Controllers\JenisFasilitasKreditController;
|
||||
use Modules\Lpj\Http\Controllers\JenisJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\JenisLampiranController;
|
||||
use Modules\Lpj\Http\Controllers\JenisLaporanController;
|
||||
use Modules\Lpj\Http\Controllers\JenisLegalitasJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\JenisPenilaianController;
|
||||
use Modules\Lpj\Http\Controllers\KJPPController;
|
||||
use Modules\Lpj\Http\Controllers\LampiranDokumenController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanAdminKreditController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanExternalController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanHasilPenilaianJaminanInternalExternalController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanPembatalanController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanPenilaianJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanPermohonanController;
|
||||
use Modules\Lpj\Http\Controllers\NilaiPlafondController;
|
||||
use Modules\Lpj\Http\Controllers\NocController;
|
||||
use Modules\Lpj\Http\Controllers\PembatalanController;
|
||||
use Modules\Lpj\Http\Controllers\PemilikJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\PenilaianController;
|
||||
use Modules\Lpj\Http\Controllers\PenilaiController;
|
||||
use Modules\Lpj\Http\Controllers\PermohonanController;
|
||||
use Modules\Lpj\Http\Controllers\PersetujuanPenawaranController;
|
||||
use Modules\Lpj\Http\Controllers\SLAController;
|
||||
use Modules\Lpj\Http\Controllers\KJPPController;
|
||||
use Modules\Lpj\Http\Controllers\MemoController;
|
||||
use Modules\Lpj\Http\Controllers\BucokController;
|
||||
use Modules\Lpj\Http\Controllers\TeamsController;
|
||||
use Modules\Lpj\Http\Controllers\RegionController;
|
||||
use Modules\Lpj\Http\Controllers\ResumeController;
|
||||
use Modules\Lpj\Http\Controllers\SLAController;
|
||||
use Modules\Lpj\Http\Controllers\StatusPermohonanController;
|
||||
use Modules\Lpj\Http\Controllers\SurveyorController;
|
||||
use Modules\Lpj\Http\Controllers\TeamsController;
|
||||
use Modules\Lpj\Http\Controllers\TenderController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanController;
|
||||
use Modules\Lpj\Http\Controllers\PenilaiController;
|
||||
use Modules\Lpj\Http\Controllers\ActivityController;
|
||||
use Modules\Lpj\Http\Controllers\BankDataController;
|
||||
use Modules\Lpj\Http\Controllers\DebitureController;
|
||||
use Modules\Lpj\Http\Controllers\SurveyorController;
|
||||
use Modules\Lpj\Http\Controllers\IjinUsahaController;
|
||||
use Modules\Lpj\Http\Controllers\PenilaianController;
|
||||
use Modules\Lpj\Http\Controllers\PembatalanController;
|
||||
use Modules\Lpj\Http\Controllers\PermohonanController;
|
||||
use Modules\Lpj\Http\Controllers\CustomFieldController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanUserController;
|
||||
use Modules\Lpj\Http\Controllers\JenisDokumenController;
|
||||
use Modules\Lpj\Http\Controllers\JenisJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\JenisLaporanController;
|
||||
use Modules\Lpj\Http\Controllers\NilaiPlafondController;
|
||||
use Modules\Lpj\Http\Controllers\ArahMataAnginController;
|
||||
use Modules\Lpj\Http\Controllers\DaftarPustakaController;
|
||||
use Modules\Lpj\Http\Controllers\JenisLampiranController;
|
||||
use Modules\Lpj\Http\Controllers\RekapHarianSoController;
|
||||
use Modules\Lpj\Http\Controllers\DokumenJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\JenisPenilaianController;
|
||||
use Modules\Lpj\Http\Controllers\PemilikJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\LampiranDokumenController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanDebitureController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanExternalController;
|
||||
use Modules\Lpj\Http\Controllers\TujuanPenilaianController;
|
||||
use Modules\Lpj\Http\Controllers\StatusPermohonanController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanPembatalanController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanPermohonanController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanSLAPenilaiController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanAdminKreditController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanMonitoringSoController;
|
||||
use Modules\Lpj\Http\Controllers\TujuanPenilaianKJPPController;
|
||||
use Modules\Lpj\Http\Controllers\JenisFasilitasKreditController;
|
||||
use Modules\Lpj\Http\Controllers\PersetujuanPenawaranController;
|
||||
use Modules\Lpj\Http\Controllers\CategoryDaftarPustakaController;
|
||||
use Modules\Lpj\Http\Controllers\JenisLegalitasJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanPenilaiJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\HubunganPemilikJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\HubunganPenghuniJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanPenilaianJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanBiayaInternalExternalController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanHasilPenilaianJaminanInternalExternalController;
|
||||
|
||||
|
||||
|
||||
|
||||
// use Modules\Lpj\Http\Controllers\ActivityController;
|
||||
|
||||
@@ -386,6 +399,17 @@ Route::middleware(['auth'])->group(function () {
|
||||
});
|
||||
Route::resource('laporan', LaporanController::class);
|
||||
|
||||
Route::group(['prefix' => 'memo'], function () {
|
||||
Route::get('datatables', [MemoController::class, 'dataForDatatables'])->name('memo.datatables');
|
||||
Route::get('create-bulk', [MemoController::class, 'create'])->name('memo.create.bulk');
|
||||
Route::post('total-biaya-pj', [MemoController::class, 'getTotalBiayaPJ'])->name('memo.total-biaya-pj');
|
||||
Route::post('preview', [MemoController::class, 'preview'])->name('memo.preview');
|
||||
Route::post('generate-pdf', [MemoController::class, 'generatePdf'])->name('memo.generate-pdf');
|
||||
// Route untuk download PDF memo penyelesaian
|
||||
Route::get('/memo/download-pdf/{id}', [MemoController::class, 'downloadPdf'])
|
||||
->name('memo.download-pdf');
|
||||
});
|
||||
Route::resource('memo', MemoController::class);
|
||||
|
||||
Route::name('resume.')->prefix('resume')->group(function () {
|
||||
Route::get('/', [ResumeController::class, 'index'])->name('index');
|
||||
@@ -654,9 +678,14 @@ Route::middleware(['auth'])->group(function () {
|
||||
|
||||
Route::get('noc/datatables', [NocController::class, 'dataForDatatables'])
|
||||
->name('noc.datatables');
|
||||
Route::get('noc/penyelesaian',[NocController::class, 'show'])->name('noc.penyelesaian');
|
||||
Route::post('noc/penyelesaian',[NocController::class, 'penyelesaian'])->name('noc.store.penyelesaian');
|
||||
Route::get('noc/datatables/pembayaran', [NocController::class, 'dataForDatatablesPembayaran'])
|
||||
->name('noc.datatables.pembayaran');
|
||||
Route::get('noc/datatables/penyelesaian', [NocController::class, 'dataForDatatablesPenyelesaian'])
|
||||
->name('noc.datatables.penyelesaian');
|
||||
|
||||
Route::get('noc/pembayaran', [NocController::class, 'pembayaran'])->name('noc.pembayaran.index');
|
||||
Route::get('noc/penyelesaian', [NocController::class, 'penyelesaian'])->name('noc.penyelesaian.index');
|
||||
Route::post('noc/penyelesaian', [NocController::class, 'penyelesaian'])->name('noc.store.penyelesaian');
|
||||
|
||||
Route::resource('noc', NocController::class);
|
||||
|
||||
@@ -680,6 +709,7 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::put('{id}', [LaporanAdminKreditController::class,'update'])->name('update');
|
||||
});
|
||||
|
||||
|
||||
Route::name('bank-data.')->prefix('bank-data')->group(function () {
|
||||
Route::get('datatables', [BankDataController::class, 'dataForDatatables'])->name('datatables');
|
||||
});
|
||||
@@ -692,7 +722,7 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('export', [LaporanPenilaiJaminanController::class, 'export'])->name('export');
|
||||
});
|
||||
|
||||
Route::prefix('laporan-permohonan')->name('laporan-permohonan.')->group(function() {
|
||||
Route::prefix('laporan-permohonan')->name('laporan-permohonan.')->group(function () {
|
||||
Route::get('datatables', [LaporanPermohonanController::class, 'dataForDatatables'])->name('data');
|
||||
Route::get('export', [LaporanPermohonanController::class, 'export'])->name('export');
|
||||
Route::get('/', [LaporanPermohonanController::class, 'index'])->name('index');
|
||||
@@ -705,18 +735,72 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('/export', [LaporanPembatalanController::class, 'export'])->name('export');
|
||||
});
|
||||
|
||||
Route::prefix('laporan-penilaian-jaminan')->name('laporan-penilaian-jaminan.')->group(function() {
|
||||
Route::prefix('laporan-penilaian-jaminan')->name('laporan-penilaian-jaminan.')->group(function () {
|
||||
Route::get('datatables', [LaporanPenilaianJaminanController::class, 'dataForDatatables'])->name('data');
|
||||
Route::get('export', [LaporanPenilaianJaminanController::class, 'export'])->name('export');
|
||||
Route::get('/', [LaporanPenilaianJaminanController::class, 'index'])->name('index');
|
||||
});
|
||||
|
||||
Route::prefix('laporan-hasil-penilaian-jaminan-internal-external')->name('laporan-hasil-penilaian-jaminan-internal-external.')->group(function() {
|
||||
Route::prefix('laporan-hasil-penilaian-jaminan-internal-external')->name('laporan-hasil-penilaian-jaminan-internal-external.')->group(function () {
|
||||
Route::get('datatables', [LaporanHasilPenilaianJaminanInternalExternalController::class, 'dataForDatatables'])->name('data');
|
||||
Route::get('export', [LaporanHasilPenilaianJaminanInternalExternalController::class, 'export'])->name('export');
|
||||
Route::get('/', [LaporanHasilPenilaianJaminanInternalExternalController::class, 'index'])->name('index');
|
||||
});
|
||||
|
||||
// rekap harian so
|
||||
Route::resource('rekap-harian-so', RekapHarianSoController::class);
|
||||
|
||||
// laporan biaya
|
||||
Route::prefix('laporan-biaya')->name('laporan-biaya.')->group(function () {
|
||||
Route::get('internal', [LaporanBiayaInternalExternalController::class, 'showLaporanBiayaInternal'])->name('internal.index');
|
||||
Route::get('external', [LaporanBiayaInternalExternalController::class, 'showLaporanBiayaExternal'])->name('external.index');
|
||||
});
|
||||
|
||||
// laporan user
|
||||
Route::prefix('laporan-user')->name('laporan-user.')->group(function () {
|
||||
Route::get('/', [LaporanUserController::class, 'index'])->name('index');
|
||||
Route::get('export', [LaporanUserController::class, 'export'])->name('export');
|
||||
Route::get('api/user-pemohon', [LaporanUserController::class, 'searchUserPemohon'])->name('api.user-pemohon');
|
||||
Route::get('datatables', [LaporanUserController::class, 'dataTableForUserPemohon'])->name('datatables');
|
||||
});
|
||||
|
||||
// laporan monitoring
|
||||
Route::prefix('laporan-monitoring')->name('laporan-monitoring.')->group(function () {
|
||||
Route::get('/', [LaporanMonitoringSoController::class, 'index'])->name('index');
|
||||
Route::get('/{id}/detail', [LaporanMonitoringSoController::class, 'show'])->name('show');
|
||||
Route::get('datatables/{id}', [LaporanMonitoringSoController::class, 'dataForDatatablePenilai'])->name('datatables');
|
||||
});
|
||||
|
||||
// laporan debiture
|
||||
Route::prefix('laporan-debiture')->name('laporan-debiture.')->group(function () {
|
||||
Route::get('/', [LaporanDebitureController::class, 'index'])->name('index');
|
||||
Route::get('datatables', [LaporanDebitureController::class, 'dataTableForDebiture'])->name('datatables');
|
||||
});
|
||||
|
||||
// laporan sla
|
||||
Route::prefix('laporan-sla-penilai')->name('laporan-sla-penilai.')->group(function () {
|
||||
Route::get('/', [LaporanSLAPenilaiController::class, 'index'])->name('index');
|
||||
Route::get('datatables', [LaporanSLAPenilaiController::class, 'dataForDatatableSLaPenilai'])->name('datatables');
|
||||
});
|
||||
|
||||
// daftar pustaka
|
||||
Route::resource('daftar-pustaka', DaftarPustakaController::class);
|
||||
|
||||
// category daftar pustaka
|
||||
Route::prefix('category-daftar-pustaka')->name('category-daftar-pustaka.')->group(function () {
|
||||
Route::get('datatables', [CategoryDaftarPustakaController::class, 'dataForDatatables'])->name('datatables');
|
||||
});
|
||||
|
||||
Route::resource('category-daftar-pustaka', CategoryDaftarPustakaController::class);
|
||||
|
||||
// Route untuk Bucok
|
||||
Route::prefix('bucok')->name('bucok.')->group(function () {
|
||||
Route::get('/', [BucokController::class, 'index'])->name('index');
|
||||
Route::get('/datatables', [BucokController::class, 'dataForDatatables'])->name('datatables');
|
||||
Route::get('/{id}', [BucokController::class, 'show'])->name('show');
|
||||
Route::post('/import', [BucokController::class, 'import'])->name('import');
|
||||
Route::get('/export', [BucokController::class, 'export'])->name('export');
|
||||
});
|
||||
});
|
||||
|
||||
require __DIR__ . '/registrasi.php';
|
||||
|
||||
Reference in New Issue
Block a user