📄 inesiiscontinue.pas
字号:
Prepare ;
Open ;
if RecordCount>0 then
begin
lypsprin:=Fieldbyname('lypsprin').AsFloat;
cypsints:=Fieldbyname('cypsints').AsFloat;
lypsints:=Fieldbyname('lypsints').AsFloat;
lycpprin:=Fieldbyname('lycpprin').AsFloat;
lycpints:=Fieldbyname('lycpints').AsFloat;
cycpints:=Fieldbyname('cycpints').AsFloat;
cypsarac:=Fieldbyname('cypsarac').AsFloat;
cyftcpfd:=Fieldbyname('cyftcpfd').AsFloat;
lycypsints:=Fieldbyname('lycypsints').AsFloat;
lycycpints:=Fieldbyname('lycycpints').AsFloat;
end;
end;
lypsprin:=lypsprin+cypsarac;
lycpprin:=lycpprin+cyftcpfd;
lypsints:=lypsints+cypsints+lycypsints;
lycpints:=lycpints+cycpints+lycycpints;
lycycpints:=(lycpprin+lycpints)*interest;
lycypsints:=(lypsprin+lypsints)*interest;
with DataShare_frm.Query5 do
begin
close;
ParamByName('param1').AsString:=formatfloat('0.0000',interest);
ParamByName('param2').AsString :=formatfloat('0.00',lycycpints);
ParamByName('param3').AsString :=formatfloat('0.00',lycypsints);
paramByname('param4').AsInteger:=RMD.Fields[3].AsInteger ;
parambyname('param5').AsString :=RMD.Fields[2].AsString ;
parambyname('param6').AsString :=formatfloat('0.00',lypsprin);
parambyname('param7').AsString :=formatfloat('0.00',lycpprin);
parambyname('param8').AsString :=formatfloat('0.00',lypsints);
parambyname('param9').AsString :=formatfloat('0.00',lycpints);
//RMD.Next ;
prepare;
execsql;
end;
end;
RMD.next;
end;
with DataShare_frm.Query6 do //把上一年未的累计储存额放入表sbda_psagacct,写sbdz_psagacct
begin
close;
sql.Clear ;
sql.Add('delete from sbda_psagacct where psseno=:p1 and yearno=:p2');
parambyname('p1').AsString :=Flatcombobox2.Items[index0];
parambyname('p2').AsInteger :=year-1;
prepare;
execsql;
end;
with DataShare_frm.Query9 do //写入上传表记录sbdz_psagacct
begin
Close ;
SQL.Clear ;
SQL.Add('insert into sbdz_psagacct(');
SQL.Add('PSSENO,YEARNO,LYCPPRIN,LYPSPRIN,LYCPINTS,LYPSINTS,CYREWG,MONTHS,CYMONTHS,');
SQL.Add('PAYIDX,LYMONTHS,LYREMONTHS,CYARCPFD,CYRELYCPFD,CYARPSFD,CYRELYPSFD,CYFTCPFD,');
SQL.Add('CYRELYCPAC,SPLYCPFD,CYCPACMONS,CYPSARAC,CYRELYPSARAC,CYRELYPSAC,CYPSACMONS,');
SQL.Add('CYCPINTS,CYPSINTS,ACCPINUPINTS,ACCPINUP,ACPSWGINUP,ACPSWGINUPINTS,WGMONUP,');
SQL.Add('DBCPFD,DBPSFD,CYDATE,PFLAG,DBFD,WGNOTES,FTNOTES,TOTFD,TOTPSFD,LYCYCPINTS,');
SQL.Add('LYCYPSINTS,NOTES,CYACMONS,PSRATE,CPRATE,SIINTER,OPCODE,OPDATE,PROCFLG)');
SQL.Add('select PSSENO,YEARNO,LYCPPRIN,LYPSPRIN,LYCPINTS,LYPSINTS,CYREWG,MONTHS,CYMONTHS,');
SQL.Add('PAYIDX,LYMONTHS,LYREMONTHS,CYARCPFD,CYRELYCPFD,CYARPSFD,CYRELYPSFD,CYFTCPFD,');
SQL.Add('CYRELYCPAC,SPLYCPFD,CYCPACMONS,CYPSARAC,CYRELYPSARAC,CYRELYPSAC,CYPSACMONS,');
SQL.Add('CYCPINTS,CYPSINTS,ACCPINUPINTS,ACCPINUP,ACPSWGINUP,ACPSWGINUPINTS,WGMONUP,');
SQL.Add('DBCPFD,DBPSFD,CYDATE,PFLAG,DBFD,WGNOTES,FTNOTES,TOTFD,TOTPSFD,LYCYCPINTS,');
SQL.Add('LYCYPSINTS,NOTES,CYACMONS,PSRATE,CPRATE,SIINTER,');
SQL.Add(Quotedstr(main_frm.user.OPNAME)+','+Quotedstr(datetimetostr(now))+',1'+' from sbda_psagacct where PSSENO=:param' );
ParamByName('param').AsString :=RMD.Fields[2].AsString ;
Prepare ;
ExecSQL ;
end;
end;
procedure TInEsiisContinue_frm.FormCreate(Sender: TObject);
var
i:integer;
begin
inherited;
with DataShare_frm.PersonalAccount_Query do
begin
close;
sql.Clear ;
sql.Add('select cpseno,cpname,industry from sbdb_cparch');
prepare;
open;
Flatcombobox3.Items.Clear ; //记录单位名称
FlatCombobox5.Items.Clear ; //记录单位编号
FlatCombobox6.Items.Clear ; //行业代号,用于读取对应的行业利息
while not eof do
begin
Flatcombobox3.Items.Add(Fieldbyname('cpname').AsString);
Flatcombobox5.Items.Add(Fieldbyname('cpseno').AsString);
Flatcombobox6.Items.Add(Fieldbyname('industry').AsString);
next;
end;
close;
end;
Scaled:=true;
if screen.Width<>screenwidth then
begin
scaleby(screen.Width,screenwidth);
for i:=0 to self.ControlCount-1 do
begin
controls[i].Width:=longint(controls[i].Width)*longint(screen.width) div screenwidth;
controls[i].Height:=longint(controls[i].Height)*longint(screen.height) div screenheight;
end;
end;
flatbutton1.Enabled :=false;
flatbutton2.Enabled :=false;
flatbutton5.Enabled :=false;
flatbutton6.Enabled :=false;
flatbutton7.Enabled :=false;
end;
procedure TInEsiisContinue_frm.FlatComboBox3Change(Sender: TObject);
begin
inherited;
with DataShare_frm.PersonalAccount_Query do
begin
close;
sql.Clear ;
sql.Add('select psseno,psname,iscode from sbdb_psarch where cpseno=:param');
parambyname('param').AsString :=Flatcombobox5.Items[Flatcombobox3.itemindex];
prepare;
open ;
Flatcombobox1.Text :='';
Flatcombobox1.Items.Clear ; //记录职工姓名
Flatcombobox2.Items.Clear ; //记录职工内码
Flatcombobox4.Items.Clear ; //记录职工身份证号
while not eof do
begin
Flatcombobox4.Items.Add(Fieldbyname('iscode').AsString);
FlatCombobox2.Items.Add(Fieldbyname('psseno').AsString);
Flatcombobox1.Items.Add(Fieldbyname('psname').AsString);
next;
end;
close;
end;
init;
index1:=flatcombobox3.ItemIndex ;
flatbutton1.Enabled :=false;
flatbutton2.Enabled :=false;
flatbutton5.Enabled :=false;
flatbutton6.Enabled :=false;
flatbutton7.Enabled :=false;
end;
procedure TInEsiisContinue_frm.FlatComboBox1Change(Sender: TObject);
begin
inherited;
init;
showdata;
index0:=Flatcombobox1.ItemIndex ;
flatbutton1.Enabled :=true;
flatbutton2.Enabled :=true;
flatbutton5.Enabled :=true;
flatbutton6.Enabled :=true;
flatbutton7.Enabled :=true;
end;
procedure TInEsiisContinue_frm.FlatSpeedButton1Click(Sender: TObject);
begin
inherited;
if trim(Flatedit30.text)<>'' then
begin
if Flatcombobox4.Items.IndexOf(Flatedit30.Text)<0 then
begin
application.MessageBox('没有该职工的相关记录,请检查输入是否有误!','恩普软件',mb_iconinformation+mb_ok);
exit;
end;
Flatcombobox1.ItemIndex:=Flatcombobox4.Items.IndexOf(Flatedit30.Text);
Flatcombobox1.Text :=Flatcombobox1.Items[Flatcombobox4.Items.IndexOf(Flatedit30.Text)];
Flatcombobox1change(nil);
end else
application.messagebox('请正确输入职工的身分证号!','恩普软件',mb_iconinformation+mb_ok);
Flatedit30.Text :='';
end;
procedure TInEsiisContinue_frm.DBGrid1KeyPress(Sender: TObject;
var Key: Char);
begin
inherited;
if RMD.Fields[3].AsInteger>2001 then
begin
Dbgrid1.Columns[4].ReadOnly :=true;
Dbgrid1.Columns[5].ReadOnly :=true;
application.MessageBox('2002年以后的数据不能更改,要更改请到浙江省社会保险事业管理中心申请!','恩普软件',mb_iconwarning+mb_ok);
key:=#0;
end else
begin
Dbgrid1.Columns[4].ReadOnly :=false;
Dbgrid1.Columns[5].ReadOnly :=false;
end;
end;
procedure TInEsiisContinue_frm.DBGrid1CellClick(Column: TColumn);
begin
inherited;
if (RMD.Fields[3].AsInteger>2001) and ((column=Dbgrid1.Columns[4]) or (column=Dbgrid1.Columns[5])) then
begin
Dbgrid1.Columns[4].ReadOnly :=true;
Dbgrid1.Columns[5].ReadOnly :=true;
end else
begin
Dbgrid1.Columns[4].ReadOnly :=false;
Dbgrid1.Columns[5].ReadOnly :=false;
end;
end;
procedure TInEsiisContinue_frm.DateEdit1Change(Sender: TObject);
begin
inherited;
date_change:=true;
end;
procedure TInEsiisContinue_frm.FlatButton7Click(Sender: TObject);
begin
inherited;
init;
FlatComboBox1.Items.Clear ;
FlatComboBox3.ItemIndex :=-1;
FlatComboBox1.Text :='';
FlatComboBox3.Text :='';
end;
procedure TInEsiisContinue_frm.FlatButton5Click(Sender: TObject);
begin
inherited;
ChectCount_frm:=TChectCount_frm.Create(nil);
with ChectCount_frm do
begin
FlatComboBox1.Items.Clear ;
if RMD.Active then
begin
RMD.First ;
psseno:=RMD.Fields[2].AsString ;
while not RMD.Eof do
begin
FlatComboBox1.Items.Add(RMD.Fields[3].asstring);
RMD.Next ;
end;
end;
end;
ChectCount_frm.ShowModal ;
ChectCount_frm.Free ;
ChectCount_frm:=nil;
end;
procedure TInEsiisContinue_frm.FlatButton2Click(Sender: TObject);
var
i:double;
j:integer;
begin
AddRecord_frm:=TAddRecord_frm.Create(nil);
if RMD.Active then
begin
RMD.First ;
AddRecord_frm.iscode:=RMD.Fields[0].AsString ;
AddRecord_frm.psname:=RMD.Fields[1].AsString ;
AddRecord_frm.psseno:=RMD.Fields[2].AsString ;
AddRecord_frm.cpseno:=Flatcombobox5.Items[Flatcombobox3.Itemindex];
while not RMD.Eof do
begin
AddRecord_frm.ComboBox1.Items.Add(trim(RMD.Fields[3].asstring));
RMD.Next ;
end;
end else RMD.Active :=true;
if AddRecord_frm.ShowModal=mrok then
begin
AddRecord_frm.RMD.First ;
while not AddRecord_frm.RMD.Eof do
begin
RMD.First ;
Add_Delete:=true;
j:=Del_Record.Items.IndexOf(AddRecord_frm.RMD.fieldbyname('yearno').AsString);
if j>=0 then
Del_Record.Items.Delete(j) ;
Add_record.AppendRecord([AddRecord_frm.RMD.Fields[0].AsString,AddRecord_frm.RMD.Fields[1].AsString,
AddRecord_frm.RMD.Fields[2].AsString,AddRecord_frm.RMD.Fields[3].AsString,
AddRecord_frm.RMD.Fields[4].AsString,AddRecord_frm.RMD.Fields[5].AsString,
AddRecord_frm.RMD.Fields[6].AsString]) ;
while (AddRecord_frm.RMD.FieldByName('yearno').AsInteger>RMD.FieldByName('yearno').AsInteger) and (not RMD.Eof) do
RMD.Next ;
if AddRecord_frm.RMD.FieldByName('cymonths').AsInteger=0 then i:=0
else i:=AddRecord_frm.RMD.FieldByName('cpsum').AsFloat/AddRecord_frm.RMD.FieldByName('cymonths').AsInteger;
RMD.InsertRecord([AddRecord_frm.RMD.FieldByName('iscode').AsString,AddRecord_frm.RMD.FieldByName('psname').AsString,
AddRecord_frm.RMD.FieldByName('psseno').AsString,AddRecord_frm.RMD.FieldByName('yearno').asstring,
AddRecord_frm.RMD.FieldByName('cpsum').AsString, AddRecord_frm.RMD.FieldByName('cymonths').AsString,
formatfloat('0.00',i)]);
AddRecord_frm.RMD.Next ;
end;
end;
AddRecord_frm.Free ;
AddRecord_frm:=nil;
end;
procedure TInEsiisContinue_frm.FlatButton6Click(Sender: TObject);
begin
inherited;
if RMD.RecordCount<1 then exit;
if application.MessageBox('请确认是否要删除该记录!','恩普软件',mb_iconquestion+mb_okcancel)=idok then
try
if RMD.FieldByName('yearno').AsInteger<2002 then
begin
Del_Record.Items.Add(RMD.FieldByName('yearno').AsString);
if Add_Record.Locate('yearno',RMD.FieldByName('yearno').AsString,[]) then
Add_Record.Delete ;
RMD.Delete;
Add_Delete:=true;
end else begin
application.MessageBox('2002年以后的数据不能更改,要更改请到浙江省社会保险事业管理中心申请','恩普软件',mb_iconinformation+mb_ok);
exit;
end;
except
application.MessageBox('删除失败!','恩普软件',mb_iconerror+mb_ok);
exit;
end;
end;
procedure TInEsiisContinue_frm.FlatButton1Click(Sender: TObject);
begin
inherited;
if validate_data then
try
screen.Cursor :=crhourglass;
DataShare_frm.Dbs.StartTransaction ;
if Date_change then save_sbdb_psarch;
save_sbdz_inesiis;
saveData;
DataShare_frm.Dbs.Commit ;
screen.Cursor :=crdefault;
except
DataShare_frm.Dbs.Rollback ;
screen.Cursor :=crdefault;
application.MessageBox('保存数据失败!','恩普软件',mb_iconerror+mb_ok);
end;
end;
procedure TInEsiisContinue_frm.FlatEdit30KeyPress(Sender: TObject;
var Key: Char);
begin
inherited;
if (key=chr(vk_tab)) or (key=chr(vk_return)) then
FlatSpeedButton1.Click ;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -