enhanced by codex
This commit is contained in:
@@ -22,10 +22,10 @@
|
||||
</section>
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="row row-cols-1 row-cols-md-2 row-cols-xl-5 g-3">
|
||||
<!-- Total Expense -->
|
||||
<div class="col-6 {{ $availableBudget > 0 ? 'col-lg-3' : 'col-lg-4' }}">
|
||||
<div class="small-box bg-info">
|
||||
<div class="col d-flex">
|
||||
<div class="small-box bg-info flex-fill">
|
||||
<div class="inner">
|
||||
<h3>Rp {{ number_format($forms->sum('total'), 0, ',', '.') }}</h3>
|
||||
<p>Total Expense</p>
|
||||
@@ -36,8 +36,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- Approved Expense -->
|
||||
<div class="col-6 {{ $availableBudget > 0 ? 'col-lg-3' : 'col-lg-4' }}">
|
||||
<div class="small-box bg-success">
|
||||
<div class="col d-flex">
|
||||
<div class="small-box bg-success flex-fill">
|
||||
<div class="inner">
|
||||
<h3>Rp {{ number_format($forms->whereIn('status', ['Approved', 'Closed'])->sum('approved_total'), 0, ',', '.') }}</h3>
|
||||
<p>Approved Expenses</p>
|
||||
@@ -48,8 +48,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- Pending Expense -->
|
||||
<div class="col-6 {{ $availableBudget > 0 ? 'col-lg-3' : 'col-lg-4' }}">
|
||||
<div class="small-box bg-warning">
|
||||
<div class="col d-flex">
|
||||
<div class="small-box bg-warning flex-fill">
|
||||
<div class="inner">
|
||||
<h3 class="text-white">Rp {{ number_format($forms->where('status', 'On Progress')->sum('total'), 0, ',', '.') }}</h3>
|
||||
<p class="text-white">Pending Expenses</p>
|
||||
@@ -59,9 +59,22 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Outstanding Expense -->
|
||||
<div class="col d-flex">
|
||||
<div class="small-box bg-danger flex-fill">
|
||||
<div class="inner">
|
||||
<h3>{{ $outstandingCount }}</h3>
|
||||
<p>Outstanding Expenses</p>
|
||||
<p class="mb-0"><small>Total Rp {{ number_format($outstandingTotal, 0, ',', '.') }}</small></p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="fas fa-exclamation-triangle"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if($availableBudget > 0)
|
||||
<div class="col-lg-3 col-6">
|
||||
<div class="small-box bg-purple">
|
||||
<div class="col d-flex">
|
||||
<div class="small-box bg-purple flex-fill">
|
||||
<div class="inner">
|
||||
<h3 class="text-white">Rp {{ number_format($availableBudget, 0, ',', '.') }}</h3>
|
||||
<p class="text-white">Available Budget</p>
|
||||
@@ -168,13 +181,11 @@
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.other.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
<button type="button"
|
||||
class="btn btn-danger btn-sm open-reject-modal"
|
||||
data-action="{{ route('forms.other.reject', $item->id) }}">
|
||||
Reject
|
||||
</button>
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->approved_at)
|
||||
@@ -195,13 +206,11 @@
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="{{ route('forms.other.reject', $item->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to reject this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger btn-sm">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
<button type="button"
|
||||
class="btn btn-danger btn-sm open-reject-modal"
|
||||
data-action="{{ route('forms.other.reject', $item->id) }}">
|
||||
Reject
|
||||
</button>
|
||||
@endif
|
||||
@endif
|
||||
@if ($item->approved2_at)
|
||||
@@ -397,6 +406,35 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<div class="modal fade" id="rejectModal" tabindex="-1" role="dialog" aria-labelledby="rejectModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<form id="rejectForm" method="POST" action="">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="rejectModalLabel">Reject Expense</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="rejectRemarks">Remarks <span class="text-danger">*</span></label>
|
||||
<textarea class="form-control" name="remarks" id="rejectRemarks" rows="3" required></textarea>
|
||||
</div>
|
||||
<p class="mb-0 text-muted small">Pengajuan akan ditolak setelah Anda mengirimkan catatan ini.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-danger">Reject</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@@ -437,6 +475,23 @@
|
||||
});
|
||||
}
|
||||
|
||||
// Handle Reject Button Click
|
||||
$(document).on('click', '.open-reject-modal', function () {
|
||||
const rejectUrl = $(this).data('action');
|
||||
$('#rejectForm').attr('action', rejectUrl);
|
||||
$('#rejectRemarks').val('');
|
||||
$('#rejectModal').modal('show');
|
||||
});
|
||||
|
||||
$('#rejectModal').on('shown.bs.modal', function () {
|
||||
$('#rejectRemarks').trigger('focus');
|
||||
});
|
||||
|
||||
$('#rejectModal').on('hidden.bs.modal', function () {
|
||||
$('#rejectForm').attr('action', '');
|
||||
$('#rejectRemarks').val('');
|
||||
});
|
||||
|
||||
// Handle Approve Button Click
|
||||
$(document).on('click', '.open-approve-modal', function() {
|
||||
const approveUrl = $(this).data('id');
|
||||
@@ -559,4 +614,4 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user