<!-- #include file="../../../include.asp" -->
<!-- #include file="../../../user/bk/jidotyobo/rm_sonekikeisansyohoukoku_main_in.asp" -->

<%
'<!--
'################################################
'	名称	:損益計算書(報告書形式)の照会
'	作成日:2002/10/31
'	作成者:川崎
'	目的 :損益計算書(報告書形式)の照会画面を表示する。
'	概要	:
'	 <<表示>>
'	・貸借対照表(報告書形式)の照会
'	 <<処理>>
'		1.書式データ取得
'		2.金額データ取得
'		3.当期利益の算出
'		4.画面出力
'################################################
'-->
'
'
%>

<%
	Dim WK_Zandaka_KanjyoCD()
	Dim WK_Zandaka_KanjyoName()
	Dim WK_Zandaka_KariKingaku()
	Dim WK_Zandaka_KashiKingaku()
	Dim WK_Zandaka_KanjyoKubun()
	Dim WK_Zandaka_TaisyakuKubun()
	Dim WK_Zandaka_SyukeiCD()
	Dim ShowCount
	Dim MaxCount

main()
Sub main()
	If Not(SessionCheck()) Then
		Exit Sub
	End If


	Dim Query, Content
	Dim tmp
	Dim Kaishibi
	Dim Syuryobi
	Dim TanaorosiFlg, HiNikubun, HiNikubunFlg
	Dim TanaorosiKubun
	Dim PageType
	PageType = "損益計算書"

	Dim bExistSyuseiKinyu
	bExistSyuseiKinyu = 0
	Query = "exec SPK伝票集計取得 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', '', -1, -1, 9"
	Set Content = OpenQuery(Query)
	If Not(Content.BOF Or Content.EOF) Then
		bExistSyuseiKinyu = 1
	End If

	Kaishibi = Request("Kaishibi")
	Syuryobi = Request("Syuryobi")
	TanaorosiKubun = Request("TanaorosiKubun")
	HiNikubun = Request("HiNikubun")
	If Kaishibi = "" Then
		Kaishibi = GB_KaikeiKaishibi
	End If
	IF Syuryobi = "" Then
		Syuryobi = GB_KaikeiSyuryobi
	End If

	If HiNikubun = "1" Then	'チェックあり
		HiNikubunFlg = "checked"
	Else
		HiNikubunFlg = ""
	End If

	Dim RouteType
	RouteType = Request("RouteType")




%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="-1">
<link href="../../../binx/sj3web.css?<% = TimeUniq() %>" rel="stylesheet" type="text/css">
<link href="../../../binx/sj3tyoboblack.css?<% = TimeUniq() %>" rel="stylesheet" type="text/css">
<title><% = AppTitle %></title>
<script language="JScript" src="../../../include.js?<% = TimeUniq() %>"></script>
<script language="JScript" src="../../../includesj.js?<% = TimeUniq() %>"></script>
<script language="JScript.Encode" src="../../../include_enc.js?<% = TimeUniq() %>"></script>
<script language="JScript.Encode" src="../../../includesj_enc.js?<% = TimeUniq() %>"></script>
<script type=""text/javascript"" src="../../../javascript.js?<% = TimeUniq() %>"></script>
</head>
<SCRIPT LANGUAGE="JavaScript">
<!--
	HomeAlias = "<% = HomeAlias %>";
	HomeAliasSL = "<% = HomeAliasSL %>";
	ExitFlg = 1;
-->
</SCRIPT>


<body onkeydown="if(ExitFlg==2)ExitFlg=3;" onBeforeUnload="window.event.returnValue = ExitMsg(ExitFlg)" bgcolor="#5C70B6" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form OnKeyDown="FormKeyDown(this)" name="form1"	method="GET" action="rm_sonekikeisansyohoukoku.asp" target="_top" autocomplete="off">
<input type="hidden" name="RouteType" value="<% = RouteType %>">

<%
	If InStr(RouteType, "ViewOnly") > 0 Then
		Response.Write(HtmlDesign(4))
	Else
		Response.Write(HtmlDesign(1))
	End If

	Response.Write(HttpL1(3))

	If InStr(RouteType, "ViewOnly") > 0 Then
		Response.Write(HttpL2("照会・集計ウィンドウ" ,"tblbtn( '/" & HomeAlias & "/user/bk/menu_s_viewonly.asp')", "経理部", "", "自動転記帳簿", "", "損益計算書", "", "", "", "", ""))
	ElseIf PackageMode = 1 Then
		Response.Write(HttpL2("メインメニュー" ,"tblbtn('/" & HomeAlias & "/user/bk/menu_cyac.asp')", "財務諸表", "tblbtn( '/" & HomeAlias & "/user/bk/menu_cyac5.asp')", "損益計算書", "", "", "", "", "", "", ""))
	Else
		Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "社長室・総務部", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s4.asp')", "財務諸表", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s41.asp')", "損益計算書", "tblbtn( 'rm_sonekikeisansyohoukoku_main.asp')", "", ""))
	End If

'	Response.Write(HttpL3("印刷", "PrintoutReal()", "", "", "", "", "", "", "", "", "", "", "", "", "", ""))
	Response.Write(HttpL3("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""))

	Response.Write(HttpL3_1("印刷", "PrintoutReal()", "", "", "", "", "", "", "", ""))

	Response.Write(HttpL3_2("販売管理費一覧", "tblbtn('rm_sonekikeisansyohoukoku_hanbaikairihi.asp?RouteType=" & RouteType & "&Syuryobi=" & Syuryobi & "')", "", "", "", "", "", "", "", ""))

	Response.Write(HttpL4(PageType, ""))
%>

<div id="L0" style="position: absolute; visibility: hidden; left: 0px; top: -2000px;">

	<table border="0" width="100%" BORDER="0" CELLSPACING="5" CELLPADDING="0" height="100%">
		<tr>
			<td height="30" align="center">
				<TABLE HEIGHT="20" BORDER="0" CELLSPACING="5" CELLPADDING="0" BGCOLOR="#FFFFFF" STYLE="BORDER:1px solid #000000">
					<TR>
						<TD ALIGN="CENTER" BACKGROUND="/<% = HomeAlias %>/images/window_bk.gif?<% = GB_STU %>">
							<table height="26" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td align="right" class="tx1416">&nbsp;日付:</td>
									<td align="left"><input type="text" name="Syuryobi" size="12" value="<% = Syuryobi %>" onBlur="SetDate(this, 1, true)" class="tbox4"></td>
									<td width="10" align="left" class="tx1416"></td>

									<td class="tx1416"><%
									If bExistSyuseiKinyu = 0 Then %>
									<input type="checkbox" value="1" name="TanaorosiKubun" <% If TanaorosiKubun = "1" Then %> checked<% End If %>>[帳簿棚卸後を表示]
									<% Else %>
									<input type="checkbox" value="1" name="HiNikubun" <% = HiNikubunFlg %>>[売上原価を仕入高に集計する]
									<% End If %>
									</td>
									<td width="10" align="left" class="tx1416"></td>
									<td>
										<TABLE onClick="SubmitReal(form1);" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="30" BGCOLOR="#33CCFF" CLASS="tbtn1" WIDTH="70">
											<TR>
												<TD WIDTH="10" BACKGROUND="/<% = HomeAlias %>/images/dlogbtn_bl.gif?<% = GB_STU %>"> </TD>
												<TD ALIGN="CENTER" VALIGN="MIDDLE" BACKGROUND="/<% = HomeAlias %>/images/dlogbtn_bc.gif?<% = GB_STU %>" WIDTH="50">更新</TD>
												<TD WIDTH="10" BACKGROUND="/<% = HomeAlias %>/images/dlogbtn_br.gif?<% = GB_STU %>"> </TD>
											</TR>
										</TABLE>
									</td>

								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td align="center">
<%
	Response.Write(TyoboSonekiKeisansyoHokokusyo(EnshuCD, KaisyaCD, KaisyaCD, "LG", "", 0, 0, Kaishibi, Syuryobi, HiNikubun & "-" & TanaorosiKubun))
%>
			</td>
		</tr>
	</table>
</div>
</form>

</body>
<% = HtmlFooter %>
</html>
<%
End Sub
%>