📄 printunit.pas
字号:
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 firstreg 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;
firstreg_radiobutton.Enabled :=true;
editreg_bitbtn.Enabled :=true;
end;
procedure Tprintform.cancel_BitBtnClick(Sender: TObject);
begin
firstreg_radiobutton.Checked :=true;
buttonUse(true);
ClearContent ;
StudentName_Edit.Enabled :=true;
search_BitBtn.Enabled :=true;
cancel_bitbtn.Enabled :=false;
ChargeRangeId_combobox.Enabled :=false;
firstreg_radiobutton.Enabled :=false;
editreg_bitbtn.Enabled :=false;
regdate_combobox.Enabled :=false;
Label7.Visible :=false;
regdate_combobox.Visible :=false;
StudentName_Edit.SetFocus ;
end;
procedure Tprintform.print_book_bitbtnClick(Sender: TObject);
begin
frxReport2.ShowReport();
print_book:=true;
end;
procedure Tprintform.ChargeRangeId_comboboxChange(Sender: TObject);
var
tuition,house,book,insurance,live,pledge:currency;
begin
clearcontent(false);
with oper_adoquery do
begin
close;
sql.clear;
sql.add('select * from firstreg 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('recetype').AsInteger of
0: ReceType_edit.Text :='现金';
1: ReceType_edit.Text :='邮局汇款';
2: ReceType_edit.Text :='银行';
end;
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_code_Edit.text:=fieldbyname('billcode').asstring;
end ;
2:
begin
house_be_Edit.text:=formatfloat('0.00',fieldbyname('quantum').asfloat);
house_re_Edit.text:=formatfloat('0.00',fieldbyname('fact').asfloat);
end;
3:
begin
book_be_Edit.text:=formatfloat('0.00',fieldbyname('quantum').asfloat);
book_re_Edit.text:=formatfloat('0.00',fieldbyname('fact').asfloat);
book_code_Edit.text:=fieldbyname('billcode').asstring;
end;
4:
begin
insurance_be_Edit.text:=formatfloat('0.00',fieldbyname('quantum').asfloat);
insurance_re_Edit.text:=formatfloat('0.00',fieldbyname('fact').asfloat);
end;
5:
begin
live_be_Edit.text:=formatfloat('0.00',fieldbyname('quantum').asfloat);
live_re_Edit.text:=formatfloat('0.00',fieldbyname('fact').asfloat);
live_code_Edit.text:=fieldbyname('billcode').asstring;
end;
6:
begin
pledge_be_Edit.text:=formatfloat('0.00',fieldbyname('quantum').asfloat);
pledge_re_Edit.text:=formatfloat('0.00',fieldbyname('fact').asfloat);
pledge_code_Edit.text:=fieldbyname('billcode').asstring;
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);
buttonUse(false);
end;
procedure Tprintform.tuition_be_EditEnter(Sender: TObject);
begin
if (sender as tedit).Text ='0' then (sender as tedit).Text:='';
end;
procedure Tprintform.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
MessageBox(application.handle,pchar('应收书费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
book_be_Edit.SetFocus ;
end;
try
insurance:=strtofloat(trim(insurance_be_Edit.Text ));
except
MessageBox(application.handle,pchar('应收保险费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
insurance_be_Edit.SetFocus ;
end;
try
live:=strtofloat(trim(live_be_Edit.Text ));
except
MessageBox(application.handle,pchar('应收生活用品费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
live_be_Edit.SetFocus ;
end;
try
pledge:=strtofloat(trim(pledge_be_Edit.Text ));
except
MessageBox(application.handle,pchar('应收保证金填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
pledge_be_Edit.SetFocus ;
end;
sum_be_Edit.Text :=formatfloat('0.00',tuition+house+book+insurance+live+pledge);
end;
procedure Tprintform.frxReport1BeforePrint(Sender: TfrxReportComponent);
begin
{ if sender.Name ='Memo1' then
(sender as tfrxmemoview).Text:='江西大宇学院';
if sender.Name ='Memo2' then
(sender as tfrxmemoview).Text:=ChargeRangeId_combobox.Text ;
if sender.Name ='Memo3' then
(sender as tfrxmemoview).Text:=trim(Spec_edit.Text );
if sender.Name ='Memo4' then
(sender as tfrxmemoview).Text:=id_edit.text;
if sender.Name ='Memo5' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(tuition_re_Edit.Text));
if sender.Name ='Memo6' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(house_re_Edit.Text));
if sender.Name ='Memo7' then
(sender as tfrxmemoview).Text:=trim(StudentName_Edit.Text );
if sender.Name ='Memo8' then
(sender as tfrxmemoview).Text:='';
if sender.Name ='Memo9' then
(sender as tfrxmemoview).Text:=analymoney(strtofloat(tuition_re_Edit.Text)+strtofloat(house_re_Edit.Text));
if sender.Name ='Memo10' then
(sender as tfrxmemoview).Text:=datetostr(date);
if sender.Name ='Memo11' then
(sender as tfrxmemoview).Text:=ReceType_edit.Text ;
if sender.Name ='Memo12' then
(sender as tfrxmemoview).Text:=ChargeRangeId_combobox.Text ;
if sender.Name ='Memo13' then
(sender as tfrxmemoview).Text:=trim(Spec_edit.Text );
if sender.Name ='Memo14' then
(sender as tfrxmemoview).Text:=id_edit.text;
if sender.Name ='Memo15' then
(sender as tfrxmemoview).Text:=trim(StudentName_Edit.Text );
if sender.Name ='Memo16' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(tuition_re_Edit.Text));
if sender.Name ='Memo17' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(house_re_Edit.Text));
if sender.Name ='Memo18' then
(sender as tfrxmemoview).Text:='';
if sender.Name ='Memo19' then
(sender as tfrxmemoview).Text:=analymoney(strtofloat(tuition_re_Edit.Text)+strtofloat(house_re_Edit.Text));
if sender.Name ='Memo20' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(tuition_re_Edit.Text)+strtofloat(house_re_Edit.Text));
if sender.Name ='Memo21' then
(sender as tfrxmemoview).Text:='江西大宇学院';
if sender.Name ='Memo22' then
(sender as tfrxmemoview).Text:=ChargeRangeId_combobox.Text ;
if sender.Name ='Memo23' then
(sender as tfrxmemoview).Text:=trim(Spec_edit.Text );
if sender.Name ='Memo24' then
(sender as tfrxmemoview).Text:=id_edit.text;
if sender.Name ='Memo25' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(tuition_re_Edit.Text));
if sender.Name ='Memo26' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(house_re_Edit.Text));
if sender.Name ='Memo27' then
(sender as tfrxmemoview).Text:=trim(StudentName_Edit.Text );
if sender.Name ='Memo28' then
(sender as tfrxmemoview).Text:='';
if sender.Name ='Memo29' then
(sender as tfrxmemoview).Text:=analymoney(strtofloat(tuition_re_Edit.Text)+strtofloat(house_re_Edit.Text));
if sender.Name ='Memo30' then
(sender as tfrxmemoview).Text:='江西大宇学院';
if sender.Name ='Memo31' then
(sender as tfrxmemoview).Text:=oper.name;
if sender.Name ='Memo32' then
(sender as tfrxmemoview).Text:=datetostr(date);
if sender.Name ='Memo33' then
(sender as tfrxmemoview).Text:=datetostr(date); }
if sender.Name ='Memo1' then
(sender as tfrxmemoview).Text:='江西大宇学院';
if sender.Name ='Memo2' then
(sender as tfrxmemoview).Text:=ChargeRangeId_combobox.Text ;
if sender.Name ='Memo3' then
(sender as tfrxmemoview).Text:=trim(Spec_edit.Text );
if sender.Name ='Memo4' then
(sender as tfrxmemoview).Text:=id_edit.text;
if sender.Name ='Memo5' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(tuition_re_Edit.Text));
if sender.Name ='Memo6' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(house_re_Edit.Text));
if sender.Name ='Memo7' then
(sender as tfrxmemoview).Text:=trim(StudentName_Edit.Text );
if sender.Name ='Memo8' then
//(sender as tfrxmemoview).Text:='';
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(book_re_Edit.Text));
if sender.Name ='Memo9' then
//(sender as tfrxmemoview).Text:=analymoney(strtofloat(tuition_re_Edit.Text)+strtofloat(house_re_Edit.Text));
(sender as tfrxmemoview).Text:=analymoney(strtofloat(tuition_re_Edit.Text)+strtofloat(house_re_Edit.Text)+strtofloat(book_re_Edit.Text));
if sender.Name ='Memo10' then
(sender as tfrxmemoview).Text:=datetostr(date);
if sender.Name ='Memo11' then
(sender as tfrxmemoview).Text:=ReceType_edit.Text ;
if sender.Name ='Memo12' then
(sender as tfrxmemoview).Text:=ChargeRangeId_combobox.Text ;
if sender.Name ='Memo13' then
(sender as tfrxmemoview).Text:=trim(Spec_edit.Text );
if sender.Name ='Memo14' then
(sender as tfrxmemoview).Text:=id_edit.text;
if sender.Name ='Memo15' then
(sender as tfrxmemoview).Text:=trim(StudentName_Edit.Text );
if sender.Name ='Memo16' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(tuition_re_Edit.Text));
if sender.Name ='Memo17' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(house_re_Edit.Text));
if sender.Name ='Memo18' then
//(sender as tfrxmemoview).Text:='';
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(book_re_Edit.Text));
if sender.Name ='Memo19' then
//(sender as tfrxmemoview).Text:=analymoney(strtofloat(tuition_re_Edit.Text)+strtofloat(house_re_Edit.Text));
(sender as tfrxmemoview).Text:=analymoney(strtofloat(tuition_re_Edit.Text)+strtofloat(house_re_Edit.Text)+strtofloat(book_re_Edit.Text));
if sender.Name ='Memo20' then
//(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(tuition_re_Edit.Text)+strtofloat(house_re_Edit.Text));
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(tuition_re_Edit.Text)+strtofloat(house_re_Edit.Text)+strtofloat(book_re_Edit.Text));
if sender.Name ='Memo21' then
(sender as tfrxmemoview).Text:='江西大宇学院';
if sender.Name ='Memo22' then
(sender as tfrxmemoview).Text:=ChargeRangeId_combobox.Text ;
if sender.Name ='Memo23' then
(sender as tfrxmemoview).Text:=trim(Spec_edit.Text );
if sender.Name ='Memo24' then
(sender as tfrxmemoview).Text:=id_edit.text;
if sender.Name ='Memo25' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(tuition_re_Edit.Text));
if sender.Name ='Memo26' then
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(house_re_Edit.Text));
if sender.Name ='Memo27' then
(sender as tfrxmemoview).Text:=trim(StudentName_Edit.Text );
if sender.Name ='Memo28' then
//(sender as tfrxmemoview).Text:='';
(sender as tfrxmemoview).Text:=formatfloat('0.00',strtofloat(book_re_Edit.Text));
if sender.Name ='Memo29' then
//(sender as tfrxmemoview).Text:=analymoney(strtofloat(tuition_re_Edit.Text)+strtofloat(house_re_Edit.Text));
(sender as tfrxmemoview).Text:=analymoney(strtofloat(tuition_re_Edit.Text)+strtofloat(house_re_Edit.Text)+strtofloat(book_re_Edit.Text));
if sender.Name ='Memo30' then
(sender as tfrxmemoview).Text:='江西大宇学院';
if sender.Name ='Memo31' then
(sender as tfrxmemoview).Text:=oper.name;
if sender.Name ='Memo32' then
(sender as tfrxmemoview).Text:=datetostr(date);
if sender.Name ='Memo33' then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -