<!-- #include file="../../include.asp" -->

<%
'<!--
'################################################
'	名称	:入庫前出庫一覧表示
'	作成日	:2008/09/12
'	作成者	:小野
'	目的	:入庫前の出庫を一覧表示する。
'	概要	:入出庫整合性有り演習でのみ利用
'################################################
'-->
%>
<%
main()
Sub main()

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


	Dim Query
	Dim Content
	Dim Content2

	Dim EnshuCD
	Dim EnshuName
	EnshuCD = Request("EnshuCD")

	If EnshuCD <> "" Then
		Query = "exec SPM演習取得 '" & GB_SystemCD & "', '" & EnshuCD & "'"
		Set Content = OpenQuery(Query)
		If Not(Content.BOF Or Content.EOF) Then
			EnshuName = Content.Fields("演習名称")
		End If
	End If

%>

<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">
<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 = 0;
-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
var lsURL="#"
function syokaibtn() {
	if(lsURL == "#") {
		alert("選択されていません");
	} else {
		if(confirm("返却してよろしいですか? ")) {
			tblbtn(lsURL); 
		}
	}
}

//TRselect & URLset
function celsel(rw,selURL)
{
	var trw;
	trw=rw;
	lsURL=selURL;
	for (k=0; k<document.all['SyoukaiList'].rows.length; k++)
	{
		document.all['SyoukaiList'].rows[k].style.backgroundColor ="";
	}//セル色クリア
	document.all['SyoukaiList'].rows[rw].style.backgroundColor ="#ffcdde";//選択行色変更
}

//-->
</SCRIPT>
</head>

<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="fm_kityochk_ichiran.asp" onSubmit="return SubmitCheck();">

<%
	Response.Write(HtmlDesign(1))

	Response.Write(HttpL1(4))

	If GB_Admin = 1 Then
		Response.Write(HttpL2("運用管理メニュー" ,"tblbtn( '/" & HomeAlias & "/admin/admenu_w.asp')", "演習管理", "tblbtn( '/" & HomeAlias & "/admin/enshu/fm_enshu_ichiran.asp?EnshuCD=" & EnshuCD & "')", "演習コントロール", "tblbtn( '/" & HomeAlias & "/admin/enshu/fm_enshucontrol.asp?EnshuCD=" & EnshuCD & "')", "入庫非受付", "", "", "", "", ""))	
	Else
		Response.Write(HttpL2("運用管理メニュー" ,"tblbtn( '/" & HomeAlias & "/admin/admenu_w.asp')", "演習管理", "tblbtn( '/" & HomeAlias & "/admin/enshu/fm_enshu1_view.asp?EnshuCD=" & EnshuCD & "')", "演習コントロール", "tblbtn( '/" & HomeAlias & "/admin/enshu/fm_enshucontrol.asp?En6shuCD=" & EnshuCD & "')", "入庫非受付", "", "", "", "", ""))	
	End If

	Response.Write(HttpL3("","" ,"", "", "", "", "", "", "", "", "", "", "", "", "", ""))

	Response.Write(HttpL3_1("&nbsp;未入庫の出庫を返却する&nbsp;", "syokaibtn()", "", "", "", "", "", "", "", ""))
	Response.Write(HttpL3_1("", "", "", "", "", "", "", "", "", ""))

	Response.Write(HttpL3_2("戻る", "tblbtn( '/" & HomeAlias & "/admin/enshu/fm_enshucontrol.asp?EnshuCD=" & EnshuCD & "')", "", "", "", "", "", "", "", ""))

	Response.Write(HttpL4("演習コントロール", "入庫非受付"))

	Response.Write(HttpL5("未入庫の出庫を表示しています"))
%>

<div id="L0" style="position: absolute; visibility: hidden; left: 0px; top: -2000px;">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="5">
	<tr>
		<td align="center">
<table width="650" height="100%" border="0" cellspacing="5" cellpadding="5" bgcolor="#ffffff" style="border:1px solid #000000">
	<tr>
		<td align="center" background="/<% = HomeAlias %>/images/window_bk.gif?<% = GB_STU %>">
			<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="5">
				<tr>
					<td valign="top">
						<TABLE WIDTH="820" HEIGHT="30" BORDER="1" CELLPADDING="0" CELLSPACING="0" BORDERCOLOR="#000000" BGCOLOR="#FFFFCC" CLASS="tx1416" STYLE="border-collapse: collapse">
							<TR ALIGN="CENTER">
								<TD width="90" align="center">対象演習名</TD>
								<TD align="center">
									<% = EnshuMeisyo %>
								</TD>
							</TR>
						</table>
						<table BORDER="0" CELLPADDING="0" CELLSPACING="0">
							<TR>
								<TD VALIGN="BOTTOM" WIDTH="640">
									<TABLE HEIGHT="24" BORDER="1" WIDTH="820" CELLPADDING="3" CELLSPACING="0" BORDERCOLOR="#000000" BGCOLOR="#FFFFCC" CLASS="tx1416" STYLE="border-collapse: collapse">
										<TR ALIGN="CENTER">
										<% If ConvEnshuKubun(EnshuCD) = "P" Then %>
											<TD HEIGHT="20" rowspan="2">学生氏名</TD>
										<% Else %>
											<TD HEIGHT="20" rowspan="2">会社コード</TD>
										<% End If %>
											<TD HEIGHT="20" WIDTH="75">仕入会社</TD>
											<TD HEIGHT="20" WIDTH="80">出庫日</TD>
											<TD HEIGHT="20" WIDTH="75">出庫会社</TD>
											<TD HEIGHT="20" WIDTH="30">区分</TD>
											<TD HEIGHT="20" WIDTH="20">No</TD>
											<TD HEIGHT="20" WIDTH="200">商品</TD>
											<TD HEIGHT="20" WIDTH="100">合計額</TD>
										</TR>
									</TABLE>
								</TD>
							</TR>
						</table>
						<table BORDER="0" CELLPADDING="0" CELLSPACING="0">
							<TR>
								<TD VALIGN="TOP">
									<DIV ID="Layer1" STYLE="position:relative; left:0px; top:0px; width:840px; height:410px; z-index:1; border: 1px none #000000; overflow: auto;">
										<TABLE ID="SyoukaiList" BORDER="1" WIDTH="820"	CELLSPACING="0" CELLPADDING="3" BGCOLOR="#FFFFFF" CLASS="tx1416" STYLE="border-collapse: collapse" BORDERCOLOR="#000000">

<%
	Dim ii
	ii = 0

	Query = "exec SPK演習出庫非受付一覧 '" & GB_SystemCD & "', '" & EnshuCD & "'"
	Set Content = OpenQuery(Query)

	Do While Not(Content.BOF Or Content.EOF)

		Response.Write("<TR ALIGN=""CENTER"" style=""cursor:hand""  onClick=""celsel(" & ii & ",'fm_enshucontrol02_bin.asp?EnshuCD=" & Content.Fields("演習CD") & "&KaisyaCD=" & Content.Fields("会社CD") & "&SakuseiKaisyaCD=" & Content.Fields("作成会社CD") & "&BunsyoSyuruiCD=" & Content.Fields("文書種類CD") & "&BunsyoNaiyoCD=" & Content.Fields("文書内容CD") & "')"" onDblClick=""syokaibtn()"">" & vbCrLf)
		If ConvEnshuKubun(EnshuCD) = "P" Then
			Response.Write("<TD HEIGHT=""20"" ALIGN=""LEFT"" >" & ConvGakuseiShimei(ConvKaisyaGakuseiNo(EnshuCD, Content.Fields("会社CD"))) & "</TD>" & vbCrLf)
		Else
			Response.Write("<TD HEIGHT=""20"" ALIGN=""LEFT"" >" & Content.Fields("会社CD") & "</TD>" & vbCrLf)
		End If
		Response.Write("<TD HEIGHT=""20"" WIDTH=""75"" ALIGN=""LEFT"">" & Content.Fields("会社略名称") & "</TD>" & vbCrLf)
		Response.Write("<TD HEIGHT=""20"" WIDTH=""62"" ALIGN=""CENTER"">" & Content.Fields("処理日") & "</TD>" & vbCrLf)
		Response.Write("<TD HEIGHT=""20"" WIDTH=""75"" ALIGN=""LEFT"">" & Content.Fields("作成会社略名称") & "</TD>" & vbCrLf)
		Response.Write("<TD HEIGHT=""20"" WIDTH=""30"" ALIGN=""CENTER"">")
		If Content.Fields("文書種類CD") = "SU" Then Response.Write("通常") Else Response.Write("返品") End If
		Response.Write("</TD>" & vbCrLf)
		Response.Write("<TD HEIGHT=""20"" WIDTH=""20"" ALIGN=""CENTER"">" & Content.Fields("文書内容CD") & "</TD>" & vbCrLf)

		Dim TmpSyohin
		TmpSyohin = ""
		Dim TmpSoGokei
		TmpSoGokei = 0
		Dim SyohinEtc
		SyohinEtc = 0
		Query = "exec SPD入出庫取得 '" & GB_SystemCD & "','" & EnshuCD & "', '" & Content.Fields("会社CD") & "', '" & Content.Fields("作成会社CD") & "', '" & Content.Fields("文書種類CD") & "', '" & Content.Fields("文書内容CD") & "'"
		Set Content2 = OpenQuery(Query)
		Do While Not(Content2.BOF Or Content2.EOF)
			If TmpSyohin = "" Then
				TmpSyohin = ConvSyohinRyakuMeisyo(Content2.Fields("商品CD"))
			ElseIf SyohinEtc = 0 Then
				TmpSyohin = TmpSyohin & "、他"
				SyohinEtc = 1
			End If
			TmpSoGokei = TmpSoGokei + (Content2.Fields("単価") * Content2.Fields("数量"))
			Content2.MoveNext
		Loop
		Response.Write("<TD HEIGHT=""20"" WIDTH=""200"" ALIGN=""Left"">" & TmpSyohin & "</TD>" & vbCrLf)
		Response.Write("<TD HEIGHT=""20"" WIDTH=""100"" ALIGN=""RIGHT"">" & SetMoney(TmpSoGokei, false, true) & "</TD>" & vbCrLf)
		Response.Write("</TR>" & vbCrLf)
		ii = ii + 1

		Content.MoveNext
	Loop

%>
										</TABLE>
									</DIV>
								</TD>
							</TR>
						</TABLE>
					</TD>
				</TR>
			</TABLE>
		</td>
	</tr>
</table>
		</td>
	</tr>
</table>
</DIV>
</form>

</body>

<% = HtmlFooter %>
</html>

<%
End Sub
%>