📄 oldregunit.pas
字号:
Parameters.ParamByName('receive').Value :=trim(tuition_re_Edit.Text );
Parameters.ParamByName('BillCode').Value :=trim(tuition_code_Edit.Text );
Parameters.ParamByName('ReceType').Value :=recetype_combobox.ItemIndex;
Parameters.ParamByName('RegDate').Value :=TmpDT;
Parameters.ParamByName('Operator').Value :=Oper.code ;
ExecSQL ;
//住宿
close;
Parameters.ParamByName('StudentID').Value :=tmpid ;
Parameters.ParamByName('ChargeRangeId').Value :=ChargeRangeId_ComboBox.Text ;
Parameters.ParamByName('StudyYear').Value :=StudyYear_ComboBox.Text ;
Parameters.ParamByName('ChargeItemId').Value :=2 ;
Parameters.ParamByName('Quantum').Value :=trim(house_be_Edit.Text );
Parameters.ParamByName('receive').Value :=trim(house_re_Edit.Text );
Parameters.ParamByName('BillCode').Value :='';
Parameters.ParamByName('ReceType').Value :=recetype_combobox.ItemIndex;
Parameters.ParamByName('RegDate').Value :=TmpDT;
Parameters.ParamByName('Operator').Value :=Oper.code ;
ExecSQL ;
//书费
close;
Parameters.ParamByName('StudentID').Value :=tmpid;
Parameters.ParamByName('ChargeRangeId').Value :=ChargeRangeId_ComboBox.Text ;
Parameters.ParamByName('StudyYear').Value :=StudyYear_ComboBox.Text ;
Parameters.ParamByName('ChargeItemId').Value :=3;
Parameters.ParamByName('Quantum').Value := trim(book_be_Edit.Text );
Parameters.ParamByName('receive').Value := trim(book_re_Edit.Text );
Parameters.ParamByName('BillCode').Value :=trim(book_code_Edit.Text );
Parameters.ParamByName('ReceType').Value :=recetype_combobox.ItemIndex;
Parameters.ParamByName('RegDate').Value :=TmpDT;
Parameters.ParamByName('Operator').Value :=Oper.code ;
ExecSQL ;
//保险
close;
Parameters.ParamByName('StudentID').Value :=tmpid;
Parameters.ParamByName('ChargeRangeId').Value :=ChargeRangeId_ComboBox.Text ;
Parameters.ParamByName('StudyYear').Value :=StudyYear_ComboBox.Text ;
Parameters.ParamByName('ChargeItemId').Value := 4;
Parameters.ParamByName('Quantum').Value := trim(insurance_be_Edit.Text );
Parameters.ParamByName('receive').Value := trim(insurance_re_Edit.Text );
Parameters.ParamByName('BillCode').Value :='';
Parameters.ParamByName('ReceType').Value :=recetype_combobox.ItemIndex;
Parameters.ParamByName('RegDate').Value :=TmpDT;
Parameters.ParamByName('Operator').Value :=Oper.code ;
ExecSQL ;
//生活用品
close;
Parameters.ParamByName('StudentID').Value :=tmpid ;
Parameters.ParamByName('ChargeRangeId').Value :=ChargeRangeId_ComboBox.Text ;
Parameters.ParamByName('StudyYear').Value :=StudyYear_ComboBox.Text ;
Parameters.ParamByName('ChargeItemId').Value := 5;
Parameters.ParamByName('Quantum').Value :=trim(live_be_Edit.Text );
Parameters.ParamByName('receive').Value := trim(live_re_Edit.Text );
Parameters.ParamByName('BillCode').Value :=trim(live_code_Edit.Text );
Parameters.ParamByName('ReceType').Value :=recetype_combobox.ItemIndex;
Parameters.ParamByName('RegDate').Value :=TmpDT;
Parameters.ParamByName('Operator').Value :=Oper.code ;
ExecSQL ;
//保证金
close;
Parameters.ParamByName('StudentID').Value :=tmpid;
Parameters.ParamByName('ChargeRangeId').Value :=ChargeRangeId_ComboBox.Text ;
Parameters.ParamByName('StudyYear').Value :=StudyYear_ComboBox.Text ;
Parameters.ParamByName('ChargeItemId').Value := 6;
Parameters.ParamByName('Quantum').Value := trim(pledge_be_Edit.Text );
Parameters.ParamByName('receive').Value :=trim(pledge_re_Edit.Text );
Parameters.ParamByName('BillCode').Value :=trim(pledge_code_Edit.Text );
Parameters.ParamByName('ReceType').Value :=recetype_combobox.ItemIndex;
Parameters.ParamByName('RegDate').Value :=TmpDT;
Parameters.ParamByName('Operator').Value :=Oper.code ;
ExecSQL ;
if Prepared then Prepared:=false;
end;
buttonUse(false);
id_Edit.Text :=tmpid;
dm.ADOConnection.CommitTrans ;
groupbox1.enabled:=false;
except
on e:exception do
begin
//MessageBox(application.handle,pchar(e.message),'错误',MB_ICONWARNING+MB_OK);
MessageBox(application.handle,pchar('该年份已有收费记录!'),'错误',MB_ICONWARNING+MB_OK);
dm.ADOConnection.RollbackTrans ;
exit;
end;
end;
end;
procedure Toldregform.calc_bitbtnClick(Sender: TObject);
var
tuition,house,book,insurance,live,pledge:currency;
tuition1,house1,book1,insurance1,live1,pledge1: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;
try
tuition1:=strtofloat(trim(tuition_re_Edit.Text ));
except
MessageBox(application.handle,pchar('实收学费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
tuition_re_Edit.SetFocus ;
end;
try
house1:=strtofloat(trim(house_re_Edit.Text ));
except
MessageBox(application.handle,pchar('实收住宿费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
house_re_Edit.SetFocus ;
end;
try
book1:=strtofloat(trim(book_re_Edit.Text ));
except
MessageBox(application.handle,pchar('实收书费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
book_re_Edit.SetFocus ;
end;
try
insurance1:=strtofloat(trim(insurance_re_Edit.Text ));
except
MessageBox(application.handle,pchar('实收保险费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
insurance_re_Edit.SetFocus ;
end;
try
live1:=strtofloat(trim(live_re_Edit.Text ));
except
MessageBox(application.handle,pchar('实收生活用品费填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
live_re_Edit.SetFocus ;
end;
try
pledge1:=strtofloat(trim(pledge_re_Edit.Text ));
except
MessageBox(application.handle,pchar('实收保证金填写不正确!'),'错误',MB_ICONWARNING+MB_OK);
pledge_re_Edit.SetFocus ;
end;
tuition_m_Edit.Text :=formatfloat('0.00',tuition-tuition1);
house_m_Edit.Text :=formatfloat('0.00',house-house1);
book_m_Edit.Text := formatfloat('0.00',book-book1);
insurance_m_Edit.Text := formatfloat('0.00',insurance-insurance1);
live_m_Edit.Text := formatfloat('0.00',live-live1);
pledge_m_Edit.Text := formatfloat('0.00',pledge-pledge1);
sum_m_Edit.Text := formatfloat('0.00',(tuition+house+book+insurance+live+pledge)-(tuition1+house1+book1+insurance1+live1+pledge1));
end;
procedure Toldregform.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_book then
if messagebox(handle,pchar('书费票据没有打印,是否打印'),'请选择',MB_ICONQUESTION +MB_YESNO)=6 then exit;
if not print_pledge then
if trim(pledge_re_Edit.Text)<>'0' then
if messagebox(handle,pchar('保证金票据没有打印,是否打印'),'请选择',MB_ICONQUESTION +MB_YESNO)=6 then exit;
if not print_get then
if trim(live_re_Edit.Text )<>'0' then
if messagebox(handle,pchar('领物单没有打印,是否打印'),'请选择',MB_ICONQUESTION +MB_YESNO)=6 then exit;
self.Close;
end;
procedure Toldregform.print_BitBtnClick(Sender: TObject);
begin
frxReport1.ShowReport();
print:=true;
end;
procedure Toldregform.print_pledge_BitBtnClick(Sender: TObject);
begin
frxReport4.ShowReport();
print_pledge:=true;
end;
procedure Toldregform.print_get_BitBtnClick(Sender: TObject);
begin
frxReport3.ShowReport();
print_get:=true;
end;
procedure Toldregform.new_BitBtnClick(Sender: TObject);
begin
if not print then
if messagebox(handle,pchar('收费票据没有打印,是否打印'),'请选择',MB_ICONQUESTION +MB_YESNO)=6 then exit;
if not print_book then
if messagebox(handle,pchar('书费票据没有打印,是否打印'),'请选择',MB_ICONQUESTION +MB_YESNO)=6 then exit;
if not print_pledge then
if trim(pledge_re_Edit.Text)<>'0' then
if messagebox(handle,pchar('保证金票据没有打印,是否打印'),'请选择',MB_ICONQUESTION +MB_YESNO)=6 then exit;
if not print_get then
if trim(live_re_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;
ChargeRangeId_combobox.Enabled :=false;
StudyYear_ComboBox.Enabled :=false;
cancel_bitbtn.Enabled :=false;
recetype_combobox.Enabled :=false;
groupbox1.enabled:=false;
StudentName_Edit.SetFocus ;
end;
procedure Toldregform.StudentName_EditKeyPress(Sender: TObject;
var Key: Char);
begin
if (key=#13) and (trim(studentname_edit.Text )<>'') then
search_bitbtn.Click ;
end;
procedure Toldregform.search_BitBtnClick(Sender: TObject);
var
i:integer;
Year, Month, Day: Word;
begin
decodedate(now,year,month,day);
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 max (chargerangeid) as chargerange from income where studentid=:studentid');
Parameters.ParamByName('studentid').Value := trim(id_Edit.Text );
open;
if not fieldbyname('chargerange').IsNull then
begin
for i :=1 to 7 do
ChargeRangeId_combobox.Items.Add(inttostr(fieldbyname('chargerange').AsInteger+i)) ;
end
else
begin
for i :=year-4 to year+4 do
ChargeRangeId_combobox.Items.Add(inttostr(i));
end;
end;
StudyYear_ComboBox.Items.Clear ;
with oper_adoquery do
begin
close;
sql.Clear;
sql.Add('select max (studyyear) as maxyear from income where studentid=:studentid');
Parameters.ParamByName('studentid').Value := trim(id_Edit.Text );
open;
if fieldbyname('maxyear').IsNull then
begin
for i :=1 to 5 do
StudyYear_ComboBox.Items.Add(inttostr(i));
end
else
begin
for i :=fieldbyname('maxyear').AsInteger+1 to 5 do
StudyYear_ComboBox.Items.Add(inttostr(i));
end;
end;
StudyYear_ComboBox.ItemIndex:=0;
StudentName_Edit.Enabled :=false;
search_BitBtn.Enabled :=false;
ChargeRangeId_combobox.Enabled :=true;
StudyYear_ComboBox.Enabled :=true;
groupbox1.Enabled :=true;
cancel_bitbtn.Enabled :=true;
recetype_combobox.Enabled :=true;
ChargeRangeId_combobox.ItemIndex:=ChargeRangeId_combobox.Items.IndexOf(inttostr(year));
ChargeRangeId_combobox.SetFocus ;
end;
procedure Toldregform.cancel_BitBtnClick(Sender: TObject);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -