<%if session("sadminLoggedIn")<>"yes" then Response.Redirect "http://intramop.nic.in" end if %> request items Saving <% set con=server.createobject("ADODB.connection") scon=connectionstring set rs=server.CreateObject("ADODB.Recordset") dim tmpitemcode(100),tmpqty(100),tmpamount(100),i,j,maxrec maxrec=request.form("maxrec") maxrec=cint(maxrec) j=1 billno=Request.Form("billno") billdate=Request.Form("billdate") pur_from=right(Request.Form("pur_from"),3) totalamount=Request.Form("totalamount") do while j<=maxrec fitem="" fitem="itemname"&j fqty="" fqty="qty"&j famount="" famount="amount"&j tmpitemcode(j)=right(Request.Form(fitem),3) tmpqty(j)=Request.Form(fqty) tmpamount(j)=Request.Form(famount) j=j+1 loop con.Open scon j=1 do while j<=maxrec if tmpitemcode(j)<>"" then sql="update stock set qty_left= qty_left+"&tmpqty(j)&" where ITEM_CODE='"&tmpitemcode(j)&"' " sqlreceipt="insert into receipt (rdate,bill_no,item_code,rqty,amount,pur_from) values (convert(smalldatetime,'"&billdate&"',103),'"&billno&"','"&tmpitemcode(j)&"',"&tmpqty(j)&","&tmpamount(j)&",'"&pur_from&"' )" con.Execute sql con.Execute sqlreceipt end if j=j+1 loop sqlmaster="insert into bill_master (rdate,bill_no,gtotal,pur_from) values (convert(smalldatetime,'"&billdate&"',103),'"&billno&"','"&totalamount&"','"&pur_from&"')" con.Execute sqlmaster con.close %>
Stock Updtated and bill receipt,bill master inserted
Back to Menu