<!--#include file="conn.asp"-->
<%
if session("login")<>"1" then
response.write("<script>alert('未登录或者登陆超时，请重新登陆！');window.location.href='login.asp';</script>")   
response.end() 
end if

if request.QueryString("ac")="preprint" and request.QueryString("DocumentoNo")<>"" then
conn.open Str
sql = "select COUNT(*) AS totallinea from Albaranproveedorarticulo where Cantidad<>Comentario and DocumentoNo="&request.QueryString("DocumentoNo")&""
set rs = conn.execute(sql)

if  CDbl(rs("totallinea"))<>0 then
response.Redirect("?ac=print&DocumentoNo="&request.QueryString("DocumentoNo")&"")
else
response.write("<script>alert('无缺货信息，无需打印！\n Sin Faltantes,No va impremir!');window.location.href='?';window.android.playFailed();</script>")   
response.end() 
end if

conn.close
rs.close
set rs=nothing
end if
if request.QueryString("ac")="print" and request.QueryString("DocumentoNo")<>"" then
conn.open Str 
sql = "select *,empleado.nombre as empleado,proveedor.nombrees as proveedor from Albaranproveedor,proveedor,empleado where Albaranproveedor.Empresaid = proveedor.Empresaid and Albaranproveedor.operadorid = empleado.empleadoid AND Albaranproveedor.DocumentoNo="&request.QueryString("DocumentoNo")&" order by Albaranproveedor.DocumentoNo desc "	
set rs = conn.execute(sql)
fecha=rs("fecha")
proveedor=rs("proveedor")
empleado=rs("empleado")
rs.close
set rs=nothing

sql = "select *,SUM(precio*cantidad) as total,COUNT(*) AS totallinea,SUM(cantidad) as cantidadtotal from Albaranproveedorarticulo where Cantidad<>Comentario and DocumentoNo="&request.QueryString("DocumentoNo")&""
set rs = conn.execute(sql)
totallinea=rs("totallinea")
cantidadtotal=rs("cantidadtotal")
rs.close
set rs=nothing

sql = "select * from Albaranproveedorarticulo where Cantidad<>Comentario and DocumentoNo="&request.QueryString("DocumentoNo")&""
set rs = conn.execute(sql)



%>
<table width="100%"  height="80" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><p><span class="STYLE2" style="font-size: 24px; font-weight: bold">供应商进货单据-缺货单</span><span style="font-size: 24px; font-weight: bold"><br />
      Faltantes
      De Al.Proveedor</span><span style="font-size: 24px"><br />
      </span></p>
    </td>
 </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="4"><div align="left" style="font-size: 24px">
      <div align="center"><strong>-------------------------------------</strong></div>
    </div></td>
  </tr>
  <tr>
    <td colspan="4"><div align="left" style="font-size: 24px; font-weight: bold">Proveedor:<%= proveedor %></div></td>
  </tr>
  <tr>
    <td colspan="4"><div align="left" style="font-size: 24px">
      <div align="center"><strong>-------------------------------------</strong></div>
    </div></td>
  </tr>
  <tr>
    <td colspan="4"><div align="left" style="font-weight: bold; font-size: 24px">Fecha:<%= fecha %><br />
      NO.:<%= request.QueryString("DocumentoNo") %><br />Operador:<%= empleado %>
    </div></td>
  </tr>
  <tr>
    <td colspan="4"><div align="left" style="font-size: 24px">
      <div align="center"><strong>-------------------------------------</strong></div>
    </div></td>
  </tr>
  <tr>
    <td width="30%"  height="30"><div align="center" style="font-size: 24px">
      <div align="left">产品<br />
        </div>
    </div></td>
    <td width="20%" height="30">
    <div align="center" style="font-size: 22px">单据数<br />
    </div></td>
    <td width="20%" height="30">
    <div align="center" style="font-size: 22px">对货数<br />
    </div></td>
	<td width="20%" height="30">
	  <div align="center" style="font-size: 22px">差数<br />
	  </div></td>
  </tr>
  <tr>
    <td  height="30" colspan="4"><div align="left" style="font-size: 24px">
      <div align="center"><strong>-------------------------------------</strong></div>
    </div></td>
  </tr>
 
<%
       while not rs.eof
	   
	   X=cstr(rs("Cantidad"))
	IF rs("Comentario")="" THEN
	Y=0
	ELSE
	Y=cstr(rs("Comentario"))
	END IF
   %>
  <tr>
    <td colspan="4" height="40px"  valign="bottom" ><span style="font-size: 24px"><%= rs("NombreES") %><%= rs("nombrecn") %></span></td>
  </tr>
  <tr>
    <td width="30%"><div align="left" style="font-size: 24px"><%= rs("ArticuloID") %></div></td>
    <td width="20%"><div align="center" style="font-size: 24px"><%= X %></div></td>
    <td width="20%"><div align="center" style="font-size: 24px"><%= Y %></div>	</td>
	<td width="20%"><div align="center" style="font-size: 24px"><%= X-Y %></div></td>
</tr>
	
	<% 
  rs.movenext
  wend
  rs.close
  conn.close
  set rs=nothing 
%>
    <tr>
      <td colspan="4" class="STYLE18" style="font-weight: bold"><div align="left" style="font-size: 24px">
      <div align="center">-------------------------------------</div>
    </div></td>
    </tr>
  <tr>
    <td width="30%" class="STYLE18" style="font-weight: bold">
      <div align="right" style="font-size: 24px; font-weight: bold">
        <div align="center"></div>
    </div></td>
    <td width="20%" class="STYLE18"><div align="center" style="font-size: 24px; font-weight: bold">
      
    </div></td>
    <td width="20%" ><div align="right" style="font-size: 24px; font-weight: bold" >Linea:<%= totallinea %></div></td>
    <td width="20%" >
    <div align="center" style="font-size: 24px; font-weight: bold"></div></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><div align="left" style="font-size: 24px">
      <div align="center"><strong>-------------------------------------</strong></div>
    </div></td>
  </tr>
  <tr>
    <td height="200" valign="top"><span style="font-size: 24px">FIRMA OPERADOR </span></td>
  </tr>
  <tr>
    <td><div align="left" style="font-size: 24px">
      <div align="center"><strong>-------------------------------------</strong></div>
    </div></td>
  </tr>
</table>
<% 
response.End()
end if %>



<% if request.QueryString("ac")="" or request.QueryString("ac")="out" or request.QueryString("ac")="c" then %>
<table width="100%"  height="80" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
	<span class="STYLE2">供应商账单查询(最后<%= AlpproveedorMAX %>张单据)</span><br />
<span class="STYLE14">AL.PRO(ULTIMOS <%= AlpproveedorMAX %> RECIBOS)</span><br />
<span class="STYLE2"><%= request.Form("key") %></span>
</td>
 </tr>
</table>
<form id="form1" name="form1" method="post" action="alp.asp?ac=c">
<table width="100%"  height="30" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>
      <label>
        <input name="key" type="text" id="key" style=" width:100%;height:30px;" autofocus="autofocus" align="right" autocomplete="off"/>
      </label></td>
		<td width="5%">
	  <INPUT type=image height="30" width="30" src="img/BUSCA.png" border=0 name="Submit" onClick="this.form.submit()" autocomplete="off" /></td>
  </tr>
  <tr>
    <td height="20">&nbsp;</td>
    <td height="20">&nbsp;</td>
  </tr>
</table>
</form>

</form>
<% 
if request.QueryString("ac")="out" and request.QueryString("DocumentoNo")<>"" then
conn.open Str
set sql=conn.execute("update albaranproveedor set bloqueado=1 where DocumentoNo='"&request.QueryString("DocumentoNo")&"'" ) 
 conn.close
 response.write("<script>alert('此账单已隐藏！\n Ya esta oculto!');window.location.href='?';window.android.playSuccess();</script>")   
response.end() 
end if

if request.QueryString("ac")="c" and request.Form("key")<>"" then
sql = "select * from albaranproveedor,proveedor where albaranproveedor.DocumentoNo = '"& request.Form("key") &"' and albaranproveedor.bloqueado<>1 and albaranproveedor.empresaid=proveedor.empresaid  order by albaranproveedor.DocumentoNo desc limit "&AlpproveedorMAX&""
end if
if request.Form("key")="" then
sql =  "select * from albaranproveedor,proveedor where albaranproveedor.bloqueado<>1 and albaranproveedor.empresaid=proveedor.empresaid order by DocumentoNo desc limit "&AlpproveedorMAX&""
end if
conn.open Str
set rs = conn.execute(sql)
 %>
 <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td  height="30" style="background-color:<%= bgcolor %>;opacity:<%= opacity %>;"><div align="center"><span class="Menu1">编号</span><br /><span class="Menu2"> CODIGO</span></div></td>
    <td  height="30" style="background-color:<%= bgcolor %>;opacity:<%= opacity %>;"><div align="center"><span class="Menu1">供货商</span><br /><span class="Menu2"> PROVEEDOR</span></div></td>
    <td  height="30" style="background-color:<%= bgcolor %>;opacity:<%= opacity %>;"><div align="center"><span class="Menu1">总价</span><br /><span class="Menu2"> TOTAL</span></div></td>
	<td  height="30" colspan="2" style="background-color:<%= bgcolor %>;opacity:<%= opacity %>;"><div align="center"><span class="Menu1">操作</span><br /><span class="Menu2"> OBRA</span></div></td>
   </tr>
 
<%
       while not rs.eof
   %>
  
  <tr>
    <td height="35"  background="img/bj35.png"><div align="center"><%= rs("DocumentoNo") %></div></td>
    <td height="35"  background="img/bj35.png"><div align="center"><%= rs("nombrecn")&rs("nombrees") %></div></td>
    <td height="35"  background="img/bj35.png"><div align="center"><%= formatnumber(rs("Total"),2,-1,-1,0) %></div></td>
	<td width="50" background="img/bj35.png"><div align="center"><span class="STYLE1"></span><a href="javascript:if(confirm('确实要隐藏该单据吗?\nEstás seguro Ocultar este albran?'))location='?ac=out&DocumentoNo=<%= rs("DocumentoNo") %>'"><img src="img/viw.png" width="20" height="20" border="0" /></a></div></td>
	<td width="50"  height="35" background="img/bj35.png"><div align="center"><span class="STYLE1"></span><a href="alp.asp?ac=check&DocumentoNo=<%= rs("DocumentoNo") %>"/><img src="img/dz.png" width="20" height="20" /></div>	  </td>
   </tr>
  
<% 
  rs.movenext
  wend
  rs.close
  conn.close
  set rs=nothing 

%>
</table>
<% end if %>

<%
if request.QueryString("ac")<>"" and request.QueryString("ac")<>"out" and request.QueryString("ac")<>"c" then

if request.QueryString("ac")="checkpro" and request.QueryString("DocumentoNo")<>"" and request.Form("Comentario")<>"" and request.QueryString("ArticuloID")<>"" then
sql = "select * from albaranproveedorarticulo where DocumentoNo = '"& request.QueryString("DocumentoNo") &"' and  ArticuloID = '"& request.QueryString("ArticuloID") &"'"
conn.open Str
set rs = conn.execute(sql)

	A=CDbl(request.Form("Comentario"))
	IF rs("Comentario")="" THEN
	B=0
	ELSE
	B=CDbl(rs("Comentario"))
	END IF
	
	C= A+B


set UPDATECANT=conn.execute("update albaranproveedorarticulo set Comentario='"& c &"' where DocumentoNo = '"& request.QueryString("DocumentoNo") &"' and ArticuloID='"& request.QueryString("ArticuloID") &"'" )
response.write("<script>window.location.href='?ac=check&DocumentoNo="&rs ("DocumentoNo")&"';window.android.playSuccess();</script>")
response.End()
  conn.close
end if

'一键更新数量
if request.QueryString("ac")="checkprook" and request.QueryString("DocumentoNo")<>"" and request.QueryString("ArticuloID")<>"" then
conn.open Str
set UPDATECANT=conn.execute("update albaranproveedorarticulo set Comentario='"& request.QueryString("Cantidad") &"' where DocumentoNo = '"& request.QueryString("DocumentoNo") &"' and ArticuloID='"& request.QueryString("ArticuloID") &"'" )
response.write("<script>window.location.href='?ac=check&DocumentoNo="&request.QueryString("DocumentoNo")&"';window.android.playSuccess();</script>")
response.End()
  conn.close
end if
'结束一键更新数量

'更新产品信息
if request.QueryString("ac")="acpro" and request.QueryString("DocumentoNo")<>"" and  request.QueryString("ArticuloID")<>"" then
conn.open Str
set UPDATECANT=conn.execute("update articulo set PrecioDetalle='"& request.Form("PrecioDetalle") &"',PrecioCoste='"& request.Form("PrecioCoste") &"' where ArticuloID='"& request.QueryString("ArticuloID") &"'" )
response.write("<script>window.location.href='?ac=check&DocumentoNo="&request.QueryString("DocumentoNo")&"&ArticuloID="&request.QueryString("ArticuloID")&"';window.android.playSuccess();</script>")
response.End()
  conn.close
end if
'结束更新产品信息

if request.QueryString("ac")="check" and request.QueryString("DocumentoNo")<>"" and request.Form("key")<>""  then
sql = "SELECT * FROM albaranproveedorarticulo,articulo WHERE albaranproveedorarticulo.DocumentoNo = '"& request.QueryString("DocumentoNo") &"' AND albaranproveedorarticulo.ArticuloID = articulo.ArticuloID AND (albaranproveedorarticulo.ArticuloID = '"& request.Form("key") &"' OR albaranproveedorarticulo.codigobarra = '"& request.Form("key") &"')"
conn.open Str
set rs = conn.execute(sql)
if rs.eof and rs.bof then

response.write("<script>alert('本单无此产品！\nProducts no esta!');window.location.href='?ac=check&DocumentoNo="&request.QueryString("DocumentoNo")&"';window.android.playFailed();</script>")   
response.End()
end if
end if

if request.QueryString("ac")="check" and request.QueryString("DocumentoNo")<>"" and request.QueryString("ArticuloID")<>""  then

sql = "SELECT * FROM albaranproveedorarticulo,articulo WHERE albaranproveedorarticulo.DocumentoNo = '"& request.QueryString("DocumentoNo") &"' AND albaranproveedorarticulo.ArticuloID = articulo.ArticuloID AND (albaranproveedorarticulo.ArticuloID = '"& request.QueryString("ArticuloID") &"' OR albaranproveedorarticulo.codigobarra = '"& request.QueryString("ArticuloID") &"')"
conn.open Str
set rs = conn.execute(sql)
if rs.eof and rs.bof then
response.write("<script>alert('本单无此产品！\nProducts no esta!');window.location.href='?ac=check&DocumentoNo="&request.QueryString("DocumentoNo")&"';window.android.playFailed();</script>")
response.End()
end if
end if




if request.QueryString("ac")="check" and request.QueryString("DocumentoNo")<>"" and request.Form("key")="" and request.QueryString("ArticuloID")="" then
sql = "select *,albaranproveedorarticulo.OrdenNo as OrdenNo from albaranproveedorarticulo,articulo where DocumentoNo = '"& request.QueryString("DocumentoNo") &"'and albaranproveedorarticulo.ArticuloID=Articulo.ArticuloID  limit "&AlpproveedorarticuloMAX&"" 
conn.open Str
set rs = conn.execute(sql)
end if

if request.QueryString("ac")="checkpro" and request.QueryString("DocumentoNo")<>"" and request.QueryString("ArticuloID")<>""  then
sql = "select *,albaranproveedorarticulo.OrdenNo as OrdenNo from albaranproveedorarticulo,articulo where DocumentoNo = '"& request.QueryString("DocumentoNo") &"'  and  albaranproveedorarticulo.ArticuloID=Articulo.ArticuloID  limit "&AlpproveedorarticuloMAX&""
conn.open Str
set rs = conn.execute(sql)
end if


if request.Form("key")="" then
autofocus="autofocus"
else
autofocus1="autofocus"
end if
 %>
 
<table width="100%"  height="80" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
	<span class="STYLE2">对货</span><br />
<span class="STYLE14">CHECK PRODUCTO</span><br />
<span class="STYLE2"><%= request.Form("key") %></span>
</td>
 </tr>
  <tr>
    <td height="20" colspan="2"><div align="center" style="font-weight: bold">单据号码：<%= request.QueryString("DocumentoNo") %></div></td>
  </tr>
</table>
<form id="form1" name="form1" method="post" action="alp.asp?ac=check&DocumentoNo=<%= request.QueryString("DocumentoNo") %>">
<table width="100%"  height="30" border="0" cellpadding="0" cellspacing="0">
   <tr>
    <td>
      <label>
        <input name="key" type="text" id="key" style=" width:100%;height:30px;" <%= autofocus %> align="right" autocomplete="off"/>
      </label>	  </td>
		<td width="10%">
	      <div align="center">
	        <INPUT type=image height="30" width="30" src="img/BUSCA.png" border=0 name="form1" onClick="this.form.submit()" autocomplete="off" />
      </div></td>
        <td width="10%"><div align="center"><a href="javascript:if(confirm('确实要打印缺货单吗?\nEstás seguro Impremir Faltantes?'))location='?ac=preprint&DocumentoNo=<%=request.QueryString("DocumentoNo")%>'"><img src="img/print.png" width="30" height="30" border="0" /></a></div></td>
	</tr>
</table>
</form>





 
<%
       while not rs.eof
	  
   %>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="word-wrap:break-word;word-break:break-all;">

     <tr>
    <td  height="30" style="background-color:<%= bgcolor %>;opacity:<%= opacity %>;"><div align="center"><span class="Menu1">产品</span></div></td>
    <td  height="30" style="background-color:<%= bgcolor %>;opacity:<%= opacity %>;"><div align="center"><span class="Menu1">编码</span></div></td>
	<td style="background-color:<%= bgcolor %>;opacity:<%= opacity %>;"><div align="center"><span class="Menu1">进价</span></div></td>
	<td style="background-color:<%= bgcolor %>;opacity:<%= opacity %>;"><div align="center"><span class="Menu1">售价</span></div></td>
	<td width="25%"  height="30" colspan="3" style="background-color:<%= bgcolor %>;opacity:<%= opacity %>;"><div align="center"><span class="Menu1">操作</span></div></td>
   </tr>
	<% 
	precio=rs("PrecioDetalle")
	X=cstr(rs("Cantidad"))
	IF rs("Comentario")="" THEN
	Y=0
	ELSE
	Y=cstr(rs("Comentario"))
	END IF
	 %>
	<form id="form3" name="form3" method="post" action="alp.asp?ac=acpro&DocumentoNo=<%=request.QueryString("DocumentoNo")%>&ArticuloID=<%=rs("ArticuloID")%>&OrdenNo=<%= rs("OrdenNo") %>">
	 
	 
  <tr>
    <td width="80" height="40"><div align="center"><span class="STYLE15"><a href="updategood.asp?ac=update&articuloid=<%= rs("articuloid") %>"/><%= rs("NombreES") %></a><br />
    </span></div>      <div align="center"></div></td>
    <td width="60" height="40"><div align="center"><span class="STYLE15"><%= rs("ArticuloID") %></span></div></td>
	<td width="60" height="40"><div align="center">
 <% if session("claseid")="1" then
	  typep="number"	  
	  else
	  typep="password"
	  readonly="readonly"
	  end if %>	


	  <input name="PrecioCoste"   type="<%= typep %>"  <%= readonly %> step="0.001" id="PrecioCoste" style=" width:40px;height:25px;  text-align:center;" value="<%= formatnumber(rs("PrecioCoste"),2,-1,-1,0) %>"  autocomplete="off"/>
	  

</div></td>
	<td width="60" height="40"><div align="center">
	  <input name="PrecioDetalle"  type="number" step="0.001" id="preciodetalle" style=" width:40px;height:25px;  text-align:center;" value="<%= formatnumber(rs("preciodetalle"),2,-1,-1,0) %>" autocomplete="off"/>
	  </div></td>
	<td  height="40" valign="middle"><div align="center">
	  <input type="image" name="ac" src="img/ac.png" width="25" height="25" onClick="document.form3.submit()">
	  </div></td>
	<td  height="40" colspan="2" valign="middle">
	<% 		
if ventamode="1" then
	precio=rs("preciodetalle")
	else
	precio=rs("preciomayor")
	end if
	
	
	
	if billetecode="1" then
	precioxs=" "&formatnumber(precio,2,-1,-1,0)
	else
	precioxs=precio
	end if
	
	if EName2IgualEName1="0" then
name1=left(rs("nombrees"),EName1MAX)
name2=left(rs("nombrecn"),EName2MAX)
else
name1=left(rs("nombrees"),EName1MAX)
name2=mid(rs("nombrees"),EName1MAX+1,EName2MAX)
end if

if isnull(rs("UnidadNombre")) or rs("UnidadNombre")="" then
UnidadNombre="Litro/Kg"
else
UnidadNombre=rs("UnidadNombre")
end if

if isnull(rs("VolumenPeso")) or rs("VolumenPeso")="0" then
nota1=nota
else
nota1=UnidadNombre&":"&formatnumber(1/formatnumber(rs("VolumenPeso"),2,-1,-1,0)*formatnumber(precio,2,-1,-1,0),2,-1,-1,0)&billete
end if

if notaxs="1" then
notaprint=nota
end if

if notaxs="2" then
notaprint=date()
end if

if notaxs="3" then
notaprint=nota1
end if

if notaxs="4" then
notaprint=rs("SITIOENALMACEN")
end if

	
if Printidocodigo="2" and rs("Codigobarra")<>"" then
code=rs("Codigobarra")
else
code=rs("ArticuloID")
end if

 if modelo="0" and style="1"  then
tipo="1"
papel="普通58MM连续纸"
papeles="Papel 58MM Continuo"
end if

 if modelo="0" and style="2"  then
tipo="9"
papel="普通58MM连续纸"
papeles="Papel 58MM Continuo"
end if

 if modelo="0" and style="3"  then
tipo="13"
papel="普通58MM连续纸"
papeles="Papel 58MM Continuo"
end if

 if modelo="0" and style="80"  then
tipo="10"
papel="普通80MM连续纸"
papeles="Papel 80MM Continuo"
end if

if modelo="1" and style="13" then
tipo="6"
papel="58MM*40MM间隙贴纸"
papeles="58MM*40MM Pegatina Adhesivo"
end if

if modelo="1" and style="18" then
tipo="18"
papel="58MM*40MM间隙贴纸"
papeles="58MM*40MM Pegatina Adhesivo"
end if

if modelo="1" and style="14" then
tipo="14"
papel="58MM*40MM间隙贴纸"
papeles="58MM*40MM Pegatina Adhesivo"
end if

%>
	
	
      <div align="center"><a href="impremir.asp?ac=imp&tipo=<%= tipo %>&articuloid=<%= code %>&preciodetalle=<%= precioxs %>&nombrees=<%= Server.URLEncode(name1)  %>&nota=<%= NOTAprint %>&name2=<%= Server.URLEncode(name2) %>&tiendaname=<%= Server.URLEncode(tiendaname) %>&url=index&billete=<%= billete %>&tiendanamesize=<%= tiendanamesize %>&tiendanamealign=<%= tiendanamealign %>&name1size=<%= name1size %>&name1align=<%= name1align %>&name2size=<%= name2size %>&name2align=<%= name2align %>&preciosize=<%= preciosize %>&precioalign=<%= precioalign %>&fxsize=<%= fxsize %>&fxalign=<%= fxalign %>&notasize=<%= notasize %>&notaalign=<%= notaalign %>&codesize=<%= codesize %>&codealign=<%= codealign %>&billetesize=<%= billetesize %>&billetealign=<%= billetealign %>&codebarwidth=<%= codebarwidth %>&codebarheight=<%= codebarheight %>&fx=<%= fx %>&BilleteAntes=<%= BilleteAntes %>&DocumentoNo=<%= request.QueryString("DocumentoNo") %>"/><img src="img/print.png" width="25" height="25" border="0" /></a>
      </div>
	
	</td>
	</tr>
</form>	
	
  <tr>
    <td width="90" height="25" bgcolor="#F0F0F0"><div align="center">条码</div></td>
    <td width="50" height="25" bgcolor="#F0F0F0"><div align="center">数量<br /></div></td>
    <td width="50" height="25" bgcolor="#F0F0F0"><div align="center">收货<br /></div></td>
    <td width="50" height="25" bgcolor="#F0F0F0"><div align="center">差数<br /></div></td>
    <td  height="25" colspan="3" valign="middle" bgcolor="#F0F0F0"><div align="center">收货</div></td>
   </tr>
	<form id="form2" name="form2" method="post" action="alp.asp?ac=checkpro&DocumentoNo=<%=request.QueryString("DocumentoNo")%>&ArticuloID=<%=rs("ArticuloID")%>&OrdenNo=<%= rs("OrdenNo") %>">

  <tr>
    <td width="80" height="40"><div align="center"><span class="STYLE15"><%= rs("codigobarra") %></span></div></td>
    <td width="60" height="40"><div align="center"><%= rs("Cantidad") %></div></td>
    <td width="60" height="40"><div align="center"><%= y %></div></td>
    <td width="60" height="40"><div align="center"><%= Y-X %></div></td>
    <td  height="40" valign="middle"><div align="center"><a href="javascript:if(confirm('确实要一键对货吗?\nEstás seguro?'))location='?ac=checkprook&DocumentoNo=<%=request.QueryString("DocumentoNo")%>&ArticuloID=<%=rs("ArticuloID")%>&Cantidad=<%= rs("Cantidad") %>&OrdenNo=<%= rs("OrdenNo") %>'"><img src="img/dh.png" width="25" height="25" border="0" /></a></div></td>
	<td height="40" valign="middle"><div align="center">
	  <input name="Comentario" type="number" id="Comentario" style="width:30px; height:20px; font-size:16px; border:ridge;" oninput="checkLength(this)" inputmode="numeric" autocomplete="off" <%= autofocus1 %>  />

<script>
let hasConfirmed = false;

function checkLength(input) {
    if (input.value.length > 3 && !hasConfirmed) {
        let confirmMessage = "你输入的数量超过了3位，确定要继续吗？\nEl numero ingresado supera los 3 digitos,estas seguro de continuar?";
        if (!confirm(confirmMessage)) {
            // 如果用户选择取消，则清空输入框内容
            input.value = '';
        }
        hasConfirmed = true; // 无论用户选择确认还是取消，都不再显示提示
    }
}
</script>

	  </div></td>
	<td width="12%" height="40" valign="middle"><input type="image" name="ac2" src="img/jia1.png" width="25" height="25" onClick="document.form2.submit()" /></td>
  </tr>
	</form>
	<% if Y<>X THEN %>
  <tr>
    <td height="5" colspan="7" bgcolor="#FF0000">&nbsp;  </td>
   </tr>
	<% END IF %>
	  <tr>
    <td colspan="7"><div align="center">  
<% if photo="1" and request.Form("key")<>""  then %>
<img src="img.asp?dibujoid=<%= rs("dibujoid") %>" style="width:50%">
<% end if %></td>
   </tr>
   </table>
<% if op3="1" and request.Form("key")<>"" and session("ClaseID")="1" then %>
 <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="word-wrap:break-word;word-break:break-all;">
    <tr>
    <td height="35" background="img/bj35.png" ><div align="center" style="font-size:16px; ">进货日期</div></td>
    <td background="img/bj35.png" ><div align="center" style="font-size:16px; ">单号</div></td>
    <td width="80" height="35" background="img/bj35.png" ><div align="center" style="font-size:18px; ">进价</div></td>
    <td width="80" height="35" background="img/bj35.png" ><div align="center" style="font-size:18px; ">数量</div></td>
   </tr>
   <%  
sqls="SELECT * FROM albaranproveedorarticulo LEFT JOIN albaranproveedor ON albaranproveedorarticulo.DocumentoNo = albaranproveedor.DocumentoNo WHERE albaranproveedorarticulo.ArticuloID = '" & Left(request.Form("key"), 15) & "' OR albaranproveedorarticulo.Codigobarra = '" & Left(request.Form("key"), 15) & "' ORDER BY albaranproveedor.fecha DESC"
set rss = conn.execute(sqls)
while not rss.eof%>
    <tr>
    <td height="35" background="img/bj35.png" ><div align="center" style="font-size:16px; "><%= Year(rss("FECHA"))&"-"&Right("00" & Month(rss("FECHA")), 2)&"-"&Right("00" & Day(rss("FECHA")), 2) %></div></td>
    <td background="img/bj35.png" ><div align="center" style="font-size:16px; "><%= rss("DocumentoNo") %></div></td>
    <td width="80" height="35" background="img/bj35.png" ><div align="center" style="font-size:18px; "><%= formatnumber(rss("precio"),2,-1,-1,-1) %></div></td>
    <td width="80" height="35" background="img/bj35.png" ><div align="center" style="font-size:18px; "><%= rss("cantidad") %></div></td>
   </tr>
  
<% 
  rss.movenext
  wend
 rss.close
  set rss=nothing 
  %> 
 </table>


<% end if
  rs.movenext
  wend
  rs.close
  conn.close
  set rs=nothing 

%>

<% end if %>

<div style="height:100px"/></div>
<!--#include file="fooder.asp"-->