@extends('layout')


@section('content')

<div class="page-header page-header-default">
	<div class="breadcrumb-line">
		<ul class="breadcrumb">
			<li><a href="index.html"><i class="icon-home2 position-left"></i> Produksi</a></li>
			<li class="active">Pengembalian Barang Keseluruhan</li>
		</ul>
	</div>
</div>

<div class="content">
	<div class="panel panel-flat">
		<div class="panel-heading">
			<h5 class="panel-title">Form Pengembalian Barang Keseluruhan</h5>
			<div class="heading-elements">
				<ul class="icons-list">
		      		<li><a data-action="collapse"></a></li>
		      	</ul>
	       	</div>
	    </div>
	    <div class="panel-body">
	    	<form class="form-horizontal" id="form_submit" method="post" action="#" autocomplete="off">
	    	<input type="hidden" name="_token" value="{{ csrf_token() }}">
	    	

        	<div class="col-sm-12">
        		<table class="table table-stripped">
        			<tr>
        				<td width="5%">Tanggal</td>
        				<td width="2%">:</td>
        				<td width="30%" id="td_nomor" style="text-align: left;">{{ tgl_full($data['induk']->tanggal, '') }}</td>
        			</tr>
        			<tr>
        				<td>Lokasi</td>
        				<td>:</td>
        				<td id="td_order" style="text-align: left;">{{ $data['induk']->nama_lokasi }}</td>
        			</tr>
        			<tr>
        				<td>Keterangan</td>
        				<td>:</td>
        				<td id="td_proses" style="text-align: left;">{{ $data['induk']->keterangan }}</td>
        			</tr>
        		</table>
        	</div>
        	

        	<div class="col-sm-12 form-group">
	        	<h5 class="panel-title">Barang Dikembalikan</h5>
	        	
	        		<div class="table-responsive">
		        	<table class="table table-stripped" id="table_kembali">
				    	<thead>
							<tr>
			                    <th>No</th>
			                    <th></th>
			                    <th>Kode Barang</th>
			                    <th>Nama Barang</th>
			                    <th>Warna</th>
			                    <th>Gudang</th>
			                    <th>Jumlah</th>
			                    <th>Jumlah Perubahan</th>
			                    <th>Proses</th>
			                    <th>Kualitas Produksi</th>
			                    <th>Corak</th>
			                    <th>Motif</th>
			                    {{-- <th>No. Order</th> --}}
			                    <th>Kualitas</th>
			                    <th>Dudulan</th>
			                    <th>Kualitas Periksa</th>
			                    <th>Label</th>
			                    <th>Cap</th>
			                    <th>Kemasan</th>
			                    <th>Kemasan Satuan</th>
			                    <th>Kemasan 10 Potong</th>
			                    <th>Kemasan Dus Ball</th>
			                </tr>
						</thead>
						<tbody id="body_setor">
							@foreach($data['detail'] as $d) 
			                <tr>
			                    <td></td>
			                    <td>@php echo status_approve($d->status)  @endphp</td>
			                    <td>{{ $d->kode_barang }}</td>
			                    <td>{{ $d->nama_barang }}</td>
			                    <td>{{ $d->nama_komposisi}}</td>
			                    <td>{{ $d->nama_gudang }}</td>
			                    <td>{{ $d->jumlah." (".$d->nama_satuan.")" }}</td>
			                    <td>{{ ($d->id_perubahansatuan != '') ? ($d->jumlah*$d->jumlah_rencana)." (".$d->nama_perubahansatuan.")":"" }}</td>
			                    <td>{{ $d->nama_proses }}</td>
			                    <td>{{ $d->nama_kualitas_proses }}</td>
			                    <td>{{ $d->nama_corak }}</td>
			                    <td>{{ $d->nama_motif }}</td>
			                    {{-- <td>{{ $d->no_workorder_barang }}</td> --}}
			                    <td>{{ $d->nama_kualitas }}</td>
			                    <td>{{ $d->nama_kualitas_dudul }}</td>
			                    <td>{{ $d->nama_kualitas_periksa }}</td>
			                    <td>{{ $d->nama_label }}</td>
			                    <td>{{ $d->nama_cap }}</td>
			                    <td>{{ $d->nama_kemasan }}</td>
			                    <td>{{ $d->nama_kemasansatuan }}</td>
			                    <td>{{ $d->nama_kemasansepuluh }}</td>
			                    <td>{{ $d->nama_kemasanseratus }}</td>
			                </tr>
			                @endforeach

						</tbody>
			    	</table>
			    	</div>
        	</div>

        	<div class="col-sm-12">
        	
            <div class="form-group pull-right">
             	<button class="btn btn-primary" type="submit" id="btn_simpan" style="display: none">Simpan</button>
            </div>
            </div>
	    </div>
	    
	</div>
</div>

</form>


<script type="text/javascript">

	var table_barang;
	var tb_no = parseInt(10000);
	var id_proses;
	var nama_proses;
	var id;
	var proses;
	var id_kembali;
	var store_idbarangkeluar = '';
	var store_jenis = '';
	$(document).ready(function(){
		table_barang = $("#table_kembali").DataTable({
			"paging": true
		});
		table_barang.on( 'order.dt search.dt', function () {
            table_barang.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) {
                cell.innerHTML = i+1;
            } );
        } ).draw();


	
        
	})
</script>
@endsection