⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 buildfilegoods.inc

📁 物业管理和办公自动化系统
💻 INC
字号:
<%
'###############################################################################
'#
'#	文件名		: buildfilegoods.inc
'#	
'#  创建人		: yaoxiaohui
'#  日期			: 2002-11-06
'#
'#	修改历史		: ****年**月**日 ****** 
'#  修改内容		: *********************************
'#
'#	功能描述		: 生成Excel文件函数文件
'#  版   本		: v1.0
'#
'#	Copyright(c) 2001-2002 上海阿尔卡特网络支援系统有限公司
'#
'###############################################################################
'*******************************************************************************
Function SheetTop()
    SheetTop = _
		"<table cellspacing=0 cellpadding=3 width=""600"" align=center border=0>" & vbLF & _
		"  <tr height=50 bgcolor=white>" & vbLF & _
		"	<td colspan=9 align=center style=""color:black;font-size:16pt;font-weight:600;"">" & sDate &"仓库报表</td>" & vbLF & _
		"  </tr>" & vbLF & _

		"  <tr height=25 bgcolor=white>" & vbLF & _
		"	<td width=70 colspan=1 align=left>&nbsp;类别:</td>" & vbLF & _
		"	<td colspan=8 align=left>&nbsp;" & sGoodsDesc & "</td>" & _
		"  </tr>" & vbLF & _
		
		"  <tr height=25 bgcolor=white>" & vbLF & _
		"	<td colspan=1 width=70 align=left>&nbsp;验收仓库:</td>" & vbLF & _
		"	<td colspan=2 align=left>&nbsp;" & sDepotName & "</td>" & _
		"	<td colspan=1 align=left>&nbsp;仓库编号:</td>" & vbLF & _
		"	<td colspan=2 align=left>&nbsp;" & pDepotID & "</td>" & _
		"	<td colspan=1 align=left>&nbsp;日期:</td>" & vbLF & _
		"	<td colspan=2 align=left>&nbsp;" & pOpdate & "</td>" & _
		"  </tr>" & vbLF & _	
		"</table>" & vbLF
End Function
'*******************************************************************************
Function TableHeader()
	dim sTemp
	if pStyle = "月份" then
	sTemp	= _
		"<td class=tdHead align=center>上月结存</td>" & _
		"<td class=tdHead align=center>本月入库</td>" & _
		"<td class=tdHead align=center>本月出库</td>" & _
		"<td class=tdHead align=center>本月结存</td>"
	else
	sTemp	= _
		"<td class=tdHead align=center>上年结存</td>" & _
		"<td class=tdHead align=center>本年入库</td>" & _
		"<td class=tdHead align=center>本年出库</td>" & _
		"<td class=tdHead align=center>本年结存</td>"
	end if
	
	TableHeader = _
		"<table cellspacing=0 cellpadding=0 width=600 align=center border=1>" & vbLF & _
		"<tr style=""display:none"">" & vbLF & _
		"	<td width=70>这一行仅用于控制表格的宽度</td>" & vbLF & _
		"	<td width=80></td>" & vbLF & _
		"	<td width=70></td>" & vbLF & _
		"	<td width=40></td>" & vbLF & _
		"	<td width=60></td>" & vbLF & _
		"	<td width=60></td>" & vbLF & _
		"	<td width=60></td>" & vbLF & _
		"	<td width=60></td>" & vbLF & _
		"	<td width=100></td></tr>" & vbLF & _
		"<tr height=25 bgcolor=white>" & _
		"<td class=tdHead align=center>序号</td>" & _
		"<td class=tdHead align=center>物品名称</td>" & _
		"<td class=tdHead align=center>型号规格</td>" & _
		"<td class=tdHead align=center>单位</td>" & _
		sTemp & _
		"<td class=tdHead align=center>备注</td>" & _
		"</tr>"
End Function
'*******************************************************************************
Function TableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
	dim sTemp	: sTemp = ""	' 临时字符串变量
	dim j						' 临时循环变量

	'------------------------------------
	' 分页所需的变量定义
	'------------------------------------
	Dim iCounter		: iCounter = 1
	Dim iPrevPage, iNextPage
	Dim rowCount        : rowCount = 0
	'------------------------------------
	' 获取数据库连接
	'------------------------------------
	dim rs	: set rs = Openrs(conn,sSQL)
	dim rs1

	dim sGoodsID, sGoodsName, sModel, sUnit, sQuantity
	dim sSheetID, sQuanIn, sQuanOut, sSQuan, sOptype, sQuanIn1, sQuanOut1

	''response.write sSQL : response.end
	
	' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
	
	iRecordsPerPage = iTotalRecords
	
	while not rs.EOF
		rowCount = rowCount + 1
		sGoodsID			    = rs("goods_id")
		sGoodsName		    	= rs("goods_name")
		sModel			        = rs("model")
		sUnit		        	= rs("unit")
		sQuantity	    		= rs("quantity")
		sQuanIn		= 0
		sQuanOut	= 0
		sQuanIn1	= 0
		sQuanOut1	= 0
		sSQuan		= 0
		
		sql = "select t1.sheet_id,t1.quantity from t_stock_detail t1" & _
		" left join t_stock_master t2 on t1.sheet_id = t2.sheet_id" & _
		" where t1.goods_id =" & ToSQL(sGoodsID,"number") & _
		" and t2.sheet_status <> 0" & _
		" and t1.opdate >= " & ToSQL(pOpdate1, "Text") & " and t1.opdate < " & ToSQL(pOpdate2, "Text")
		set rs1 = Openrs(conn,sql)
		while not rs1.EOF
			sSheetID	= GetValue(rs1,"sheet_id")
			sSQuan		= GetValue(rs1,"quantity")
			sql = "select optype from t_stock_master where sheet_id =" & ToSQL(sSheetID,"number")
			sOptype		= DLookUp(conn,sql)
			if sOptype = "1" or sOptype = "2" or sOptype = "3" or sOptype = "9" then
					sQuanIn		= sQuanIn + sSQuan
			else
					sQuanOut	= sQuanOut + sSQuan
			end if
			rs1.movenext
		wend
		rs1.Close()
		set rs1 = nothing
		'response.write sQuanIn & "in<br>" & sQuanOut & "out<br>" : response.end
		
		sSQuan	= 0
		sql = "select t1.sheet_id,t1.quantity from t_stock_detail t1" & _
		" left join t_stock_master t2 on t1.sheet_id = t2.sheet_id" & _
		" where t1.goods_id =" & ToSQL(sGoodsID,"number") & _
		" and t2.sheet_status <> 0" & _
		" and t1.opdate >= " & ToSQL(pOpdate1, "Text")
		set rs1 = Openrs(conn,sql)
		while not rs1.EOF
			sSheetID	= GetValue(rs1,"sheet_id")
			sSQuan		= GetValue(rs1,"quantity")
			sql = "select optype from t_stock_master where sheet_id =" & ToSQL(sSheetID,"number")
			sOptype		= DLookUp(conn,sql)
			if sOptype = "1" or sOptype = "2" or sOptype = "3" or sOptype = "9" then
					sQuanIn1	= sQuanIn1 + sSQuan
			else
					sQuanOut1	= sQuanOut1 + sSQuan
			end if
			rs1.movenext
		wend
		rs1.Close()
		set rs1 = nothing

		sTemp = sTemp & "<tr bgcolor=white height=25>" & _
				"<td class=tdlist align=center nowrap>&nbsp;" & rowCount & "</td>" & _
				"<td class=tdlist align=center nowrap>&nbsp;" & sGoodsName & "</td>" & _
				"<td class=tdlist align=center nowrap>&nbsp;" & sModel & "</td>" & _
				"<td class=tdlist align=center nowrap>&nbsp;" & sUnit & "</td>" & _
				"<td class=tdlist align=center nowrap>&nbsp;" & (sQuantity + sQuanOut1 - sQuanIn1) & "</td>" & _
				"<td class=tdlist align=center nowrap>&nbsp;" & sQuanIn & "</td>" & _
				"<td class=tdlist align=center nowrap>&nbsp;" & sQuanOut & "</td>" & _
				"<td class=tdlist align=center nowrap>&nbsp;" & (sQuantity + sQuanOut1 - sQuanIn1 + sQuanIn - sQuanOut) &"</td>" & _
				"<td class=tdlist align=center nowrap>&nbsp;</td>" & _
				"</tr>"
		iCounter = iCounter + 1
		rs.movenext
	wend
	rs.Close()
	set rs = nothing

	TableRecords = _
				sTemp & _
				"</table>"
End Function
'*******************************************************************************
Function SheetMasterDown
	SheetMasterDown = _	
		"<table cellspacing=0 cellpadding=3 width=""600"" align=center border=0>" & vbLF & _
		"  <tr height=30 bgcolor=white>" & vbLF & _
		"	<td colspan=1 align=left width=70>&nbsp;仓库主管:</td>" & vbLF & _
		"	<td colspan=5 align=left>&nbsp;</td>" & _
		"	<td colspan=1 align=left>&nbsp;保管员:</td>" & vbLF & _
		"	<td colspan=2 align=left>&nbsp;</td>" & _
		"  </tr>" & vbLF & _
		"  <tr height=30 bgcolor=white>" & vbLF & _
		"	<td colspan=9 align=right>仲量联行上海信息大楼物业管理中心&nbsp;&nbsp;</td>" & vbLF & _
		"  </tr>" & vbLF & _		
		"</table>" & vbLF
End Function
'*******************************************************************************
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -