<div class="modal" id="add_detail" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" >
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <div class="modal-content" style="border-left: red 2px solid;">
     
<form class="form-horizontal" data-toggle="validator" method="post" id="form-add_detail">
   <?php echo e(csrf_field()); ?> <?php echo e(method_field('POST')); ?>

   
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"> &times; </span> </button>
        <h6 class="modal-title">Detail Product</h6>
    </div>

   <div style="padding:5px 50px">

    <input type="hidden" id="idinv2" name="idinv2">
    <input type="hidden" id="iddetail" name="iddetail">
    <input type="hidden" id="idsup" name="idsup">
   
	<div class="form-group">
		<input id="prd2" type="hidden" class="form-control" name="prd2" readonly="true" autofocus required>	
		<label>Produk</label>
		<div class="input-group">
			<input type="text" class="form-control" id="produk" name="produk" autofocus required readonly="true">
			<span class="input-group-btn">
				<button onclick="showProduk()" type="button" class="btn btn-info" style="width:10px;height:30px;">...</button>
			</span>
		</div>
    </div>
    
    <div class="form-group">
        <input type="hidden" id="kms2" name="kms2">
        <label>Kemasan/Isi</label>
        <input type="text" class="form-control" id="kms" name="kms" autofocus required readonly="true">
    </div>
    
    <div class="form-group">
        <label>Harga </label>
        <input type="number" class="form-control" id="harga" name="harga" autofocus>
        <small class="text-muted">Harga modal, bisa diedit </small>
    </div>

    <div class="form-group">
        <label>Discount </label>
        <input type="number" class="form-control" id="dis1" name="dis1" value="0" required autofocus>
        <small class="text-muted">Disc per Item barang</small>
    </div>

    <div class="form-group">
        <label>QTY</label>
        <input type="number" id="qty" name="qty" class="form-control" value="1" autofocus required>
        <small class="text-muted">Qty barang</small>
    </div>

   
    <div class="text-right">
        <button type="submit-add" class="btn btn-primary btn-save btn-sm"><i class="fa fa-floppy-o"></i> Save </button> 
        <button type="button" class="btn btn-warning btn-close btn-sm" data-dismiss="modal"><i class="fa fa-times-circle"></i> Cancel </button>
    </div>
    <br>
    </div>
    
</form>

            </div>
        </div>
    </div>
</div>

<!----------------------------------------------------------------->
   
<script type="text/javascript">

function showProduk(){
	var sss=$('#idsup').val();
    $('#modal-produk').modal('show');
	
    tblproduk.ajax.url("invoice/"+sss+"/listproduk");
	tblproduk.ajax.reload();
}

function selectProduk(id){
	$('#kms2').val(id);
	$('#modal-produk').modal('hide');
	
	$.ajax({
        url : "<?php echo e(DIR_APP); ?>invoice/"+id+"/tampilkemasan",
        type : "GET",
        dataType : "JSON",
        success : function(data){
            $('#produk').val(data.namaprd);
			$('#kms').val(data.kemasan);
			$('#harga').val(data.harga);
        },
        error : function(){
          alert("Tidak dapat menampilkan data!");
        }   
     });  
}

</script>
   
        


 
<?php /**PATH /home/myprojeq/public_html/sriayu/resources/views/invoice/add_detail.blade.php ENDPATH**/ ?>