<script   src="js/scroll.js"></script>

<div class="row text-center">
    <b>
        <?php if($titulo!="d"): ?>
            <?php echo e($titulo); ?>

        <?php endif; ?>
    </b>
</div>

<div class="table-responsive"><br/>
<table width="95%" class="table-bordered table-hover fixed" id="tablaReporte">
    <thead>
        <tr>
            <th colspan="3" style="text-align: center; background: #bababa">Factura</th>
            <th colspan="3" style="text-align: center; background: #FAF834">Otros datos</th>
        </tr>
        <tr style="background: #aa4d0e; color:white">
            <th>Código</th>
            <th>Descuento</th>
            <th>Fecha</th>
            <th>Cliente</th>
            <th>Observación</th>
            <th>Usuario</th>
        </tr>
    </thead>
    <tbody>
        <?php            
            $TTotalDescuento = 0;
        ?>
       <?php foreach($reporte as $repor): ?>
       
    <tr>
        <td align="right"><a href="<?php echo e(url('/detfacdes/'.$repor->IdVenta_Fin)); ?>" target="_blank"> <?php echo e($repor->IdVenta_Fin); ?> </a></td>
        <td align="right"><?php echo e($repor->Descuento); ?></td>
        <td align="right"><?php echo e(date('d-m-Y',strtotime($repor->created_at))); ?></td>
        <td align="left">&nbsp;&nbsp;&nbsp;<?php echo e($repor->nomcli." ".$repor->apecli); ?></td>
        <td align="left">&nbsp;&nbsp;&nbsp;<?php echo e($repor->observacion); ?></td>
        <td align="left">&nbsp;&nbsp;&nbsp;<?php echo e($repor->Nombres." ".$repor->Apellidos); ?></td>       
        <?php 
            $TTotalDescuento += $repor->Descuento;
        ?>
    </tr>    
      <?php endforeach; ?>
    </tbody>
    
    <tfoot>
        <tr>
          <td colspan="7"><br/></td>
      </tr>
      <tr>
        <th style="text-align: right">Total:</th>
        <th style="text-align: right"><?php echo e($TTotalDescuento); ?></th>
        <th style="text-align: right" colspan="6" ></th>
      </tr>
      <tr>
          <td colspan="10"><br/></td>
      </tr>
    </tfoot>      
</table>
</div>