613 lines
15 KiB
ObjectPascal
613 lines
15 KiB
ObjectPascal
object Form1: TForm1
|
|
Left = 229
|
|
Top = 50
|
|
Caption = #24180#24230#38283#24115#20316#26989
|
|
ClientHeight = 626
|
|
ClientWidth = 816
|
|
Color = clBtnFace
|
|
Font.Charset = DEFAULT_CHARSET
|
|
Font.Color = clWindowText
|
|
Font.Height = -16
|
|
Font.Name = 'Tahoma'
|
|
Font.Style = []
|
|
OldCreateOrder = False
|
|
Position = poDesigned
|
|
OnActivate = FormActivate
|
|
OnClose = FormClose
|
|
OnCreate = FormCreate
|
|
PixelsPerInch = 96
|
|
TextHeight = 19
|
|
object spl1: TSplitter
|
|
Left = 0
|
|
Top = 369
|
|
Width = 816
|
|
Height = 5
|
|
Cursor = crVSplit
|
|
Align = alTop
|
|
ExplicitTop = 305
|
|
end
|
|
object WDBGRID1: WDBGRID
|
|
Left = 0
|
|
Top = 40
|
|
Width = 816
|
|
Height = 329
|
|
Align = alTop
|
|
DataSource = DSBPAA
|
|
TabOrder = 0
|
|
TitleFont.Charset = DEFAULT_CHARSET
|
|
TitleFont.Color = clWindowText
|
|
TitleFont.Height = -16
|
|
TitleFont.Name = 'Tahoma'
|
|
TitleFont.Style = []
|
|
IsTwoColor = True
|
|
TwoColor = 12648447
|
|
TwoFontColor = clWindowText
|
|
AllowAppend = False
|
|
AllowDelete = False
|
|
IsVerScrollBar = True
|
|
MenuShow = [msWDGM, msExcel, msDBF, msDB, msTXT, msMDB]
|
|
Columns = <
|
|
item
|
|
Expanded = False
|
|
Width = 0
|
|
Visible = True
|
|
ValueChecked = 'T'
|
|
ValueUnchecked = 'F'
|
|
EditType = etEdit
|
|
TwoColor = 12648447
|
|
TwoFontColor = clWindowText
|
|
end
|
|
item
|
|
Expanded = False
|
|
FieldName = 'CHECKED'
|
|
Title.Caption = #36984#21462
|
|
Width = 36
|
|
Visible = True
|
|
Check = True
|
|
ValueChecked = 'Y'
|
|
ValueUnchecked = 'N'
|
|
EditType = etEdit
|
|
TwoColor = 12648447
|
|
TwoFontColor = clWindowText
|
|
end
|
|
item
|
|
Expanded = False
|
|
FieldName = 'BPPNM'
|
|
Title.Caption = #35336#30059#20195#34399
|
|
Width = 70
|
|
Visible = True
|
|
ValueChecked = 'T'
|
|
ValueUnchecked = 'F'
|
|
EditType = etEdit
|
|
TwoColor = 12648447
|
|
TwoFontColor = clWindowText
|
|
end
|
|
item
|
|
Expanded = False
|
|
FieldName = 'BPPME'
|
|
Title.Caption = #35336#30059#21517#31281
|
|
Width = 257
|
|
Visible = True
|
|
ValueChecked = 'T'
|
|
ValueUnchecked = 'F'
|
|
EditType = etEdit
|
|
TwoColor = 12648447
|
|
TwoFontColor = clWindowText
|
|
end
|
|
item
|
|
Expanded = False
|
|
FieldName = 'BPPYN'
|
|
Title.Caption = #21407#24180#24230#35336#30059#20195#34399
|
|
Width = 118
|
|
Visible = True
|
|
ValueChecked = 'T'
|
|
ValueUnchecked = 'F'
|
|
EditType = etEdit
|
|
TwoColor = 12648447
|
|
TwoFontColor = clWindowText
|
|
end
|
|
item
|
|
Expanded = False
|
|
FieldName = 'NEW_BPPNM'
|
|
Title.Caption = #26032#35336#30059#20195#34399
|
|
Width = 84
|
|
Visible = True
|
|
ValueChecked = 'T'
|
|
ValueUnchecked = 'F'
|
|
EditType = etEdit
|
|
TwoColor = 12648447
|
|
TwoFontColor = clWindowText
|
|
end>
|
|
end
|
|
object Panel1: TPanel
|
|
Left = 0
|
|
Top = 0
|
|
Width = 816
|
|
Height = 40
|
|
Align = alTop
|
|
BevelOuter = bvNone
|
|
TabOrder = 1
|
|
object Label1: TLabel
|
|
Left = 8
|
|
Top = 10
|
|
Width = 112
|
|
Height = 19
|
|
Caption = #35201#35079#35069#30340#24180#24230#65306
|
|
end
|
|
object eYY: TEdit
|
|
Left = 120
|
|
Top = 7
|
|
Width = 65
|
|
Height = 27
|
|
TabOrder = 0
|
|
end
|
|
object btnYYOk: TButton
|
|
Left = 191
|
|
Top = 8
|
|
Width = 65
|
|
Height = 25
|
|
Caption = #26597#35426
|
|
TabOrder = 1
|
|
OnClick = btnYYOkClick
|
|
end
|
|
end
|
|
object Panel2: TPanel
|
|
Left = 0
|
|
Top = 374
|
|
Width = 816
|
|
Height = 64
|
|
Align = alTop
|
|
BevelOuter = bvNone
|
|
TabOrder = 2
|
|
object Label2: TLabel
|
|
Left = 8
|
|
Top = 9
|
|
Width = 64
|
|
Height = 19
|
|
Caption = #26032#24180#24230#65306
|
|
end
|
|
object btnOpenYear: TButton
|
|
Left = 146
|
|
Top = 7
|
|
Width = 154
|
|
Height = 25
|
|
Caption = #30906#23450#35079#35069#33267#26032#24180#24230
|
|
TabOrder = 1
|
|
OnClick = btnOpenYearClick
|
|
end
|
|
object eNewYY: TEdit
|
|
Left = 74
|
|
Top = 6
|
|
Width = 65
|
|
Height = 27
|
|
TabOrder = 0
|
|
end
|
|
object cbInsertBPAA: TCheckBox
|
|
Left = 145
|
|
Top = 38
|
|
Width = 120
|
|
Height = 20
|
|
Caption = #26032#22686#24180#24230#25509#21934
|
|
Checked = True
|
|
State = cbChecked
|
|
TabOrder = 3
|
|
end
|
|
object cbInsertBPJA: TCheckBox
|
|
Left = 385
|
|
Top = 38
|
|
Width = 89
|
|
Height = 20
|
|
Caption = #26032#22686#32887#31281
|
|
Checked = True
|
|
State = cbChecked
|
|
TabOrder = 5
|
|
end
|
|
object cbInsertBPJB: TCheckBox
|
|
Left = 481
|
|
Top = 38
|
|
Width = 121
|
|
Height = 20
|
|
Caption = #26032#22686#32887#31281#31561#32026
|
|
Checked = True
|
|
State = cbChecked
|
|
TabOrder = 6
|
|
end
|
|
object cbInsertRASN: TCheckBox
|
|
Left = 610
|
|
Top = 38
|
|
Width = 136
|
|
Height = 20
|
|
Caption = #36681#20154#21729#27966#36963#36039#26009
|
|
Checked = True
|
|
State = cbChecked
|
|
TabOrder = 7
|
|
end
|
|
object cbInsertBPAB: TCheckBox
|
|
Left = 273
|
|
Top = 38
|
|
Width = 105
|
|
Height = 20
|
|
Caption = #36681#26371#35336#31185#30446
|
|
Checked = True
|
|
State = cbChecked
|
|
TabOrder = 4
|
|
end
|
|
object cbClearFirst: TCheckBox
|
|
Left = 306
|
|
Top = 9
|
|
Width = 154
|
|
Height = 21
|
|
Caption = #20808#28165#38500#20877#35079#35069#36039#26009
|
|
TabOrder = 2
|
|
end
|
|
end
|
|
object Memo1: TMemo
|
|
Left = 0
|
|
Top = 438
|
|
Width = 816
|
|
Height = 188
|
|
Align = alClient
|
|
TabOrder = 3
|
|
ExplicitTop = 410
|
|
ExplicitHeight = 116
|
|
end
|
|
object Conn: TADOConnection
|
|
LoginPrompt = False
|
|
Provider = 'SQLNCLI.1'
|
|
Left = 48
|
|
Top = 112
|
|
end
|
|
object QBPAA: TADODataSet
|
|
Connection = Conn
|
|
CursorType = ctStatic
|
|
CommandText =
|
|
' SELECT '#39'N'#39' AS CHECKED, A.BPPNM, A.BPYER, A.BPPYN, A.BPPYM, B.BP' +
|
|
'PME, '#39#39' AS NEW_BPPNM, '#39#39' AS NEW_BPPYN'#13#10' FROM BPAA A INNER JOIN B' +
|
|
'PRJ B ON A.BPPNM=B.BPPNM'#13#10' WHERE A.BPYER=:BPYER AND A.BPPNM<>'#39'00' +
|
|
'0001'#39#13#10
|
|
Parameters = <
|
|
item
|
|
Name = 'BPYER'
|
|
Attributes = [paSigned]
|
|
DataType = ftInteger
|
|
Precision = 10
|
|
Size = 4
|
|
Value = Null
|
|
end>
|
|
Left = 96
|
|
Top = 112
|
|
object QBPAACHECKED: TStringField
|
|
FieldName = 'CHECKED'
|
|
ProviderFlags = []
|
|
Size = 1
|
|
end
|
|
object QBPAABPPNM: TWideStringField
|
|
FieldName = 'BPPNM'
|
|
Size = 10
|
|
end
|
|
object QBPAABPYER: TIntegerField
|
|
FieldName = 'BPYER'
|
|
end
|
|
object QBPAABPPYN: TWideStringField
|
|
FieldName = 'BPPYN'
|
|
Size = 10
|
|
end
|
|
object QBPAABPPYM: TWideStringField
|
|
FieldName = 'BPPYM'
|
|
Size = 50
|
|
end
|
|
object QBPAABPPME: TWideStringField
|
|
FieldName = 'BPPME'
|
|
Size = 30
|
|
end
|
|
object QBPAANEW_BPPNM: TStringField
|
|
DisplayLabel = #26032#35336#30059#20195#34399
|
|
DisplayWidth = 10
|
|
FieldName = 'NEW_BPPNM'
|
|
ProviderFlags = []
|
|
Size = 10
|
|
end
|
|
end
|
|
object DSBPAA: TDataSource
|
|
DataSet = CDSBPAA
|
|
Left = 256
|
|
Top = 112
|
|
end
|
|
object InsertBPAA: TADOCommand
|
|
CommandText =
|
|
'INSERT INTO BPAA '#13#10' (BPPNM, BPYER, BPPYN, BPPYM, BPBGT, BPCSD, ' +
|
|
'BPMSD, BPS01, BPS02, BPS03, '#13#10' BPS04, BPS05, BPS06, BPS07, BPS' +
|
|
'08, BPS09, BPS10, BPS11, BPS12, BPS13, '#13#10' BPS14, BPS15, BPS16,' +
|
|
' BPS17, BPS18, BPS19, BPS20, BPS21, BPS22, BPS23, '#13#10' BPS24, BP' +
|
|
'S25, BPS26, BPS27, BPS28, BPS29, BPS30, BPFED, APPNO, TRDAT, '#13#10' ' +
|
|
' TRMOD, TRUSR)'#13#10'SELECT '#13#10' :BPPNM, :BPYER, :BPPYN, :BPPYM, BPB' +
|
|
'GT, BPCSD, BPMSD, BPS01, BPS02, BPS03, '#13#10' BPS04, BPS05, BPS06,' +
|
|
' BPS07, BPS08, BPS09, BPS10, BPS11, BPS12, BPS13, '#13#10' BPS14, BP' +
|
|
'S15, BPS16, BPS17, BPS18, BPS19, BPS20, BPS21, BPS22, BPS23, '#13#10' ' +
|
|
' BPS24, BPS25, BPS26, BPS27, BPS28, BPS29, BPS30, BPFED, 1, :TR' +
|
|
'DAT, '#13#10' '#39'INSERT'#39', TRUSR'#13#10'FROM BPAA'#13#10'WHERE BPPYN=:OLD_BPPYN'#13#10
|
|
Connection = Conn
|
|
Parameters = <
|
|
item
|
|
Name = 'BPPNM'
|
|
DataType = ftWideString
|
|
Size = 10
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'BPYER'
|
|
DataType = ftInteger
|
|
Size = -1
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'BPPYN'
|
|
DataType = ftWideString
|
|
Size = 12
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'BPPYM'
|
|
DataType = ftWideString
|
|
Size = 50
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'TRDAT'
|
|
DataType = ftDateTime
|
|
Size = -1
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'OLD_BPPYN'
|
|
DataType = ftWideString
|
|
Size = 12
|
|
Value = Null
|
|
end>
|
|
Left = 48
|
|
Top = 168
|
|
end
|
|
object InsertBPAB: TADOCommand
|
|
CommandText =
|
|
'INSERT INTO BPAB'#13#10' (BPPYN, BPACC, BPAME, BPBGT, BPCLS, BPORD, ' +
|
|
'BPDOC, APPNO, TRDAT, TRMOD, TRUSR) '#13#10'SELECT'#13#10' :BPPYN, BPACC, B' +
|
|
'PAME, BPBGT, BPCLS, BPORD, BPDOC, APPNO, :TRDAT, '#39'INSERT'#39', TRUSR' +
|
|
#13#10'FROM BPAB'#13#10'WHERE BPPYN=:OLD_BPPYN'#13#10
|
|
Connection = Conn
|
|
Parameters = <
|
|
item
|
|
Name = 'BPPYN'
|
|
DataType = ftWideString
|
|
Size = 12
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'TRDAT'
|
|
DataType = ftDateTime
|
|
Size = -1
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'OLD_BPPYN'
|
|
DataType = ftWideString
|
|
Size = 12
|
|
Value = Null
|
|
end>
|
|
Left = 112
|
|
Top = 168
|
|
end
|
|
object InsertBPJA: TADOCommand
|
|
CommandText =
|
|
'INSERT INTO BPJA'#13#10' (BPPYN, BPJNO, BPJME, BPQTY, APPNO, TRDAT, ' +
|
|
'TRMOD, TRUSR) '#13#10'SELECT'#13#10' :BPPYN, BPJNO, BPJME, BPQTY, APPNO, :' +
|
|
'TRDAT, '#39'INSERT'#39', TRUSR'#13#10'FROM BPJA'#13#10'WHERE BPPYN=:OLD_BPPYN'#13#10
|
|
Connection = Conn
|
|
Parameters = <
|
|
item
|
|
Name = 'BPPYN'
|
|
DataType = ftWideString
|
|
Size = 12
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'TRDAT'
|
|
DataType = ftDateTime
|
|
Size = -1
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'OLD_BPPYN'
|
|
DataType = ftWideString
|
|
Size = 12
|
|
Value = Null
|
|
end>
|
|
Left = 176
|
|
Top = 168
|
|
end
|
|
object InsertBPJB: TADOCommand
|
|
CommandText =
|
|
'INSERT INTO BPJB'#13#10' (BPPYN, BPJNO, BPCNO, BPCME, BPSRM, BPSRD, ' +
|
|
'BPP01, BPP02, BPP03, BPP04, BPP05, APPNO, TRDAT, TRMOD, TRUSR) '#13 +
|
|
#10'SELECT'#13#10' :BPPYN, BPJNO, BPCNO, BPCME, BPSRM, BPSRD, BPP01, BP' +
|
|
'P02, BPP03, BPP04, BPP05, APPNO, :TRDAT, '#39'INSERT'#39', TRUSR'#13#10'FROM B' +
|
|
'PJB'#13#10'WHERE BPPYN=:OLD_BPPYN'#13#10
|
|
Connection = Conn
|
|
Parameters = <
|
|
item
|
|
Name = 'BPPYN'
|
|
DataType = ftWideString
|
|
Size = 12
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'TRDAT'
|
|
DataType = ftDateTime
|
|
Size = -1
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'OLD_BPPYN'
|
|
DataType = ftWideString
|
|
Size = 12
|
|
Value = Null
|
|
end>
|
|
Left = 240
|
|
Top = 168
|
|
end
|
|
object InsertRASN: TADOCommand
|
|
CommandText =
|
|
'INSERT INTO dbo.RASN'#13#10' (RANUM, RAITM, RACNM, RAPYN, RASDT, RAE' +
|
|
'DT, RAJNO, RACNO, RABRH, RAS01, APPNO, TRDAT, TRMOD, TRUSR) '#13#10'SE' +
|
|
'LECT'#13#10' A.RANUM, (SELECT MAX(B.RAITM) + 1 FROM RASN B WHERE B.' +
|
|
'RANUM=A.RANUM) RAITM, A.RACNM, '#13#10' :BPPYN, :RASDT, NULL, A.RAJ' +
|
|
'NO, A.RACNO, A.RABRH, A.RAS01, A.APPNO, :TRDAT, '#39'INSERT'#39', TRUSR'#13 +
|
|
#10'FROM RASN A'#13#10'WHERE RAPYN=:OLD_BPPYN AND A.RAEDT IS NULL'#13#10
|
|
Connection = Conn
|
|
Parameters = <
|
|
item
|
|
Name = 'BPPYN'
|
|
DataType = ftWideString
|
|
Size = 12
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'RASDT'
|
|
DataType = ftDateTime
|
|
Size = -1
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'TRDAT'
|
|
DataType = ftDateTime
|
|
Size = -1
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'OLD_BPPYN'
|
|
DataType = ftWideString
|
|
Size = 12
|
|
Value = Null
|
|
end>
|
|
Left = 304
|
|
Top = 168
|
|
end
|
|
object EndOldRASN: TADOCommand
|
|
CommandText =
|
|
'UPDATE RASN SET RAEDT=:RAEDT WHERE RAPYN=:OLD_RAPYN AND RAEDT IS' +
|
|
' NULL '
|
|
Connection = Conn
|
|
Parameters = <
|
|
item
|
|
Name = 'RAEDT'
|
|
Attributes = [paNullable]
|
|
DataType = ftDateTime
|
|
NumericScale = 3
|
|
Precision = 23
|
|
Size = 16
|
|
Value = Null
|
|
end
|
|
item
|
|
Name = 'OLD_RAPYN'
|
|
Attributes = [paNullable]
|
|
DataType = ftWideString
|
|
NumericScale = 255
|
|
Precision = 255
|
|
Size = 10
|
|
Value = Null
|
|
end>
|
|
Left = 368
|
|
Top = 168
|
|
end
|
|
object DSPBPAA: TDataSetProvider
|
|
DataSet = QBPAA
|
|
ResolveToDataSet = True
|
|
Options = [poAllowCommandText, poUseQuoteChar]
|
|
Left = 144
|
|
Top = 112
|
|
end
|
|
object CDSBPAA: TClientDataSet
|
|
Aggregates = <>
|
|
Params = <>
|
|
ProviderName = 'DSPBPAA'
|
|
Left = 200
|
|
Top = 112
|
|
end
|
|
object DeleteBPAA: TADOCommand
|
|
CommandText = 'DELETE FROM BPAA '#13#10'WHERE BPPYN=:BPPYN'#13#10
|
|
Connection = Conn
|
|
Parameters = <
|
|
item
|
|
Name = 'BPPYN'
|
|
Attributes = [paNullable]
|
|
DataType = ftWideString
|
|
NumericScale = 255
|
|
Precision = 255
|
|
Size = 10
|
|
Value = Null
|
|
end>
|
|
Left = 48
|
|
Top = 232
|
|
end
|
|
object DeleteBPAB: TADOCommand
|
|
CommandText = 'DELETE FROM BPAB'#13#10'WHERE BPPYN=:BPPYN'#13#10
|
|
Connection = Conn
|
|
Parameters = <
|
|
item
|
|
Name = 'BPPYN'
|
|
DataType = ftWideString
|
|
NumericScale = 255
|
|
Precision = 255
|
|
Size = 10
|
|
Value = Null
|
|
end>
|
|
Left = 112
|
|
Top = 232
|
|
end
|
|
object DeleteBPJA: TADOCommand
|
|
CommandText = 'DELETE FROM BPJA'#13#10'WHERE BPPYN=:BPPYN'#13#10
|
|
Connection = Conn
|
|
Parameters = <
|
|
item
|
|
Name = 'BPPYN'
|
|
DataType = ftWideString
|
|
NumericScale = 255
|
|
Precision = 255
|
|
Size = 10
|
|
Value = Null
|
|
end>
|
|
Left = 176
|
|
Top = 232
|
|
end
|
|
object DeleteBPJB: TADOCommand
|
|
CommandText = 'DELETE FROM BPJB'#13#10'WHERE BPPYN=:BPPYN'#13#10
|
|
Connection = Conn
|
|
Parameters = <
|
|
item
|
|
Name = 'BPPYN'
|
|
DataType = ftWideString
|
|
NumericScale = 255
|
|
Precision = 255
|
|
Size = 10
|
|
Value = Null
|
|
end>
|
|
Left = 240
|
|
Top = 232
|
|
end
|
|
object DeleteRASN: TADOCommand
|
|
CommandText = 'DELETE FROM RASN'#13#10'WHERE RAPYN=:BPPYN'
|
|
Connection = Conn
|
|
Parameters = <
|
|
item
|
|
Name = 'BPPYN'
|
|
Attributes = [paNullable]
|
|
DataType = ftWideString
|
|
NumericScale = 255
|
|
Precision = 255
|
|
Size = 10
|
|
Value = Null
|
|
end>
|
|
Left = 304
|
|
Top = 232
|
|
end
|
|
end
|