<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<style type="text/css">
<!--

body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
@media print {
.noprint {
display: none;
}
}

-->
</style>

<% 
conn.open Str
sql="select * from TicketColgando,TicketColgandoarticulo where TicketColgando.DocumentoNo=TicketColgandoarticulo.DocumentoNo and TicketColgando.DocumentoNo='"&request.QueryString("DocumentoNo")&"'"
set rs = conn.execute(sql)
total=rs("total")
nota=rs("ColgarNota")
DescuentoTotal=rs("DescuentoTotal")
 %>
 <div id='page1'>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"  style="table-layout:fixed;word-wrap:break-word;word-break:break-all">
  <% if logo<>"" then %>
  <tr>
    <td height="20" colspan="3"><div align="center"><img src="<%= logo %>" width="100%" /></div></td>
  </tr>
   <% end if %>
  <tr>
    <td height="20" colspan="3"><div align="center"style="font-size:32px;" ><span style="font-weight: bold"><%= tiendaname %></span></div></td>
  </tr>
  <tr>
    <td colspan="3"><p style="font-size: 24px"><%= empresa %><br /><%= cif %><br />TELF:<%= telefono %><br />
     <%= calle %><br /> 
      <%= cp&","&Provincia %></p>      </td>
  </tr>
  
  <tr>
    <td height="30" colspan="3"><span style="font-size: 24px">CLIENTE:<%= rs("EmpresaID") %></span></td>
  </tr>

  
  <tr>
    <td height="30" colspan="3"><div align="left" style="font-size: 24px">
      <div align="center"><strong>-------------------------------------</strong></div>
    </div></td>
  </tr>
  <tr>
    <td height="30" colspan="3"><div align="center" style="font-size: 24px"><strong><%= TkTipo %></strong></div></td>
  </tr>
  <tr>
    <td height="30" colspan="3"><div align="left" style="font-size: 24px">
      <div align="center"><strong>-------------------------------------</strong></div>
    </div></td>
  </tr>
  
  <% 
Randomize 
codenew=Int((9999999999 * Rnd) + 1111111111)

  IF TkNO="1" THEN
  TkNOXS=codenew
  END IF
  
  IF TkNO="2" THEN
  TkNOXS="[PENDIENTE]"
  END IF
  
  IF TkNO="3" THEN
  TkNOXS=""
  END IF
  
  
   %>
  
  <tr>
    <td height="30" colspan="3"><span  style="font-size: 24px">NO.:<%= TkNOXS %> </span></td>
  </tr>
  
  
  <tr>
    <td height="30" colspan="3"><span  style="font-size: 24px">FECHA : <%= rs("FechaEntrada") %></span></td>
  </tr>
  <tr>
    <td height="30" colspan="3" valign="top"><div align="left" style="font-size: 24px">
      <div align="center"><strong>-------------------------------------</strong></div>
    </div></td>
  </tr>
  <tr>
    <td height="20" colspan="3"><span  style="font-size: 24px">PRODUCTO</span></td>
  </tr>
  <tr>
    <td width="50" height="20"><span style="font-size: 24px">CANT</span></td>
    <td width="85" height="20"><div align="center" style="font-size: 24px">PRECIO</div></td>
    <td width="85" height="20"><div align="center" style="font-size: 24px">IMPORTE</div></td>
  </tr>
  <tr>
    <td height="30" colspan="3"><div align="left" style="font-size: 24px">
      <div align="center"><strong>-------------------------------------</strong></div>
    </div></td>
  </tr>
  <tr>
    <td colspan="3" valign="top">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<%   
 while not rs.eof  
		%>
	

      <tr>
        <td height="30" colspan="3" style="font-size: 30px"><span style="font-size: 24px"><%= rs("NombreES") %><%= rs("NombreCN") %></span></td>
        </tr>
      <tr>
        <td width="50" height="30"><span style="font-size: 24px"><%= rs("Cantidad") %></span></td>
        <td width="85" height="30"><div align="center" style="font-size: 24px"><%= formatnumber(rs("Precio"),2,-1,-1,0) %></div></td>
        <td width="85" height="30"><div align="right" style="font-size: 24px"><%= formatnumber(formatnumber(rs("Cantidad"),2,-1,-1,0)*(formatnumber(rs("Precio"),2,-1,-1,0)),2,-1,-1,0)  %></div></td>
      </tr>
	  
	    <% 	
  rs.movenext
  wend


	   %>
	    <tr>
	      <td height="15" colspan="3"><div align="left" style="font-size: 24px">
	        <div align="center"><strong>-------------------------------------</strong></div>
	      </div></td>
	      </tr>
	    <tr>
        <td height="25" colspan="2"><div align="right" style="font-size: 24px">PrecioTotal:</div></td>
        <td height="25"><div align="right" style="font-size: 24px"><%= FormatNumber(Total,2,-1)  %></div></td>
      </tr>

       <tr>
        <td height="25" colspan="2"><div align="right" style="font-size: 24px">Descunto:</div></td>
        <td height="25"><div align="right" style="font-size: 24px"><%= FormatNumber(DescuentoTotal,2,-1) %></div></td>
      </tr>
      <tr>
        <td height="25" colspan="2"><div align="right" style="font-size: 24px">Subtotal:</div></td>
        <td height="25"><div align="right"><span style="font-size: 24px"><%= FormatNumber(FormatNumber(Total,2,-1)-FormatNumber(DescuentoTotal,2,-1),2,-1)  %></span></div></td>
      </tr>
      <tr>
        <td height="25" colspan="3"><span style="font-size: 24px">NOTA:<%= nota %></span></td>
        </tr>
      <tr>
        <td height="25" colspan="3"><div align="center" style="font-size: 24px"><%= TkNota %></div></td>
      </tr>
	  
	 <% 
	 rs.close
  conn.close
  set rs=nothing 
   %>
      <tr>
        <td colspan="3">
		 <input id="text" type="hidden" value="http://hipos.com.es/jingu/wap/vale.asp?id=<%= request.QueryString("vid") %>"/>
<div id="qrcode" style="width:1px; height:1x; margin-top:15px;"></div>

<script type="text/javascript">
var qrcode = new QRCode(document.getElementById("qrcode"), {
	width : 1,
	height : 1
});

function makeCode () {		
	var elText = document.getElementById("text");
	
	if (!elText.value) {
		alert("Input a text");
		elText.focus();
		return;
	}
	
	qrcode.makeCode(elText.value);
}

makeCode();

$("#text").
	on("blur", function () {
		makeCode();
	}).
	on("keydown", function (e) {
		if (e.keyCode == 13) {
			makeCode();
		}
	});
</script></td>
        </tr>
    </table>	</td>
  </tr>
</table>
</div>
</body>

