%@ LANGUAGE = "VBScript" %>
<%
Date_ini=Request.QueryString("Date_ini")
Date_end=Request.Form("Date_end")
campo=1
if Date_ini="" or Date_ini=null then
Date_ini=date()
Date_end=date()
end if
dia1=right("00"&day(Date_ini),2)
mes1=right("00"&month(Date_ini),2)
anno1=right("00"&year(Date_ini),4)
'Date_inii=cdate(dia1+"/"+mes1+"/"+anno1)
cfechai=cdbl(anno1+mes1+dia1)
%>
<%
busca="ok"
if busca="ok" then
'response.write("FROM: "&cfechai&" ")
'response.write("TO: "&cfechaf&" ")
if campo=1 then
set Rscompras=dbsql2.execute("select a.bal_date, a.bal_seq, a.bal_sub, a.ipgo_seq, a.po_no, a.code, b.desc_note, a.money_chk, a.ipgo_qty - isnull(a1.chul_qty,0.00) inv_qty, a.ipgo_price, round((a.ipgo_qty - isnull(a1.chul_qty,0.00)) * a.ipgo_price,2) inv_amt, ' ' note from mab030t a(nolock) left outer join ( select bal_date, bal_seq, bal_sub,sum(chul_qty) chul_qty from mab040t(nolock) group by bal_date, bal_seq, bal_sub) a1 on a.bal_date = a1.bal_date and a.bal_seq = a1.bal_seq and a.bal_sub = a1.bal_sub, mab010t b(nolock) where a.code = b.code and a.ipgo_qty - isnull(a1.chul_qty,0.00) > 0 and a.bal_date <= '" & cfechai & "' and a.po_no like '%' and b.desc_note like '%' order by a.code ")
end if
nitem=0
If not Rscompras.EOF Then
Rscompras.movefirst
'response.write("TO: 2")
Do While Not Rscompras.EOF
'if isnumeric(Rscompras("bal_qty")) then
' cbalqty=Rscompras("bal_qty")
'else
' cbalqty=0
'end if
%>
<%=Rscompras("po_no")%>
<%=Rscompras("code")%>
<%=Rscompras("desc_note")%>
<%=Rscompras("inv_qty")%>
<%=Rscompras("money_chK")%>
<%=Rscompras("ipgo_price")%>
<%=Rscompras("inv_amt")%>
<%=Rscompras("note")%>
<% 'if cint(Rscompras("ipgo_qty"))-cbalqty=0 then
lfondo="#DFFFDF"
'end if
'if cint(Rscompras("ipgo_qty"))-cbalqty>0 then
' lfondo="#FFDBB7"
'end if
'if cint(Rscompras("ipgo_qty"))-cbalqty<0 then
' lfondo="#FFDBDB"
'end if
%>
<%
nitem=nitem+1
rscompras.movenext
Loop
end if
Rscompras.close
end if
%>