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

📄 default.asp

📁 进销存软件源代码
💻 ASP
字号:
<!-- #include virtual="/eB3KTransaction.asp" --><!-- #include virtual="/Server/ebo.asp" -->
<!-- #include virtual="/Server/common.asp" --><!-- #include virtual="/Server/cblib.asp" -->
<HTML><HEAD><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
td{font-size:12px};
.no {heigth=18;border-style:solid;border-left-width:0px;border-right-width:1px;border-top-width:0px;border-bottom-width:1px};
.no1 {heigth=18;border-style:solid;border-left-width:0px;border-right-width:1px;border-top-width:0px;border-bottom-width:1px}
</style><script src="/Client/ebComm.js"></script><title></title></HEAD>
<%
dim DateFrom, DateTo,szSQL
dim Subject, Subject1Subject=CStr(GetForm("Subject"))
Subject1=CStr(GetForm("Subject1"))

dim szAccountID,szSubject

szAccountID=" [vt].[AccountID]="& AccountID &"  AND [vt].[IsDeleted]=0"

if len(Subject)<>0 and len(Subject1)<>0 then
	szSubject=" AND [bis].[Code]>="& CLng(subject) &" AND [bis].[Code]<="& CLng(subject1)
end if 

if len(GetForm("DateFrom"))>0 then
	DateFrom=CDate(GetForm("DateFrom")) 
	datefrom = DateSerial(year(datefrom), month(datefrom), day(datefrom))
	datefrom = GetDateString(datefrom)
else
	err.Raise 10000,"DateFromCheck","起始日期未填!"
end if

if len(GetForm("DateTo"))>0 then 
	DateTo=CDate(GetForm("DateTo"))
else
	DateTo=Now()
end if

dateto = DateSerial(year(dateto), month(dateto), day(dateto))
dateto = DateAdd("d", 1, dateto)
dateto = GetDateString(dateto)

szSQL="SELECT [Order] AS [Order], [SearchCode2] AS [Title], [Code] AS [Code], [ID] AS [ID], [BillDate] AS [BillDate], [Memo] AS [Memo], [Mark] AS [Mark], [Debit] AS [Debit], [Credit] AS [Credit]" &_
"FROM (" &_
"	SELECT DISTINCT 0 AS [Order] , NULL AS [ID], 0 AS [Serial], [Code] AS [Code], [SearchCode2] AS [SearchCode2], NULL AS [BillDate], '期初余额' AS [Memo], [Mark] AS [Mark], SUM([Debit]) AS [Debit], SUM([Credit]) AS [Credit]" &_
"	FROM (" &_
"		SELECT DISTINCT [bis].[Code] AS [Code], [bis].[SearchCode2] AS [SearchCode2], [bis].[int1] AS [Mark], SUM([vl].[Quantity]*(1-[bis].[int1])) AS [Debit], SUM([vl].[Quantity]*[bis].[int1]) AS [Credit]" &_
"		FROM [bdFirstBalance] AS [vt], [bdFirstBalanceList] AS [vl], [biSubject] AS [bis]" &_ 
"		WHERE "& szAccountID & szSubject &" AND [vt].[ID]=[vl].[ID] AND [vl].[ProductID]=[bis].[ID]" &_
"		GROUP BY [bis].[Code], [bis].[SearchCode2], [bis].[int1]" &_
"		UNION" &_
"		SELECT DISTINCT [bis].[Code] AS [Code], [bis].[SearchCode2] AS [SearchCode2], [bis].[int1] AS [Mark], SUM([vl].[Currency1]) AS [Debit], SUM([vl].[Currency2]) AS [credit]" &_
"		FROM [bdVoucher] AS [vt], [bdVoucherList] AS [vl], [biSubject] AS [bis]" &_ 
"		WHERE "& szAccountID & szSubject &" AND [vt].[AuditID]<>0 AND [vt].[ID]=[vl].[ID] AND [vl].[ProductID]=[bis].[ID] AND [vt].[UpdateDate]<'"& DateFrom &"'"&_
"		GROUP BY [bis].[Code], [bis].[SearchCode2], [bis].[int1]" &_
"	) AS [nvFirst]" &_
"	GROUP BY [Code], [SearchCode2], [Mark]" &_
"	UNION" &_
"	SELECT 1 AS [Order], [vl].[ID] AS [ID], [vl].[Serial] AS [Serial], [bis].[Code] AS [Code], [bis].[SearchCode2] AS [SearchCode2], [vt].[BillDate] AS [BillDate], [vl].[BillListMemo] AS [Memo], [bis].[int1] AS [Mark], [vl].[Currency1] AS [Debit], [vl].[Currency2] AS [credit]" &_
"	FROM [bdVoucher] AS [vt], [bdVoucherList] AS [vl], [biSubject] AS [bis]" &_ 
"	WHERE "& szAccountID & szSubject &" AND [vt].[AuditID]<>0 AND [vt].[ID]=[vl].[ID] AND [vl].[ProductID]=[bis].[ID] AND [vt].[UpdateDate]>='"& DateFrom &"' AND [vt].[UpdateDate]<'"& DateTo &"'"&_
"	UNION" &_
"	SELECT DISTINCT 2 AS [Order], NULL AS [ID], 0 AS [Serial], [bis].[Code] AS [Code], [bis].[SearchCode2] AS [SearchCode2], NULL AS [BillDate], '本期发生额' AS [Memo], [bis].[int1] AS [Mark], SUM([vl].[Currency1]) AS [Debit], SUM([vl].[Currency2]) AS [credit]" &_
"	FROM [bdVoucher] AS [vt], [bdVoucherList] AS [vl], [biSubject] AS [bis]" &_ 
"	WHERE "& szAccountID & szSubject &" AND [vt].[AuditID]<>0 AND [vt].[ID]=[vl].[ID] AND [vl].[ProductID]=[bis].[ID] AND [vt].[UpdateDate]>='"& DateFrom &"' AND [vt].[UpdateDate]<'"& DateTo &"'"&_
"	GROUP BY [bis].[Code], [bis].[SearchCode2], [bis].[int1]" &_
"	UNION" &_
"	SELECT DISTINCT 3 AS [Order] , Null AS [ID], 0 AS [Serial], [Code] AS [Code], [SearchCode2] AS [SearchCode2], NULL AS [BillDate], '期末余额' AS [Memo], [Mark] AS [Mark], SUM([Debit]) AS [Debit], SUM([Credit]) AS [Credit]" &_
"	FROM (" &_
"		SELECT DISTINCT [bis].[Code] AS [Code], [bis].[SearchCode2] AS [SearchCode2], [bis].[int1] AS [Mark], SUM([vl].[Quantity]*(1-[bis].[int1])) AS [Debit], SUM([vl].[Quantity]*[bis].[int1]) AS [Credit]" &_
"		FROM [bdFirstBalance] AS [vt], [bdFirstBalanceList] AS [vl], [biSubject] AS [bis]" &_ 
"		WHERE "& szAccountID & szSubject &" AND [vt].[ID]=[vl].[ID] AND [vl].[ProductID]=[bis].[ID]" &_
"		GROUP BY [bis].[Code], [bis].[SearchCode2], [bis].[int1]" &_
"		UNION" &_
"		SELECT DISTINCT [bis].[Code] AS [Code], [bis].[SearchCode2] AS [SearchCode2], [bis].[int1] AS [Mark], SUM([vl].[Currency1]) AS [Debit], SUM([vl].[Currency2]) AS [credit]" &_
"		FROM [bdVoucher] AS [vt], [bdVoucherList] AS [vl], [biSubject] AS [bis]" &_ 
"		WHERE "& szAccountID & szSubject &" AND [vt].[AuditID]<>0 AND [vt].[ID]=[vl].[ID] AND [vl].[ProductID]=[bis].[ID] AND [vt].[UpdateDate]<'"& DateFrom &"'"&_
"		GROUP BY [bis].[Code], [bis].[SearchCode2], [bis].[int1]" &_
"		UNION" &_
"		SELECT DISTINCT [bis].[Code] AS [Code], [bis].[SearchCode2] AS [SearchCode2], [bis].[int1] AS [Mark], SUM([vl].[Currency1]) AS [Debit], SUM([vl].[Currency2]) AS [credit]" &_
"		FROM [bdVoucher] AS [vt], [bdVoucherList] AS [vl], [biSubject] AS [bis]" &_ 
"		WHERE "& szAccountID & szSubject &" AND [vt].[AuditID]<>0 AND [vt].[ID]=[vl].[ID] AND [vl].[ProductID]=[bis].[ID] AND [vt].[UpdateDate]>='"& DateFrom &"' AND [vt].[UpdateDate]<'"& DateTo &"'"&_
"		GROUP BY [bis].[Code], [bis].[SearchCode2], [bis].[int1]" &_
"	) AS [nvEnd]" &_
"	GROUP BY [Code], [SearchCode2], [Mark]" &_
" ) AS [nv]" &_
" ORDER BY [Code], [Order], [BillDate]"
%>
<script>
function getTableTitle(code,title){
	document.write ('<table width=100% height=100% border=0><tr><td>');
	document.write ('<p align=center><font size=5><b>会 计 帐 本</b></font></p>');
	document.write ('<div align=right>科目:<u>'+code+'</u>&nbsp;'+title+'</div>');
	document.write ('<table width="100%" border=0 cellspacing=0 cellpadding=2 style="border-style:solid; border-color:#000000;border-left-width:1px;border-right-width:0px;border-top-width:1px;border-bottom-width:0px">');
	document.write ('<tr><td class=no>填写时间</td><td class=no>凭证号</td><td class=no>摘要</td><td class=no>余额</td><td class=no>借方</td><td class=no>贷方</td></tr>');
}

function getTableBody(time,iCode,memo,mark,debit,credit){
	var fun;
	if (mark==0)
		fun='借方';
	else if (mark==1)
		fun='贷方';
	else
		fun='&nbsp;';
	if (memo=='期末余额'){
		if (!mark){
			debit-=credit;
			credit=0;
		}
		if (mark){
			credit-=debit;
			debit=0;
		}
	}
	if (time=='') time='&nbsp';
	if (iCode=='') iCode='&nbsp';
	if (memo=='') memo='&nbsp';
	document.write ('<tr><td class=no>'+time+'</td><td class=no>'+iCode+'</td><td class=no>'+memo+'</td><td class=no>'+fun+'</td><td class=no>'+debit+'</td><td class=no>'+credit+'</td></tr>');
}

function getTableBodySpace(n){
	var i;
	for (i=0;i<n;i++){
		document.write ('<tr><td class=no1>&nbsp;</td><td class=no1>&nbsp;</td><td class=no1>&nbsp;</td><td class=no1>&nbsp;</td><td class=no1>&nbsp;</td><td class=no>&nbsp;</td></tr>');
	}
}

function getTableFoot(nowPage,iPage){
	document.write ('</table>');
	document.write ('<br><table width=100%><tr><td width=20%>主管</td><td width=20%>会计</td><td width=20%>复核</td><td width=20%>记帐</td><td width=20% align=right>第'+nowPage+'页  共'+iPage+'页</td></tr></table><br>');
	document.write ('</td></tr></table>');
}

function start(v){
	try{printWB.ExecWB(v,1);}catch(e){}
	window.close();
}

var view=<%=GetForm("view")%>;
</script><object id="printWB" style="display:none" width=0 height=0 classid="clsid:8856F961-340A-11D0-A96B-00C04FD705A2" VIEWASTEXT></object>
<BODY topmargin=0 leftmargin=0 onload="start((view+6))">
<%
Response.write "<script>" & VBCrLf

dim iPagenew,iPageOld,iPageMax,rsCount,subjectCode,iPageCount
dim rs
iPageNew=1
iPageMax=30

function printMain(rsOld,rsNew,pageMax,rs)
	dim i,j,page,iPageCount,iCount
	rs.Move (rsOld-1),1
	page=rsNew-rsOld
	if (page mod pageMax)=0 then
		iPageCount=CInt(page/pageMax)
	else
		iPageCount=CInt(fix(page/pageMax)+1)
	end if
	for i=1 to iPageCount
		Response.write "getTableTitle('"&rs("code")&"','"&rs("title")&"');" & VBCrLf
		iCount=((i-1)*pageMax+1)
		for j=iCount to i*pageMax
			if j<=page then
				Response.write "getTableBody('"&JScriptEncode(rs("BillDate"))&"','"&JScriptEncode(rs("ID"))&"','"&JScriptEncode(rs("Memo"))&"',"&JScriptEncode(rs("mark"))&","&JScriptEncode(rs("debit"))&","&JScriptEncode(rs("credit"))&");" & VBCrLf
				rs.MoveNext
			else
				Response.write "getTableBodySpace("& JScriptEncode(i*pageMax-j)+1 &")" & VBCrLf
				j=i*pageMax
			end if
		next
		Response.write "getTableFoot("&i&","&iPageCount&");" & VBCrLf
	next
end function


Set rs = Server.CreateObject("ADODB.RecordSet")rs.open szSQL,Conn,1,1
if rs.RecordCount>0 then subjectCode=rs("Code")
do while not rs.EOF
	if rs("Code")=subjectCode then
		rs.MoveNext
	else
		subjectCode=rs("Code")
		iPageOld=iPageNew
		iPageNew=rs.AbsolutePosition
		printMain ipageOld,iPageNew,iPageMax,rs
		rs.Move(iPageNew-1),1
	end if
loop
set rs=nothing
Response.write "</script>"
%></BODY><%=szSQL%>
</HTML>

⌨️ 快捷键说明

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