fix some revisi

This commit is contained in:
Jagad R R
2025-01-19 14:57:01 +07:00
parent 430700bc59
commit 1610d83bc6
17 changed files with 562 additions and 477 deletions
@@ -109,13 +109,13 @@
<th>Bukti</th>
<th>Account Number</th>
<th>Status</th>
@if (auth()->user()->can('approval.approve'))
@if (auth()->user()->can('approval.view'))
<th>Approval 1</th>
@endif
@if (auth()->user()->can('approval2.approve'))
@if (auth()->user()->can('approval2.view'))
<th>Approval 2</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
@if (auth()->user()->can('final_approval.view'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
@@ -157,92 +157,87 @@
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve'))
@if (auth()->user()->can('approval.view'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'On Progress' || $item->status == 'Rejected')
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.entertainment.approve', $item->id) }}">
Approve 1
</button>
</form>
<form action="{{ route('forms.entertainment.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>
@else
@if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
@if (auth()->user()->can('approval2.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved 1' && $item->approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.entertainment.approve2', $item->id) }}">
Approve 2
</button>
</form>
<form action="{{ route('forms.entertainment.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>
@else
@if ($item->approved2_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm final-approve-modal"
data-id="{{ route('forms.entertainment.final-approve', $item->id) }}">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.entertainment.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
@if (auth()->user()->can('approval.approve'))
@if ($item->status == 'On Progress')
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.entertainment.approve', $item->id) }}">
Approve 1
</button>
</form>
<form action="{{ route('forms.entertainment.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>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
@if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
@if (auth()->user()->can('approval2.view'))
<td>
{{-- approve / reject button --}}
@if (auth()->user()->can('approval2.approve'))
@if ($item->status == 'Approved 1' && $item->approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.entertainment.approve2', $item->id) }}">
Approve 2
</button>
</form>
<form action="{{ route('forms.entertainment.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>
@endif
@endif
@if ($item->approved2_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
@if(auth()->user()->can('final_approval.view'))
<td>
{{-- approve / reject button --}}
@if(auth()->user()->can('final_approval.approve'))
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm final-approve-modal"
data-id="{{ route('forms.entertainment.final-approve', $item->id) }}">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.entertainment.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
</button>
</form>
@endif
@endif
@endif
@if ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
<td>
@@ -108,13 +108,13 @@
<th>Total Approved</th>
<th>Account Number</th>
<th>Status</th>
@if (auth()->user()->can('approval.approve'))
@if (auth()->user()->can('approval.view'))
<th>Approval 1</th>
@endif
@if (auth()->user()->can('approval2.approve'))
@if (auth()->user()->can('approval2.view'))
<th>Approval 2</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
@if (auth()->user()->can('final_approval.view'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
@@ -147,92 +147,87 @@
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve'))
@if (auth()->user()->can('approval.view'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'On Progress' || $item->status == 'Rejected')
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.meeting.approve', $item->id) }}">
Approve 1
</button>
</form>
<form action="{{ route('forms.meeting.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>
@else
@if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
@if (auth()->user()->can('approval2.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved 1' && $item->approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.meeting.approve2', $item->id) }}">
Approve 2
</button>
</form>
<form action="{{ route('forms.meeting.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>
@else
@if ($item->approved2_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm final-approve-modal"
data-id="{{ route('forms.meeting.final-approve', $item->id) }}">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.meeting.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
@if (auth()->user()->can('approval.approve'))
@if ($item->status == 'On Progress')
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.meeting.approve', $item->id) }}">
Approve 1
</button>
</form>
<form action="{{ route('forms.meeting.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>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
@if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
@if (auth()->user()->can('approval2.view'))
<td>
{{-- approve / reject button --}}
@if (auth()->user()->can('approval2.approve'))
@if ($item->status == 'Approved 1' && $item->approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.meeting.approve2', $item->id) }}">
Approve 2
</button>
</form>
<form action="{{ route('forms.meeting.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>
@endif
@endif
@if ($item->approved2_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
@if(auth()->user()->can('final_approval.view'))
<td>
{{-- approve / reject button --}}
@if(auth()->user()->can('final_approval.approve'))
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm final-approve-modal"
data-id="{{ route('forms.meeting.final-approve', $item->id) }}">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.meeting.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
</button>
</form>
@endif
@endif
@endif
@if ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
<td>
@@ -108,13 +108,13 @@
<th>Bukti Total</th>
<th>Account Number</th>
<th>Status</th>
@if (auth()->user()->can('approval.approve'))
@if (auth()->user()->can('approval.view'))
<th>Approval 1</th>
@endif
@if (auth()->user()->can('approval2.approve'))
@if (auth()->user()->can('approval2.view'))
<th>Approval 2</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
@if (auth()->user()->can('final_approval.view'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
@@ -155,92 +155,87 @@
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve'))
@if (auth()->user()->can('approval.view'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'On Progress' || $item->status == 'Rejected')
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.other.approve', $item->id) }}">
Approve 1
</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>
@else
@if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
@if (auth()->user()->can('approval2.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved 1' && $item->approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.other.approve2', $item->id) }}">
Approve 2
</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>
@else
@if ($item->approved2_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm final-approve-modal"
data-id="{{ route('forms.other.final-approve', $item->id) }}">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.other.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
@if (auth()->user()->can('approval.approve'))
@if ($item->status == 'On Progress')
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.other.approve', $item->id) }}">
Approve 1
</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>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
@if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
@if (auth()->user()->can('approval2.view'))
<td>
{{-- approve / reject button --}}
@if (auth()->user()->can('approval2.approve'))
@if ($item->status == 'Approved 1' && $item->approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.other.approve2', $item->id) }}">
Approve 2
</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>
@endif
@endif
@if ($item->approved2_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
@if(auth()->user()->can('final_approval.view'))
<td>
{{-- approve / reject button --}}
@if(auth()->user()->can('final_approval.approve'))
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm final-approve-modal"
data-id="{{ route('forms.other.final-approve', $item->id) }}">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.other.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
</button>
</form>
@endif
@endif
@endif
@if ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
<td>
@@ -108,13 +108,13 @@
<th>Total Approved</th>
<th>Account Number</th>
<th>Status</th>
@if (auth()->user()->can('approval.approve'))
@if (auth()->user()->can('approval.view'))
<th>Approval 1</th>
@endif
@if (auth()->user()->can('approval2.approve'))
@if (auth()->user()->can('approval2.view'))
<th>Approval 2</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
@if (auth()->user()->can('final_approval.view'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
@@ -153,92 +153,87 @@
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve'))
@if (auth()->user()->can('approval.view'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'On Progress' || $item->status == 'Rejected')
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.up-country.approve', $item->id) }}">
Approve 1
</button>
</form>
<form action="{{ route('forms.up-country.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>
@else
@if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
@if (auth()->user()->can('approval2.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved 1' && $item->approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.up-country.approve2', $item->id) }}">
Approve 2
</button>
</form>
<form action="{{ route('forms.up-country.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>
@else
@if ($item->approved2_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm final-approve-modal"
data-id="{{ route('forms.up-country.final-approve', $item->id) }}">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.up-country.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
@if (auth()->user()->can('approval.approve'))
@if ($item->status == 'On Progress')
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.up-country.approve', $item->id) }}">
Approve 1
</button>
</form>
<form action="{{ route('forms.up-country.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>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
@if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
@if (auth()->user()->can('approval2.view'))
<td>
{{-- approve / reject button --}}
@if (auth()->user()->can('approval2.approve'))
@if ($item->status == 'Approved 1' && $item->approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.up-country.approve2', $item->id) }}">
Approve 2
</button>
</form>
<form action="{{ route('forms.up-country.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>
@endif
@endif
@if ($item->approved2_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
@if(auth()->user()->can('final_approval.view'))
<td>
{{-- approve / reject button --}}
@if(auth()->user()->can('final_approval.approve'))
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm final-approve-modal"
data-id="{{ route('forms.up-country.final-approve', $item->id) }}">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.up-country.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
</button>
</form>
@endif
@endif
@endif
@if ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
<td>
@@ -110,13 +110,13 @@
<th>Bukti</th>
<th>Account Number</th>
<th>Status</th>
@if (auth()->user()->can('approval.approve'))
@if (auth()->user()->can('approval.view'))
<th>Approval 1</th>
@endif
@if (auth()->user()->can('approval2.approve'))
@if (auth()->user()->can('approval2.view'))
<th>Approval 2</th>
@endif
@if (auth()->user()->can('final_approval.approve'))
@if (auth()->user()->can('final_approval.view'))
<th>Final Approval</th>
@endif
<th>Aksi</th>
@@ -159,92 +159,87 @@
<span class="badge badge-danger text-white">{{ $item->status }}</span>
@endif
</td>
@if (auth()->user()->can('approval.approve'))
@if (auth()->user()->can('approval.view'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'On Progress' || $item->status == 'Rejected')
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.vehicle.approve', $item->id) }}">
Approve 1
</button>
</form>
<form action="{{ route('forms.vehicle.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>
@else
@if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
@if (auth()->user()->can('approval2.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved 1' && $item->approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.vehicle.approve2', $item->id) }}">
Approve 2
</button>
</form>
<form action="{{ route('forms.vehicle.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>
@else
@if ($item->approved2_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@elseif($item->rejected_at)
{{ \Carbon\Carbon::parse($item->rejected_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
</td>
@endif
@if(auth()->user()->can('final_approval.approve'))
<td>
{{-- approve / reject button --}}
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm final-approve-modal"
data-id="{{ route('forms.vehicle.final-approve', $item->id) }}">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.vehicle.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
@if (auth()->user()->can('approval.approve'))
@if ($item->status == 'On Progress')
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.vehicle.approve', $item->id) }}">
Approve 1
</button>
</form>
<form action="{{ route('forms.vehicle.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>
@elseif ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@else
-
@endif
@endif
@if ($item->approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
@if (auth()->user()->can('approval2.view'))
<td>
{{-- approve / reject button --}}
@if (auth()->user()->can('approval2.approve'))
@if ($item->status == 'Approved 1' && $item->approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm open-approve-modal"
data-id="{{ route('forms.vehicle.approve2', $item->id) }}">
Approve 2
</button>
</form>
<form action="{{ route('forms.vehicle.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>
@endif
@endif
@if ($item->approved2_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
@if(auth()->user()->can('final_approval.view'))
<td>
{{-- approve / reject button --}}
@if(auth()->user()->can('final_approval.approve'))
@if ($item->status == 'Approved 2' && $item->approved2_at && !$item->final_approved_at)
<form action="javascript:void(0);" class="d-inline">
<button type="button"
class="btn btn-success btn-sm final-approve-modal"
data-id="{{ route('forms.vehicle.final-approve', $item->id) }}">
Final Approve
</button>
</form>
@else
@if ($item->final_approved_at && auth()->user()->can('final_approval.open'))
<form action="{{ route('forms.vehicle.open', $item->id) }}" method="POST" class="d-inline"onsubmit="return confirm('Are you sure you want to approve this item?');">
@csrf
@method('PUT')
<button type="submit" class="btn btn-success btn-sm">
Open
</button>
</form>
@endif
@endif
@endif
@if ($item->final_approved_at)
{{ \Carbon\Carbon::parse($item->approved_at)->locale('id')->isoFormat('D MMMM Y') }}
@endif
</td>
@endif
<td>