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

<%
'<!--
'################################################
'	名称	:入出庫表示
'	作成日:2002/9/20
'	作成者:山崎 貴史
'	目的 :入出庫画面を表示する。
'	概要	:
'	 <<表示>>
'	・初期は"追加モード":文書内容CDはNULL
'	・文書内容CDが指定してある場合は"修正モード"
'	<<入力チェック>>
'	1.取引日のチェック
'	2.取引先のチェック
'	3.明細部のチェック
'	修正変更:(080327)材料入庫モードを追加
'################################################
'-->
'
%>

<%
main()

Sub main()

	Dim SyohinNyusyukkoSeikousei
	Dim ShukkoUkeshoHitsuyo
	Dim AiteShukkoHitsuyo
	Dim JishaZaikoHitsuyo
	Dim HyojunTankaHyoji
	Dim SoukoRiyo
	Dim HaraidashiTankaRiyo
	Query = "exec SPM演習取得 '" & GB_SystemCD & "','" & EnshuCD & "'"
	Set Content = OpenQuery(Query)
	If Not(Content.BOF Or Content.EOF) Then
		SyohinNyusyukkoSeikousei = "" & Content.Fields("商品入出庫整合性利用")
		ShukkoUkeshoHitsuyo = "" & Content.Fields("出庫時注文請書必要")
		AiteShukkoHitsuyo = "" & Content.Fields("入庫時相手出庫必要") 
		JishaZaikoHitsuyo = "" & Content.Fields("出庫時在庫必要") 
		HyojunTankaHyoji = "" & Content.Fields("標準販売単価表示") 
		SoukoRiyo = "" & Content.Fields("倉庫部利用")
		HaraidashiTankaRiyo = "" & Content.Fields("出庫時払出単価入力")
	End If

	'HaraidashiTankaRiyo = "1"

	If ShukkoUkeshoHitsuyo = "" Then
		ShukkoUkeshoHitsuyo = "0"
	End If
	If AiteShukkoHitsuyo <> "1" Then
		AiteShukkoHitsuyo = "0"
	End If

	Dim BunsyoNaiyoCD, Syoribi, TorihikisakiCD, NonyuKijitsu
	Dim UnsoGaisyaCD, UntinSyogakariKubun, Unsohi, UnsohiSeikyuFlg, Tekiyo, ShiharaiHoho, HasshinFlg
	Dim SenpoBunsyoNaiyoCD, SenpoBunsyoSyuruiCD, SenpoSyoribi
	Dim BunsyoSyuruiCD
	Dim Kakaku(5)		'標準単価
	Dim SyohinCD(5)														'商品コード
	Dim SyohinName(5)							'商品名称
	Dim Suryo(5)															'数量
	Dim Tanka(5)															'単価
	Dim UnsoTanka(5)														'運送単価
	Dim SyohinGazo(5)

	Dim GakuseiShimei							'学生氏名(係印)
	Dim SyoruiMei
	Dim Query
	Dim Content
	Dim Shimei
	Dim PageType
	Dim RouteType
	Dim SyohinGazoStr
	Dim SakuseiKaisyaCD
	Dim KaisyaCD1
	Dim AdminMailFlag

	Dim SenpoChumonCD
	Dim SenpoChumonNo

	AdminMailFlag = 0

	RouteType = Request("RouteType")
	PageType = Request("PageType")
	BunsyoNaiyoCD = Request("BunsyoNaiyoCD")
	BunsyoSyuruiCD = Request("BunsyoSyuruiCD")
	SenpoBunsyoNaiyoCD = Request("SenpoBunsyoNaiyoCD")
	SenpoBunsyoSyuruiCD = Request("SenpoBunsyoSyuruiCD")
	TorihikisakiCD = Request("TorihikisakiCD")
	SakuseiKaisyaCD = Request("SakuseiKaisyaCD")

	
	'メール管理機能から開いた場合はKaisyaCD1からKaisyaCDを取得
	if Request("KaisyaCD1") <> "" then
		AdminMailFlag = 1
		KaisyaCD = Request("KaisyaCD1")
	end if


	Dim Label
	If BunsyoSyuruiCD = "ZS" Then
		Label = "材料"
	Else
		Label = "商品"
	End If

	Dim ButtonLabel
	If BunsyoSyuruiCD = "SU" Or BunsyoSyuruiCD = "SX" Or BunsyoSyuruiCD = "MU" Then
		ButtonLabel = "出庫"
	Else
		ButtonLabel = "入庫"
	End If


'Response.Write("AdminMaliFlag:" & AdminMaliFlag)

	SyohinGazoStr = ""

	Dim SenpoFlg
	SenpoFlg = 0
	If SenpoBunsyoNaiyoCD <> "" Then
		SenpoFlg = 1
	End If


	If SenpoFlg = 0 Then
		SakuseiKaisyaCD = KaisyaCD
	End If


	Dim SenpoTmpBunsyoSyuruiCD

	If BunsyoSyuruiCD = "SS" Then 
		SenpoTmpBunsyoSyuruiCD = "SU"
	ElseIf BunsyoSyuruiCD = "SY" Then 
		SenpoTmpBunsyoSyuruiCD = "SX"
	End If

	SyoruiMei = ConvKubunMeisyo("入出庫区分", BunsyoSyuruiCD)

'Response.Write("PageType:" & PageType & "<br>")
'Response.Write("BunsyoNaiyoCD:" & BunsyoNaiyoCD & "<br>")
'Response.Write("SenpoBunsyoNaiyoCD:" & SenpoBunsyoNaiyoCD & "<br>")
'Exit sub

	If BunsyoNaiyoCD <> "" Or SenpoBunsyoNaiyoCD <> "" Then
		If SenpoFlg = 1 Then
			Query = "exec SPD入出庫取得2 '" & GB_SystemCD & "','" & EnshuCD & "','" & KaisyaCD & "', '" & SakuseiKaisyaCD & "', '" & SenpoBunsyoSyuruiCD & "', '" & SenpoBunsyoNaiyoCD & "'"
		Else
			Query = "exec SPD入出庫取得2 '" & GB_SystemCD & "','" & EnshuCD & "','" & KaisyaCD & "', '" & SakuseiKaisyaCD & "', '" & BunsyoSyuruiCD & "', '" & BunsyoNaiyoCD & "'"
		End If
'Response.Write(Query)
'Exit Sub

		Set Content = OpenQuery(Query)


'Response.Write(query)



		If Not(Content.BOF Or Content.EOF) Then

			If SenpoFlg = 1 Then
				TorihikisakiCD = Content.Fields("作成会社CD")
				SenpoSyoribi = Content.Fields("処理日")
				Syoribi = Content.Fields("処理日")
				BunsyoNaiyoCD = SenpoBunsyoNaiyoCD
			Else
				TorihikisakiCD = Content.Fields("取引先CD")
				SenpoSyoribi = Content.Fields("先方処理日")
				Syoribi = Content.Fields("処理日")
				SenpoChumonCD = "" & Content.Fields("先方仕入売上種類CD")
				SenpoChumonNo = "" & Content.Fields("先方仕入売上内容CD")
			End If
			
'060908--------------------
			Dim PreNyusyukoSEQ
			PreNyusyukoSEQ = 0
'--------------------------

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

				NyusyukoSEQ = Content.Fields("入出庫SEQ")
				If BunsyoSyuruiCD = "ZS" Then
					SyohinGazo(NyusyukoSEQ) = ConvZairyoGazo(EnshuCD, Content.Fields("商品CD"))
					Kakaku(NyusyukoSEQ) = ConvZairyoHanbaiTanka(Content.Fields("商品CD"))
				Else
					SyohinGazo(NyusyukoSEQ) = ConvSyohinGazo(EnshuCD, Content.Fields("商品CD"))
					Kakaku(NyusyukoSEQ) = ConvSyohinHanbaiTanka(Content.Fields("商品CD"))
				End If
				SyohinCD(NyusyukoSEQ) = Content.Fields("商品CD")
				Suryo(NyusyukoSEQ) = Content.Fields("数量")
				Tanka(NyusyukoSEQ) = Content.Fields("単価")
				
'060908--------------------
If NyusyukoSEQ <> PreNyusyukoSEQ Then
'--------------------------

				If SyohinGazoStr <> "" Then
					SyohinGazoStr = SyohinGazoStr & ","
				End If

				If SyohinGazo(NyusyukoSEQ) <> "" Then
					SyohinGazoStr = SyohinGazoStr & """" &  Fgoods & "/" & EnshuCD & "/" &SyohinGazo(NyusyukoSEQ) & """"
				Else
					SyohinGazoStr = SyohinGazoStr & """/" & HomeAlias & "/images/truck_box.gif?" & GB_STU & """"
				End If
				
'060908--------------------
End If
PreNyusyukoSEQ = NyusyukoSEQ
'--------------------------

				Content.MoveNext
			Loop
		End If
	End If

'DEBUG#################
'Response.Write(SyohinGazoStr)

	Dim jj,tmps
	


	'TTX文書F開封処理
	If InStr(RouteType, "MailOnly") > 0 Then
		If BunsyoSyuruiCD = "SU" AND BunsyoNaiyoCD <> "" And GB_JisyaFlag <> "" Then	'運用管理・演習管理(自社フラグ無し)では開封フラグを立てない(061213小野)
			Query = "exec SPD入出庫書類開封 '" & GB_SystemCD & "','" & EnshuCD & "','" & KaisyaCD & "', '" & SakuseiKaisyaCD & "', '" & BunsyoSyuruiCD & "', '" & BunsyoNaiyoCD & "'"
			Set Content = OpenQuery(Query)
		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 = 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)"	method="POST" action="fd_nyusyukko_bin.asp" name="form1">

<%

	Dim BunsyoType
	If InStr(RouteType, "RMail") > 0 Then
		BunsyoType = "受信文書"
	ElseIf InStr(RouteType, "SMail") > 0 Then
		BunsyoType = "発信文書"
	End If


	If InStr(RouteType, "MailOnly") > 0 Then
		Response.Write(HtmlDesign(6))
	ElseIf InStr(RouteType, "ViewOnly") > 0 Then
		Response.Write(HtmlDesign(4))
	Else
		Response.Write(HtmlDesign(1))
	End If


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



	Response.Write(HttpL1(3))
	
	'メール管理機能から開いた場合
	If AdminMailFlag = 1 Then
		Response.Write(HttpL2("受発信文書ウィンドウ" ,"tblbtn( '/" & HomeAlias & "/admin/mail/fn_jyuhasshinbunsyo.asp?PageType=" & PageType & "&RouteType=MailOnly')", "", "", "", "", "", "", "", "", "", ""))
	
	
	
	ElseIf InStr(RouteType, "MailOnly") > 0 Then
		Response.Write(HttpL2("受発信文書ウィンドウ" ,"tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyownd/fn_jyuhasshinbunsyo.asp?PageType=" & PageType & "&RouteType=MailOnly')", "", "", "", "", "", "", "", "", "", ""))

	ElseIf BunsyoSyuruiCD = "SC" Then
		Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "商品企画室", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s5.asp')", SyoruiMei, "", "", "", "", ""))
	ElseIf InStr(RouteType, "ViewOnly") > 0 And InStr(RouteType, "RMail") > 0 Then
		Response.Write(HttpL2("照会・集計ウィンドウ" ,"tblbtn( '/" & HomeAlias & "/user/bk/menu_s_viewonly.asp')", "受発信文書", "", "受信文書", "", "", "", "", "", "", ""))
	ElseIf InStr(RouteType, "ViewOnly") > 0 And InStr(RouteType, "SMail") > 0	Then
		Response.Write(HttpL2("照会・集計ウィンドウ" ,"tblbtn( '/" & HomeAlias & "/user/bk/menu_s_viewonly.asp')", "受発信文書", "", "発信文書", "", "", "", "", "", "", ""))
	ElseIf InStr(RouteType, "ViewOnly") > 0 Then
		Response.Write(HttpL2("照会・集計ウィンドウ" ,"tblbtn( '/" & HomeAlias & "/user/bk/menu_s_viewonly.asp')", SyoruiMei, "", "", "", "", "", "", "", "", ""))
	Else
		If BunsyoSyuruiCD = "SC" Then
			Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "オリジナル商品管理部", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s5.asp')", SyoruiMei, "", "", "", "", ""))
		ElseIf BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SX" Then
			If SoukoRiyo = "1" And GB_Gyosyu = "S" Then
				Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "倉庫部", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s7.asp')", SyoruiMei, "", "", "", "", ""))
			Else
				Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "仕入部", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s3.asp')", SyoruiMei, "", "", "", "", ""))
			End If
		ElseIf BunsyoSyuruiCD = "ZS" Or BunsyoSyuruiCD = "ZU" Or BunsyoSyuruiCD = "MU" Then
			Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "製造部", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s6.asp')", SyoruiMei, "", "", "", "", ""))
		Else
			If SoukoRiyo = "1" And GB_Gyosyu = "S" Then
				Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "倉庫部", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s7.asp')", SyoruiMei, "", "", "", "", ""))
			Else
				Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "販売部", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s2.asp')", SyoruiMei, "", "", "", "", ""))
			End If
		End If
	End If



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

	If AdminMailFlag = 1 Then
		Response.Write(HttpL3_1("", "", "", "", "", "", "", "", "", ""))
		
		
	ElseIf InStr(RouteType, "MailOnly") > 0 Then
		Response.Write(HttpL3_1("印刷", "PrintoutReal()", "", "", "", "", "", "", "", ""))

	ElseIf InStr(RouteType, "ViewOnly") > 0 Or BunsyoSyuruiCD = "MU" Then	'製造部製品出庫は同一会社内なので整合性のため修正・削除は無し
		Response.Write(HttpL3_1("印刷", "PrintoutReal()",	"", "", "", "", "", "", "", ""))
	ElseIf AiteShukkoHitsuyo = "1" And (BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SY" Or BunsyoSyuruiCD = "SU" Or BunsyoSyuruiCD = "SX") Then	'入出庫整合性は出庫側も削除不能
		Response.Write(HttpL3_1("印刷", "PrintoutReal()", "修正", "tblbtn( 'fd_nyusyukko.asp?BunsyoSyuruiCD=" & BunsyoSyuruiCD & "&BunsyoNaiyoCD=" & BunsyoNaiyoCD & "&SakuseiKaisyaCD=" & SakuseiKaisyaCD & "')", "", "", "", "", "", ""))
	Else
		Response.Write(HttpL3_1("印刷", "PrintoutReal()", "修正", "tblbtn( 'fd_nyusyukko.asp?BunsyoSyuruiCD=" & BunsyoSyuruiCD & "&BunsyoNaiyoCD=" & BunsyoNaiyoCD & "&SakuseiKaisyaCD=" & SakuseiKaisyaCD & "')", "削除", "if(confirm('削除してよろしいですか? '))tblbtn('fd_nyusyukko_bin.asp?Action=Del&BunsyoSyuruiCD=" & BunsyoSyuruiCD & "&BunsyoNaiyoCD=" & BunsyoNaiyoCD & "')", "", "", "", ""))
	End If








	If InStr(RouteType, "MailOnly") > 0 Then
		If PageType = "発信文書" Then
			'メール管理機能から開いた場合
			If AdminMailFlag = 1 Then
				Response.Write(HttpL3_3("受信文書", "tblbtn( '/" & HomeAlias & "/admin/mail/fn_jyuhasshinbunsyo.asp?PageType=受信文書&RouteType=MailOnly')", "発信文書", "", "", "", "受信メール", "tblbtn( '/" & HomeAlias & "/admin/mail/fn_mailsakusei_ichiran.asp?PageType=受信メール&RouteType=MailOnly')" ,"送信メール", "tblbtn( '/" & HomeAlias & "/admin/mail/fn_mailsakusei_ichiran.asp?PageType=送信メール&RouteType=MailOnly')"))
			Else
				Response.Write(HttpL3_2("受信文書", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyownd/fn_jyuhasshinbunsyo.asp?PageType=受信文書&RouteType=MailOnly')", "発信文書", "", "メール作成", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyownd/fn_mailsakusei.asp?RouteType=MailOnly')", "受信メール", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyownd/fn_mailsakusei_ichiran.asp?PageType=受信メール&RouteType=MailOnly')" ,"送信メール", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyownd/fn_mailsakusei_ichiran.asp?PageType=送信メール&RouteType=MailOnly')"))
			End If
		Else
			'メール管理機能から開いた場合
			If AdminMailFlag = 1 Then
				Response.Write(HttpL3_3("受信文書", "", "発信文書", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyownd/fn_jyuhasshinbunsyo.asp?PageType=発信文書&RouteType=MailOnly')", "", "", "受信メール", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyownd/fn_mailsakusei_ichiran.asp?PageType=受信メール&RouteType=MailOnly')" ,"送信メール", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyownd/fn_mailsakusei_ichiran.asp?PageType=送信メール&RouteType=MailOnly')"))
			Else
				Response.Write(HttpL3_2("受信文書", "", "発信文書", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyownd/fn_jyuhasshinbunsyo.asp?PageType=発信文書&RouteType=MailOnly')", "メール作成", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyownd/fn_mailsakusei.asp?RouteType=MailOnly')", "受信メール", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyownd/fn_mailsakusei_ichiran.asp?PageType=受信メール&RouteType=MailOnly')" ,"送信メール", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyownd/fn_mailsakusei_ichiran.asp?PageType=送信メール&RouteType=MailOnly')"))
			End If
		End If
	ElseIf InStr(RouteType, "ViewOnly") > 0 And InStr(RouteType, "RMail") > 0	Then
		Response.Write(HttpL3_2("一覧表示", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyo/fn_jyuhasshinbunsyo.asp?RouteType=ViewOnly&PageType=受信文書')", "", "", "", "", "", "", "", ""))
	ElseIf InStr(RouteType, "ViewOnly") > 0 And InStr(RouteType, "SMail") > 0	Then
		Response.Write(HttpL3_2("一覧表示", "tblbtn( '/" & HomeAlias & "/user/bk/jyuhasshinbunsyo/fn_jyuhasshinbunsyo.asp?RouteType=ViewOnly&PageType=発信文書')", "", "", "", "", "", "", "", ""))
	ElseIf InStr(RouteType, "ViewOnly") > 0 Then
		Response.Write(HttpL3_2("一覧表示", "tblbtn( 'fd_nyusyukko_ichiran.asp?RouteType=ViewOnly&BunsyoSyuruiCD=" & BunsyoSyuruiCD & "')", "", "", "", "", "", "", "", ""))
	ElseIf BunsyoSyuruiCD = "MU" Then
		Response.Write(HttpL3_2("追加", "tblbtn( 'fd_seizosashizusho_ichiran.asp?Mode=Shukko')", "一覧表示", "tblbtn( 'fd_nyusyukko_ichiran.asp?BunsyoSyuruiCD=" & BunsyoSyuruiCD & "')", "", "", "", "", "", ""))
	Else

		Dim ButtonTsuikaLabel
		Dim ButtonTsuikaValue
		Dim ButtonChumonLabel
		Dim ButtonChumonValue
		Dim ButtonSenpoLabel
		Dim ButtonSenpoValue
		Dim ButtonIchiranLabel
		Dim ButtonIchiranValue
		ButtonTsuikaLabel  = "追加"
		ButtonTsuikaValue  = "tblbtn('fd_nyusyukko.asp?BunsyoSyuruiCD=" & BunsyoSyuruiCD & "');"
		ButtonChumonLabel  = "注文請書から出庫"
		ButtonChumonValue  = "tblbtn('fd_nyusyukko_ichiran2.asp?BunsyoSyuruiCD=" & BunsyoSyuruiCD & "&SenpoBunsyoSyuruiCD=" & SenpoTmpBunsyoSyuruiCD & "&NyusyukoKubun=U');"
		ButtonSenpoLabel   = "先方出庫一覧"
		ButtonSenpoValue   = "tblbtn('fd_nyusyukko_ichiran.asp?BunsyoSyuruiCD=" & BunsyoSyuruiCD & "&SenpoBunsyoSyuruiCD=" & SenpoTmpBunsyoSyuruiCD & "');"
		ButtonIchiranLabel = "一覧表示"
		ButtonIchiranValue = "tblbtn('fd_nyusyukko_ichiran.asp?BunsyoSyuruiCD=" & BunsyoSyuruiCD & "');"
'ShukkoUkeshoHitsuyo = "1"
'AiteShukkoHitsuyo = "1"
		If BunsyoSyuruiCD = "SU" Then
			'売上出庫(追加・注文請書出庫・一覧表示)
			ButtonSenpoLabel = ""
			ButtonSenpoValue = ""
			If ShukkoUkeshoHitsuyo = "1" Or ShukkoUkeshoHitsuyo = "3" Then
				'出庫には注文請書が必要(注文請書出庫・一覧表示)
				ButtonTsuikaLabel = ""
				ButtonTsuikaValue = ""
			ElseIf GB_Gyosyu = "K" Or ShukkoUkeshoHitsuyo = "2" Then
				'管理部の場合及び注文請書を利用させない場合(追加・一覧表示)
				ButtonChumonLabel = ""
				ButtonChumonValue = ""
			End If
		ElseIf (BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SY") And AiteShukkoHitsuyo = "1" Then
			'入庫には相手出庫が必要(先方出庫一覧・一覧表示)
			ButtonTsuikaLabel   = ""
			ButtonTsuikaValue   = ""
			ButtonChumonLabel   = ""
			ButtonChumonValue   = ""
		Else
			'その他(追加・一覧表示)
			ButtonChumonLabel  = ""
			ButtonChumonValue  = ""
			ButtonSenpoLabel   = ""
			ButtonSenpoValue   = ""
		End If
		Response.Write(HttpL3_2(ButtonTsuikaLabel, ButtonTsuikaValue, ButtonChumonLabel, ButtonChumonValue, ButtonSenpoLabel, ButtonSenpoValue, ButtonIchiranLabel, ButtonIchiranValue, "", ""))

	End If

	Response.Write(HttpL4(SyoruiMei, "照会"))

%>



<div id="L0" style="position: absolute; visibility: hidden; left: 0px; top: -2000px;">
<table border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td align="CENTER" valign="top">

			<table width="600" border="0" cellspacing="0" cellpadding="10" height="305" bgcolor="#FFFFFF" style="border:solid 1px #000000">
				<tr>
					<td  width="600" height="305" align="CENTER" valign="top">
						<table width="600" border="0" cellspacing="0" cellpadding="0" height="305">
							<tr>
								<td height="40" align="CENTER" valign="middle">
									<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"  height="30" width="580" class="tx1416">
										<tr>
											<td width="25%">
												<table width="190" border="0" cellpadding="0" cellspacing="0">
													<tr class="tx1214">
														<td width="190" align="left">
															<table width="130" class="tx2224b" border="0" cellpadding="0" cellspacing="0" >
																<tr>
																	<td align="center" nowrap><%
																		If Len(SyoruiMei) < 8 Then
																			Response.Write(SetStringInsertSpace(SyoruiMei))
																		Else
																			Response.Write(SyoruiMei)
																		End If
																	%></td>
																</tr>
															</table>
														</td>
													</tr>
												</table>
											</td>
											<td> </td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td height="45" align="CENTER" valign="BOTTOM">
									<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"  height="54" width="580" class="tx1618">
										<tr>
											<td width="12%" height="20"><% = ButtonLabel %>番号</td>
											<td width="38%" height="20"><% = BunsyoNaiyoCD %></td>
											<td width="20%" height="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;処理日</td>
											<td width="30%" height="20"><% = Syoribi %></td>
										</tr>
<% 'If BunsyoSyuruiCD <> "SC" And BunsyoSyuruiCD <> "MU" Then %>
<% If BunsyoSyuruiCD <> "MU" And  TorihikisakiCD <> KaisyaCD Then %>
										<tr>
											<td height="20">取引先</td>
											<td height="20">
											<%
											If TorihikisakiCD = "SJ4KOURIHANBAI" Then
												Response.Write("小売販売")
											Else
												Response.Write(ConvKaisyaMeisyoDx(EnshuCD, TorihikisakiCD))
											End If
											%>
											<td width="80" height="20"></td>
											<td width="120" height="20"></td>
										</tr>
<% End If %>
										</table>
								</td>
							</tr>
							<tr>
								<td align="CENTER">
									<table width="580" height="230" border="0" cellpadding="4" cellspacing="0" style="border-collapse: collapse; border:solid 2px #FFFFFF">
										<tr>
											<td width="100%" align="RIGHT">
												<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="580" bordercolor="#000000">
													<tr>
														<td height="30" valign="TOP">
															<table width="100%" height="30" border="1" cellpadding="0" cellspacing="0" frame="below" style="border-collapse: collapse" bordercolor="#000000" class="tx1618" bgcolor="#CCCCCC">
																<tr>
																	<td align="center"><% = Label %>名称</td>
																	<% If HyojunTankaHyoji <> "0" Then '標準販売単価表示 %>
																	<td align="center" width="17%"><% If MHMSTDSELLPRICE <> "" Then Response.Write(MHMSTDSELLPRICE) Else Response.Write("標準単価") End If %></td>
																	<% End If %>
																	<td align="center" width="16%">数 量</td>
																	<% If BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SX" Or BunsyoSyuruiCD = "ZS" Then %>
																	<td align="center" width="17%">単 価</td>
																	<% ElseIf HaraidashiTankaRiyo <> "1" Then %>
																	<td align="center" width="17%">払出単価</td>
																	<% End If %>
																	<% If 1 = 0 Then %>
																	<td align="center" width="17%">運送単価</td>
																	<% End If %>
																	</tr>
															</table>
														</td>
													</tr>


													<tr>
														<td>
															<table width="100%" height="180" border="1" cellpadding="3" cellspacing="0" frame="below" style="border-collapse: collapse" bordercolor="#000000" class="tx1618">
																<tr>
																	<% If BunsyoSyuruiCD = "ZS" Then %>
																	<td align="left"><% = AscLeft(ConvZairyoMeisyo(SyohinCD(1)),38) %><br></td> <!-- 商品名称を38Byteで切り捨て(061031小野)-->
																	<% Else %>
																	<td align="left"><% = AscLeft(ConvSyohinMeisyo(SyohinCD(1)),38) %><br></td> <!-- 商品名称を38Byteで切り捨て(061031小野)-->
																	<% End If %>
																	<% If HyojunTankaHyoji <> "0" Then '標準販売単価表示 %>
																	<td align="right" width="17%"><% = SetMoney(Kakaku(1), false, true) %><br></td>
																	<% End If %>
																	<td align="right" width="16%"><% = SetMoney(Suryo(1), false, true) %><br></td>
																	<% 'If 1 = 1 Or BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SX" Then %>
																	<% If BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SX" Or HaraidashiTankaRiyo <> "1" Then %>
																	<td align="right" width="17%"><% = SetMoney(Tanka(1), false, true) %><br></td>
																	<% End If %>
																</tr>
																<tr>
																	<% If BunsyoSyuruiCD = "ZS" Then %>
																	<td align="left"><% = AscLeft(ConvZairyoMeisyo(SyohinCD(2)),38) %><br></td> <!-- 商品名称を38Byteで切り捨て(061031小野)-->
																	<% Else %>
																	<td align="left"><% = AscLeft(ConvSyohinMeisyo(SyohinCD(2)),38) %><br></td> <!-- 商品名称を38Byteで切り捨て(061031小野)-->
																	<% End If %>
																	<% If HyojunTankaHyoji <> "0" Then '標準販売単価表示 %>
																	<td align="right" width="17%"><% = SetMoney(Kakaku(2), false, true) %><br></td>
																	<% End If %>
																	<td align="right" width="16%"><% = SetMoney(Suryo(2), false, true) %><br></td>
																	<% 'If 1 = 1 Or BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SX" Then %>
																	<% If BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SX" Or HaraidashiTankaRiyo <> "1" Then %>
																	<td align="right" width="17%"><% = SetMoney(Tanka(2), false, true) %><br></td>
																	<% End If %>
																</tr>
																<tr>
																	<% If BunsyoSyuruiCD = "ZS" Then %>
																	<td align="left"><% = AscLeft(ConvZairyoMeisyo(SyohinCD(3)),38) %><br></td> <!-- 商品名称を38Byteで切り捨て(061031小野)-->
																	<% Else %>
																	<td align="left"><% = AscLeft(ConvSyohinMeisyo(SyohinCD(3)),38) %><br></td> <!-- 商品名称を38Byteで切り捨て(061031小野)-->
																	<% End If %>
																	<% If HyojunTankaHyoji <> "0" Then '標準販売単価表示 %>
																	<td align="right" width="17%"><% = SetMoney(Kakaku(3), false, true) %><br></td>
																	<% End If %>
																	<td align="right" width="16%"><% = SetMoney(Suryo(3), false, true) %><br></td>
																	<% 'If 1 = 1 Or BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SX" Then %>
																	<% If BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SX" Or HaraidashiTankaRiyo <> "1" Then %>
																	<td align="right" width="17%"><% = SetMoney(Tanka(3), false, true) %><br></td>
																	<% End If %>
																</tr>
																<tr>
																	<% If BunsyoSyuruiCD = "ZS" Then %>
																	<td align="left"><% = AscLeft(ConvZairyoMeisyo(SyohinCD(4)),38) %><br></td> <!-- 商品名称を38Byteで切り捨て(061031小野)-->
																	<% Else %>
																	<td align="left"><% = AscLeft(ConvSyohinMeisyo(SyohinCD(4)),38) %><br></td> <!-- 商品名称を38Byteで切り捨て(061031小野)-->
																	<% End If %>
																	<% If HyojunTankaHyoji <> "0" Then '標準販売単価表示 %>
																	<td align="right" width="17%"><% = SetMoney(Kakaku(4), false, true) %><br></td>
																	<% End If %>
																	<td align="right" width="16%"><% = SetMoney(Suryo(4), false, true) %><br></td>
																	<% 'If 1 = 1 Or BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SX" Then %>
																	<% If BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SX" Or HaraidashiTankaRiyo <> "1" Then %>
																	<td align="right" width="17%"><% = SetMoney(Tanka(4), false, true) %><br></td>
																	<% End If %>
																</tr>
																<tr>
																	<% If BunsyoSyuruiCD = "ZS" Then %>
																	<td align="left"><% = AscLeft(ConvZairyoMeisyo(SyohinCD(5)),38) %><br></td> <!-- 商品名称を38Byteで切り捨て(061031小野)-->
																	<% Else %>
																	<td align="left"><% = AscLeft(ConvSyohinMeisyo(SyohinCD(5)),38) %><br></td> <!-- 商品名称を38Byteで切り捨て(061031小野)-->
																	<% End If %>
																	<% If HyojunTankaHyoji <> "0" Then '標準販売単価表示 %>
																	<td align="right" width="17%"><% = SetMoney(Kakaku(5), false, true) %><br></td>
																	<% End If %>
																	<td align="right" width="16%"><% = SetMoney(Suryo(5), false, true) %><br></td>
																	<% 'If 1 = 1 Or BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SX" Then %>
																	<% If BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SX" Or HaraidashiTankaRiyo <> "1" Then %>
																	<td align="right" width="17%"><% = SetMoney(Tanka(5), false, true) %><br></td>
																	<% End If %>
																</tr>


															</table>
														</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
		<% If Request("Action") = "7" Then %>
		<td width="200">
			<table width="100%" height="210" border="0" cellpadding="0" cellspacing="0">
				<tr> 
					<td width="200">
						<table width="100%" height="210" border="0" cellpadding="0" cellspacing="0">
							<tr> 
								<td width="20" rowspan="2"> 
									<img src="/<% = HomeAlias %>/images/warehouse_l.gif?<% = GB_STU %>" width="20" height="210"></td>
								<td valign="top"> 
									<div id="AreaLay" style="position:absolute; width:100%; height:195px; z-index:1; visibility: visible; overflow: hidden;">
										<div id="TruckLay" style="position:absolute; width:155px; height:135px; z-index:1; top: 60; left: 500;">
											<% If BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SY" Or BunsyoSyuruiCD = "ZS" Then %>
											<table width="175" height="135" border="0" cellpadding="0" cellspacing="0">
												<tr> 
													<td width="45" rowspan="2" valign="bottom"><img src="/<% = HomeAlias %>/images/truck_l_l.gif?<% = GB_STU %>" width="45" height="65"></td>
													<td width="130" height="100" align="center" valign="bottom"><img src="/<% = HomeAlias %>/images/piece.gif?<% = GB_STU %>" name="picIMG" width="120" height="90" id="picIMG"></td>
												</tr>
												<tr> 
													<td width="130" height="35"><img src="/<% = HomeAlias %>/images/truck_l_r.gif?<% = GB_STU %>" width="130" height="35"></td>
												</tr>
											</table>
											<% Else %>
											<table width="175" height="135" border="0" cellpadding="0" cellspacing="0">
												<tr> 
													<td width="130" height="100" align="center" valign="bottom"><img src="/<% = HomeAlias %>/images/piece.gif?<% = GB_STU %>" name="picIMG" width="120" height="90" id="picIMG"></td>
													<td width="45" rowspan="2" valign="bottom"><img src="/<% = HomeAlias %>/images/truck_r_l.gif?<% = GB_STU %>" width="45" height="65"></td>
												</tr>
												<tr> 
													<td width="130" height="35"><img src="/<% = HomeAlias %>/images/truck_r_r.gif?<% = GB_STU %>" width="130" height="35"></td>
												</tr>
											</table>
											<% End If %>
										</div>
									</div>
									<table width="100%" height="195" border="0" cellpadding="0" cellspacing="0">
										<tr> 
											<td width="50" rowspan="2"><img src="/<% = HomeAlias %>/images/warehouse_r.gif?<% = GB_STU %>" width="50" height="195"></td>
											<td height="180">&nbsp;</td>
										</tr>
										<tr> 
											<td height="15" bgcolor="#999999"><img src="/<% = HomeAlias %>/images/spacer.gif?<% = GB_STU %>" width="10" height="10"></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr> 
								<td height="15" bgcolor="#999999"><img src="/<% = HomeAlias %>/images/spacer.gif?<% = GB_STU %>" width="10" height="10"></td>
							</tr>
						</table>

					</td>
					<% End If %>
				</tr>
			</table>
		</td>
	</tr>
</table>
</div>
<input type="hidden" name="BunsyoSyuruiCD" value="<% = BunsyoSyuruiCD %>">
<input type="hidden" name="SenpoBunsyoNaiyoCD" value="<% = SenpoBunsyoNaiyoCD %>">
<input type="hidden" name="SenpoBunsyoSyuruiCD" value="<% = SenpoBunsyoSyuruiCD %>">

</form>
</body>
<SCRIPT LANGUAGE="JavaScript"> 
	<% If Request("Action") = "7" Then %>
	var pm;
	pm = -1;
	<% If BunsyoSyuruiCD = "SC" Or BunsyoSyuruiCD = "SS" Or BunsyoSyuruiCD = "SY" Or BunsyoSyuruiCD = "ZS" Then %>
	pm = 1;
	<% End If %>
	itemimg=[<% = SyohinGazoStr %>];
	itemnum=itemimg.length-1;
	
	count=0;
	speed=5;
	//speed=50;


	function init(){
		defw = document.all.AreaLay.clientWidth + 50;
		mvlw = document.all.TruckLay.clientWidth + speed;
		if(pm == 1)start = defw;
		else start = -1 * mvlw;
		document.all.TruckLay.style.left = start;
		xx=0;
		moveLay();
	}


	function moveLay(){
		xx+=speed;
		if(xx>defw+mvlw){
			count+=1;
			if(count>itemnum){ return;}
			document.images["picIMG"].src=itemimg[count];
			init();
		}
		document.all.TruckLay.style.left = start - (xx * pm);
		clearTimeout(slideID);
		slideID=setTimeout('moveLay()',50);
	}

	if(itemnum >= 0)
	{
		slideID=setTimeout("",1);
		document.images["picIMG"].src=itemimg[0];
		init();
	}
<% End If %>
</SCRIPT>

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