📄 editregunit.pas
字号:
house_fa_Edit.SetFocus ;
end;
try
book2:=strtofloat(trim(book_fa_Edit.Text ));
except
MessageBox(application.handle,pchar('实收书费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
book_fa_Edit.SetFocus ;
end;
try
insurance2:=strtofloat(trim(insurance_fa_Edit.Text ));
except
MessageBox(application.handle,pchar('实收保险费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
insurance_fa_Edit.SetFocus ;
end;
try
live2:=strtofloat(trim(live_fa_Edit.Text ));
except
MessageBox(application.handle,pchar('实收生活用品费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
live_fa_Edit.SetFocus ;
end;
try
pledge2:=strtofloat(trim(pledge_fa_Edit.Text ));
except
MessageBox(application.handle,pchar('实收保证金填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
pledge_fa_Edit.SetFocus ;
end;
tuition_m_Edit.Text :=formatfloat('0.00',tuition-tuition4-(tuition1-tuition3)-tuition2);
house_m_Edit.Text :=formatfloat('0.00',house-(house1-house3)-house2);
book_m_Edit.Text := formatfloat('0.00',book-(book1-book3)-book2);
insurance_m_Edit.Text := formatfloat('0.00',insurance-(insurance1-insurance3)-insurance2);
live_m_Edit.Text := formatfloat('0.00',live-(live1-live3)-live2);
pledge_m_Edit.Text := formatfloat('0.00',pledge-(pledge1-pledge3)-pledge2);
sum_m_Edit.Text := formatfloat('0.00',(tuition+house+book+insurance+live+pledge)-tuition4-((tuition1+house1+book1+insurance1+live1+pledge1)-(tuition3+house3+book3+insurance3+live3+pledge3))-(tuition2+house2+book2+insurance2+live2+pledge2));
end;
procedure Teditregform.close_BitBtnClick(Sender: TObject);
begin
if save_BitBtn.Enabled then
begin
self.Close;
exit;
end;
if not print then
if messagebox(handle,pchar('收费票据没有打印,是否打印'),'请选择',MB_ICONQUESTION +MB_YESNO)=6 then exit;
if not print_pledge then
if trim(pledge_fa_Edit.Text)<>'0' then
if messagebox(handle,pchar('保证金票据没有打印,是否打印'),'请选择',MB_ICONQUESTION +MB_YESNO)=6 then exit;
if not print_get then
if trim(live_fa_Edit.Text )<>'0' then
if messagebox(handle,pchar('领物单没有打印,是否打印'),'请选择',MB_ICONQUESTION +MB_YESNO)=6 then exit;
self.Close;
end;
procedure Teditregform.print_BitBtnClick(Sender: TObject);
begin
frxReport1.ShowReport();
print:=true;
end;
procedure Teditregform.print_pledge_BitBtnClick(Sender: TObject);
begin
frxReport4.ShowReport();
print_pledge:=true;
end;
procedure Teditregform.print_get_BitBtnClick(Sender: TObject);
begin
frxReport3.ShowReport();
print_get:=true;
end;
procedure Teditregform.new_BitBtnClick(Sender: TObject);
begin
if not print then
if messagebox(handle,pchar('收费票据没有打印,是否打印'),'请选择',MB_ICONQUESTION +MB_YESNO)=6 then exit;
if not print_pledge then
if trim(pledge_fa_Edit.Text)<>'0' then
if messagebox(handle,pchar('保证金票据没有打印,是否打印'),'请选择',MB_ICONQUESTION +MB_YESNO)=6 then exit;
if not print_get then
if trim(live_fa_Edit.Text )<>'0' then
if messagebox(handle,pchar('领物单没有打印,是否打印'),'请选择',MB_ICONQUESTION +MB_YESNO)=6 then exit;
buttonUse(true);
ClearContent ;
StudentName_Edit.Enabled :=true;
search_BitBtn.Enabled :=true;
cancel_bitbtn.Enabled :=false;
recetype_combobox.Enabled :=false;
ChargeRangeId_combobox.Enabled :=false;
groupbox1.enabled:=false;
StudentName_Edit.SetFocus ;
end;
procedure Teditregform.StudentName_EditKeyPress(Sender: TObject;
var Key: Char);
begin
if (key=#13) and (trim(studentname_edit.Text )<>'') then
search_bitbtn.Click ;
end;
procedure Teditregform.search_BitBtnClick(Sender: TObject);
begin
if trim(studentname_edit.Text )='' then exit;
tipform:=Ttipform.create(self);
try
tipform.list_adoquery.close;
tipform.list_adoquery.SQL.Clear;
tipform.list_adoquery.SQL.Add(tipform.SqlText );
tipform.list_adoquery.SQL.Add('and student.studentname=:studentname');
tipform.list_adoquery.Parameters.ParamByName('studentname').Value := trim(StudentName_Edit.Text );
tipform.list_adoquery.open;
clearcontent;
if not tipform.list_adoquery.IsEmpty then
begin
if tipform.list_adoquery.RecordCount>1 then
begin
tipform.Caption :='请选择相应的学生信息';
case tipform.ShowModal of
mrcancel: exit;
end;
end;
StudentName_Edit.Text := tipform.list_adoquery.fieldbyname('StudentName').AsString ;
id_edit.Text :=markid(tipform.list_adoquery.fieldbyname('id').AsString );
ChargeYearID_Edit.Text := tipform.list_adoquery.fieldbyname('ChargeYearID').AsString ;
sex_edit .Text :=tipform.list_adoquery.fieldbyname('sexname').AsString ;
Address_Edit .Text :=tipform.list_adoquery.fieldbyname('Address').AsString ;
Scholar_Edit.Text := tipform.list_adoquery.fieldbyname('Scholar').AsString ;
Department_Edit.Text :=tipform.list_adoquery.fieldbyname('department').AsString ;
Spec_edit.Text := tipform.list_adoquery.fieldbyname('spec').AsString ;
Length_edit .Text :=tipform.list_adoquery.fieldbyname('length').AsString ;
ClassCode_Edit.Text := tipform.list_adoquery.fieldbyname('classCode').AsString ;
Code_Edit .Text :=tipform.list_adoquery.fieldbyname('code').AsString ;
Source_Edit.Text :=tipform.list_adoquery.fieldbyname('Source').AsString ;
Tutor_Edit .Text :=tipform.list_adoquery.fieldbyname('Tutor').AsString ;
Circs_Edit.Text := tipform.list_adoquery.fieldbyname('Circs').AsString ;
Memo_Edit .Text :=tipform.list_adoquery.fieldbyname('Memo').AsString ;
end
else
begin
MessageBox(application.handle,pchar('没有查找到相应学生信息!'),'错误',MB_ICONWARNING+MB_OK);
exit;
end;
finally
freeandnil(tipform);
end;
ChargeRangeId_combobox.Items.Clear ;
with oper_adoquery do
begin
close;
sql.Clear;
sql.Add('select distinct(chargerangeid) as chargerange from income where studentid=:studentid');
Parameters.ParamByName('studentid').Value := trim(id_Edit.Text );
open;
while not eof do
begin
ChargeRangeId_combobox.Items.Add(fieldbyname('chargerange').AsString );
next;
end;
end;
StudentName_Edit.Enabled :=false;
search_BitBtn.Enabled :=false;
ChargeRangeId_combobox.Enabled :=true;
cancel_bitbtn.Enabled :=true;
recetype_combobox.Enabled :=true;
end;
procedure Teditregform.cancel_BitBtnClick(Sender: TObject);
begin
buttonUse(true);
ClearContent ;
StudentName_Edit.Enabled :=true;
search_BitBtn.Enabled :=true;
cancel_bitbtn.Enabled :=false;
ChargeRangeId_combobox.Enabled :=false;
recetype_combobox.Enabled :=false;
groupbox1.enabled:=false;
StudentName_Edit.SetFocus ;
end;
procedure Teditregform.sum_fa_EditEnter(Sender: TObject);
var
tuition,house,book,insurance,live,pledge:currency;
begin
try
tuition:=strtofloat(trim(tuition_fa_Edit.Text ));
except
MessageBox(application.handle,pchar('实收学费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
tuition_fa_Edit.SetFocus ;
end;
try
house:=strtofloat(trim(house_fa_Edit.Text ));
except
MessageBox(application.handle,pchar('实收住宿费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
house_fa_Edit.SetFocus ;
end;
try
book:=strtofloat(trim(book_fa_Edit.Text ));
except
MessageBox(application.handle,pchar('实收书费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
book_fa_Edit.SetFocus ;
end;
try
insurance:=strtofloat(trim(insurance_fa_Edit.Text ));
except
MessageBox(application.handle,pchar('实收保险费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
insurance_fa_Edit.SetFocus ;
end;
try
live:=strtofloat(trim(live_fa_Edit.Text ));
except
MessageBox(application.handle,pchar('实收生活用品费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
live_fa_Edit.SetFocus ;
end;
try
pledge:=strtofloat(trim(pledge_fa_Edit.Text ));
except
MessageBox(application.handle,pchar('实收保证金填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
pledge_fa_Edit.SetFocus ;
end;
sum_fa_Edit.Text :=formatfloat('0.00',tuition+house+book+insurance+live+pledge);
end;
procedure Teditregform.print_book_bitbtnClick(Sender: TObject);
begin
frxReport2.ShowReport();
print_book:=true;
end;
procedure Teditregform.ChargeRangeId_comboboxChange(Sender: TObject);
var
tuition,house,book,insurance,live,pledge:currency;
begin
with oper_adoquery do
begin
close;
sql.clear;
sql.add('select * from income where studentid=:studentid and chargerangeid=:chargerangeid');
Parameters.ParamByName('studentid').Value := trim(id_Edit.Text );
Parameters.ParamByName('chargerangeid').Value := trim(ChargeRangeId_combobox.Text );
open;
if isempty then
begin
MessageBox(application.handle,pchar('没有该年份收费信息!'),'错误',MB_ICONWARNING+MB_OK);
exit;
end;
StudyYear_edit.text:=fieldbyname('StudyYear').asstring;
while not eof do
begin
case fieldbyname('chargeitemid').asinteger of
1:
begin
tuition_be_Edit.text:=formatfloat('0.00',fieldbyname('quantum').asfloat);
tuition_re_Edit.text:=formatfloat('0.00',fieldbyname('fact').asfloat);
tuition_rr_Edit.text:=formatfloat('0.00',fieldbyname('returnnum').asfloat);
tuition_fa:=fieldbyname('fact').asfloat;
derate_edit.Text :=formatfloat('0.00',fieldbyname('derate').asfloat);
deratename_memo.Text :=trim(fieldbyname('deratename').Asstring);
end ;
2:
begin
house_fa:=fieldbyname('fact').asfloat;
house_be_Edit.text:=formatfloat('0.00',fieldbyname('quantum').asfloat);
house_re_Edit.text:=formatfloat('0.00',fieldbyname('fact').asfloat);
house_rr_Edit.text:=formatfloat('0.00',fieldbyname('returnnum').asfloat);
end;
3:
begin
book_fa:=fieldbyname('fact').asfloat;
book_be_Edit.text:=formatfloat('0.00',fieldbyname('quantum').asfloat);
book_re_Edit.text:=formatfloat('0.00',fieldbyname('fact').asfloat);
book_rr_Edit.text:=formatfloat('0.00',fieldbyname('returnnum').asfloat);
end;
4:
begin
insurance_fa :=fieldbyname('fact').asfloat;
insurance_be_Edit.text:=formatfloat('0.00',fieldbyname('quantum').asfloat);
insurance_re_Edit.text:=formatfloat('0.00',fieldbyname('fact').asfloat);
insurance_rr_Edit.text:=formatfloat('0.00',fieldbyname('returnnum').asfloat);
end;
5:
begin
live_fa:=fieldbyname('fact').asfloat;
live_be_Edit.text:=formatfloat('0.00',fieldbyname('quantum').asfloat);
live_re_Edit.text:=formatfloat('0.00',fieldbyname('fact').asfloat);
live_rr_Edit.text:=formatfloat('0.00',fieldbyname('returnnum').asfloat);
end;
6:
begin
pledge_fa:=fieldbyname('fact').asfloat;
pledge_be_Edit.text:=formatfloat('0.00',fieldbyname('quantum').asfloat);
pledge_re_Edit.text:=formatfloat('0.00',fieldbyname('fact').asfloat);
pledge_rr_Edit.text:=formatfloat('0.00',fieldbyname('returnnum').asfloat);
end;
end;
next;
end;
end;
tuition:=strtofloat(trim(tuition_be_Edit.Text ));
house:=strtofloat(trim(house_be_Edit.Text ));
book:=strtofloat(trim(book_be_Edit.Text ));
insurance:=strtofloat(trim(insurance_be_Edit.Text ));
live:=strtofloat(trim(live_be_Edit.Text ));
pledge:=strtofloat(trim(pledge_be_Edit.Text ));
sum_be_Edit.Text :=formatfloat('0.00',tuition+house+book+insurance+live+pledge);
tuition:=strtofloat(trim(tuition_re_Edit.Text ));
house:=strtofloat(trim(house_re_Edit.Text ));
book:=strtofloat(trim(book_re_Edit.Text ));
insurance:=strtofloat(trim(insurance_re_Edit.Text ));
live:=strtofloat(trim(live_re_Edit.Text ));
pledge:=strtofloat(trim(pledge_re_Edit.Text ));
sum_re_Edit.Text :=formatfloat('0.00',tuition+house+book+insurance+live+pledge);
tuition:=strtofloat(trim(tuition_rr_Edit.Text ));
house:=strtofloat(trim(house_rr_Edit.Text ));
book:=strtofloat(trim(book_rr_Edit.Text ));
insurance:=strtofloat(trim(insurance_rr_Edit.Text ));
live:=strtofloat(trim(live_rr_Edit.Text ));
pledge:=strtofloat(trim(pledge_rr_Edit.Text ));
sum_rr_Edit.Text :=formatfloat('0.00',tuition+house+book+insurance+live+pledge);
groupbox1.enabled:=true;
end;
procedure Teditregform.tuition_be_EditEnter(Sender: TObject);
begin
if (sender as tedit).Text ='0' then (sender as tedit).Text:='';
end;
procedure Teditregform.sum_be_EditEnter(Sender: TObject);
var
tuition,house,book,insurance,live,pledge:currency;
begin
try
tuition:=strtofloat(trim(tuition_be_Edit.Text ));
except
MessageBox(application.handle,pchar('应收学费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
tuition_be_Edit.SetFocus ;
end;
try
house:=strtofloat(trim(house_be_Edit.Text ));
except
MessageBox(application.handle,pchar('应收住宿费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
house_be_Edit.SetFocus ;
end;
try
book:=strtofloat(trim(book_be_Edit.Text ));
except
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -