%@ LANGUAGE = "VBScript" %>
<%
busca=request.QueryString("busca")
doc=request.QueryString("doc")
origen=request.QueryString("origen")
Date_ini=Request.Querystring("Date_ini")
Date_end=Request.Querystring("Date_end")
if isnull(date_ini) or isnull(date_end) or date_ini="" or date_end="" then
Date_ini=Request.Form("Date_ini")
Date_end=Request.Form("Date_end")
end if
lvende=Request.Form("cvende")
planta=Request.Form("planta")
criterio22=Request.Form("criterio22")
if criterio22="" then
xcriterio22=" Todos "
end if
if Date_ini="" or Date_ini=null then
Date_ini=date()-(day(date()))+1
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)
dia2=right("00"&day(Date_end),2)
mes2=right("00"&month(Date_end),2)
anno2=right("00"&year(Date_end),4)
'cfechaf=cdate((dia2+"/"+mes2+"/"+anno2))
cfechaf=cdbl(anno2&mes2&dia2)
''''''''''''''''''''''''''''''''''''''
strday = Right("00" & Day(Date_ini), 2)
strmonth = Right("00" & Month(Date_ini), 2)
stryear = Right("00" & Year(Date_ini), 4)
strday2 = Right("00" & Day(Date_end), 2)
strmonth2 = Right("00" & Month(Date_end), 2)
stryear2 = Right("00" & Year(Date_end), 4)
fechainicial = CDbl(stryear + strmonth + strday)
fechafinal = CDbl(stryear2 + strmonth2 + strday2)
''''''''''''''''''''''''''''''''''''''
%>
Report Packing Checkdatepicker demo
<%
header
%>
Packing by Date List
<%
if busca="ok" then
'''''''''''calcula
strday = Right("00" & Day(Date_ini), 2)
strmonth = Right("00" & Month(Date_ini), 2)
stryear = Right("00" & Year(Date_ini), 4)
strday2 = Right("00" & Day(Date_end), 2)
strmonth2 = Right("00" & Month(Date_end), 2)
stryear2 = Right("00" & Year(Date_end), 4)
fechainicial = CStr(stryear + strmonth + strday)
fechafinal = CStr(stryear2 + strmonth2 + strday2)
'response.write(fechainicial)&" FI "
' response.write(fechafinal)&" Ff "
Dim Rspack
Dim Sqlmir1, sqlmir2, sqlInvoice, sqlInvoice2
if origen="offset" or planta="2" then
set Rspack=dbsql2.execute("SELECT a.crp_id, a.goods_class, a.good_date, a.good_seq, a.sales_chk, Right(a.good_date,6)+'-'+a.good_seq AS good_no, a.pack_no, (select cust_nm from stb010t where cust_cd = a.cust_cd) AS cust_nm, a.oncar_qty, a.oncar_m2, a.oncar_amt, a.carry_amt, a.car_info, a.note1+' '+a.note2 AS nota FROM sal030t AS a WHERE ((a.crp_id)='10') AND ((a.good_date) >= '" & cfechai & "' And (a.good_date) <= '" & cfechaf & "') ORDER BY a.good_date, a.good_seq")
else
set Rspack=dbsql.execute("SELECT a.crp_id, a.goods_class, a.good_date, a.good_seq, a.sales_chk, Right(a.good_date,6)+'-'+a.good_seq AS good_no, a.pack_no, (select cust_nm from stb010t where cust_cd = a.cust_cd) AS cust_nm, a.oncar_qty, a.oncar_m2, a.oncar_amt, a.change_m2, a.carry_amt, a.car_info, (select code_nm from sta010t where major_cd = '9131' and minor_cd = a.carry_vendor)+' / '+(select code_nm from sta010t where major_cd = '9130' and minor_cd = a.carry_kind)+' / '+(select code_nm from sta010t where major_cd = '9140' and minor_cd = a.carry_area) AS carry_info, a.note1+' '+a.note2 AS nota FROM sal030t AS a WHERE ((a.crp_id)='10') AND ((a.good_date) >= '" & cfechai & "' And (a.good_date) <= '" & cfechaf & "') ORDER BY a.good_date, a.good_seq")
end if
'Set Rsmir1 = CurrentDb.OpenRecordset(Sqlmir1)
If Rspack.EOF And Rspack.BOF Then
ExisteUsuario = False
Msg = "No records exist for this date in Plant 1."
Style = vbDefaultButton2
Title = "Msg from System"
Help = ""
ctxt = 1000
'Response = MsgBox(Msg, Style, Title, Help, ctxt)
response.write ("Sin registros")
Else
''''''''''''''''''''''' actual year fin
%>
<%
if origen="offset" or planta="2" then
%>
Offset
<%else%>
Planta 1
<%end if%>
Packing
Good No
Packing No
Customer
Sales Qty
Sales M2
Sales Amt
Freight
Freight Info
Car Info
<%
Rspack.MoveFirst
Do While Not Rspack.EOF
%>
<% if Rspack("sales_chk")=0 then %>
No
<% else %>
SI
<%end if%>
<%=Rspack("good_no")%>
<%=Rspack("pack_no")%>
<%=Rspack("cust_nm")%>
<%=Rspack("oncar_qty")%>
<%=Rspack("oncar_m2")%>
<%=Rspack("oncar_amt")%>
<%=Rspack("carry_amt")%>
<%=Rspack("car_info")%>
<%
if origen="offset" or planta="2" then
%>
.
<%else%>
<%=Rspack("carry_info")%>
<%end if%>
<%
Rspack.MoveNext
Loop
End If
Rspack.Close
Set Rspack = Nothing
%>