%@ LANGUAGE = "VBScript" %> <% 'Session.Timeout = 120 busca=request.QueryString("busca") doc=request.QueryString("doc") origen=request.QueryString("origen") Date_ini=Request.Form("Date_ini") Date_end=Request.Form("Date_end") lvende=Request.Form("cvende") 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_ini=date() Date_end=date()+4 end if '''''''''''''''''''''''''''''''''''''' %>
<% '''''''''''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_ini+1), 2) 'strmonth2 = Right("00" & Month(Date_ini+1), 2) 'stryear2 = Right("00" & Year(Date_ini+1), 4) 'strday3 = Right("00" & Day(Date_ini+2), 2) 'strmonth3 = Right("00" & Month(Date_ini+2), 2) 'stryear3 = Right("00" & Year(Date_ini+2), 4) 'strday4 = Right("00" & Day(Date_ini+3), 2) 'strmonth4 = Right("00" & Month(Date_ini+3), 2) 'stryear4 = Right("00" & Year(Date_ini+3), 4) 'strday5 = Right("00" & Day(Date_ini+4), 2) 'strmonth5 = Right("00" & Month(Date_ini+4), 2) 'stryear5 = Right("00" & Year(Date_ini+4), 4) fechainicial = (stryear & strmonth & strday) 'fechafinal = (stryear5 & strmonth5 & strday5) lfec1= (stryear & strmonth & strday) 'lfec2= (stryear2 & strmonth2 & strday2) 'lfec3= (stryear3 & strmonth3 & strday3) 'lfec4= (stryear4 & strmonth4 & strday4) 'lfec5= (stryear5 & strmonth5 & strday5) 'response.write(fechainicial)&" FI " 'response.write(fechafinal)&" Ff " '************** cortos Dim Rscortos, Rsinven,rswip Dim Sqlinven1,sqlinven2,sqlwip set Rscortos=dbsql.execute("select a.ship_date, a.ship_no, left(a.ship_no,8) chul_date, a.ship_sub, (select cust_nm from stb010t(nolock) where cust_cd = a.cust_cd) cust_nm, a.good_nm, a.desc_1, a.po_no, a.chul_qty, isnull(right(b.good_date,6),'') good_date, b.good_seq, isnull(b.sales_qty,0) sales_qty, (select code_nm from sta010t(nolock) where major_cd = '9015' and minor_cd = a.chk_tit) chk_tit, a.iva_chk, a.lease_no from chul010t a(nolock) left outer join ( select mov_date, mov_seq, chul_sub, max(chul_date) good_date, max(chul_seq) good_seq, sum(chul_qty) sales_qty from sal012t group by mov_date, mov_seq, chul_sub) b on a.ship_no = b.mov_date + b.mov_seq and a.ship_sub = b.chul_sub where a.crp_id = '10' and a.ship_date>='"&fechainicial&"' and a.ship_date<='"&fechainicial&"' and a.cust_cd <> '20001' order by a.ship_date, a.ship_no, a.ship_sub") 'set Rsinven=dbsql.execute("select b.crp_id, b.cust_cd, (select cust_nm from stb010t(nolock) where cust_cd = b.cust_cd) customer, b.item, max(b.price) price, sum(a.in_qty1) - sum(a.out_qty1) inv_qty1, round(max(b.price) * (sum(a.in_qty1) - sum(a.out_qty1)),3) inv_amt1, sum(a.in_qty2) - sum(a.out_qty2) inv_qty2, round(max(b.price) * (sum(a.in_qty2) - sum(a.out_qty2)),3) inv_amt2, sum(a.in_qty3) - sum(a.out_qty3) inv_qty3, round(max(b.price) * (sum(a.in_qty3) - sum(a.out_qty3)),3) inv_amt3 " & _ '"from (select a.cust_cd, a.item, sum(isnull(a.in_qty1,0)) in_qty1, sum(isnull(a.out_qty1,0)) out_qty1, sum(isnull(a.in_qty2,0)) in_qty2, sum(isnull(a.out_qty2,0)) out_qty2, sum(isnull(a.in_qty3,0)) in_qty3, sum(isnull(a.out_qty3,0)) out_qty3 " & _ '"from ( select cust_cd, item, sum(qty) in_qty1 , 0 out_qty1, 0 in_qty2, 0 out_qty2, 0 in_qty3, 0 out_qty3 " & _ '"from inout_table where class = '1' and crp_id ='10' and local_cd = '1' group by cust_cd, item " & _ '"union select cust_cd, item, 0 in_qty1, sum(qty) out_qty1, 0 in_qty2 , 0 out_qty2, 0 in_qty3 , 0 out_qty3 " & _ '"from inout_table where class = '2' and crp_id ='10' and local_cd = '1' group by cust_cd, item " & _ '"union select cust_cd, item, 0 in_qty2 , 0 out_qty2, sum(qty) in_qty1 , 0 out_qty1, 0 in_qty3 , 0 out_qty3 " & _ '"from inout_table where class = '1' and crp_id ='10' and local_cd = '2' group by cust_cd, item " & _ '"union select cust_cd, item, 0 in_qty2 , 0 out_qty2, 0 in_qty1 , sum(qty) out_qty1, 0 in_qty3 , 0 out_qty3 " & _ '"from inout_table where class = '2' and crp_id ='10' and local_cd = '2' group by cust_cd, item " & _ '"union select cust_cd, item, 0 in_qty2 , 0 out_qty2, 0 in_qty3 , 0 out_qty3, sum(qty) in_qty1 , 0 out_qty1 " & _ '"from inout_table where class = '1' and crp_id ='10' and local_cd = '3' group by cust_cd, item " & _ '"union select cust_cd, item, 0 in_qty2 , 0 out_qty2, 0 in_qty3 , 0 out_qty3, 0 in_qty1 , sum(qty) out_qty3 " & _ '"from inout_table where class = '2' and crp_id ='10' and local_cd = '3' group by cust_cd, item ) a group by a.cust_cd, a.item) a, (select crp_id, cust_cd, item, max(price) price from inout_table where class = '1' group by crp_id, cust_cd, item ) b " & _ '"where a.cust_cd = b.cust_cd and a.item = b.item and b.crp_id ='10' and (a.in_qty1 - a.out_qty1 <> 0 or a.in_qty2 - a.out_qty2 <> 0 or a.in_qty3 - a.out_qty3 <> 0 ) group by b.crp_id, b.cust_cd, b.item order by b.crp_id, b.cust_cd, b.item") 'and a.cust_cd like :as_cust_cd and a.chk_tit like :as_chk_tit If Rscortos.EOF And Rscortos.BOF Then ExisteUsuario = False Msg = "No records exist for this date." Style = vbDefaultButton2 Title = "Msg from System" Help = "" ctxt = 1000 'Response = MsgBox(Msg, Style, Title, Help, ctxt) response.Write("No records exist for this date.") Else %>
| CUSTOMER | ITEM | PO NO. | Ship Date | Qty Req | Qty Load | Qty Inv | Balance | Note: |
| <%= Rscortos("cust_nm")%> | <%= Rscortos("good_nm")%> | <%= Rscortos("po_no")%> | <%= Rscortos("ship_date")%> | <%= Rscortos("chul_qty")%> | <%= Rscortos("sales_qty")%> | <%= linventario%> | <%= lbalance %> |