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

📄 default.asp

📁 进销存软件源代码
💻 ASP
字号:
<!-- #include virtual="/eB3KTransaction.asp" -->
<!-- #include virtual="/Server/ebo.asp" -->
<!-- #include virtual="/Server/common.asp" -->
<!-- #include virtual="/Server/cblib.asp" -->
<!-- #include virtual="/Server/SqlReport.asp" -->
<!-- #include virtual="/Server/ReportRes.asp" -->
<!-- #include virtual="/Server/rawdata.asp" -->
<HTML><HEAD><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><LINK REL=stylesheet HREF="/Client/All.css" TYPE="text/css"><script src="/Client/ebComm.js"></script><title></title></HEAD>
<script src="/client/ebo.js"></script>
<script src="/client/Request.js"></script>
<script src="/client/IClient.js"></script>
<script src="/client/grid.js"></script>
<script src="/client/cblib.js"></script>
<script src="/client/IServer.js"></script>
<%
dim szSQL,szTableName,DateFrom, DateTo,subject,CorpCheck
dim SubjectNameSubjectName=CStr(GetForm("SubjectText"))
corpCheck=GetForm("corpCheck")

dim szAccountID,szSubject

if len(GetForm("subject"))>0 then subject=CStr(GetForm("subject")) else err.Raise 10000,"SubjectCheck","会计科目未填!"

szAccountID=" [vt].[AccountID]="& AccountID &"  AND [vt].[IsDeleted]=0"
if corpCheck=1 then szAccountID=" ([vt].[AccountID]=(SELECT RootID FROM [biCorperation] WHERE ID=" & AccountID & ") OR [vt].[AccountID]="& AccountID &") AND [vt].[IsDeleted]=0"
szSubject=" AND [bis].[ID]="& subject

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"))
	dateto = DateSerial(year(dateto), month(dateto), day(dateto))
	dateto = DateAdd("d", 1, dateto)
	dateto = GetDateString(dateto)
else
	DateTo=Now()
	dateto = DateSerial(year(dateto), month(dateto), day(dateto))
	dateto = DateAdd("d", 1, dateto)
	dateto = GetDateString(dateto)
end if


szSQL="SELECT [ID] AS [凭证号], [BillDate] AS [凭证填写时间], [Memo] AS [摘要], [Mark] AS [余额], [Debit] AS [借方], [Credit] AS [贷方]" &_
"FROM (" &_
"	SELECT DISTINCT 0 AS [Order] , NULL AS [ID], 0 AS [Serial], [Code] AS [Code], [Title] AS [Title], NULL AS [BillDate], '期初余额' AS [Memo], [Mark] AS [Mark], SUM([Debit]) AS [Debit], SUM([Credit]) AS [Credit]" &_
"	FROM (" &_
"		SELECT DISTINCT [bis].[Code] AS [Code], [bis].[Title] AS [Title], [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].[Title], [bis].[int1]" &_
"		UNION" &_
"		SELECT DISTINCT [bis].[Code] AS [Code], [bis].[Title] AS [Title], [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].[Title], [bis].[int1]" &_
"	) AS [nvFirst]" &_
"	GROUP BY [Code], [Title], [Mark]" &_
"	UNION" &_
"	SELECT 1 AS [Order], [vl].[ID] AS [ID], [vl].[Serial] AS [Serial], [bis].[Code] AS [Code], [bis].[Title] AS [Title], [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].[Title] AS [Title], 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].[Title], [bis].[int1]" &_
"	UNION" &_
"	SELECT DISTINCT 3 AS [Order] , Null AS [ID], 0 AS [Serial], [Code] AS [Code], [Title] AS [Title], NULL AS [BillDate], '期末余额' AS [Memo], [Mark] AS [Mark], SUM([Debit]) AS [Debit], SUM([Credit]) AS [Credit]" &_
"	FROM (" &_
"		SELECT DISTINCT [bis].[Code] AS [Code], [bis].[Title] AS [Title], [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].[Title], [bis].[int1]" &_
"		UNION" &_
"		SELECT DISTINCT [bis].[Code] AS [Code], [bis].[Title] AS [Title], [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].[Title], [bis].[int1]" &_
"		UNION" &_
"		SELECT DISTINCT [bis].[Code] AS [Code], [bis].[Title] AS [Title], [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].[Title], [bis].[int1]" &_
"	) AS [nvEnd]" &_
"	GROUP BY [Code], [Title], [Mark]" &_
" ) AS [nv]" &_
" ORDER BY [Code], [Order], [BillDate]"

eboReg 1, "gridCols", "iCols", "", "cbLocalVariable"

eboReg 2, "gridTilte_", "szTitle", "", "cbLocalVariable"

dim iCols, szTitle, szValue

dim i,rs
Response.Write "<script>" & VBCrLf
Set rs = Server.CreateObject("ADODB.RecordSet")rs.open szSQL,Conn,1,1
IData2d 0,1iCols=rs.Fields.Count
eboGet 1, nothing, nothingIData2d 1,2for i=0 to rs.Fields.Count-1
	szTitle=rs.Fields.Item(i).Name	eboGet 2, nothing, nothing
next
rawGet rsSet rs = NothingResponse.Write "</script>" & VBCrLf
%>
<LINK REL=stylesheet HREF="/Client/All.css" TYPE="text/css"><script src="/Client/ebComm.js"></script><BODY>
<table>
<tr><td><div align="center"><font size=5><b><u>查 看 明 细 帐</u></b></font></div></td></tr>
<tr><td><div>科目名称:<%=SubjectName%><br>会计期间:<%=FormatDatetime(DateFrom,1)%>-<%=FormatDatetime(DateAdd("d",-1,DateTo),1)%></div></td></tr>
<tr><td><div id=SelectArea></div></td></tr>
</table><center>
<div id=bdPanel width="100" height="60" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; DISPLAY: none; POSITION: absolute">
<div id=bdPanelButton><input type=button value="查看" onclick="panelSee()"></div>
</div></center></BODY>
<script>
function panelShow(idCtrl,idPanel,idChild,dir){
	var coll=idPanel.all.tags('div');
	for (i=0;i<coll.length;i++){
		if (coll(i)==idChild)
			coll(i).style.display='block';
		else
			coll(i).style.display='none';
	}
	idPanel.style.display='block';
	var rect=idCtrl.getBoundingClientRect();
	var rectPanel=idPanel.getBoundingClientRect();
	switch(dir){
		case 1:
			idPanel.style.left=rect.right-(rectPanel.right-rectPanel.left);
			idPanel.style.top=idCtrl.getBoundingClientRect().top;
			break;
		case 2:
			idPanel.style.left=rect.left;
			idPanel.style.top=rect.bottom;
			break;
		case 3:
			idPanel.style.left=rect.right-rectPanel.right-rectPanel.left;
			idPanel.style.top=rect.bottom;
			break;
		default:
			idPanel.style.left=rect.left;
			idPanel.style.top=rect.top;
	}
	idPanel.style.left=parseInt(idPanel.style.left)+document.body.scrollLeft;
	idPanel.style.top=parseInt(idPanel.style.top)+document.body.scrollTop;
}
function ecbDetail(eo,szEvent,x,y){
iPanelx=gDetail.showpos+x;
iPanely=y;
if (iPanelx<gDetail.data.length){
	if (szEvent=='MOUSECLICK'){	
	if (bdPanel.style.display=='block') return panelHide();
	iPanelx=eo.showpos+x;
		detailName=eo;
		panelShow(eo.grid.rows(x+1).cells(y+1),bdPanel,bdPanelButton,1);
		return true;	
	}
}}
function panelHide(){bdPanel.style.display='none';}
function cbSeeLoad(ifrid, fun, data){
	if (fun=='start')
		ifrid.document.title=getMainTitle();
}
function panelSee(){
panelHide();
	if (gDetail.data[iPanelx][0].length!=0){		
		var newindow=window.open('', 'yyz','toolbar=no,directories=no menubar=no,scrollbars=yes,resizable=yes,location=no,width=780,height=550,left=0,top=44','_blank');
		 IServer(newindow,'AccountList.Examine','ID='+gDetail.data[iPanelx][0],cbSeeLoad);
	 }
}


function getGridWidth(titleText){
	switch(titleText){
		case '余额':
			return 40;
			break;
		case '凭证号':
			return 60;
			break;
		case '单据填写时间':
			return 100;
			break;
		case '摘要':
			return 280;
			break;
		default:
			return 120;
	}
}

function getGridNumeric(titleText){
	switch(titleText){
		case '借方':
			return 1;
			break;		
		case '贷方':
			return 1;
			break;
		default:
			return 0;
	}
}

function getGridAlign(titleText){
	switch(titleText){
		case '余额':
			return 'center';
			break;
		case '借方':
			return 'right';
			break;
		case '贷方':
			return 'right';
			break;
		default:
			return '';
	}
}

function getGridTotal(titleText){
	switch(titleText){

		default:
			return 0;
	}
}

function makeGrid(indata){
	var gridCols=parseInt(indata.item('gridCols'));
	var gDetail = new ZYDGRID(new ZYDGRIDFORIEBUG(),SelectArea,20,gridCols,'100%','',1,testUndefine,IRAWDataEnd(),ecbDetail);
	gDetail.title[0].text='№';
	for (var i=0;i<gridCols;i++){
		gDetail.title[i+1].text=indata.item('gridTilte_'+i);
		gDetail.title[i+1].width=getGridWidth(indata.item('gridTilte_'+i));
		gDetail.title[i+1].isNumeric=getGridNumeric(indata.item('gridTilte_'+i));
		gDetail.title[i+1].formAlign=getGridAlign(indata.item('gridTilte_'+i));
		gDetail.title[i+1].isTotal=getGridTotal(indata.item('gridTilte_'+i));
	}
	gDetail.calcTotal();
	gDetail.refreshAll();
	if (gDetail.data.length!=0){
		for (var i=0;i<gDetail.data.length;i++){
			for (var j=0;j<gDetail.data[i].length;j++){
				if (gDetail.data[i][2]=='期末余额'){
						if (gDetail.data[i][3]==0){
							gDetail.data[i][4]=gDetail.data[i][4]-gDetail.data[i][5];
							gDetail.data[i][5]=0;
						}
						else if (gDetail.data[i][3]==1){
							gDetail.data[i][4]=0;
							gDetail.data[i][5]=gDetail.data[i][5]-gDetail.data[i][4];
						}
				}
				if (gDetail.data[i][3])
					gDetail.data[i][3]='借方';
				else
					gDetail.data[i][3]='贷方';
			}
		}
	}
	gDetail.calcTotal();
	gDetail.refreshAll(1,0);
	return gDetail
}

var gDetail=makeGrid(IDataEnd());
</script>
</HTML>

⌨️ 快捷键说明

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