<?php $__env->startSection('content'); ?>
<div class="container-fluid">
     <script src="<?php echo e(url('js/Imprimir.js')); ?>"></script>
	<div class="row">
		<div class="col-md-8 col-md-offset-2">
			<div class="panel panel-default">
                            <div class="panel-heading"><center>Reporte Detallado de Descuentos (Factura de Venta)</center></div>
                                <div class="panel-body">
                                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                                <ul class="nav navbar-nav navbar-right">		
                                    <!--<li><a href="<?php echo e(url('/cajera')); ?>">Opciones</a></li>-->
                                    <!-- <li><a href="<?php echo e(url('/Mod_producto')); ?>"> Atras </a></li>-->
                                 </ul>
                                </div>
				<?php if(count($errors) > 0): ?>
					<div class="alert alert-danger">
                                            <strong>Whoops!</strong> Hay algunos problemas!!!.<br><br>
						<ul>
                                                    <?php foreach($errors->all() as $error): ?>
                                                        <li><?php echo e($error); ?></li>
                                                    <?php endforeach; ?>
						</ul>
					</div>
				<?php endif; ?>
                                <?php if($alert = Session::get('alert-success')): ?>
                                        <div class="alert alert-success">
                                            <?php echo $alert; ?>

                                        </div>
                                <?php endif; ?>
                           
                                        <div class="row">
                                            <div class="col-md-6">&nbsp;&nbsp;&nbsp;Cliente: <b><?php echo e($nomcli); ?></b></div>
                                            <div class="col-md-6 text-right"># Factura: <b><?php echo e($id); ?></b>&nbsp;&nbsp;&nbsp;</div>                                            
                                        </div> 
                                        <div id="ciercaja">
					    <table class="table-bordered" WIDTH=100%>
                                                <tr>
                                                    <th>&nbsp;C&oacute;digo</th>
                                                    <th>&nbsp;Nombre</th>
                                                    <th>&nbsp;Cant.</th>
                                                    <th>&nbsp;Valor Unitario</th>
                                                    <th>&nbsp;Valor Venta</th>
                                                    <th>&nbsp;Descuento</th>
<!--                                                    <th>&nbsp;Sub-Total</th>-->
                                                </tr>
                                                <?php 
                                                    $sumdes=0;
                                                    $sumvat=0;
                                                ?>
                                                <?php foreach($facdes as $facdes): ?>
                                                    <tr>
                                                        <td><?php echo e($facdes->idProducto); ?></td>                          
                                                        <td><?php echo e($facdes->Nombre_Produc); ?></td>
                                                        <td align="right"><?php echo e($facdes->Cantidad); ?></td>
                                                        <td align="right"><?php echo e($facdes->Valor_Total / $facdes->Cantidad); ?></td>
                                                        <td align="right"><?php echo e($facdes->Valor_Total); ?></td>
                                                        <td align="right"><?php echo e($facdes->descuento); ?></td>
<!--                                                        <td align="right"><?php echo e($facdes->Valor_Total-$facdes->descuento); ?></td>-->
                                                    </tr>
                                                    <?php 
                                                        $sumdes+=$facdes->descuento;                                                        
                                                        $sumvat+=$facdes->Valor_Total;
                                                    ?>
                                                <?php endforeach; ?>
                                                <tr>
                                                    <th colspan="4" style="text-align: right">Total</th>                                                    
                                                    <th  style="text-align: right">&nbsp;<?=$sumvat?></th>
                                                    <th  style="text-align: right">&nbsp;<?=$sumdes?></th>
                                                </tr>

                                            </table>
                                            <br>
                                        </div>
                                                
					
                                        <div class="form-group">
                                            <div class="col-md-6 col-md-offset-4">
                                                <button type="submit" class="btn btn-primary" onclick="javascript:imprcc('rciercaja')">
                                                    Imprimir
                                                </button>
                                            </div>
                                         </div>
                                        
				</div>
			</div>
		</div>
	</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>