|
Server : LiteSpeed System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : elvh3918 ( 1528) PHP Version : 8.2.31 Disable Function : mail Directory : /home/elvh3918/public_html/tenant/storage/framework/views/ |
<?php $__env->startSection('title', $breadcrumbs[count($breadcrumbs) - 1]['name']); ?>
<?php $__env->startSection('content'); ?>
<?php echo $__env->make('components/breadcrumb', ['breadcrumbs' => $breadcrumbs], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="card card-solid">
<div class="card-body">
<form action="<?php echo e(route('trans.incoming.index')); ?>" method="GET">
<div class="row">
<div class="col-md-3 col-6 mb-2">
<label class="form-label fs-5" for="date_from">Date From</label>
<div class="input-group date" id="show_date_from" data-target-input="nearest">
<input type="text" class="form-control datetimepicker-input" data-target="#show_date_from" id="date_from" name="date_from" placeholder="DD-MMM-YYYY"
required/>
<div class="input-group-append" data-target="#show_date_from" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div>
<div class="col-md-3 col-6 mb-2">
<label class="form-label fs-5" for="date_to">Date To</label>
<div class="input-group date" id="show_date_to" data-target-input="nearest">
<input type="text" class="form-control datetimepicker-input" data-target="#show_date_to" id="date_to" name="date_to" placeholder="DD-MMM-YYYY"
required/>
<div class="input-group-append" data-target="#show_date_to" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div>
<div class="col-md-6 mb-2">
<label class="form-label fs-5" for="tenant_id">Tenant</label>
<div class="d-flex flex-row">
<select class="form-control tenant_idSelect2" name="tenant_id" id="tenant_id">
<?php if(Auth::user()->model_type == 'App\Models\Bussiness'): ?>
<option value=0 <?php echo e($data_input['tenant_id'] == 0 ? "selected" : ""); ?>>All</option>
<?php endif; ?>
<?php $__currentLoopData = $tenant; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($data->id); ?>" <?php echo e($data_input['tenant_id'] == $data->id ? "selected" : ""); ?>><?php echo e($data->name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<button type="submit" class="ml-2 btn btn-primary" onclick='buttonSpin("btn_search", "spinner-border spinner-border-sm")'>
<i id="btn_search" class="fa fa-search"></i>
</button>
</div>
</div>
</div>
</form>
<table id="example1" class="table table-sm table-bordered table-striped">
<thead>
<tr>
<th class="text-center"></th>
<th class="text-center">Series</th>
<th class="text-center">Date</th>
<th class="text-center">Tenant</th>
<th class="text-center">Qty</th>
<th class="text-center">Create by</th>
<th class="text-center">Updated</th>
<th class="text-center d-print-none">#</th>
<th class="text-center" hidden>detail</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $query; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td></td>
<td>
<?php echo e($data->series); ?>
</td>
<td>
<?php echo e($data->date_trans); ?>
</td>
<td>
<?php echo e($data->tenant->name); ?>
</td>
<td>
<?php echo e(number_format($data->qty, 2, '.', ',')); ?>
</td>
<td>
<?php echo e($data->user ? $data->user->name : 'N/A'); ?>
</td>
<td>
<?php echo e($data->updated_at); ?>
</td>
<td class="d-print-none">
<a href="<?php echo e(route('trans.incoming.edit', $data->id)); ?>" class="mr-1">
<span class="badge bg-warning p-1"><i class="fa fa-edit"></i> Edit</span>
</a>
<a onclick="return confirm('Are you sure?')"
href="<?php echo e(route('trans.incoming.destroy', $data->id)); ?>">
<span class="badge bg-danger p-1"><i class="fa fa-trash"></i> Delete</span>
</a>
</td>
<td hidden>
<?php echo e($data); ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div><!--/. container-fluid -->
</section>
<!-- /.content -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-style'); ?>
<link rel="stylesheet" href="<?php echo e(asset('assets/plugins/datatables-bs4/css/dataTables.bootstrap4.css')); ?>">
<link rel="stylesheet" href="<?php echo e(asset('assets/plugins/datatables-buttons/css/buttons.bootstrap4.css')); ?>">
<link rel="stylesheet" href="<?php echo e(asset('assets/plugins/toastr/toastr.min.css')); ?>">
<link rel="stylesheet" href="<?php echo e(asset('assets/plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css')); ?>">
<style>
button.colorCreate,
a.colorCreate {
color: white !important;
background-color: black !important;
}
,
</style>
<style>
.table td, .table th {padding-top: 0; padding-bottom: 1; padding-left: 2; padding-right: 2;}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-script'); ?>
<script src="<?php echo e(asset('assets/plugins/datatables/dataTables.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables/dataTables.bootstrap4.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables-buttons/js/dataTables.buttons.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables-buttons/js/buttons.bootstrap4.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables-buttons/js/buttons.print.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables-buttons/js/jszip.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables-buttons/js/buttons.html5.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables-buttons/js/buttons.colVis.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/toastr/toastr.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/external/button-spin.js')); ?>"></script>
<script src="<?php echo e(asset('assets/external/load-toastr.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/moment/moment.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/external/format-number.js')); ?>"></script>
<script>
loadToastr(<?php echo json_encode(Session::get('message')); ?>);
let table = $("#example1").DataTable({
paging: true,
lengthChange: true,
searching: true,
ordering: true,
info: true,
autoWidth: false,
responsive: true,
pageLength: 100,
scrollY: true,
order: [[3, 'asc'], [2, 'desc']],
columnDefs: [{
data: 'expland',
name: 'expland',
targets: 0,
className: 'dt-control',
orderable: false,
defaultContent: ''
},
{
data: 'series',
name: 'series',
targets: 1,
className: 'dt-body-center',
},
// series
{
data: 'date',
name: 'date',
targets: 2,
className: 'dt-body-center',
render: DataTable.render.datetime('DD-MMM-YYYY')
},
{
data: 'tenant_name',
name: 'tenant_name',
targets: 3,
className: 'dt-body-left'
},
{
data: 'qty',
name: 'qty',
targets: 4,
className: 'dt-body-right'
},
{
data: 'user',
name: 'user',
targets: 5,
className: 'dt-body-left'
},
{
data: 'updated_at',
name: 'updated_at',
targets: 6,
className: 'dt-body-left',
width: 150,
},
{
data: 'action',
name: 'action',
targets: 7,
className: 'dt-body-center',
width: 150,
orderable: false,
},
{
data: 'data',
name: 'data',
targets: 8,
className: 'dt-body-left',
orderable: false,
visible: false,
}
],
buttons: [{
text: '+ Create',
className: 'colorCreate',
action: function(e, dt, node, config) {
create();
}
},
'pageLength',
{
extend: 'collection',
text: 'Control',
buttons: [
'copy', 'excel', 'print',
{
text: 'Visibility',
popoverTitle: 'Control',
extend: 'colvis',
collectionLayout: 'two-column',
postfixButtons: ['colvisRestore']
}
]
}
],
layout: {
topStart: ['buttons']
}
});
table.on('click', 'td.dt-control', function (e) {
let tr = e.target.closest('tr');
let row = table.row(tr);
if (row.child.isShown()) {
row.child.hide();
}
else {
row.child(data_detail(row.data())).show();
}
});
function data_detail(data) {
var data = JSON.parse(data.data);
var html="";
html +='<table class="table table-sm table-bordered my-2">';
html +='<thead class="bg-dark">';
html +='<tr>';
html +='<th class="text-center align-middle text-capitalize">type</th>';
html +='<th class="text-center align-middle text-capitalize">item</th>';
html +='<th class="text-center align-middle text-capitalize">qty</th>';
html +='</tr>';
html +='</thead>';
html +='<tbody id="tbody-item">';
var qty = 0;
for (let index = 0; index < data.incoming_details.length; index++) {
html +='<tr class="bg-white">';
html +='<td class="align-middle text-capitalize">' + data.incoming_details[index].item.type + '</td>';
html +='<td class="align-middle text-capitalize">' + data.incoming_details[index].item.name + '</td>';
qty += parseFloat(data.incoming_details[index].qty);
html +='<td class="text-right align-middle text-capitalize item_total_qty">' + formatNumber(data.incoming_details[index].qty, 2) + '</td>';
html +='</tr>';
}
html +='</tbody>';
html +='<tfoot class="bg-light">';
html +='<tr>';
html +='<td class="text-center align-middle text-capitalize font-weight-bold" colspan="2">total</td>';
html +='<td class="text-right align-middle text-capitalize font-weight-bold">';
html +='<span id="total_qty">' + formatNumber(qty, 2) + '</span>';
html +='</td>';
html +='</tr>';
html +='</tfoot>';
html +='</table>';
return html;
}
$('#show_date_from').datetimepicker({
format: 'DD-MMM-YYYY'
});
$('#show_date_to').datetimepicker({
format: 'DD-MMM-YYYY'
});
$date_from = <?php echo json_encode(old($data_input['date_from'])); ?> ? new Date(<?php echo json_encode(old($data_input['date_from'])); ?>) : new Date(<?php echo json_encode($data_input['date_from']); ?>);
$date_to = <?php echo json_encode(old($data_input['date_to'])); ?> ? new Date(<?php echo json_encode(old($data_input['date_to'])); ?>) : new Date(<?php echo json_encode($data_input['date_to']); ?>);
document.getElementById('date_from').value = moment($date_from).format('DD-MMM-YYYY');
document.getElementById('date_to').value = moment($date_to).format('DD-MMM-YYYY');
function create() {
window.location.href = "<?php echo e(route('trans.incoming.create')); ?>";
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts/app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/elvh3918/public_html/tenant/resources/views/content/trans/incoming/index.blade.php ENDPATH**/ ?>