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

<%
'<!--
'################################################
'	名称	:繰越残高設定
'	作成日:2003/1/20
'	作成者:山崎
'	目的 :繰越残高設定を表示する。
'	概要	:
'################################################
'-->
'
%>

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

	Dim HyojiFlg
	HyojiFlg = Request("HyojiFlg")

	Dim ShijoCD
	ShijoCD = Request("ShijoCD")

	'製造部対応(080411小野)
	Dim Mode
	Mode = Request("Mode")

	Dim GenkinNyusyukinCD, Genkin , Kingaku
	Dim Query, Content, Content1, ContentKoza , QueryKoza , Query1
	Dim ii, jj, kk

	Dim bCheck

	Query = "exec SPK現金入出金取得 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', 0, 0"
	Set Content = OpenQuery(Query)
	If Not(Content.BOF Or Content.EOF) Then
		Genkin = Content.Fields("金額")
	End If

	'運用管理対応(080415小野)
	Dim TmpGakuseiNo
	Query = "exec SPM会社取得 '" & GB_SystemCD & "','" & EnshuCD & "','" & KaisyaCD & "'"
	Set Content = OpenQuery(Query)
	If Not(Content.BOF Or Content.EOF) Then
		TmpGakuseiNo = "" & Content.Fields("学生番号")
	End If

	Dim HyojunTankaHyoji
	Dim KishusetteiRiyo
	Dim KishusetteiRiyoKanjo
	Dim KishusetteiRiyoKurikoshi
	Query = "exec SPM演習取得 '" & GB_SystemCD & "','" & EnshuCD & "'"
	Set Content = OpenQuery(Query)
	If Not(Content.BOF Or Content.EOF) Then
		HyojunTankaHyoji = "" & Content.Fields("標準販売単価表示")
		KishusetteiRiyo = "" & Content.Fields("期首設定経理部利用")
	End If
	If "" & KishusetteiRiyo = "" Then
		KishusetteiRiyo = "3"
	End If
	KishusetteiRiyoKanjo = "1"
	KishusetteiRiyoKurikoshi = "1"
	If KishusetteiRiyo = "2" Or KishusetteiRiyo = "0" Then
		'勘定残高のみ
		KishusetteiRiyoKurikoshi = "0"
	End If
	If KishusetteiRiyo = "1" Or KishusetteiRiyo = "0" Then
		'繰越残高のみ
		KishusetteiRiyoKanjo = "0"
	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)"	name="form1" method="POST" action="fk_kurikoshizandaka_bin.asp">
<input type="hidden" name="DenpyoNo" value="0000000">
<input type="hidden" name="SendValue" value="">

<%
	Response.Write(HtmlDesign(1))

	If GB_Admin >= 1 Then
		Response.Write(HttpL1(4))
	Else
		Response.Write(HttpL1(2))
	End If

	If GB_Admin >= "1" Then
		Response.Write(HttpL2("運用管理メニュー" ,"tblbtn( '/" & HomeAlias & "/admin/admenu.asp')", "マスター管理", "tblbtn( '/" & HomeAlias & "/admin/master/fm_master_select.asp')", "会社マスター", "tblbtn( '/" & HomeAlias & "/admin/master/kaisya/fm_kaisya_view.asp?Action=2&KaisyaCD=" & KaisyaCD & "&ShijoCD=" & ShijoCD & "&HyojiFlg=" & HyojiFlg & "' )", "繰越残高設定", "", "", "", "", ""))
	ElseIf Mode = "Seizo" Then	'製造部対応(080411小野)
		Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "製造部", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s6.asp')", "繰越残高設定", "", "", "", "", ""))
	ElseIf GB_Gyosyu <> "B" Then
		Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo, "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "経理部", "tblbtn( '/" & HomeAlias & "/user/bk/menu_s1.asp')", "繰越残高設定", "", "", "", "", ""))
	Else
		Response.Write(HttpL2("会社選択" ,"tblbtn( '/" & HomeAlias & "/user/bk/')", GB_GyosyuMeisyo , "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & ".asp')", "経理業務", "tblbtn( '/" & HomeAlias & "/user/bk/menu_" & GB_Gyosyu & "1.asp')", "繰越残高設定", "", "", "", "", ""))
	End If

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

	Response.Write(HttpL3_1("", "", "", "", "", "", "", "", "", ""))

	If KishusetteiRiyoKurikoshi = "1" Then
		Response.Write(HttpL3_2("入力", "tblbtn('fk_kurikoshizandaka.asp?KaisyaCD=" & Request("KaisyaCD") & "&GyosyuCD=" & Request("GyosyuCD") & "&Mode=" & Mode & "&ShijoCD=" & ShijoCD & "&HyojiFlg=" & HyojiFlg & "')", "", "", "", "", "", "", "", ""))
	Else
		Response.Write(HttpL3_2("", "", "", "", "", "", "", "", "", ""))
	End If

	Dim KaishaHyoji
	If GB_Admin > 0 Then
		KaishaHyoji = ConvKaisyaRyakuMeisyoDx(EnshuCD, KaisyaCD)
	End If
	If Mode = "Seizo" Then	'製造部対応(080411小野)
		Response.Write(HttpL4("製造部繰越残高設定", KaishaHyoji))
	Else
		Response.Write(HttpL4("繰越残高設定", KaishaHyoji))
	End If



%>


<div id="L0" style="position: absolute; visibility: hidden; left: 0px; top: -2000px;">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td align="center">
			<table width="1" height="500" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td align="center">
						<table width="1" height="520" border="0" cellpadding="0" cellspacing="0" style="border:solid 0px #111111">
							<tr>
								<td align="center">
									<table width="1" height="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td width="155" align="center" valign="bottom">
												<table width="1" height="100%" border="0" cellspacing="5" cellpadding="5" bgcolor="#ffffff" style="border:1px solid #000000">
													<tr>
														<td valign="top" align="center" background="/<% = HomeAlias %>/images/window_bk.gif">
															<DIV ID="Layer1" STYLE="position:relative; left:0px; top:0px; width:100%px; height:100%; z-index:1; border: 1px none #000000; overflow: auto;"> 
															<table border="0" class="tx1618" width="100%" cellspacing="0" cellpadding="3">
																<tr height="10">
<% If Mode <> "Seizo" Then %>
																	<td height="10" valign="top">

															<table border="0" class="tx1618" width="100%" cellspacing="0" cellpadding="3">
																<tr height="10">
																	<td valign="top">
																		期首現金設定<br>
																		<table border="1" class="tx1416" STYLE="border-collapse: collapse" bordercolor="#000000" cellspacing="0" cellpadding="3" bgcolor="#FFFFFF">
																			<tr align="center">
																				<td bgcolor="#FFFFCC" width="110">金額</td>
																			</tr>
																			<tr>
																				<td align="right"> 
																					<% If Genkin <> "" Then %>
																						<% = ConvIntToMoney(Genkin, false, false) %>
																					<% End If %>
																				</td>
																			</tr>

																		</table>
																	</td>
																</tr>
																<tr height="10">
																	<td valign="top">
																		期首銀行設定<BR>
																		<table border="0" class="tx1416" width="100%" cellspacing="0" cellpadding="0">
																			<tr>
																				<td>
																					<table border="1" class="tx1416" STYLE="border-collapse: collapse" bordercolor="#000000" cellspacing="0" cellpadding="3" bgcolor="#FFFFFF">
																						<tr align="center">
																							<td nowrap bgcolor="#FFFFCC" width="130">銀行口座</td>
																							<td nowrap bgcolor="#FFFFCC" width="110">金額</td>
																						</tr>
																						<%
																							Dim GinkoSoGokei
																							GinkoSoGokei = 0
																							QueryKoza = "exec SPB銀行口座一覧4 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "'"
																							Set ContentKoza = OpenQuery(QueryKoza)
																							Do While Not(ContentKoza.BOF Or ContentKoza.EOF)
																								Kingaku = ""
																								Dim MyGinkoCD, MyKozaKubun
																								MyGinkoCD = ""
																								MyKozaKubun = ""
																								If Not(ContentKoza.BOF Or ContentKoza.EOF) Then
																									MyGinkoCD = ContentKoza.Fields("銀行CD")
																									MyKozaKubun = ContentKoza.Fields("口座区分")
																								End If
																								Query = "exec SPB銀行口座入出金一覧 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', '" & MyGinkoCD & "', '" & MyKozaKubun & "', ''"
																								Set Content = OpenQuery(Query)
																								Do While Not(Content.BOF Or Content.EOF)
																									If Content.Fields("処理時期区分") = 0 Then
																										Kingaku = Content.Fields("金額")
																									End If
																									Content.MoveNext
																								Loop
																								If Kingaku <> "" Then
																									GinkoSoGokei = GinkoSoGokei + Kingaku
																								End If
			%>
																						<tr align="center">
																							<td nowrap><% = ConvKaisyaRyakuMeisyo(MyGinkoCD) %> <% = ConvKubunMeisyo("口座区分", MyKozaKubun) %></td>
																							<td nowrap align="right"><% = ConvIntToMoney(Kingaku, false, false) %></td>
																						</tr>
			<%
																							ContentKoza.MoveNext
																							Loop
																							%>

																					</table>
																				</td>
																			</tr>
																			<tr>
																				<td align="right">合計金額:<% = SetMoney(GinkoSoGokei, false, true) %>
																				</td>
																			</tr>
																		</table>
																	</td>
																</tr>
															</table>

																	</td>
																	<td rowspan="3" valign="top">
																		&nbsp;
																	</td>
<% End If %>


																	<td rowspan="3" valign="top">
																		<% If GB_Gyosyu <> "B" Then %>
																		<table border="0" class="tx1618" width="100%" cellspacing="0" cellpadding="0">
																			<tr>
																				<td>
																					期首<% If Mode = "Seizo" Then Response.Write("材料") Else Response.Write("商品") End If %>設定
																				</td>
																			</tr>
																			<tr>
																				<td>
																					<table border="1" class="tx1416" STYLE="border-collapse: collapse" bordercolor="#000000" cellspacing="0" cellpadding="3" bgcolor="#FFFFFF">
																						<tr align="center">
																							<td bgcolor="#FFFFCC" nowrap width="240">商品</td>
																						<% If HyojunTankaHyoji <> "0" Then '標準販売単価表示 %>
																							<td bgcolor="#FFFFCC" nowrap><% If MHMSTDSELLPRICE <> "" Then Response.Write(MHMSTDSELLPRICE) Else Response.Write("標準単価") End If %></td>
																						<% End If %>
																							<td bgcolor="#FFFFCC" nowrap width="90">個数</td>
																							<td bgcolor="#FFFFCC" nowrap width="110">仕入単価</td>
																							<td bgcolor="#FFFFCC" nowrap width="110">金額</td>
																						</tr>
																						<%
																						Dim SyohinSu, ShohinSogokei
																						Dim NyusyukoBango, QueryNyusyuko, ContentNyusyuko
																						
																						'Dim NyusyukoSEQ, NextNyusyukoSEQ'090625追加
																						'NyusyukoSEQ = 0'090625追加
																						'NextNyusyukoSEQ = 0'090625追加
																						
																						
																						ShohinSogokei = 0
																						If Mode = "Seizo" Then	'製造部対応(080411小野)
																							QueryNyusyuko = "exec SPD入出庫一覧 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', '" & KaisyaCD & "', 'ZS'"
																						Else
																							QueryNyusyuko = "exec SPD入出庫一覧 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', '" & KaisyaCD & "', 'SS'"
																						End If
																						Set ContentNyusyuko = OpenQuery(QueryNyusyuko)
																						Do While Not(ContentNyusyuko.BOF Or ContentNyusyuko.EOF)
																							If ContentNyusyuko.Fields("処理時期区分") = 0 Then
																								NyusyukoBango = ContentNyusyuko.Fields("文書内容CD")
																							End If
																							ContentNyusyuko.MoveNext
																						Loop

																						If Mode = "Seizo" Then	'製造部対応(080411小野)
																							QueryNyusyuko = "exec SPD入出庫取得 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', '" & KaisyaCD & "', 'ZS', '" & NyusyukoBango	& "'"
																						Else
																							QueryNyusyuko = "exec SPD入出庫取得 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', '" & KaisyaCD & "', 'SS', '" & NyusyukoBango	& "'"
																						End If
																						Set ContentNyusyuko = OpenQuery(QueryNyusyuko)
																						Do While Not(ContentNyusyuko.BOF Or ContentNyusyuko.EOF)
																						
																						
																						'NyusyukoSEQ = ContentNyusyuko("入出庫SEQ")'090625追加
																						'if NyusyukoSEQ <> NextNyusyukoSEQ then'090625追加
																						
																						
																						
																						
																							ShohinSogokei = ShohinSogokei + ContentNyusyuko.Fields("数量") * ContentNyusyuko.Fields("単価")
			%>
																						<tr align="center">
																							<td nowrap>
																							<%
																							Dim SyohinTmp
																							Dim TankaTmp
																							'運用管理の場合は学生番号を一時入れ替え(080415小野)
																							Dim Tmp2GakuseiNo
																							If GB_Admin >= 1 Then
																								Tmp2GakuseiNo = GB_GakuseiNo
																								GB_GakuseiNo = TmpGakuseiNo
																							End If
																							If Mode = "Seizo" Then	'製造部対応(080411小野)
																								SyohinTmp = ConvZairyoMeisyo(ContentNyusyuko.Fields("商品CD"))
																								TankaTmp = ConvZairyoHanbaiTanka(ContentNyusyuko.Fields("商品CD"))
																							Else
																								SyohinTmp = ConvSyohinMeisyo(ContentNyusyuko.Fields("商品CD"))
																								TankaTmp = ConvSyohinHanbaiTanka(ContentNyusyuko.Fields("商品CD"))
																							End If
																							'運用管理の場合は学生番号を戻す(080415小野)
																							If GB_Admin >= 1 Then
																								GB_GakuseiNo = Tmp2GakuseiNo
																							End If
																							If AscLen(SyohinTmp) > 31 Then
																								SyohinTmp = AscLeft(SyohinTmp,31) '商品名称を19byteで切捨て(061027小野)
																							End If
																							%>
																							<% = SyohinTmp %></td>
																						<% If HyojunTankaHyoji <> "0" Then '標準販売単価表示 %>
																							<td nowrap align="right"><% = ConvIntToMoney(TankaTmp, false, false) %></td>
																						<% End If %>
																							<td nowrap align="right"><% = ConvIntToMoney(ContentNyusyuko.Fields("数量"), false, false) %></td>
																							<td nowrap align="right"><% = ConvIntToMoney(ContentNyusyuko.Fields("単価"), false, false) %></td>
																							<td nowrap align="right"><% = ConvIntToMoney(ContentNyusyuko.Fields("数量") * ContentNyusyuko.Fields("単価"), false, false) %></td>
																						</tr>

			<%
																							'end if'090625追加
																							'NextNyusyukoSEQ = NyusyukoSEQ'090625追加
																							
																							
																							ContentNyusyuko.MoveNext
																						Loop
			%>
																						<tr align="center">
																							<td colspan="<% If HyojunTankaHyoji <> "0" Then '標準販売単価表示 %>4<% Else %>3<% End If %>" align="right" nowrap>合計金額&nbsp;</td>
																							<td nowrap align="right"><% = SetMoney(ShohinSogokei, false, true) %> </td>
																						</tr>

																					</table>
																				</td>
																			</tr>
																		</table>
																		<% If 0=1 And Mode = "Seizo" Then	'期首製品は不要(常に商品になる)なので停止。いずれ期首仕掛品を作るかもしれない %>
																		<table border="0" class="tx1416" width="100%" cellspacing="0" cellpadding="0">
																			<tr>
																				<td height="24" valign="bottom">
																					期首製品設定
																				</td>
																			</tr>
																			<tr>
																				<td>
																					<table border="1" class="tx1416" STYLE="border-collapse: collapse" bordercolor="#000000" cellspacing="0" cellpadding="3" bgcolor="#FFFFFF">
																						<tr align="center">
																							<td bgcolor="#FFFFCC" nowrap width="140">商品</td>
																							<td bgcolor="#FFFFCC" nowrap>標準単価</td>
																							<td bgcolor="#FFFFCC" nowrap width="50">個数</td>
																							<td bgcolor="#FFFFCC" nowrap width="80">仕入単価</td>
																							<td bgcolor="#FFFFCC" nowrap width="80">金額</td>
																						</tr>
																						<%
																						
																						ShohinSogokei = 0
																						QueryNyusyuko = "exec SPD入出庫一覧 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', '" & KaisyaCD & "', 'MS'"
																						Set ContentNyusyuko = OpenQuery(QueryNyusyuko)
																						Do While Not(ContentNyusyuko.BOF Or ContentNyusyuko.EOF)
																							If ContentNyusyuko.Fields("処理時期区分") = 0 Then
																								NyusyukoBango = ContentNyusyuko.Fields("文書内容CD")
																							End If
																							ContentNyusyuko.MoveNext
																						Loop

																						QueryNyusyuko = "exec SPD入出庫取得 '" & GB_SystemCD & "','" & EnshuCD & "', '" & KaisyaCD & "', '" & KaisyaCD & "', 'MS', '" & NyusyukoBango	& "'"
																						Set ContentNyusyuko = OpenQuery(QueryNyusyuko)
																						Do While Not(ContentNyusyuko.BOF Or ContentNyusyuko.EOF)
																						
																						
																						'NyusyukoSEQ = ContentNyusyuko("入出庫SEQ")'090625追加
																						'if NyusyukoSEQ <> NextNyusyukoSEQ then'090625追加
																						
																						
																						
																						
																							ShohinSogokei = ShohinSogokei + ContentNyusyuko.Fields("数量") * ContentNyusyuko.Fields("単価")
			%>
																						<tr align="center">
																							<td nowrap>
																							<%
																							'運用管理の場合は学生番号を一時入れ替え(080415小野)
																							If GB_Admin >= 1 Then
																								Tmp2GakuseiNo = GB_GakuseiNo
																								GB_GakuseiNo = TmpGakuseiNo
																							End If
																							SyohinTmp = ConvSyohinMeisyo(ContentNyusyuko.Fields("商品CD"))
																							TankaTmp = ConvSyohinHanbaiTanka(ContentNyusyuko.Fields("商品CD"))
																							'運用管理の場合は学生番号を戻す(080415小野)
																							If GB_Admin >= 1 Then
																								GB_GakuseiNo = Tmp2GakuseiNo
																							End If
																							If AscLen(SyohinTmp) > 19 Then
																								SyohinTmp = AscLeft(SyohinTmp,19) '商品名称を19byteで切捨て(061027小野)
																							End If
																							%>
																							<% = SyohinTmp %></td>
																							<td nowrap align="right"><% = ConvIntToMoney(TankaTmp, false, false) %></td>
																							<td nowrap align="right"><% = ConvIntToMoney(ContentNyusyuko.Fields("数量"), false, false) %></td>
																							<td nowrap align="right"><% = ConvIntToMoney(ContentNyusyuko.Fields("単価"), false, false) %></td>
																							<td nowrap align="right"><% = ConvIntToMoney(ContentNyusyuko.Fields("数量") * ContentNyusyuko.Fields("単価"), false, false) %></td>
																						</tr>

			<%
																							'end if'090625追加
																							'NextNyusyukoSEQ = NyusyukoSEQ'090625追加
																							
																							
																							ContentNyusyuko.MoveNext
																						Loop
			%>
																						<tr align="center">
																							<td colspan="4" align="right" nowrap>合計金額&nbsp;</td>
																							<td nowrap align="right"><% = SetMoney(ShohinSogokei, false, true) %> </td>
																						</tr>

																					</table>
																				</td>
																			</tr>
																		</table>
																		<% End If %>
																		<% End If %>
																	</td>
																</tr>
															</table>
															</div>
														</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</div>
</form>
</body>
<% = HtmlFooter %>

<script language="JavaScript">


	function SubmitCheck()
	{
		ii = 1;
			if(ii < 10)jj = "0" + ii;
			else jj = "" + ii;
			var GinkoCDs, aGinkoCD;
			aGinkoCD = "";
			GinkoCDs = "";
		while( typeof(form1["GinkoCD" + jj]) == "object" )
		{
			if(form1["GinkoCD" + jj].value == "" && form1["GinkoKingaku" + jj].value != "")
			{
				alert("口座を選択してください");
				form1["GinkoCD" + jj].focus();
				return;
			}
			aGinkoCD = GinkoCDs.split(",");
			for(kk = 0; kk< aGinkoCD.length; kk++)
			{

				if(aGinkoCD[kk] != "" && aGinkoCD[kk] == form1["GinkoCD" + jj].value)
				{
					alert("口座が重複しています");
					form1["GinkoCD" + jj].focus();
					return;

				}
			}
			GinkoCDs = GinkoCDs + form1["GinkoCD" + jj].value + ","

			ii = ii + 1;
				if(ii < 10)jj = "0" + ii;
				else jj = "" + ii;
		}


		ii = 1;
			if(ii < 10)jj = "0" + ii;
			else jj = "" + ii;
			var SyohinCDs, aSyohinCD;
			aSyohinCD = "";
			SyohinCDs = "";
		while( typeof(form1["SyohinCD" + jj]) == "object" )
		{
			if(form1["SyohinCD" + jj].value != "" || form1["SyohinKosu" + jj].value != "" || form1["SyohinKingaku" + jj].value != "" )
			{
				if(form1["SyohinCD" + jj].value == "")
				{
					alert("商品を選択してください");
					form1["SyohinCD" + jj].focus();
					return;
				}
				if(form1["SyohinKosu" + jj].value == "")
				{
					alert("個数を選択してください");
					form1["SyohinKosu" + jj].focus();
					return;
				}
				if(form1["SyohinKingaku" + jj].value == "")
				{
					alert("仕入単価を選択してください");
					form1["SyohinKingaku" + jj].focus();
					return;
				}



			}


			aSyohinCD = SyohinCDs.split(",");
			for(kk = 0; kk< aSyohinCD.length; kk++)
			{

				if(aSyohinCD[kk] != "" && aSyohinCD[kk] == form1["SyohinCD" + jj].value)
				{
					alert("商品が重複しています");
					form1["SyohinCD" + jj].focus();
					return;

				}
			}
			SyohinCDs = SyohinCDs + form1["SyohinCD" + jj].value + ","

			ii = ii + 1;
				if(ii < 10)jj = "0" + ii;
				else jj = "" + ii;
		}



		SubmitReal(form1);
	}

</script>
</html>
<%
End Sub
%>