Files
shopee-apps/application/views/proses/IN_StokBarang_StokGudang_2.php
T
2026-06-13 16:02:07 +10:00

453 lines
19 KiB
PHP

<!doctype html>
<html class="fixed sidebar-left-collapsed">
<head>
<!-- Basic -->
<meta charset="UTF-8">
<title>STOK BARANG</title>
<meta name="keywords" content="HTML5 Admin Template" />
<meta name="description" content="Porto Admin - Responsive HTML5 Template">
<meta name="author" content="okler.net">
<!-- Mobile Metas -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<!-- Vendor CSS -->
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/font-awesome/css/font-awesome.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/magnific-popup/magnific-popup.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/bootstrap-datepicker/css/datepicker3.css" />
<!-- Specific Page Vendor CSS -->
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/select2/select2.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/jquery-datatables-bs3/assets/css/datatables.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/pnotify/pnotify.custom.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/bootstrap-multiselect/bootstrap-multiselect.css" />
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/vendor/base/jquery-ui.css" />
<!-- Theme CSS -->
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/stylesheets/theme.css" />
<!-- Skin CSS -->
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/stylesheets/skins/default.css" />
<!-- Theme Custom CSS -->
<link rel="stylesheet" href="<?php echo base_url('') ?>assets/stylesheets/theme-custom.css">
<!-- Head Libs -->
<script src="<?php echo base_url('') ?>assets/vendor/modernizr/modernizr.js"></script>
</head>
<script src="<?= base_url() ?>assets/bower_components/jquery/jquery-3.3.1.min.js"></script>
<script src="<?= base_url() ?>assets/bower_components/sweetalert2/sweetalert2.all.min.js"></script>
<style>
.ui-front {
z-index: 9999;
}
.solid {
border-left-style: solid;
border-width: 5px;
border-color: darkcyan;
}
.f18 {
font-size: 18px;
}
</style>
<script type="text/javascript">
let base_url = '<?= base_url() ?>';
</script>
<body>
<section class="body">
<!-- start: header -->
<?php $this->load->view('template/header'); ?>
<!-- end: header -->
<div class="inner-wrapper">
<!-- start: sidebar -->
<?php $this->load->view('template/sidebar'); ?>
<!-- end: sidebar -->
<section role="main" class="content-body">
<header class="page-header">
<h2><b>Data Alur Barang | <?=$namaGudang?> | <b style="color:Chartreuse" id="dataTampil">Klik Tombol</b></b></h2>
<div class="right-wrapper pull-right">
<ol class="breadcrumbs">
<li><span><a onclick="tutupTab()"><b style="color:Silver">Tutup Tab <i class="fa fa-times"></i></b></a></span></li>
<li><span><b style="color:DeepSkyBlue">Pusat Data</span></b></li>
</ol>
<a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fa fa-chevron-left"></i></a>
</div>
</header>
<!-- start: page -->
<section class="panel panel-featured panel-featured-secondary">
<header class="panel-heading">
<h2 class="panel-title"><b style="color:Red">DATA ALUR BARANG | <b style="color:Olive"><?=$kode_barang?></b> | <b style="color:Black" id="totAll">0</b></b></h2>
</header>
<div class="panel-body">
<div class="col-md-12">
<b style="color:Black; font-size:16px">PEMBELIAN | <b style="color:Blue" id="totalDbMasuk">0 Masuk</b> | <b style="color:Tomato" id="totalDbKeluar">0 Keluar</b></b><br>
<b style="color:Black; font-size:16px">KELUAR MASUK | <b style="color:Blue" id="totalIoMasuk">0 Masuk</b> | <b style="color:Tomato" id="totalIoKeluar">0 Keluar</b></b><br>
<b style="color:Black; font-size:16px">MUTASI BARANG | <b style="color:Blue" id="totalDmbMasuk">0 Masuk</b> | <b style="color:Tomato" id="totalDmbKeluar">0 Keluar</b></b><br>
<b style="color:Black; font-size:16px">PENJUALAN | <b style="color:Blue" id="totalDoMasuk">0 Masuk</b> | <b style="color:Tomato" id="totalDoKeluar">0 Keluar</b></b><br>
<b style="color:Black; font-size:16px">KONSINYASI | <b style="color:Blue" id="totalDfkMasuk">0 Masuk</b> | <b style="color:Tomato" id="totalDfkKeluar">0 Keluar</b></b><br>
<b style="color:Black; font-size:16px">PEMINJAMAN | <b style="color:Tomato" id="totalDfpKeluar">0 Keluar</b></b><br>
</div>
<div class="col-md-12">
<div class="btn-group">
<button type="button" class="btn btn-default" onclick="bukaGroup(1)"><b style="color:Teal">PEMBELIAN</b></button>
<button type="button" class="btn btn-default" onclick="bukaGroup(2)"><b style="color:FireBrick">KELUAR MASUK</b></button>
<button type="button" class="btn btn-default" onclick="bukaGroup(3)"><b style="color:Green">MUTASI BARANG</b></button>
<button type="button" class="btn btn-default" onclick="bukaGroup(4)"><b style="color:DarkViolet">PENJUALAN</b></button>
<button type="button" class="btn btn-default" onclick="bukaGroup(5)"><b style="color:DarkOrange">KONSINYASI</b></button>
<button type="button" class="btn btn-default" onclick="bukaGroup(6)"><b style="color:Crimson">PEMINJAMAN</b></button>
</div>
</div>
<div class="col-md-12" id="group1" hidden="hidden">
<table class="table table-bordered table-striped mb-none" id="table1">
<thead>
<th class="center default">No</th>
<th class="default">Kode</th>
<th class="default">Dibuat</th>
<th class="center default">Masuk</th>
<th class="center default">Retur</th>
</thead>
<tbody>
<?php
if (is_array($db) || is_object($db)) {
$no = 1; $indb = 0; $outdb = 0;
foreach ($db as $key) { ?>
<tr>
<td class="center"><?= $no; ?></td>
<td class="default"><b style="color:Black"><?= $key['KODE_PEMBELIAN']; ?> <b style="color:DarkOrange">[<?= $key['ALIAS_CORP']; ?>]</b></b><br>(<?= $key['TANGGAL']; ?>)</td>
<td class="default"><b style="color:Green"><?= $key['CIPTA_PEMBELIAN']; ?><br></b></td>
<td class="center"><b style="color:Blue"><?= $key['QTY_DB']; ?></b></td>
<td class="center"><b style="color:Tomato"><?= $key['RETUR_DB']; ?></b></td>
<?php $indb = $indb+$key['QTY_DB']; $outdb = $outdb+$key['RETUR_DB']; ?>
</tr>
<?php $no++;
}
} ?>
</tbody>
</table>
</div>
<div class="col-md-12" id="group2" hidden="hidden">
<table class="table table-bordered table-striped mb-none" id="table2">
<thead>
<th class="center default">No</th>
<th class="default">Kode</th>
<th class="default">Dibuat</th>
<th class="default">Keterangan</th>
<th class="center default">Masuk</th>
<th class="center default">Keluar</th>
</thead>
<tbody>
<?php
if (is_array($io) || is_object($io)) {
$no = 1; $inio = 0; $outio = 0;
foreach ($io as $key) { ?>
<tr>
<td class="center"><?= $no; ?></td>
<td class="default"><b style="color:Black"><?= $key['KODE_BUKTI']; ?></b><br>(<?= $key['TANGGAL']; ?>)</td>
<td class="default"><b style="color:Green"><?= $key['CIPTA_IO']; ?><br></b></td>
<td class="default"><b style="color:Chocolate"><?= $key['KET_IO']; ?><br></b></td>
<?php if ($key['JENIS_IO']==0) { ?>
<td class="center"><b style="color:Blue">0</b></td>
<td class="center"><b style="color:Tomato"><?= $key['QTY_IO']; ?></b></td>
<?php $outio = $outio+$key['QTY_IO']; ?>
<?php } else if ($key['JENIS_IO']==1) { ?>
<td class="center"><b style="color:Blue"><?= $key['QTY_IO']; ?></b></td>
<td class="center"><b style="color:Tomato">0</b></td>
<?php $inio = $inio+$key['QTY_IO']; ?>
<?php } ?>
</tr>
<?php $no++;
}
} ?>
</tbody>
</table>
</div>
<div class="col-md-12" id="group3" hidden="hidden">
<table class="table table-bordered table-striped mb-none" id="table3">
<thead>
<th class="center default">No</th>
<th class="default">Kode</th>
<th class="default">Dibuat</th>
<th class="default">Diterima</th>
<th class="center default">Masuk</th>
<th class="center default">Keluar</th>
</thead>
<tbody>
<?php
if (is_array($dmb) || is_object($dmb)) {
$no = 1; $indmb = 0; $outdmb = 0;
foreach ($dmb as $key) { ?>
<tr>
<td class="center"><?= $no; ?></td>
<td class="default"><b style="color:Black"><?= $key['KODE_MB']; ?></b><br>(<?= $key['TANGGAL']; ?>)</td>
<td class="default"><b style="color:Green"><?= $key['CIPTA_MB']; ?><br></b></td>
<td class="default"><b style="color:Chocolate"><?= $key['TERIMA_MB']; ?><br></b></td>
<?php if ($gudang==1) { ?>
<?php if ($key['JENIS_MB']==0 OR $key['JENIS_MB']==2) { ?>
<td class="center"><b style="color:Blue">0</b></td>
<td class="center"><b style="color:Tomato"><?= $key['QTY_DMB']; ?></b></td>
<?php $outdmb = $outdmb+$key['QTY_DMB']; ?>
<?php } else { ?>
<td class="center"><b style="color:Blue"><?= $key['QTY_DMB']; ?></b></td>
<td class="center"><b style="color:Tomato">0</b></td>
<?php $indmb = $indmb+$key['QTY_DMB']; ?>
<?php } ?>
<?php } else if ($gudang==2) { ?>
<?php if ($key['JENIS_MB']==0) { ?>
<td class="center"><b style="color:Blue"><?= $key['QTY_DMB']; ?></b></td>
<td class="center"><b style="color:Tomato">0</b></td>
<?php $indmb = $indmb+$key['QTY_DMB']; ?>
<?php } else { ?>
<td class="center"><b style="color:Blue">0</b></td>
<td class="center"><b style="color:Tomato"><?= $key['QTY_DMB']; ?></b></td>
<?php $outdmb = $outdmb+$key['QTY_DMB']; ?>
<?php } ?>
<?php } else if ($gudang==3) { ?>
<?php if ($key['JENIS_MB']==2) { ?>
<td class="center"><b style="color:Blue"><?= $key['QTY_DMB']; ?></b></td>
<td class="center"><b style="color:Tomato">0</b></td>
<?php $indmb = $indmb+$key['QTY_DMB']; ?>
<?php } else { ?>
<td class="center"><b style="color:Blue">0</b></td>
<td class="center"><b style="color:Tomato"><?= $key['QTY_DMB']; ?></b></td>
<?php $outdmb = $outdmb+$key['QTY_DMB']; ?>
<?php } ?>
<?php } ?>
</tr>
<?php $no++;
}
} ?>
</tbody>
</table>
</div>
<div class="col-md-12" id="group4" hidden="hidden">
<table class="table table-bordered table-striped mb-none" id="table4">
<thead>
<th class="center default">No</th>
<th class="default">Kode</th>
<th class="default">Dibuat</th>
<th class="center default">Keluar</th>
<th class="center default">Retur</th>
</thead>
<tbody>
<?php
if (is_array($do) || is_object($do)) {
$no = 1; $indo = 0; $outdo = 0;
foreach ($do as $key) { ?>
<tr>
<td class="center"><?= $no; ?></td>
<td class="default"><b style="color:Black"><?= $key['KODE_PENJUALAN']; ?> <b style="color:DarkOrange">[<?= $key['ALIAS_CORP']; ?>]</b></b><br>(<?= $key['TANGGAL']; ?>)</td>
<td class="default"><b style="color:Green"><?= $key['CIPTA_SO']; ?><br></b></td>
<td class="center"><b style="color:Tomato"><?= $key['QTY_DO']; ?></b></td>
<td class="center"><b style="color:Blue"><?= $key['RETUR_DO']; ?></b></td>
<?php $indo = $indo+$key['RETUR_DO']; $outdo = $outdo+$key['QTY_DO']; ?>
</tr>
<?php $no++;
}
} ?>
</tbody>
</table>
</div>
<div class="col-md-12" id="group5" hidden="hidden">
<table class="table table-bordered table-striped mb-none" id="table5">
<thead>
<th class="center default">No</th>
<th class="default">Kode</th>
<th class="default">Dibuat</th>
<th class="center default">Konsinyasi</th>
<th class="center default">Kembali</th>
</thead>
<tbody>
<?php
if (is_array($dfk) || is_object($dfk)) {
$no = 1; $indfk = 0; $outdfk = 0;
foreach ($dfk as $key) { ?>
<tr>
<td class="center"><?= $no; ?></td>
<td class="default"><b style="color:Black"><?= $key['KODE_KONSINYASI']; ?></b><br>(<?= $key['TANGGAL']; ?>)</td>
<td class="default"><b style="color:Green"><?= $key['CIPTA_KONSINYASI']; ?><br></b></td>
<td class="center"><b style="color:Tomato"><?= $key['QTY_DFK']; ?></b></td>
<td class="center"><b style="color:Blue"><?= $key['KEMBALI_DFK']; ?></b></td>
<?php $indfk = $indfk+$key['KEMBALI_DFK']; $outdfk = $outdfk+$key['QTY_DFK']; ?>
</tr>
<?php $no++;
}
} ?>
</tbody>
</table>
</div>
<div class="col-md-12" id="group6" hidden="hidden">
<table class="table table-bordered table-striped mb-none" id="table6">
<thead>
<th class="center default">No</th>
<th class="default">Kode</th>
<th class="default">Dibuat</th>
<th class="center default">Peminjaman</th>
</thead>
<tbody>
<?php
if (is_array($dfp) || is_object($dfp)) {
$no = 1; $outdfp = 0;
foreach ($dfp as $key) { ?>
<tr>
<td class="center"><?= $no; ?></td>
<td class="default"><b style="color:Black"><?= $key['KODE_PEMINJAMAN']; ?></b><br>(<?= $key['TANGGAL']; ?>)</td>
<td class="default"><b style="color:Green"><?= $key['CIPTA_PEMINJAMAN']; ?><br></b></td>
<td class="center"><b style="color:Tomato"><?= $key['QTY_DFP']; ?></b></td>
<?php $outdfp = $outdfp+$key['QTY_DFP']; ?>
</tr>
<?php $no++;
}
} ?>
</tbody>
</table>
</div>
</div>
</section>
<!-- end: page -->
</section>
</div>
</section>
<?php
$this->load->view('template/sidebar_right');
$this->load->view('template/script_vendor');
$this->load->view('template/script_flashdata');
$this->load->view('template/notification');
?>
<script>
$(document).ready(function() {
var indb = <?=$indb?>;
var indfk = <?=$indfk?>;
var indmb = <?=$indmb?>;
var indo = <?=$indo?>;
var inio = <?=$inio?>;
var outdb = <?=$outdb?>;
var outdfk = <?=$outdfk?>;
var outdfp = <?=$outdfp?>;
var outdmb = <?=$outdmb?>;
var outdo = <?=$outdo?>;
var outio = <?=$outio?>;
var totAll = parseInt(indb+indfk+indmb+indo+inio-outdb-outdfk-outdfp-outdmb-outdo-outio);
$('#totalDbMasuk').html(indb+" Masuk");
$('#totalDbKeluar').html(outdb+" Keluar");
$('#totalDfkMasuk').html(indfk+" Masuk");
$('#totalDfkKeluar').html(outdfk+" Keluar");
$('#totalDfpKeluar').html(outdfp+" Keluar");
$('#totalDmbMasuk').html(indmb+" Masuk");
$('#totalDmbKeluar').html(outdmb+" Keluar");
$('#totalDoMasuk').html(indo+" Masuk");
$('#totalDoKeluar').html(outdo+" Keluar");
$('#totalIoMasuk').html(inio+" Masuk");
$('#totalIoKeluar').html(outio+" Keluar");
$('#totAll').html(totAll+" EA");
})
$('#table1').dataTable( {
"paging": false
} );
$('#table2').dataTable( {
"paging": false
} );
$('#table3').dataTable( {
"paging": false
} );
$('#table4').dataTable( {
"paging": false
} );
$('#table5').dataTable( {
"paging": false
} );
$('#table6').dataTable( {
"paging": false
} );
function tutupTab() {
window.close();
}
function bukaGroup(verse) {
if (verse==1) {
document.getElementById("group1").style.display = 'block';
document.getElementById("group2").style.display = 'none';
document.getElementById("group3").style.display = 'none';
document.getElementById("group4").style.display = 'none';
document.getElementById("group5").style.display = 'none';
document.getElementById("group6").style.display = 'none';
$('#dataTampil').html("Pembelian");
} else if (verse==2) {
document.getElementById("group1").style.display = 'none';
document.getElementById("group2").style.display = 'block';
document.getElementById("group3").style.display = 'none';
document.getElementById("group4").style.display = 'none';
document.getElementById("group5").style.display = 'none';
document.getElementById("group6").style.display = 'none';
$('#dataTampil').html("Keluar Masuk");
} else if (verse==3) {
document.getElementById("group1").style.display = 'none';
document.getElementById("group2").style.display = 'none';
document.getElementById("group3").style.display = 'block';
document.getElementById("group4").style.display = 'none';
document.getElementById("group5").style.display = 'none';
document.getElementById("group6").style.display = 'none';
$('#dataTampil').html("Mutasi Barang");
} else if (verse==4) {
document.getElementById("group1").style.display = 'none';
document.getElementById("group2").style.display = 'none';
document.getElementById("group3").style.display = 'none';
document.getElementById("group4").style.display = 'block';
document.getElementById("group5").style.display = 'none';
document.getElementById("group6").style.display = 'none';
$('#dataTampil').html("Penjualan");
} else if (verse==5) {
document.getElementById("group1").style.display = 'none';
document.getElementById("group2").style.display = 'none';
document.getElementById("group3").style.display = 'none';
document.getElementById("group4").style.display = 'none';
document.getElementById("group5").style.display = 'block';
document.getElementById("group6").style.display = 'none';
$('#dataTampil').html("Konsinyasi");
} else if (verse==6) {
document.getElementById("group1").style.display = 'none';
document.getElementById("group2").style.display = 'none';
document.getElementById("group3").style.display = 'none';
document.getElementById("group4").style.display = 'none';
document.getElementById("group5").style.display = 'none';
document.getElementById("group6").style.display = 'block';
$('#dataTampil').html("Peminjaman");
}
}
</script>
</body>
</html>