<%

Function Tegata(EnshuCD, KaisyaCD, SakuseiKaisyaCD, BunsyoSyuruiCD, BunsyoNaiyoCD, AutoFlg, PrintFlg)

	Dim RouteType
	RouteType = Request("RouteType")

	Dim SenpoFlg
	Dim Title
	Title = ConvKubunMeisyo("手形種類区分", BunsyoSyuruiCD)

	Dim JitsuinRiyo
	Dim SoufuzumiTegataHyoji
	Query = "exec SPM演習取得 '" & GB_SystemCD & "','" & EnshuCD & "'" 
	Set Content = OpenQuery(Query)
	If Not(Content.BOF Or Content.EOF) Then
		SoufuzumiTegataHyoji = "" & Content.Fields("送付済み手形表示様式")
		If BunsyoSyuruiCD = "TG" Then
			SoufuzumiTegataHyoji = "" & Content.Fields("送付済み小切手表示様式")
		End If
		JitsuinRiyo = "" & Content.Fields("実印利用")
	End If

	SenpoFlg = 0
	If SakuseiKaisyaCD <> KaisyaCD Then
		SenpoFlg = 1
	End If


	Dim Query, Content
	Dim TmpKaisyaCD
	Dim HikiukeninCD, FuridashininCD, UketorininCD
	Dim ShiharaiBasyo
	Dim ShiharaiKijitsu, Furidashibi
	Dim Kingaku
	Dim Tekiyo
	Dim HasshinFlg
	Dim Tenmatsubi, TenmatsuKubun, HiuragakininCD, UragakininCD
	Dim SakujyoFlg
	Dim SojyushinKubun

	Dim MainTenmatsubi, MainTenmatsuKubun, MainHiuragakininCD
	Dim FuridashininMeisyo, UketorininMeisyo, HikiukeninMeisyo, HiuragakininMeisyo, ShiharaibasyoMeisyo, TegataSyuruiMeisyo

	Dim UragakininMeisyo, TenmatsuKubunMeisyo
	Dim TegataNo
	
	Dim BunsyoNaiyouSEQ

	If GB_JisyaFlag <> "" Then	'運用管理・演習管理(自社フラグ無し)では開封フラグを立てない(061213小野)
		Query = "exec SPK手形開封"
		Query = Query & " '" & GB_SystemCD & "', '" & EnshuCD & "'"		'演習CD
		Query = Query & ",'" & KaisyaCD & "'"					'会社CD
		Query = Query & ",'" & SakuseiKaisyaCD & "'"				'会社CD
		Query = Query & ",'" & BunsyoSyuruiCD & "'"
		Query = Query & ",'" & BunsyoNaiyoCD & "'"
	
		Set Content = OpenQuery(Query)
	End If

	Query = "exec SPK手形取得"
	Query = Query & " '" & GB_SystemCD & "', '" & EnshuCD & "'"			'演習CD
	Query = Query & ",'" & KaisyaCD & "'"						'会社CD
	Query = Query & ",'" & SakuseiKaisyaCD & "'"					'会社CD
	Query = Query & ",'" & BunsyoSyuruiCD & "'"
	Query = Query & ",'" & BunsyoNaiyoCD & "'"

	Set Content = OpenQuery(Query)


	If Not(Content.BOF Or Content.EOF) Then
		TegataNo = Content.Fields("手形番号")

		FuridashininMeisyo = Content.Fields("振出人名称")
		UketorininMeisyo = Content.Fields("受取人名称")
		HikiukeninMeisyo = Content.Fields("引受人名称")
		HiuragakininMeisyo = Content.Fields("被裏書人名称")
		ShiharaibasyoMeisyo = Content.Fields("支払場所名称")
		TegataSyuruiMeisyo = Content.Fields("手形種類名称")

		HikiukeninCD = Content.Fields("引受人CD")
		FuridashininCD = Content.Fields("振出人CD")
		UketorininCD = Content.Fields("受取人CD")
		ShiharaiBasyo = Content.Fields("支払場所CD")
		BunsyoNaiyoCD = Content.Fields("文書内容CD")
		ShiharaiKijitsu = SetTimeYYYYMMDD(Content.Fields("支払期日"))
		Furidashibi = SetTimeYYYYMMDD(Content.Fields("取引日"))
		Tekiyo = Content.Fields("摘要")
		Kingaku = Content.Fields("金額")
		HasshinFlg = Content.Fields("発行フラグ")
		SakujyoFlg = Content.Fields("削除フラグ")
		Tenmatsubi = SetTimeYYYYMMDD(Content.Fields("顛末日"))
		TenmatsuKubun = Content.Fields("顛末区分")
		SojyushinKubun = Content.Fields("送受信区分")
		HiuragakininCD = Content.Fields("被裏書人CD")
	End If

	MainTenmatsubi = Tenmatsubi
	MainTenmatsuKubun = TenmatsuKubun
	MainHiuragakininCD = HiuragakininCD

	Dim UketorininRyaku, Uketorinin, HikiukeninRyaku, Hikiukenin
	
	If HikiukeninCD = "etc" Then
		HikiukeninRyaku = "その他"
		Hikiukenin = "その他"
	Else
		HikiukeninRyaku = HikiukeninMeisyo
		Hikiukenin = HikiukeninMeisyo
	End If


	If UketorininCD = "etc" Then
		UketorininRyaku = "その他"
		Uketorinin = "その他"
	Else
		UketorininRyaku = ConvKaisyaRyakuMeisyo(UketorininCD)
		Uketorinin = ConvKaisyaMeisyoDx(EnshuCD, UketorininCD)
	End If

	If IsNull(TenmatsuKubun) Then
		TenmatsuKubun = ""
	End If


	Dim TegataType
	TegataType = ""
	If SojyushinKubun = "S" And HasshinFlg = 0 Then
		TegataType = "VA"
	ElseIf SojyushinKubun = "S" And HasshinFlg <> 0 Then
		TegataType = "VB"
	ElseIf SojyushinKubun = "R" And HasshinFlg <> 2 And TenmatsuKubun = "" Then
		TegataType = "VC"
	ElseIf SojyushinKubun = "R" And HasshinFlg <> 2 And TenmatsuKubun <> "" Then
		TegataType = "VD"
	ElseIf SojyushinKubun = "R" And HasshinFlg >= 2 Then
		TegataType = "VF"
	ElseIf SojyushinKubun = "U" Then
		TegataType = "VE"
	ElseIf SojyushinKubun = "H" Then
		TegataType = "VG"
	End IF

	Dim BackColor
	Dim BackColor2
	Dim BackColor3
	BackColor = "FFF8DB"
	BackColor2 = "FFFFF1"
	BackColor3 = "FFF0C0"
	If BunsyoSyuruiCD = "TG" Then
		BackColor = "FBFFE0"
		BackColor2 = "FCFFFC"
		BackColor3 = "F7FFC8"
	End If



'DEBUG
'Response.Write("デバッグ中だす(^^ゞ<br>")
'Response.Write("EnshuCD:"&EnshuCD&"<br>")
'Response.Write("KaisyaCD:"&KaisyaCD&"<br>")
'Response.Write("SakuseiKaisyaCD:"&SakuseiKaisyaCD&"<br>")
'Response.Write("BunsyoSyuruiCD:"&BunsyoSyuruiCD&"<br>")
'Response.Write("BunsyoNaiyoCD:"&BunsyoNaiyoCD&"<br>")
'Response.Write("AutoFlg:"&AutoFlg&"<br>")
'Response.Write("PrintFlg:"&PrintFlg&"<br>")
'Response.Write("RouteType:"&RouteType&"<br>")
'Response.Write("TegataNo:"&TegataNo&"<br>")
'Response.Write("SojyushinKubun:"&SojyushinKubun&"<br>")
'Response.Write("TegataType:"&TegataType&"<br>")
'Response.Write("HasshinFlg:" & HasshinFlg & "<br>")
'Response.Write("TenmatsuKubun:"&TenmatsuKubun&"<br>")


%>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr> 
		<td align="left" valign="top">
		<%
			If PrintFlg = 1 Then
				Response.Write(PrintHeader(AutoFlg, ""))
				If BunsyoSyuruiCD = "TG" Then
					If HasshinFlg = 0 And SenpoFlg = 0 Then
						Response.Write("作成小切手")
					ElseIf HasshinFlg = 1 And SenpoFlg = 0 Then
						Response.Write("振出小切手")
					Else
						Response.Write("受取小切手")
					End If
				ElseIf (BunsyoSyuruiCD = "TK" Or BunsyoSyuruiCD = "TY") And TegataType <> "VE" And TegataType <> "VF" And TegataType <> "VG" Then '裏書譲渡控え・手形引受控え・銀行受領控えには表記しない
					If HasshinFlg = 0 And SenpoFlg = 0 Then
						Response.Write("作成手形")
					ElseIf HasshinFlg = 1 And SenpoFlg = 0 Then
						Response.Write("振出手形")
					Else
						Response.Write("受取手形")
					End If
				End If
			End If
		%>
			<% If TegataType = "VE" Or TegataType = "VF" Or TegataType = "VG" Then %>
			<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" BGCOLOR="#FFFFFF" STYLE="border: 1px solid #111111" width="<% If ((TegataType = "VC" OR TegataType = "VD" OR TegataType = "VE" Or TegataType = "VF") And BunsyoSyuruiCD <> "TG") And PrintFlg = 0 Then %>820<% Else %>700<% End If %>" height="300">
				<tr>
					<td width="100%" align="center" CLASS="tx1618">
					
					<!-- 文書系には、手形タイトルを入れない //-->
					<% If InStr(RouteType, "MailOnly") = 0 and InStr(RouteType, "RMail") = 0 Then %>
						<% If TegataType = "VE" Then %>
						裏書譲渡控え
						<% ElseIf TegataType = "VG" Then %>
						手形引受控え
						<% Else %>
						銀行受領控え
						<% End If %>
						
					<% end if %>
					
			<% End If %>

						<table BORDER="0" CELLSPACING="0" CELLPADDING="0" width="<% If ((TegataType = "VC" OR TegataType = "VD" OR TegataType = "VE" Or TegataType = "VF") And BunsyoSyuruiCD <> "TG") And PrintFlg = 0 Then %>820<% Else %>700<% End If %>">
							<tr>
								<td align="center">
									<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="250" STYLE="border-left: 1px solid #111111;">
										<tr>
											
											<% 
												'社長室・総務部から入った場合の記述を追加 GB_Gyosyu <> "S"
												If InStr(RouteType, "Hakushi") > 0 Or ((TegataType = "VA" OR TegataType = "VB") and InStr(RouteType, "SMail") = 0 and InStr(RouteType, "syatyo") = 0) Then 
											%>
											
											<td width="180" valign="top" bgcolor="#<% = BackColor2 %>" align="center" STYLE="border-top: 1px solid #111111;border-right: 1px solid #111111;border-bottom: 1px solid #111111;">
												<div style="position:relative; width:100%;">
													<div style="position:absolute; right:0px; top:70px; z-index:2; overflow:visible;">
														<% If JitsuinRiyo = "1" And InStr(RouteType, "Hakushi") < 1 Then %>
														<img src="/<% = HomeAlias %>/images/jitsuin_l.gif?<% = GB_STU %>">
														<% End If %>
													</div>
													<div style="position:absolute; left:10px; top:13px; z-index:1; overflow:visible;">
														<table border="0" width="90%" cellspacing="0" cellpadding="0" class="tx1416">
															<tr>
																<td><span class="tx1214">NO.</span><% = TegataNo %><div style="border-bottom-style: solid; border-bottom-width: 1;"></div></td>
															</tr>
															<tr>
																<td>受取人:<br><% = Uketorinin %><div style="border-bottom-style: solid; border-bottom-width: 1;"></div></td>
															</tr>
															<% If BunsyoSyuruiCD = "TK" Then %>
															<tr>
																<td>引受人:<br><% = Hikiukenin %><div style="border-bottom-style: solid; border-bottom-width: 1;"></div></td>
															</tr>
															<% End If %>
															<tr>
																<td>金額:<span class="tx1618"><% = ConvIntToMoney(Kingaku, false, false) %></span><div style="border-bottom-style: solid; border-bottom-width: 1;"></div></td>
															</tr>
															<% If BunsyoSyuruiCD = "TK" Or BunsyoSyuruiCD = "TY" Then %>
															<tr>
																<td>支払期日:<br><% = SetDate(ShiharaiKijitsu, 3) %><div style="border-bottom-style: solid; border-bottom-width: 1;"></div></td>
															</tr>
															<% End If %>
															<tr>
																<td>支払場所:<br><% = ShiharaibasyoMeisyo %><div style="border-bottom-style: solid; border-bottom-width: 1;"></div></td>
															</tr>
															<tr>
																<td>振出日:<br><% = SetDate(Furidashibi, 3) %><div style="border-bottom-style: solid; border-bottom-width: 1;"></div></td>
															</tr>
														<% If BunsyoSyuruiCD = "TG" Then %>
															<tr>
																<td>摘要:<br><% = HardWrap(Tekiyo) %><div style="border-bottom-style: solid; border-bottom-width: 1;"></div></td>
															</tr>
														<% End If %>
														</table>
													</div>
												</div>
											</td>
											
											<% End If %>
						
											<% 
												'社長室・総務部から入った場合の記述を追加
												If SoufuzumiTegataHyoji = "0" And TegataType = "VB" And InStr(RouteType, "SMail") = 0 And InStr(RouteType, "syatyo") = 0 Then 
											%>
						                    <!--ドット-->
											<td WIDTH="525" STYLE="border-top: 1px dotted #111111;border-right: 1px dotted #111111;border-bottom: 1px dotted #111111;"><img src="/<% = HomeAlias %>/images/spacer.gif?<% = GB_STU %>" width="1" height="1"></td>
											
											<% End If %>
						
											<% 
												'社長室・総務部から入った場合の記述を追加
												If (SoufuzumiTegataHyoji = "1" And TegataType = "VB") Or TegataType = "" Or TegataType = "VA" Or TegataType = "VC" Or TegataType = "VD" OR TegataType = "VE" Or TegataType = "VF" Or TegataType = "VG" Or InStr(RouteType, "SMail") <> 0 Or InStr(RouteType, "syatyo") > 0 Then 
											%>
						
											<td WIDTH="525" valign="top" bgcolor="#<% = BackColor %>" STYLE="border-top: 1px solid #111111;border-right: 1px solid #111111;border-bottom: 1px solid #111111;border-top: 1px solid #111111;border-right: 1px solid #111111;border-bottom: 1px solid #111111;">
												<div style="position:relative; width:100%;">
													<% '送付済み(印刷時は半透明処理が効かないため除外する)
													If PrintFlg = 0 And TegataType = "VB" And InStr(RouteType, "SMail") = 0 And InStr(RouteType, "syatyo") = 0 Then %>
													<div style="position:absolute; left:0px; top:0px; z-index:3; overflow:visible;"> 
														<img src="/<% = HomeAlias %>/images/souhuzumi.gif?<% = GB_STU %>" alt="IMG" width="494" height="240" style="filter: alpha(style=0, opacity=10);">
													</div> 
													<% '廃棄済み(印刷時は半透明処理が効かないため除外する)
													ElseIf PrintFlg = 0 And SakujyoFlg = 1 And TegataType = "VA" And InStr(RouteType, "SMail") = 0 And InStr(RouteType, "syatyo") = 0 Then %>
													<div style="position:absolute; left:0px; top:0px; z-index:3; overflow:visible;"> 
														<img src="/<% = HomeAlias %>/images/haikizumi.gif?<% = GB_STU %>" alt="IMG" width="494" height="240" style="filter: alpha(style=0, opacity=10);">
													</div> 
													<% End If %>
													<div style="position:absolute; left:0px; top:70px; z-index:2; overflow:visible;">
														<% If JitsuinRiyo = "1" And InStr(RouteType, "Hakushi") < 1 Then %>
														<img src="/<% = HomeAlias %>/images/jitsuin_r.gif?<% = GB_STU %>">
														<% End If %>
													</div>
													<div style="position:absolute; left:0px; top:0px; z-index:1; overflow:visible;">
														<table border="0" width="100%"	HEIGHT="100%" cellspacing="0" cellpadding="0">
															<tr>
																<td height="36" valign="bottom">
																	<table border="0" width="100%" cellspacing="0" cellpadding="0" CLASS="tx1618">
																		<tr>
																			<td width="10"><br></td>
																			<td width="140" class="tx1416" align="left">&nbsp;<span class="tx1214">NO.</span><% = TegataNo %>
																			<div style="border-bottom-style: solid; border-bottom-width: 1;"></div></td>
																			<td align="center"><% If Len(Title) < 8 Then Response.Write(SetStringInsertSpace(Title)) Else Response.Write(Title) %><% If PrintFlg = 1 And TegataType = "VB" And InStr(RouteType, "SMail") = 0 And InStr(RouteType, "syatyo") = 0 Then %>&nbsp;(送付済み)<% End If %></td>
																			<td width="150" align="right" CLASS="tx1416">拒絶証書不要<img src="/<% = HomeAlias %>/images/spacer.gif?<% = GB_STU %>" width="1" height="1"></td>
																			<td width="10"><br></td>
																		</tr>
																	</table>
																</td>
															</tr>
															<tr>
																<td height="10"><img src="/<% = HomeAlias %>/images/spacer.gif?<% = GB_STU %>" width="1" height="1"></td>
															</tr>
															<tr>
																<td>
																	<table border="0" width="100%" cellspacing="0" cellpadding="0" class="tx1416" height="80%">
																		<tr>
																			<td width="98" align="center">
																				<% If BunsyoSyuruiCD = "TK" OR BunsyoSyuruiCD = "TY" Then %>
																				<table border="0" width="84" height="95" cellspacing="0" cellpadding="0" style="border: 1px dotted #888888" class="tx1618">
																					<tr>
																						<td width="100%" valign="middle" align="center"><font color="#888888">* * *<br>* * *<br>* * *</font></td>
																					</tr>
																				</table>
																				<% End If %>
																			</td>
																			<td valign="middle" align="center">
																				<% If BunsyoSyuruiCD = "TK" Then %>
																				<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" height="65" width="90%">
																					<tr>
																						<td width="100%" height="10">
																							<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" height="100%" width="100%" class="tx1416">
																								<tr>
																									<td width="55">引受人</td>
																									<td><% = Hikiukenin %>殿</td>
																								</tr>
																							</table>
																						</td>
																					</tr>
																					<tr>
																						<td width="100%">
																								<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#<% = BackColor3 %>" STYLE="border: 1px solid #111111" WIDTH="100%" HEIGHT="100%" class="tx1416">
																								<tr>
																									<td width="100%" align="center">金額 ¥<span class="tx1820"><% If InStr(RouteType, "Hakushi") > 0 Then %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<% Else %><% = ConvIntToMoney(Kingaku, false, false) %><% End If %></span>※</td>
																								</tr>
																							</table>
																						</td>
																					</tr>
																					<tr>
																						<td width="100%" height="10" class="tx1416">
																							<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" height="100%" width="100%" class="tx1416">
																								<tr>
																									<td width="55">受取人</td>
																									<td><% = Uketorinin %></td>
																								</tr>
																							</table>
																						</td>
																					</tr>
																					<tr>
																						<td width="100%" height="10" class="tx1416">振出日 <% = SetDate(Furidashibi, 3) %></td>
																					</tr>
																				</table>
																				<% ElseIf BunsyoSyuruiCD = "TY" Then %>
																				<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" height="65" width="90%">
																					<tr>
																						<td width="100%" height="10" class="tx1416">
																							<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" height="100%" width="100%" class="tx1416">
																								<tr>
																									<td width="55">受取人</td>
																									<td><% = Uketorinin %>殿</td>
																								</tr>
																							</table>
																						</td>
																					</tr>
																					<tr>
																						<td width="100%">
																							<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#<% = BackColor3 %>" STYLE="border: 1px solid #111111" WIDTH="100%" HEIGHT="100%" class="tx1416">
																								<tr>
																									<td width="100%" align="center">金額 ¥<span class="tx1820"><% If InStr(RouteType, "Hakushi") > 0 Then %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<% Else %><% = ConvIntToMoney(Kingaku, false, false) %><% End If %></span>※</td>
																								</tr>
																							</table>
																						</td>
																					</tr>
																					<tr>
																						<td width="100%" height="10" class="tx1416">振出日 <% = SetDate(Furidashibi, 3) %></td>
																					</tr>
																				</table>
																				<% Else %>
																				<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" height="65" width="90%">
																					<tr>
																						<td width="100%">
																							<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#<% = BackColor3 %>" STYLE="border: 1px solid #111111" WIDTH="100%" HEIGHT="100%" class="tx1416">
																								<tr>
																									<td width="100%" align="center">金額 ¥<span class="tx1820"><% If InStr(RouteType, "Hakushi") > 0 Then %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<% Else %><% = ConvIntToMoney(Kingaku, false, false) %><% End If %></span>※</td>
																								</tr>
																							</table>
																						</td>
																					</tr>
																					<tr>
																						<td width="100%" height="10" class="tx1416">上記の金額をこの小切手と引替に<br>持参人へお支払いください</td>
																					</tr>
																					<tr>
																						<td width="100%" height="10" class="tx1416">振出日 <% = SetDate(Furidashibi, 3) %></td>
																					</tr>
																				</table>
																				<% End If %>
																			</td>
																			<td width="135">
																				<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="5"	WIDTH="100%" HEIGHT="75" STYLE="border: 1px dotted #111111" class="tx1416" bordercolor="#000000">
																					<% If BunsyoSyuruiCD = "TK" Or BunsyoSyuruiCD = "TY" Then %>
																					<tr>
																						<td height="20">支払期日<br> <% = SetDate(ShiharaiKijitsu, 3) %></td>
																					</tr>
																					<% End If %>
																					<tr>
																						<td>支払場所<br><% = ShiharaibasyoMeisyo %></td>
																					</tr>
																				</table>
																			</td>
																			<td width="10"> </td>
																		</tr>
																	</table>
																</td>
															</tr>
															<tr>
																<td height="6"><img src="/<% = HomeAlias %>/images/spacer.gif?<% = GB_STU %>" width="1" height="1"></td>
															</tr>
															<tr>
																<td height="80">
																	<table BORDER="0" CELLSPACING="1" CELLPADDING="0" width="100%" height="100%" class="tx1416">
																		<tr>
																			<td width="96" valign="middle" align="center">
																				<% If BunsyoSyuruiCD = "TK" OR BunsyoSyuruiCD = "TY" Then %>
																				<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="0" width="72" height="86" STYLE="border: 1px solid #888888" class="tx1416" bordercolor="#888888">
																					<tr>
																						<td width="100%" style="line-height:13px; font-family:MS 明朝,serif; font-size:12px; color:#888888;" valign="middle" align="center">
																							税&nbsp;付&nbsp;印<br>
																							務&nbsp;に&nbsp;紙<br>
																							署&nbsp;つ&nbsp;税<br>
																							承&nbsp;き&nbsp;申<br>
																							認&nbsp;○&nbsp;告<br>
																							済&nbsp;○&nbsp;納</td>
																					</tr>
																				</table>
																				<% End If %>
																			</td>
																			<TD width="220" valign="top">
																				<div style="position:relative;">
																					<div STYLE="position:absolute; left:0px; top:10px; z-index:3; overflow:visible;">
																						振出人 <br>
																						<span class="tx1214"><% = ConvKaisyaJyusyo1(EnshuCD, FuridashininCD) %></span><br>
																						<% = ConvKaisyaName(EnshuCD, FuridashininCD) %><br>
																						代表取締役 <% = ConvDaihyoName(EnshuCD, FuridashininCD) %>
																					</div>
																					<div STYLE="position:absolute; right:10px; top:15px; z-index:4; overflow:visible;">
																						<% If JitsuinRiyo = "1" And InStr(RouteType, "Hakushi") < 1 Then %>
																						<img src="/<% = HomeAlias %>/images/jitsuin.gif?<% = GB_STU %>">
																						<% End If %>
																					</div>
																				</div>
																			</td>
																			<td class="tx1416"></td>
																			<% If BunsyoSyuruiCD = "TK" Then %>
																			<TD width="220" valign="top">
																				<div style="position:relative;">
																					<div STYLE="position:absolute; left:0px; top:10px; z-index:5; overflow:visible;">
																						引受人 <br>
																						<span class="tx1214"><% = ConvKaisyaJyusyo1(EnshuCD, HikiukeninCD) %></span><br>
																						<% = Hikiukenin %>
																					</div>
																					<div STYLE="position:absolute; right:10px; top:15px; z-index:6; overflow:visible;">
																						<% If JitsuinRiyo = "1" And InStr(RouteType, "Hakushi") < 1 Then %>
																						<img src="/<% = HomeAlias %>/images/jitsuin.gif?<% = GB_STU %>">
																						<% End If %>
																					</div>
																				</div>
																			</td>
																			<% Else %>
																			<td width="220">&nbsp;</td>
																			<% End If %>
																		</tr>
																	</table>
																</td>
															</tr>
														</table>
													</div>
												</div>
											</td>
											
											<% End If %>
											
										</tr>
									</table>
									
									<% If (TegataType = "VC" OR TegataType = "VD" OR TegataType = "VE" Or TegataType = "VF") And BunsyoSyuruiCD <> "TG" Then %>
									(表面)
								</td>



									<% If PrintFlg = 1 Then '印刷時は裏書を回り込み %>
							</tr>
						</table>

			<% If TegataType = "VE" Or TegataType = "VF" Or TegataType = "VG" Then %>
					</td>
				</tr>
			</TABLE>
			<% End If %>
		</td>
	</tr>
	<tr> 
		<td align="center" valign="center">
			<% If TegataType = "VE" Or TegataType = "VF" Or TegataType = "VG" Then %>
			<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" BGCOLOR="#FFFFFF" STYLE="border: 1px solid #111111"	width="650" height="390">
				<tr>
					<td width="100%" align="center" CLASS="tx1618">
			<% End If %>
						<table BORDER="0" CELLSPACING="0" CELLPADDING="3">
							<tr>
									<% End If %>



								<td>
									<% If PrintFlg = 0 Then '画面表示は縦が足らないので縮める(^^; %>
									<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" BGCOLOR="#FFFFFF" STYLE="border: 1px solid #111111"	width="240" height="465">
									<% Else %>
									<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="2" BGCOLOR="#FFFFFF" STYLE="border: 1px solid #111111"	width="240" height="525">
									<% End If %>
										<tr>
											<td width="100%" valign="top">
											
											<% If PrintFlg = 0 Then %>
												<DIV ID="Layer1" STYLE="position:relative; left:0px; top:0px; width:250px; height:100%; z-index:1; border: 1px none #000000; overflow: auto;">
											<% End If %>
						
											<% 
												Query = "exec SPK手形取得裏書"
												Query = Query & " '" & GB_SystemCD & "', '" & EnshuCD & "'"		'演習CD
												Query = Query & ",'" & KaisyaCD & "'"	'会社CD
												Query = Query & ",'" & SakuseiKaisyaCD & "'"	'会社CD
												Query = Query & ",'" & BunsyoSyuruiCD & "'"
												Query = Query & ",'" & BunsyoNaiyoCD & "'"
												
												
												'Response.write(Query)
												
												Set Content = OpenQuery(Query)
												
												Dim cnt1,i
												cnt1 = 0
												Do While Not(Content.BOF Or Content.EOF)
													cnt1 = cnt1 + 1 '裏書の件数を調べる
													Content.MoveNext
												Loop
												
												Set Content = OpenQuery(Query)
												

												'手形タイプがU(裏書)またはRで、かつ送受信文書ならば、自分が送ったぶんは表示させないので所得数を-1する
												'RouteType="MailOnlyRmail"
												
												'if (SojyushinKubun = "U" or SojyushinKubun = "R") and  InStr(RouteType, "RMail") <> 0  then
												'if (SojyushinKubun = "U") and  InStr(RouteType, "RMail") <> 0  then
												if (TenmatsuKubun = "TU" or TenmatsuKubun = "TT" or TenmatsuKubun = "TW") and  InStr(RouteType, "RMail") <> 0  then
													cnt1 = cnt1 - 1 
												end if
												
												for i = 1 to cnt1 'ループし裏書情報を取得
												
													'Do While Not(Content.BOF Or Content.EOF)

													Tenmatsubi = SetTimeYYYYMMDD(Content.Fields("取引日"))
													UragakininCD = Content.Fields("裏書人CD")
													HiuragakininCD = Content.Fields("被裏書人CD")
													TenmatsuKubun = Content.Fields("顛末区分")
													UragakininMeisyo = Content.Fields("裏書人略名称")
													HiuragakininMeisyo = Content.Fields("被裏書人略名称")
													TenmatsuKubunMeisyo = Content.Fields("顛末区分名称")
													
													BunsyoNaiyouSEQ = Content.Fields("文書内容SEQ")
													
											%>
												<table width="249" height="100" border="0" cellspacing="0" cellpadding="0" class="tx1416" style="border-bottom: 2px double black;">
													<tr>
														<td width="100%" colspan="2">表記金額を<BR>下記被裏書人へお支払いください</td>
													</tr>
													<tr>
														<td colspan="2">
															<table border="0" cellspacing="0" cellpadding="0" class="tx1416">
																<tr>
																	<td nowrap><% = SetDate(Tenmatsubi, 3) %><!--<% = Tenmatsubi %>//--></td>
																	<td nowrap> 拒絶証書不要</td>
																</tr>
															</table>
														</td>
													</tr>
													<tr>
														<td>裏書人 </td>
														<td width="160"><% = UragakininMeisyo %></td>
													</tr>
													<tr>
														<td>(目的) </td>
														<td><% = TenmatsuKubunMeisyo %>の為</td>
													</tr>
													<tr>
														<td width="100%" colspan="2">
															<table	border="0" cellspacing="0" cellpadding="0" class="tx1416" width="100%" style="border-top: 1px dotted gray;">
																<tr>
																	<td width="70">被裏書人</td>
																	<td><% If HiuragakininCD = "" Or IsNull(HiuragakininCD) Then 
																		Response.Write("(銀行以外の被受取人)")
																	Else
																		Response.Write(HiuragakininMeisyo)
																	End If
																	 %></td>
																</tr>
															</table>
														</td>
													</tr>
												</table>
												
											<%
													Content.MoveNext
													'Loop
												
												next

											%>

											<% If PrintFlg = 0 Then %>
												</div>
											<% End If %>
											
											</td>
											
										</tr>
									</table>
									(裏面)
								<% End If %>
								</td>
							</tr>
						</table>

			<% If TegataType = "VE" Or TegataType = "VF" Or TegataType = "VG" Then %>
					</td>
				</tr>
			</TABLE>
			<% End If %>

		<%
			If PrintFlg = 1 Then
				Response.Write(PrintFooter())
			End if
		%>
		</td>
	</tr>
</table>


<%
End Function
%>