<% If GB_Admin => 1 Then %>
対象演習名 |
<% = EnshuMeisyo %>
|
<% End If %>
<% If GB_Admin => 1 Then %>
<% If ConvEnshuKubun(EnshuCD) = "P" Then %>
学生氏名 |
<% Else %>
会社コード |
<% End If %>
申込会社 |
<% End If %>
種別 |
支払期日 |
支払会社 |
額面 |
|
|
<%
Dim Cell1
Dim Cell2
Dim Cell3
Dim Cell4
Dim Cell5
Dim Cell6
ReDim Cell1(0)
ReDim Cell2(0)
ReDim Cell3(0)
ReDim Cell4(0)
ReDim Cell5(0)
ReDim Cell6(0)
Dim ii
ii = 0
Query = "exec SPB銀行取引書類一覧 '" & GB_SystemCD & "', '" & EnshuCD & "', '', '', ''"
Set Content = OpenQuery(Query)
Do While Not(Content.BOF Or Content.EOF)
If (Content.Fields("文書種類CD") = "BS" Or Content.Fields("文書種類CD") = "BT") And "" & Content.Fields("受付区分") = "Y" And "" & Content.Fields("入出金フラグ") <> "1" And "" & Content.Fields("削除フラグ") <> "1" Then
'同時同業の場合は選択生徒のみ表示
If ConvEnshuKubun(EnshuCD) = "G" Or SeitoCD = "" Or "" & ConvKaisyaGakuseiNo(EnshuCD, Content.Fields("作成会社CD")) = SeitoCD Then
ReDim PreServe Cell1(UBound(Cell1) + 1) '配列+1
ReDim PreServe Cell2(UBound(Cell2) + 1) '配列+1
ReDim PreServe Cell3(UBound(Cell3) + 1) '配列+1
ReDim PreServe Cell4(UBound(Cell4) + 1) '配列+1
ReDim PreServe Cell5(UBound(Cell5) + 1) '配列+1
ReDim PreServe Cell6(UBound(Cell6) + 1) '配列+1
Dim TorihikisakiCD
TorihikisakiCD = Content.Fields("作成会社CD")
Dim ShiharaininCD
ShiharaininCD = Content.Fields("手形作成会社CD")
'手形から支払情報を取得
Dim Kingaku
Dim Kijutsu
Dim Tenmatsubi
Query = "exec SPK手形取得"
Query = Query & " '" & GB_SystemCD & "', '" & EnshuCD & "'"
Query = Query & ",'" & Content.Fields("取引先CD") & "'"
Query = Query & ",'" & Content.Fields("手形作成会社CD") & "'"
Query = Query & ",'" & Content.Fields("手形文書種類CD") & "'"
Query = Query & ",'" & Content.Fields("手形文書内容CD") & "'"
Set ContentTG = OpenQuery(Query)
If Not(ContentTG.BOF Or ContentTG.EOF) Then
Kingaku = ContentTG.Fields("金額")
Kijutsu = SetTimeYYYYMMDD(ContentTG.Fields("支払期日"))
Tenmatsubi = SetTimeYYYYMMDD(ContentTG.Fields("顛末日"))
Else '手形が存在しない場合
Kingaku = Content.Fields("手形小切手出金金額")
Kijutsu = SetTimeYYYYMMDD(Content.Fields("手形支払期日"))
Tenmatsubi = "--"
TorihikisakiCD = Content.Fields("取引先CD")
ShiharaininCD = GetKozaShoyuKaishaCD(EnshuCD, Content.Fields("手形小切手出金銀行CD"), Content.Fields("手形小切手出金口座区分"), Content.Fields("手形小切手出金口座番号"))
End If
If GB_Admin => 1 Then
If ConvEnshuKubun(EnshuCD) = "P" Then
Cell1(UBound(Cell1)) = ConvGakuseiShimei(ConvKaisyaGakuseiNo(EnshuCD, TorihikisakiCD))
Else
Cell1(UBound(Cell1)) = TorihikisakiCD
End If
Cell2(UBound(Cell2)) = ConvKaisyaMeisyoDx(EnshuCD, TorihikisakiCD)
End If
If Content.Fields("文書種類CD") = "BS" Then
Cell3(UBound(Cell3)) = "取立"
Else
Cell3(UBound(Cell3)) = "割引"
End If
Cell4(UBound(Cell4)) = Kijutsu
Cell5(UBound(Cell5)) = ConvKaisyaMeisyoDx(EnshuCD, ShiharaininCD)
Cell6(UBound(Cell6)) = SetMoney(Kingaku, false, true)
ii = ii + 1
End If
End If
Content.MoveNext
Loop
'インスタントソート出力
If UBound(Cell1) > 0 Then
'最大の支払期日を取得(デクリメントするため)
Dim TmpMaxDate
TmpMaxDate = Cell4(1) '先頭行を仮代入する
For ii = 2 To UBound(Cell1)
If DateDiff("d", TmpMaxDate, Cell4(ii)) > 0 Then
TmpMaxDate = Cell4(ii)
End If
Next
Dim jj
For jj = 1 To UBound(Cell1)
'最小の支払期日を取得し、該当する行を全出力
Dim TmpMinDate
TmpMinDate = TmpMaxDate
For ii = 1 To UBound(Cell1)
If Cell4(ii) <> "" Then
If DateDiff("d", TmpMinDate, Cell4(ii)) < 0 Then
TmpMinDate = Cell4(ii)
End If
End If
Next
For ii = 1 To UBound(Cell1)
If Cell4(ii) <> "" And Cell4(ii) = TmpMinDate Then
Response.Write("" & vbCrLf)
If GB_Admin => 1 Then
Response.Write("" & Cell1(ii) & " | " & vbCrLf)
Response.Write("" & Cell2(ii) & " | " & vbCrLf)
End If
Response.Write("" & Cell3(ii) & " | " & vbCrLf)
Response.Write("" & Cell4(ii) & " | " & vbCrLf)
Response.Write("" & Cell5(ii) & " | " & vbCrLf)
Response.Write("" & Cell6(ii) & " | " & vbCrLf)
Response.Write(" " & vbCrLf)
Cell4(ii) = "" '以降の処理から除外するためNULL代入
End If
Next
Next
'最大の支払期日に該当する行を全出力
For ii = 1 To UBound(Cell1)
If Cell4(ii) = TmpMaxDate Then
Response.Write("" & vbCrLf)
If GB_Admin => 1 Then
Response.Write("" & Cell1(ii) & " | " & vbCrLf)
Response.Write("" & Cell2(ii) & " | " & vbCrLf)
End If
Response.Write("" & Cell3(ii) & " | " & vbCrLf)
Response.Write("" & Cell4(ii) & " | " & vbCrLf)
Response.Write("" & Cell5(ii) & " | " & vbCrLf)
Response.Write("" & Cell6(ii) & " | " & vbCrLf)
Response.Write(" " & vbCrLf)
End If
Next
End If
%>
|
|