<? 
require_once('../../../conf/connection.php');

 $proveedor=$_GET["proveedor"];
 $sucu=$_GET["sucu"];
 
 //nombre suscursal
	   $query_nom="SELECT * FROM sucu WHERE codsucu='$sucu'";
	   $res_nom=mysql_query($query_nom);
	   $nom_sucu=mysql_result($res_nom,0,"nombre");
	   
 $numero=$_GET["num"];
 $fecha = date("Y-m-d");
 $hora =  date("H:i:s");
 
  $query_num="SELECT * FROM detalles_proveedor  WHERE numero='$numero'";
  $res_num=mysql_query($query_num); 
  $nr_ide=mysql_num_rows($res_num);
 
  $query_sum="SELECT sum(valor_total) AS total_venta FROM detalles_proveedor  WHERE numero='$numero'";
  $res_sum=mysql_query($query_sum); 
  $total=mysql_result($res_sum,0,"total_venta");
  
  $neto=$total/1.19;
  
  $iva=($neto*0.19)/1.19;
  $bruto=$total-$efectivo;
  if($nr_ide<>0){
	
?>
<!DOCTYPE html>
<html dir="ltr" lang="en-US"><head>
    <meta charset="utf-8">
    <title>mod_venta</title>
    <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">
    <script type='text/javascript' src='jquery-1.7.1.min.js'></script>
    <!--[if lt IE 9]><script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    <link rel="stylesheet" href="../../../style.css" media="screen">
    <!--[if lte IE 7]><link rel="stylesheet" href="style.ie7.css" media="screen" /><![endif]-->
    <link rel="stylesheet" href="../../../style.responsive.css" media="all">

    <script src="../../../jquery.js"></script>
    <script src="../../../script.js"></script>
    <script src="../../../script.responsive.js"></script>



<style>.art-content .art-postcontent-0 .layout-item-0 { border-top-width:1px;border-top-style:solid;border-top-color:#B1C9C7;margin-top: 10px;margin-bottom: 10px;  }
.art-content .art-postcontent-0 .layout-item-1 { border-right-style:solid;border-right-width:1px;border-right-color:#B1C9C7; padding-right: 10px;padding-left: 10px;  }
.ie7 .art-post .art-layout-cell {border:none !important; padding:0 !important; }
.ie6 .art-post .art-layout-cell {border:none !important; padding:0 !important; }

</style>
<script>

function info (elEvento) { 
         evento = elEvento || window.event;
         k=evento.keyCode; //número de código de la tecla.
        
		       //finalizar con boleta 
          if (k==119){
		
			  
			  }
			  
		
		 		 
		 }
window.onload = function() {
document.onkeydown = info;
}
</script>

</head>
<body>
<div id="art-main">

<div class="art-sheet clearfix">
            <div class="art-layout-wrapper">
                <div class="art-content-layout">
                    <div class="art-content-layout-row">
                        <div class="art-layout-cell art-content"><article class="art-post art-article">
                                
                                                
                                <div class="art-postcontent art-postcontent-0 clearfix"><div class="art-content-layout">
    <div class="art-content-layout-row">
    <div class="art-layout-cell layout-item-1" style="width: 100%" >
       
        <p>
        <form action="add_bol.php" method="post" id="boleta" name="boleta">    
         <input type="hidden" value="<? echo $sucu; ?>" name="sucu" id="sucu">
         <input type="hidden" value="<? echo $fecha; ?>" name="fecha" id="fecha">
         <input type="hidden" value="<? echo $proveedor; ?>" name="proveedor" id="proveedor">
         <input type="hidden" value="<? echo $numero; ?>" name="numero" id="numero">
          <table width="589" border="0">
  <tr>
    <td colspan="3" align="right">Numero de documento: <? echo $numero; ?></td>
  </tr>
  <tr>
    <td colspan="3" align="right">Fecha: <? echo $fecha; ?></td>
  </tr>
  <tr>
    <td width="108">NETO: </td>
    <td width="256"><div class='input'><input name="neto" type="text" id="neto" value="<? echo $neto; ?>"
    style="font-size:18px" readonly="readonly" ></div></td>
    <td width="211">&nbsp;</td>
  </tr>
  <tr>
    <td>IVA: </td>
    <td><div class='input'><input type="text" id="iva" name="iva" value="<? echo $iva; ?>" style="font-size:18px" ></div></td>
    <td>&nbsp;</td>
    </tr>
  <tr>
    <td>TOTAL: </td>
    <td><div class='input'><input type="text" id="total" name="total" value="<? echo $bruto; ?>"  style="font-size:18px" ></div></td>
    <td>&nbsp;</td>
    </tr>
  <tr>
    <td colspan="3" align="center">
    <input type="submit" value="Guardar documento" class="art-button" style="height:50px; width:120px;"
    onClick="guardar">
    </td>
    </tr>
          </table>
</form>
       
        </p>
    </div>
    </div>
</div>
<div class="art-content-layout-br layout-item-0">
</div></div>


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

    </div>
    
</div>


</body></html>
<? }else{?><script>alert("No existen productos en el proceso de venta...");window.close(); </script> <? }?>