Tambahkan fitur pembayaran dan perbaikan tampilan terkait
- Tambah file migration untuk update tabel `persetujuan_penawaran` dengan relasi baru. - Tambah fungsi baru di controller pembayaran: `edit`, `store`, `update`, dan `approval`. - Perbarui view daftar pembayaran dan tambahkan form pembayaran baru. - Tambah endpoint dan breadcrumbs untuk fitur pembayaran di routes.
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card 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 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 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Pembayaran
|
||||
@@ -27,49 +27,39 @@
|
||||
<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">
|
||||
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]" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </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="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-[150px] text-center" data-datatable-column="approve_bayar_by">
|
||||
<span class="sort"> <span class="sort-label"> Status Approve </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>
|
||||
@@ -93,8 +83,7 @@
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function pembayaranOtorisator(id)
|
||||
{
|
||||
function pembayaranOtorisator(id) {
|
||||
// alert('hai id = ' + id);
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
@@ -114,12 +103,12 @@
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
let useURL= "{{ URL::to('pembayaran') }}"+"/"+id;
|
||||
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._method = 'PUT';
|
||||
input_data.id = id;
|
||||
input_data.keterangan = keterangan;
|
||||
|
||||
$.ajaxSetup({
|
||||
@@ -133,14 +122,11 @@
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: (response) => {
|
||||
if('success' == response.status)
|
||||
{
|
||||
if ('success' == response.status) {
|
||||
Swal.fire('Berhasil!', response.message, 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
else if('error' == response.status)
|
||||
{
|
||||
} else if ('error' == response.status) {
|
||||
Swal.fire('Error!', response.message, 'error').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
@@ -151,7 +137,7 @@
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan otorisator.',
|
||||
'error');
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -192,7 +178,10 @@
|
||||
branch_id: {
|
||||
title: 'Cabang Pemohon',
|
||||
render: (item, data) => {
|
||||
return `${data.branch.name}`;
|
||||
if (data.branch) {
|
||||
return `${data.branch.name}`;
|
||||
}
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
debitur_id: {
|
||||
@@ -201,31 +190,14 @@
|
||||
return `${data.debiture.name}`;
|
||||
},
|
||||
},
|
||||
tujuan_penilaian_id: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return `${data.tujuan_penilaian.name}`;
|
||||
},
|
||||
},
|
||||
approve_bayar_by: {
|
||||
title: 'Status Approve',
|
||||
render: (item, data) => {
|
||||
var status_bayar='';
|
||||
if(data.approve_bayar_by)
|
||||
status_bayar=`<span class="text-md font-bold text-green-600 uppercase">CLEAR</span>`;
|
||||
// return `${data.tujuan_penilaian.name}`;
|
||||
|
||||
return status_bayar;
|
||||
},
|
||||
},
|
||||
status_bayar: {
|
||||
title: 'Status Bayar',
|
||||
render: (item, data) => {
|
||||
const status = data.status_bayar.replace(/_/g,
|
||||
' ');
|
||||
const statusClass = data.status_bayar === 'belum_bayar' ? 'text-red-600' :
|
||||
'text-green-600';
|
||||
return `<span class="text-md font-bold ${statusClass} uppercase">
|
||||
const status = data.status_bayar.replace(/_/g,
|
||||
' ');
|
||||
const statusClass = data.status_bayar === 'belum_bayar' ? 'text-red-600' :
|
||||
'text-green-600';
|
||||
return `<span class="text-md font-bold ${statusClass} uppercase">
|
||||
${status}
|
||||
</span>`;
|
||||
},
|
||||
@@ -233,21 +205,11 @@
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
var iconPembayaranOtorisator ='';
|
||||
if(!data.approve_bayar_by)
|
||||
{
|
||||
iconPembayaranOtorisator = `<a class="btn btn-sm btn-icon btn-clear btn-primary " onclick="pembayaranOtorisator(${data.id})">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
</a>`;
|
||||
}
|
||||
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning " href="#">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>`
|
||||
+iconPembayaranOtorisator+`
|
||||
</div>`;
|
||||
|
||||
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">
|
||||
<i class="ki-outline ki-credit-cart"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -255,7 +217,7 @@
|
||||
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user