<?php
session_start();
require_once ("../conexion.php");
require_once('../include/sesiones.php');
$ven_id=$_GET['ven_id'];
?>
<div class="table-responsive">
    <table class="table table-bordered table-hover table-striped">    
        <tr>
        <th width="5%">CODIGO</th>
        <th Width="5%">CANTIDAD</th>
        <th>DESCRIPCION</th>
        <th Width="5%"><span class="pull-right">PRECIO_UNITARIO</span></th>
        <th width="5%"></th>
    </tr>
    <?php
        $sumador_total=0;
        $sql=mysqli_query($con, "SELECT * from dian_nota_credito_detalle_temp where usuario='$usu_id' and ven_id='$ven_id'");
        while ($row=mysqli_fetch_array($sql))
        {
            $not_art_cantidad=$row['not_art_cantidad'];
            $not_precio=$row['not_precio'];
            $not_iva=$row['not_iva'];
            $not_desc=$row['not_descuento'];
            $descuento=($not_desc/100)*$not_precio;
            $precio_total=$not_precio*$not_art_cantidad;
            $sumador_total+=$precio_total;//Sumador
        ?>
    <tr>
        <td><?php echo $row["not_art_referencia"];?></td>
        <td><?php echo $not_art_cantidad;?></td>
        <td><?php echo$row["not_art_nombre"];?></td>
        <td><span class="pull-right"><?php echo number_format($not_precio,0);?></span></td>
        <td>
            <a href="#" id="del-<?php echo $row["not_id"];?>" class="btn btn-xs btn-danger"> <i class="btn-icon-only icon-remove"></i></a>
            <script>
            $("#del-"+<?php echo $row["not_id"];?>).click(function(e){
                e.preventDefault();
                p = confirm("Estas seguro?");
                if(p){
                    $.get("./php_doc_nota_debito/eliminar_temp.php","not_id="+<?php echo $row["not_id"];?>,function(data){
                        loadtablanota();
                    });
                }
            });
            </script>
        </td>
    </tr>
<?php } ?>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td><span class="pull-right"><?php echo number_format($sumador_total,0);?></span></td>
        <td></td>
    </tr>      
    </table>
</div>