localize library cdn, remove approve button from transaction page, fix all fitur running datatable as well, fixing sortable datatable using new cdn, fix modal approve, add note to receiver mutations
This commit is contained in:
@@ -26,24 +26,23 @@ License: You must have a valid license purchased only from themeforest(the above
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<!--begin::Fonts -->
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700|Roboto:300,400,500,600,700">
|
||||
<link rel="stylesheet" href="{{ asset('css/google-font.css') }}">
|
||||
<!--end::Fonts -->
|
||||
|
||||
<!--begin::Global Theme Styles(used by all pages) -->
|
||||
<link href="{{ url('css/app.bundle.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('css/app.bundle.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<!--end::Global Theme Styles -->
|
||||
|
||||
<!--begin::Global Custom Styles(used by all pages) -->
|
||||
<link href="{{ url('css/custom-web.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('css/custom-web.css') }}" rel="stylesheet" type="text/css" />
|
||||
<!--end::Global Custom Styles -->
|
||||
|
||||
<link rel="shortcut icon" href="{{ asset('assets/media/logos/ckb.jpeg') }}" />
|
||||
|
||||
<!--begin::DataTables CSS -->
|
||||
<link href="https://cdn.datatables.net/1.13.6/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="https://cdn.datatables.net/fixedcolumns/4.2.2/css/fixedColumns.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<!--end::DataTables CSS -->
|
||||
|
||||
<link href="{{ asset('css/vendor/dataTables.bootstrap4.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('css/vendor/fixedColumns.bootstrap4.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('css/vendor/sweetalert2.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!-- begin::Global Config(global config for global JS sciprts) -->
|
||||
<script>
|
||||
@@ -74,23 +73,11 @@ License: You must have a valid license purchased only from themeforest(the above
|
||||
<!--end::Global Theme Bundle -->
|
||||
|
||||
<!--begin::DataTables -->
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/fixedcolumns/4.2.2/js/dataTables.fixedColumns.min.js"></script>
|
||||
<!--end::DataTables -->
|
||||
<script src="{{ asset('js/vendor.js') }}"></script>
|
||||
|
||||
<!--begin::Common Script -->
|
||||
<script src="{{ asset('js/init.js') }}" type="text/javascript"></script>
|
||||
<!--end::Common Scripts -->
|
||||
|
||||
<!--begin::SweetAlert2 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<!--end::SweetAlert2 -->
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.3.0/dist/chart.umd.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2"></script>
|
||||
|
||||
|
||||
|
||||
@yield('styles')
|
||||
</head>
|
||||
|
||||
@@ -27,8 +27,7 @@ License: You must have a valid license purchased only from themeforest(the above
|
||||
<meta name="base-url" content="{{ url('/') }}">
|
||||
|
||||
<!--begin::Fonts -->
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700|Roboto:300,400,500,600,700">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,600,700|Roboto:300,400,500,600,700">
|
||||
<link rel="stylesheet" href="{{ asset('css/google-font.css') }}">
|
||||
|
||||
<!--end::Fonts -->
|
||||
|
||||
@@ -43,11 +42,11 @@ License: You must have a valid license purchased only from themeforest(the above
|
||||
|
||||
<link rel="shortcut icon" href="{{ asset('assets/media/logos/ckb.jpeg') }}" />
|
||||
|
||||
<link href="{{ asset('css/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('css/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!--begin::DataTables CSS -->
|
||||
<link href="https://cdn.datatables.net/1.13.6/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="https://cdn.datatables.net/fixedcolumns/4.2.2/css/fixedColumns.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('css/vendor/dataTables.bootstrap4.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('css/vendor/fixedColumns.bootstrap4.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<!--end::DataTables CSS -->
|
||||
|
||||
<style>
|
||||
@@ -125,7 +124,9 @@ License: You must have a valid license purchased only from themeforest(the above
|
||||
<script src="//maps.google.com/maps/api/js?key=AIzaSyBTGnKT7dt597vo9QgeQ7BFhvSRP4eiMSM" type="text/javascript"></script>
|
||||
<!--end::Global Theme Bundle -->
|
||||
|
||||
<!--begin::DataTables -->
|
||||
<script src="{{ asset('js/vendor.js') }}"></script>
|
||||
|
||||
{{-- <!--begin::DataTables -->
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/fixedcolumns/4.2.2/js/dataTables.fixedColumns.min.js"></script>
|
||||
@@ -141,7 +142,7 @@ License: You must have a valid license purchased only from themeforest(the above
|
||||
|
||||
<!--end::Common Scripts -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.3.0/dist/chart.umd.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2"></script> --}}
|
||||
<script src="{{ asset('js/bootstrap-datepicker.min.js') }}" type="text/javascript"></script>
|
||||
|
||||
|
||||
|
||||
@@ -44,93 +44,6 @@
|
||||
</li>
|
||||
@endcan
|
||||
|
||||
@if (Auth::user()->can('view', $menus['dealer.index']) || Auth::user()->can('view', $menus['category.index']) || Auth::user()->can('view', $menus['work.index']))
|
||||
<li class="kt-menu__item kt-menu__item--submenu" aria-haspopup="true" data-ktmenu-submenu-toggle="hover">
|
||||
<a href="javascript:;" class="kt-menu__link kt-menu__toggle">
|
||||
<span class="kt-menu__link-icon">
|
||||
<i class="fa fa-box"></i>
|
||||
</span>
|
||||
<span class="kt-menu__link-text">Data Master</span><i class="kt-menu__ver-arrow la la-angle-right"></i>
|
||||
</a>
|
||||
<div class="kt-menu__submenu "><span class="kt-menu__arrow"></span>
|
||||
<ul class="kt-menu__subnav">
|
||||
{{-- <li class="kt-menu__item kt-menu__item--parent" aria-haspopup="true"><span class="kt-menu__link"><span class="kt-menu__link-text">Kategori Pekerjaan</span></span></li> --}}
|
||||
@can('view', $menus['dealer.index'])
|
||||
<li class="kt-menu__item" aria-haspopup="true"><a href="{{ route('dealer.index') }}" class="kt-menu__link "><i class="fa fa-car" style="display: flex; align-items: center; margin-right: 10px;"><span></span></i><span class="kt-menu__link-text">Dealer</span></a></li>
|
||||
@endcan
|
||||
@can('view', $menus['category.index'])
|
||||
<li class="kt-menu__item" aria-haspopup="true"><a href="{{ route('category.index') }}" class="kt-menu__link "><i class="fa fa-users" style="display: flex; align-items: center; margin-right: 10px;"><span></span></i><span class="kt-menu__link-text">Kategori Pekerjaan</span></a></li>
|
||||
@endcan
|
||||
@can('view', $menus['work.index'])
|
||||
<li class="kt-menu__item" aria-haspopup="true"><a href="{{ route('work.index') }}" class="kt-menu__link "><i class="fa fa-list" style="display: flex; align-items: center; margin-right: 10px;"><span></span></i><span class="kt-menu__link-text">Pekerjaan</span></a></li>
|
||||
@endcan
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->can('view', $menus['user.index']) || Auth::user()->can('view', $menus['roleprivileges.index']))
|
||||
<li class="kt-menu__item kt-menu__item--submenu" aria-haspopup="true" data-ktmenu-submenu-toggle="hover">
|
||||
<a href="javascript:;" class="kt-menu__link kt-menu__toggle">
|
||||
<span class="kt-menu__link-icon">
|
||||
<i class="fa fa-box"></i>
|
||||
</span>
|
||||
<span class="kt-menu__link-text">Management User</span><i class="kt-menu__ver-arrow la la-angle-right"></i>
|
||||
</a>
|
||||
<div class="kt-menu__submenu "><span class="kt-menu__arrow"></span>
|
||||
<ul class="kt-menu__subnav">
|
||||
{{-- <li class="kt-menu__item kt-menu__item--parent" aria-haspopup="true"><span class="kt-menu__link"><span class="kt-menu__link-text">Kategori Pekerjaan</span></span></li> --}}
|
||||
@can('view', $menus['user.index'])
|
||||
<li class="kt-menu__item" aria-haspopup="true"><a href="{{ route('user.index') }}" class="kt-menu__link "><i class="fa fa-car" style="display: flex; align-items: center; margin-right: 10px;"><span></span></i><span class="kt-menu__link-text">User</span></a></li>
|
||||
@endcan
|
||||
@can('view', $menus['roleprivileges.index'])
|
||||
<li class="kt-menu__item" aria-haspopup="true"><a href="{{ route('roleprivileges.index') }}" class="kt-menu__link "><i class="fa fa-users" style="display: flex; align-items: center; margin-right: 10px;"><span></span></i><span class="kt-menu__link-text">Role & Privileges</span></a></li>
|
||||
@endcan
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
@endcan
|
||||
|
||||
{{-- <li class="kt-menu__item kt-menu__item--submenu" aria-haspopup="true" data-ktmenu-submenu-toggle="hover">
|
||||
<a href="{{ route('user.index') }}" class="kt-menu__link kt-menu__toggle">
|
||||
<span class="kt-menu__link-icon">
|
||||
<i class="fa fa-list"></i>
|
||||
</span>
|
||||
<span class="kt-menu__link-text">User</span>
|
||||
</a>
|
||||
</li> --}}
|
||||
|
||||
@if (Auth::user()->can('view', $menus['report.transaction']) || Auth::user()->can('view', $menus['report.transaction_sa']) || Auth::user()->can('view', $menus['report.transaction_dealer']))
|
||||
<li class="kt-menu__item kt-menu__item--submenu" aria-haspopup="true" data-ktmenu-submenu-toggle="hover">
|
||||
<a href="javascript:;" class="kt-menu__link kt-menu__toggle">
|
||||
<span class="kt-menu__link-icon">
|
||||
<i class="fa fa-box"></i>
|
||||
</span>
|
||||
<span class="kt-menu__link-text">Laporan</span><i class="kt-menu__ver-arrow la la-angle-right"></i>
|
||||
</a>
|
||||
<div class="kt-menu__submenu "><span class="kt-menu__arrow"></span>
|
||||
<ul class="kt-menu__subnav">
|
||||
{{-- <li class="kt-menu__item kt-menu__item--parent" aria-haspopup="true"><span class="kt-menu__link"><span class="kt-menu__link-text">Kategori Pekerjaan</span></span></li> --}}
|
||||
@can('view', $menus['report.transaction'])
|
||||
<li class="kt-menu__item" aria-haspopup="true">
|
||||
<a href="{{ route('report.transaction') }}" class="kt-menu__link "><i class="fa fa-wrench" style="display: flex; align-items: center; margin-right: 10px;"><span></span></i><span class="kt-menu__link-text">Laporan Pekerjaan</span></a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('view', $menus['report.transaction_sa'])
|
||||
<li class="kt-menu__item" aria-haspopup="true">
|
||||
<a href="{{ route('report.transaction_sa') }}" class="kt-menu__link "><i class="fa fa-user" style="display: flex; align-items: center; margin-right: 10px;"><span></span></i><span class="kt-menu__link-text">Laporan Performa SA</span></a>
|
||||
</li>
|
||||
@endcan
|
||||
@can('view', $menus['report.transaction_dealer'])
|
||||
<li class="kt-menu__item" aria-haspopup="true">
|
||||
<a href="{{ route('report.transaction_dealer') }}" class="kt-menu__link "><i class="fa fa-car" style="display: flex; align-items: center; margin-right: 10px;"><span></span></i><span class="kt-menu__link-text">Laporan Performa Dealer</span></a>
|
||||
</li>
|
||||
@endcan
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
{{-- Section Header --}}
|
||||
<div class="kt-menu__section" style="padding: 10px 20px; font-weight: bold;">
|
||||
<i class="kt-menu__section-icon fa fa-box"></i>
|
||||
|
||||
@@ -1800,6 +1800,18 @@ use Illuminate\Support\Facades\Auth;
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${mutation.shipping_notes ? `
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-12">
|
||||
<strong>Catatan dari Pengirim:</strong><br>
|
||||
<div class="alert alert-info mb-0">
|
||||
<i class="fa fa-info-circle mr-2"></i>
|
||||
${mutation.shipping_notes}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
` : ''}
|
||||
|
||||
<hr>
|
||||
|
||||
<h6 class="mb-3">Detail Produk & Penerimaan:</h6>
|
||||
@@ -1945,8 +1957,8 @@ use Illuminate\Support\Facades\Auth;
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="fa fa-check-circle mr-2"></i>
|
||||
<div>
|
||||
<strong>Status:</strong> Mutasi telah diterima dan siap untuk disetujui.
|
||||
<br><small>Stock akan dipindahkan setelah Anda menyetujui mutasi ini.</small>
|
||||
<strong>Status:</strong> Mutasi telah diterima dan menunggu persetujuan admin.
|
||||
<br><small>Stock akan dipindahkan setelah admin menyetujui mutasi ini.</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2063,135 +2075,8 @@ use Illuminate\Support\Facades\Auth;
|
||||
|
||||
|
||||
|
||||
// Handle approve button click
|
||||
$(document).on('click', '.btn-approve-mutation', function() {
|
||||
var mutationId = $(this).data('id');
|
||||
|
||||
Swal.fire({
|
||||
title: 'Konfirmasi Persetujuan Mutasi',
|
||||
html: `
|
||||
<div class="text-left">
|
||||
<p class="mb-3">Dengan menyetujui mutasi ini:</p>
|
||||
<ul class="text-muted mb-3" style="font-size: 14px;">
|
||||
<li>Stock akan dipindahkan secara otomatis dari dealer asal ke dealer tujuan</li>
|
||||
<li>Proses mutasi akan selesai dan tidak dapat dibatalkan</li>
|
||||
<li>Perubahan stock akan tercatat dalam log sistem</li>
|
||||
</ul>
|
||||
<div class="form-group text-left">
|
||||
<label for="approval-notes" class="font-weight-bold">Catatan Persetujuan:</label>
|
||||
<textarea id="approval-notes" class="form-control" rows="3" placeholder="Masukkan catatan persetujuan (opsional)..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
icon: 'question',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#28a745',
|
||||
cancelButtonColor: '#6c757d',
|
||||
confirmButtonText: 'Ya, Setujui Mutasi',
|
||||
cancelButtonText: 'Batal',
|
||||
width: '500px',
|
||||
preConfirm: () => {
|
||||
return document.getElementById('approval-notes').value;
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
// Create form and submit
|
||||
var form = $('<form>').attr({
|
||||
method: 'POST',
|
||||
action: '{{ route("mutations.approve", ":id") }}'.replace(':id', mutationId)
|
||||
});
|
||||
|
||||
form.append($('<input>').attr({
|
||||
type: 'hidden',
|
||||
name: '_token',
|
||||
value: $('meta[name="csrf-token"]').attr('content')
|
||||
}));
|
||||
|
||||
form.append($('<input>').attr({
|
||||
type: 'hidden',
|
||||
name: 'from_transaction_page',
|
||||
value: '1'
|
||||
}));
|
||||
|
||||
if (result.value) {
|
||||
form.append($('<input>').attr({
|
||||
type: 'hidden',
|
||||
name: 'approval_notes',
|
||||
value: result.value
|
||||
}));
|
||||
}
|
||||
|
||||
$('body').append(form);
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Handle reject button click
|
||||
$(document).on('click', '.btn-reject-mutation', function() {
|
||||
var mutationId = $(this).data('id');
|
||||
|
||||
Swal.fire({
|
||||
title: 'Konfirmasi Penolakan Mutasi',
|
||||
html: `
|
||||
<div class="text-left">
|
||||
<div class="alert alert-warning mb-3">
|
||||
<i class="fa fa-exclamation-triangle mr-2"></i>
|
||||
<strong>Perhatian:</strong> Mutasi yang ditolak tidak dapat diubah lagi dan proses akan dihentikan.
|
||||
</div>
|
||||
<div class="form-group text-left">
|
||||
<label for="rejection-reason" class="font-weight-bold">Alasan Penolakan: <span class="text-danger">*</span></label>
|
||||
<textarea id="rejection-reason" class="form-control" rows="3" placeholder="Jelaskan alasan penolakan mutasi ini..." required></textarea>
|
||||
<small class="text-muted">Alasan penolakan wajib diisi untuk dokumentasi.</small>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#dc3545',
|
||||
cancelButtonColor: '#6c757d',
|
||||
confirmButtonText: 'Ya, Tolak Mutasi',
|
||||
cancelButtonText: 'Batal',
|
||||
width: '500px',
|
||||
preConfirm: () => {
|
||||
const reason = document.getElementById('rejection-reason').value;
|
||||
if (!reason || reason.trim() === '') {
|
||||
Swal.showValidationMessage('Alasan penolakan harus diisi!');
|
||||
return false;
|
||||
}
|
||||
return reason;
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed && result.value) {
|
||||
// Create form and submit
|
||||
var form = $('<form>').attr({
|
||||
method: 'POST',
|
||||
action: '{{ route("mutations.reject", ":id") }}'.replace(':id', mutationId)
|
||||
});
|
||||
|
||||
form.append($('<input>').attr({
|
||||
type: 'hidden',
|
||||
name: '_token',
|
||||
value: $('meta[name="csrf-token"]').attr('content')
|
||||
}));
|
||||
|
||||
form.append($('<input>').attr({
|
||||
type: 'hidden',
|
||||
name: 'from_transaction_page',
|
||||
value: '1'
|
||||
}));
|
||||
|
||||
form.append($('<input>').attr({
|
||||
type: 'hidden',
|
||||
name: 'rejection_reason',
|
||||
value: result.value
|
||||
}));
|
||||
|
||||
$('body').append(form);
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
});
|
||||
// Note: Approve and reject buttons removed from transaction page
|
||||
// These actions are now only available to admin users in the admin panel
|
||||
|
||||
// Save active tab to localStorage
|
||||
$('.nav-link').on('click', function() {
|
||||
|
||||
@@ -53,7 +53,9 @@
|
||||
|
||||
@if($row->status->value === 'approved')
|
||||
<!-- Stock has already been moved automatically after approval -->
|
||||
<span class="badge badge-success">Stock Telah Dipindahkan</span>
|
||||
<div class="text-center">
|
||||
<span class="btn btn-sm btn-success" style="cursor: default; pointer-events: none;">Selesai</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
@@ -48,6 +48,55 @@
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('styles')
|
||||
<style>
|
||||
/* DataTables Sorting Icons */
|
||||
table.dataTable thead .sorting:before,
|
||||
table.dataTable thead .sorting:after,
|
||||
table.dataTable thead .sorting_asc:before,
|
||||
table.dataTable thead .sorting_asc:after,
|
||||
table.dataTable thead .sorting_desc:before,
|
||||
table.dataTable thead .sorting_desc:after {
|
||||
font-family: 'Font Awesome 5 Free';
|
||||
font-weight: 900;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting:before {
|
||||
content: "\f0dc";
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting_asc:before {
|
||||
content: "\f0de";
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting_desc:before {
|
||||
content: "\f0dd";
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting:after,
|
||||
table.dataTable thead .sorting_asc:after,
|
||||
table.dataTable thead .sorting_desc:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Ensure column headers are clickable */
|
||||
table.dataTable thead th {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
table.dataTable thead th.sorting,
|
||||
table.dataTable thead th.sorting_asc,
|
||||
table.dataTable thead th.sorting_desc {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@section('javascripts')
|
||||
<script src="{{ mix('js/warehouse_management/mutations/index.js') }}"></script>
|
||||
@endsection
|
||||
@@ -215,7 +215,7 @@
|
||||
|
||||
@if($mutation->status->value === 'received' && (auth()->user()->dealer_id == $mutation->from_dealer_id || auth()->user()->hasRole('admin')))
|
||||
<!-- Approve Button for sender or admin -->
|
||||
<button type="button" class="btn btn-success btn-approve" data-id="{{ $mutation->id }}">
|
||||
<button type="button" class="btn btn-success btn-approve" data-toggle="modal" data-target="#approveModal{{ $mutation->id }}" data-id="{{ $mutation->id }}">
|
||||
Setujui Mutasi
|
||||
</button>
|
||||
<!-- Reject Button for sender or admin -->
|
||||
@@ -248,12 +248,12 @@
|
||||
@if($mutation->status->value === 'sent' && auth()->user()->dealer_id == $mutation->to_dealer_id)
|
||||
<!-- Receive Modal -->
|
||||
<div class="modal fade" id="receiveModal{{ $mutation->id }}" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Terima Mutasi</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="{{ route('mutations.receive', $mutation->id) }}" method="POST">
|
||||
@@ -263,6 +263,16 @@
|
||||
<strong>Konfirmasi!</strong> Anda akan menerima mutasi dari <strong>{{ $mutation->fromDealer->name }}</strong>.
|
||||
</div>
|
||||
|
||||
@if($mutation->shipping_notes)
|
||||
<div class="form-group">
|
||||
<label><strong>Catatan dari Pengirim:</strong></label>
|
||||
<div class="alert alert-warning">
|
||||
<i class="fa fa-info-circle mr-2"></i>
|
||||
{{ $mutation->shipping_notes }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="form-group">
|
||||
<label>Catatan Penerimaan</label>
|
||||
<textarea name="reception_notes" class="form-control" rows="3" placeholder="Catatan kondisi barang saat diterima (opsional)"></textarea>
|
||||
@@ -320,13 +330,13 @@
|
||||
|
||||
@if($mutation->status->value === 'received' && (auth()->user()->dealer_id == $mutation->from_dealer_id || auth()->user()->hasRole('admin')))
|
||||
<!-- Approve Modal -->
|
||||
<div class="modal fade" id="approveModal{{ $mutation->id }}" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal fade" id="approveModal{{ $mutation->id }}" tabindex="-1" role="dialog" aria-labelledby="approveModalLabel{{ $mutation->id }}" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Setujui Mutasi</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
<h5 class="modal-title" id="approveModalLabel{{ $mutation->id }}">Setujui Mutasi</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="{{ route('mutations.approve', $mutation->id) }}" method="POST" class="approve-form">
|
||||
@@ -389,12 +399,12 @@
|
||||
|
||||
<!-- Reject Modal -->
|
||||
<div class="modal fade" id="rejectModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Tolak Mutasi</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="{{ route('mutations.reject', $mutation->id) }}" method="POST">
|
||||
@@ -421,12 +431,12 @@
|
||||
@if($mutation->canBeCancelled() && (auth()->user()->dealer_id == $mutation->from_dealer_id || auth()->user()->hasRole('admin')))
|
||||
<!-- Cancel Modal -->
|
||||
<div class="modal fade" id="cancelModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Batalkan Mutasi</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="{{ route('mutations.cancel', $mutation->id) }}" method="POST">
|
||||
@@ -472,6 +482,52 @@
|
||||
.approve-form .form-control.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Ensure modal backdrop is properly removed */
|
||||
.modal-backdrop {
|
||||
z-index: 1040;
|
||||
}
|
||||
|
||||
.modal {
|
||||
z-index: 1050;
|
||||
}
|
||||
|
||||
/* Force remove any blocking overlays */
|
||||
body.modal-open {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
body:not(.modal-open) {
|
||||
overflow: auto !important;
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
/* Ensure all modals are centered */
|
||||
.modal-dialog-centered {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: calc(100% - 1rem);
|
||||
}
|
||||
|
||||
.modal-dialog-centered::before {
|
||||
display: block;
|
||||
height: calc(100vh - 1rem);
|
||||
content: "";
|
||||
}
|
||||
|
||||
.modal-dialog-centered.modal-dialog-centered-sm {
|
||||
min-height: calc(100% - 1rem);
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
.modal-dialog-centered {
|
||||
min-height: calc(100% - 3.5rem);
|
||||
}
|
||||
|
||||
.modal-dialog-centered::before {
|
||||
height: calc(100vh - 3.5rem);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@@ -483,6 +539,49 @@ $(document).ready(function() {
|
||||
var mutationId = $(this).data('id');
|
||||
$('#approveModal' + mutationId).modal('show');
|
||||
});
|
||||
|
||||
// Handle modal close events
|
||||
$('.modal').on('hidden.bs.modal', function () {
|
||||
// Reset form
|
||||
if ($(this).find('form').length > 0) {
|
||||
$(this).find('form')[0].reset();
|
||||
}
|
||||
|
||||
// Remove modal backdrop manually if it exists
|
||||
$('.modal-backdrop').remove();
|
||||
|
||||
// Ensure body is not blocked
|
||||
$('body').removeClass('modal-open');
|
||||
$('body').css('padding-right', '');
|
||||
|
||||
// Remove any overlay that might be blocking
|
||||
$('.modal-backdrop, .fade.show').remove();
|
||||
});
|
||||
|
||||
// Additional cleanup for approve modal specifically
|
||||
$(document).on('click', '[data-dismiss="modal"]', function() {
|
||||
var $modal = $(this).closest('.modal');
|
||||
$modal.modal('hide');
|
||||
|
||||
setTimeout(function() {
|
||||
$('.modal-backdrop').remove();
|
||||
$('body').removeClass('modal-open');
|
||||
$('body').css('padding-right', '');
|
||||
|
||||
// Force remove any remaining overlays
|
||||
$('.modal-backdrop, .modal-open').remove();
|
||||
$('body').removeClass('modal-open');
|
||||
}, 300);
|
||||
});
|
||||
|
||||
// Force cleanup on any modal hide
|
||||
$(document).on('hide.bs.modal', '.modal', function() {
|
||||
setTimeout(function() {
|
||||
$('.modal-backdrop').remove();
|
||||
$('body').removeClass('modal-open');
|
||||
$('body').css('padding-right', '');
|
||||
}, 100);
|
||||
});
|
||||
|
||||
// Validate quantity approved in receive modal
|
||||
$(document).on('input', 'input[name*="quantity_approved"]', function() {
|
||||
|
||||
@@ -1,5 +1,34 @@
|
||||
@extends('layouts.backapp')
|
||||
|
||||
@section('styles')
|
||||
<style>
|
||||
/* Ensure DataTables sorting icons are visible */
|
||||
table.dataTable thead .sorting:before,
|
||||
table.dataTable thead .sorting:after,
|
||||
table.dataTable thead .sorting_asc:before,
|
||||
table.dataTable thead .sorting_asc:after,
|
||||
table.dataTable thead .sorting_desc:before,
|
||||
table.dataTable thead .sorting_desc:after {
|
||||
opacity: 0.5 !important;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting_asc:before,
|
||||
table.dataTable thead .sorting_desc:after {
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
/* Make sure table headers are clickable */
|
||||
table.dataTable thead th {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
table.dataTable thead th.sorting_disabled {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="kt-portlet kt-portlet--mobile" id="kt_blockui_datatable">
|
||||
<div class="kt-portlet__head kt-portlet__head--lg">
|
||||
|
||||
Reference in New Issue
Block a user