<div class='row'>
        <?php $filters = $_reporte->getOptions();?>
        <table class="w-100">
            <tr>
                <td><strong><?php echo $_translator->_getTranslation('Sucursal');?></strong></td>
                <td><?php echo $filters['store_name'] ?></td>
                <td></td>
                <td class="text-right"><span class="_report btn btn-primary btn-sm" data-reportname="sales_activity" data-toggle='modal' data-target='#modalFiltroReportes'><i class="fa fa-pencil"></i></span></td>
            </tr>
            <tr>
                <td><strong><?php echo $_translator->_getTranslation('Fecha inicio');?></strong></td>
                <td><?php echo $filters['fechaInicio'] ?></td>
                <td><strong><?php echo $_translator->_getTranslation('Fecha fin');?></strong></td>
                <td class="text-right"><?php echo $filters['fechaFin'] ?></td>
            </tr>
            <tr>
               
            </tr>
        </table>
        <hr/>
        <?php $result = $_reporte->getReporte(); ?> 
        <table class="w-100">
            <tbody class="summary_sales">
            <tr>
                <td>
                    <span class="content pull-left">                        
                        <h4 class="m-a-0 p-a-0"><strong>$<?php echo number_format($result['total_sales'],2) ?></strong></h4>
                        <?php echo $_translator->_getTranslation('Total de ventas');?>
                    </span>
                </td>
                <td>
                    <span class="content pull-left">    
                         <h4 class="m-a-0 p-a-0"><strong><?php echo number_format($result['quantity_sales'],2) ?></strong></h4>
                        <?php echo $_translator->_getTranslation('Cantidad de ventas');?>                        
                    </span>
                </td>
            </tr>
            <tr>
                <td>
                    <span class="content pull-left">                         
                        <h4 class="m-a-0 p-a-0">
                            <strong>
                                <?php 
                                if($result['quantity_sales'] > 0){
                                    echo '$'.number_format($result['total_sales']/$result['quantity_sales'],2); 
                                }else{
                                    echo '$0.00';
                                }
                                ?>
                            </strong></h4>
                        <?php echo $_translator->_getTranslation('Promedio precio por venta');?>
                    </span>
                </td>
                <td>
                    <span class="content pull-left"> 
                        <h4 class="m-a-0 p-a-0"><strong>$<?php echo number_format($result['total_discounts'],2) ?></strong></h4>
                        <?php echo $_translator->_getTranslation('Descuentos');?>                        
                    </span>
                </td>
            </tr>
            </tbody>
        </table>
        <hr/>
        <h5><i class="fa fa-credit-card"></i> <?php echo $_translator->_getTranslation('Formas de pago'); ?></h5>
        <table class="table">
           <tbody class="payment_method">
            <?php 
            foreach($result['payment_method'] as $method){?>
                <tr>
                    <td><?php echo $method['formaPago'] ?></td>   
                    <td class="text-right"><?php echo number_format($method['monto'],2) ?></td>
                </tr><?php                    
            }?>            
            </tbody>
        </table>
        <a class="_collapseProducts" style="text-decoration: none;color:#000" role="button" data-toggle="collapse" href="#collapseProducts" aria-expanded="false" aria-controls="collapseProducts">
            <i class="fa fa-plus"></i>
            <span ><?php echo $_translator->_getTranslation('Productos vendidos')?>:</span> 
            <span ><?php echo $result['total_sold_products']?></span> 
        </a>
        <div class="clear"></div>
        <div class="collapse" id="collapseProducts">
            <table class="table">
                <thead>
                    <tr>
                        <th><?php echo $_translator->_getTranslation('Producto') ?></th>
                        <th class="text-center"><?php echo $_translator->_getTranslation('Cantidad') ?></th>
                    </tr>
                </thead>
                <tbody class="sold_product">
                <?php 
                foreach($result['summary_sold_products'] as $product){?>
                    <tr>
                        <td>
                            <span class="content pull-left">                         
                                <?php echo $product['producto'] ?><br/>
                                <small><?php echo $product['tamano'] ?></small>
                            </span>
                        </td>   
                        <td class="text-center"><?php echo $product['cantidad'] ?></td>
                    </tr><?php                    
                }?>            
                </tbody>
            </table>
        </div>
</div>
<script>
    $('._collapseProducts').on('click', function(){
         $(this).find('.fa').toggleClass('fa-plus fa-minus');
    });
</script>