<head>
    <style>
        #tblisi th { border-bottom:1px black solid; }
    </style>
</head>



<?php $__env->startSection('title'); ?>
    Cetak Invoice Pembelian &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

  	<a onclick="window.location='<?php echo e(route('home')); ?>'" class="btn btn-primary"><i class="fa fa-home"></i> Home </a>
	<a onclick="window.history.go(-1)" class="btn btn-warning"><i class="fa fa-undo"></i> Back </a> 
	<a onclick="myFunction()" class="btn btn-success"><i class="fa fa-print"></i>Print Dokumen</a>
    <!--a onclick="printmatrix()" class="btn btn-success"><i class="fa fa-print"></i>Print Faktur</a-->

    <script>
        function myFunction() {
          window.print();
        }
    </script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumb'); ?>
   ##parent-placeholder-6e5ce570b4af9c70279294e1a958333ab1037c86##
     <li>print invoice pembelian</li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

<center>
	<h4>Invoice Pembelian</h4>
</center>

<input type="hidden" id="idinv" name="idinv" value="<?php echo e($inv->id); ?>">


<table style="width:98%" id='tblheader'>
	<tr><td width="600"><b><?php echo e($sup->sup_nama); ?></b></td><td width="350"><?php echo e(tanggal_indonesia($inv->inv_tgl, false)); ?></td></tr>
	<tr><td>Gudang Tujuan: <?php echo e($gdg->nama.' ['.$gdg->kode.']'); ?></td></tr>
	<tr><td></td><td><b>Invoice: <?php echo e($inv->inv_no); ?></b></td></tr>
	<tr><td></td><td>Disc: <?php echo e($inv->inv_disc."%"); ?> &nbsp;&nbsp;&nbsp; PPN: <?php echo e($inv->inv_ppn."%"); ?></td></tr>
	<tr><td>Jatuh Tempo: <?php echo e(tanggal_indonesia($inv->inv_jt, false)); ?></td><td></td></tr>
</table>
<br>

<table cellspacing="5" cellpadding="5"  style="width:98%;" id="tblisi">

<tr border="1">
	<th width="200">DESKRIPSI</th>
	<th width="50" class="text-right">---QTY---</th>
	<th width="80" class="text-right">Harga</th>
	<th width="50" class="text-right">DISC</th>
	<th width="100" class="text-right">Jumlah</th>
</tr>

<?php $__currentLoopData = $dt; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
	
	<tr>
    	<td><?php echo e($list->product_name); ?></td>
    	<td align="right"><?php echo e($list->qty.' '.$list->satuan); ?></td>
    	<td align="right"><?php echo e(format_uang($list->harga)); ?></td>
    	<td align="right"><?php echo e(format_uang($list->disc_1)); ?></td>
    	<td align="right"><?php echo e(format_uang(($list->qty*$list->harga)-($list->qty*$list->harga*$list->disc_1/100))); ?></td>
    </tr>
	
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<tr>
	<td></td>
	<td></td>
	<td></td>	
	<td align="left">Sub Total</td>
	<td align="right"><b><?php echo e(format_uang($sub)); ?></b></td>
</tr>

<tr>
	<td></td>
	<td></td>
	<td></td>	
	<td align="left">Discount <?php echo e($inv->inv_disc.'%'); ?></td>
	<td align="right"><b><?php echo e(format_uang($dis)); ?></b></td>
</tr>
<tr>
	<td></td>
	<td></td>
	<td></td>	
	<td align="left">PPN  <?php echo e($inv->inv_ppn.'%'); ?></td>
	<td align="right"><b><?php echo e(format_uang($ppn)); ?></b></td>
</tr>
<tr>
	<td></td>
	<td></td>
	<td></td>	
	<td align="left">Grand Total</td>
	<td align="right"><b><?php echo e(format_uang($ttl)); ?></b></td>
</tr>

</table>

<hr> <!--style="width:96%; margin-top:5px; margin-bottom:5px; background-color: black; height: 1px; border:1;"-->

<table style="width:98%">
    <tr><td width="600" style="font-style:italic">Terbilang: #<?php echo e(terbilang($ttl)); ?> rupiah#</td></tr>
</table>
<br>

<table style="width:80%">
    <tr>
        <td width="50"></td><td>Penerima</td>
		<td width="250"></td><td>Mengetahui</td>
	</tr>
	<tr>
		<td>&nbsp;</td><td></td>
	    <td>&nbsp;</td><td></td>	
	</tr>
	<tr>
		<td>&nbsp;</td><td></td>
	    <td>&nbsp;</td><td></td>	
	</tr>

</table>

<p></p>
<?php $__env->stopSection(); ?>

<script type="text/javascript">
    
    function printmatrix(){
        
        var idinv = $('#idinv').val();
        
        var ua = navigator.userAgent.toLowerCase();
        var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
                	
        if(isAndroid) {
            var tpdevice='android';
        }else{
            var tpdevice='pclaptop';
        }
            
        $.ajax({
            url : "<?php echo e(DIR_APP); ?>invoice/"+idinv+"/printfaktur_matrix",
            type : "GET",
            dataType : "JSON",
            success : function(data){
                if(tpdevice=='android'){
                    window.location.href=data.data;
                }else{
                	var socket = new WebSocket("ws://127.0.0.1:40213/");        /* harus dijalankan dulu dari rawbt.bat */
                    socket.bufferType = "arraybuffer";
                    socket.onerror = function(error) {
                	    alert("Error");
                    };			
                	socket.onopen = function() {
                		socket.send(data.data);
                		socket.close(1000, "Work complete");
                	};                    
                }

            },
            error : function(){
                alert("error print...");
            }
        });
    }

</script>

<?php echo $__env->make('layouts.print', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u345793601/domains/my-projeq.com/public_html/swa/resources/views/invoice/faktur.blade.php ENDPATH**/ ?>