%@ LANGUAGE = "VBScript" %>
<%
busca=request.QueryString("busca")
doc=request.QueryString("doc")
origen=request.QueryString("origen")
invoice=Request.Form("invoice")
Date_ini=Request.Form("Date_ini")
Date_end=Request.Form("Date_end")
lvende=Request.Form("cvende")
laccion=Request.Form("accion")
criterio22=Request.Form("criterio22")
if criterio22="" then
xcriterio22=" Todos "
end if
xday = Right("00" & Day(Date), 2)
xmonth = Right("00" & Month(Date), 2)
xyear = Right("00" & Year(Date), 4)
xdate=xyear&xmonth&xday
Dim Rsfore0
Dim Sqlfore0
set Rsfore0=dbsql3.execute("SELECT * FROM forecast WHERE id=49")
'************** Transfer
xday2 = Right("00" & Rsfore0("month"), 2)
xmonth2 = Right("00" & Rsfore0("forecast"), 2)
xyear2 = Right("00" & Rsfore0("year"), 4)
xdate2=xyear2&xmonth2&xday2
''''''''''''''''''''''''''''''''''''''
If xdate>xdate2 Then
response.write" General Error. Call Support "
response.write (ErrorNo1)
mensaje1=ErrorNo1
else
if Date_ini="" or Date_ini=null then
Date_ini=date()
end if
Date_end=date()
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)
''''''''''''''''''''''''''''''''''''''
%>
Reprint Packing
datepicker demo
<%
header
if busca="" or busca=null then
origen=doc
end if
%>
Reprint Packing
<%
if busca="ok" then
sla="/"
cero1="00"
cero2="0000"
'''''''''''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 "
layer=weekday(date()-1)
If layer = 1 Then
lfecinicial=date()-3
lfecfinal=date()-3
else
if layer=7 then
lfecinicial=date()-2
lfecfinal=date()-2
else
lfecinicial=date()-1
lfecfinal=date()-1
end if
end if
strdaybook = Right("00" & Day(lfecinicial), 2)
strmonthbook = Right("00" & Month(lfecinicial), 2)
stryearbook = Right("00" & Year(lfecinicial), 4)
lfechabook1 = CStr(stryearbook + strmonthbook + strdaybook)
lfechabook2 = CStr(stryearbook + strmonthbook + strdaybook)
If lvende = "" Then
vendedor_i = "00000"
vendedor_f = "99999"
Else
if cdbl(lvende)=0 then
vendedor_i = "00000"
vendedor_f = "99999"
else
vendedor_i = lvende
vendedor_f = lvende
end if
End If
Dim Rsinven1, Rsdetalle,RsInvoice,RsInvoice2
Dim Sqlmir1, sqlmir2, sqlInvoice, sqlInvoice2
linvoice=right("00"&invoice,4)
'response.write("fac "&linvoice)
'response.write(" fec "&fechainicial)
if laccion="2" then
set Rsinven1=dbsql2.execute("select a.good_date, a.good_seq, right(a.good_date,4) + '-' + a.good_seq chul_no, (select cust_nm from stb010t(nolock) where cust_cd = max(a.cust_cd)) cust_nm, case max(a.nap_cd) when '1' then '' else (select nap_nm from stb030t(nolock) where crp_id = '10' and cust_cd = max(a.cust_cd) and nap_cd = max(a.nap_cd)) end nap_nm, max(a.car_info) note, sum(a.oncar_qty) oncar_qty, sum(a.oncar_amt) oncar_amt, max(pack_no) pack_no, (select code_nm from sta010t where major_cd = '9130' and minor_cd = max(a.carry_kind))+''+max(a.car_info) carry_kind, max(chk_tit) chk_tit, (select code_nm from sta010t(nolock) where major_cd = '9015' and minor_cd = max(chk_tit)) chk_tit_nm, max(prt_chk) prt_chk from sal030t a(nolock) where (right('00'+a.pack_no,4) like '" & linvoice & "') group by a.good_date, a.good_seq order by a.good_date desc, a.good_seq")
else
set Rsinven1=dbsql2.execute("select a.good_date, a.good_seq, right(a.good_date,4) + '-' + a.good_seq chul_no, (select cust_nm from stb010t(nolock) where cust_cd = max(a.cust_cd)) cust_nm, case max(a.nap_cd) when '1' then '' else (select nap_nm from stb030t(nolock) where crp_id = '10' and cust_cd = max(a.cust_cd) and nap_cd = max(a.nap_cd)) end nap_nm, max(a.car_info) note, sum(a.oncar_qty) oncar_qty, sum(a.oncar_amt) oncar_amt, max(pack_no) pack_no, (select code_nm from sta010t where major_cd = '9130' and minor_cd = max(a.carry_kind))+''+max(a.car_info) carry_kind, max(chk_tit) chk_tit, (select code_nm from sta010t(nolock) where major_cd = '9015' and minor_cd = max(chk_tit)) chk_tit_nm, max(prt_chk) prt_chk from sal030t a(nolock) where (a.good_date='" & fechainicial & "') group by a.good_date, a.good_seq order by a.good_date desc, a.good_seq")
end if
'and a.good_date between :as_fm_date and :as_to_date and a.pack_no like '" & invoice & "'
'a.good_date='20150515'
%>
| Date: |
Packing: |
Customer: |
QTY: |
Amount: |
Invoice: |
Print: |
<%
'Rsinven1.MoveFirst
Do While Not Rsinven1.EOF
%>
| <%=Rsinven1("good_date")%> |
<%=Rsinven1("chul_no")%> |
<%=Rsinven1("cust_nm")%> |
<%=Rsinven1("oncar_qty")%> |
<%=Rsinven1("oncar_amt")%> |
<%=Rsinven1("pack_no")%> |
" target="_blank">
|
<%
Rsinven1.MoveNext
Loop
Rsinven1.Close
Set Rsinven1 = Nothing
'**************end inventory
%>
<%
end if
%>
<%
End If
Rsfore0.Close
Set Rsfore0 = Nothing
'''''''''''''
%>