<%@ LANGUAGE = "VBScript" %> <%Response.Buffer = False%> <% busca=request.QueryString("busca") doc=request.QueryString("doc") npacking=request.QueryString("npacking") %> Print Packing datepicker demo
   
<% if not isnull(npacking) then Dim Rsinven1, Rsdetalle,RsInvoice,RsInvoice2 Dim Sqlmir1, sqlmir2, sqlInvoice, sqlInvoice2 linvoice=right("00"&invoice,5) 'response.write("fac "&linvoice) 'response.write(" fec "&fechainicial) 'set Rsinven1=dbsql.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.pack_no='" & npacking & "') group by a.good_date, a.good_seq order by a.good_date desc, a.good_seq") Set Rsinven1 = Server.CreateObject("ADODB.RecordSet") Rsinven1.CursorType = adOpenDynamic set Rsinven1=dbsql.execute("SELECT sal030t.pack_no, sal030t.oncar_qty as totpiezas, sal030t.oncar_amt as importe, sal020t.*, stb010t.cust_nm, stb010t.addr_1, stb010t.addr_2, stb010t.addr_3, stb010t.tel_no, stb010t.fax_no, stb030t.nap_nm, stb030t.addr_1 AS dir1, stb030t.addr_2 as dir2, stb030t.addr_3 as dir3, stb030t.tel_no as telefono, stb030t.fax_no as faxnum, sta010t.code_nm, (select max(note_5) from sal012t a(nolock) left outer join ( select po_no, count(*) po_cnt from sal020t group by po_no) a1 on a.po_no = a1.po_no where a.po_no = sal020t.po_no ) as note5 " & _ "FROM sal020t LEFT JOIN (((sal030t LEFT JOIN stb010t ON sal030t.cust_cd = stb010t.cust_cd) LEFT JOIN stb030t ON (sal030t.nap_cd = stb030t.nap_cd) AND (sal030t.crp_id = stb030t.crp_id) AND (sal030t.cust_cd = stb030t.cust_cd)) LEFT JOIN sta010t ON sal030t.carry_kind = sta010t.minor_cd) ON sal020t.good_date = sal030t.good_date and (sal020t.goods_class = sal030t.goods_class) AND (sal020t.good_seq = sal030t.good_seq)" & _ "WHERE (((sal030t.pack_no)='" & npacking & "') AND ((sta010t.major_cd)='9130')) order by sal020t.chul_sub, sal020t.po_no, sal020t.good_nm, sal020t.desc_1") 'a.chul_date, a.chul_seq, a.chul_sub, a.po_no, b.cust_cd, c.good_cd, b.item 'sal020t.pack_no = sal030t.pack_no 'and a.good_date between :as_fm_date and :as_to_date and a.pack_no like '" & invoice & "' 'a.good_date='20150515' lyear=mid(Rsinven1("good_date"),1,4) lmonth=mid(Rsinven1("good_date"),5,2) lday=mid(Rsinven1("good_date"),7,2) ldate=lmonth+"/"+lday+"/"+lyear %> <% end if %>