📄 dayreport.pas
字号:
PawnMoney:=0;
if dqHeadUn.IsEmpty=False then
begin
//self.txtLast.Text:=inttostr(dqHeadUn.RecordCount);
dqHeadUn.First;
while not dqHeadUn.Eof do
begin
PawnMoney:=PawnMoney+dqHeadUn.fieldbyName('TotalPawnMoney').Value;
dqHeadUn.Next;
end;
end;
self.txtLastDay.Text:=format('%12.1f',[PawnMoney]);
//统计现金收入即客户赎回和逾期赎回所得的金额之和
if txtRansomMoney.Text='' then
txtRansomMoney.Text:='0';
if txtOutRansomMoney.Text='' then
txtOutRansomMoney.Text:='0';
PawnMoney:=0;
PawnMoney:=strtofloat(txtRansomMoney.Text)+strtofloat(txtOutRansomMoney.Text);
txtGotCash.Text:=format('%12.1f',[PawnMoney]);
//统计现金支付的金额即今日典当和续当及逾期续当的金额总和
if txtPawnMoney.Text='' then
txtPawnMoney.Text:='0';
if txtRePawnMoney.Text='' then
txtRePawnMoney.Text:='0';
if txtOutRePMoney.Text='' then
txtOutRePMoney.Text:='0';
if txtLastDay.Text='' then
txtLastDay.Text:='0';
if txtPayCash.Text='' then
txtPayCash.Text:='0';
if txtGotCash.Text='' then
txtGotCash.Text:='0';
txtPayCash.Text:=format('%12.1f',[strtofloat(txtPawnMoney.text)
+strtofloat(txtRePawnMoney.Text)
+strtofloat(txtOutRePMoney.Text)]);
//统计本日结余即结存+支付-收入
txtToday.Text:=format('%10.1f',[strtofloat(trim(txtLastDay.text))
+strtofloat(trim(txtPayCash.text))
-strtofloat(trim(txtGotCash.text))]);
//统计营业收入即:赎当时的服务费+赎当的利息+续当或新当时的综合费用
dqHeadUn.Close;
dqHeadUn.SQL.Clear;
Sql:='Select MonthRate,ServiceMoney from RansomMoney_Tbl where RansomDate=:NowDate ';
dqHeadUn.SQL.Add(Sql);
dqHeadUn.ParamByName('NowDate').asDateTime:=NowDate;
dqHeadUn.Open;
PawnMoney:=0;
if dqHeadUn.IsEmpty=False then
begin
//self.txtLast.Text:=inttostr(dqHeadUn.RecordCount);
dqHeadUn.First;
while not dqHeadUn.Eof do
begin
GotMoney:=dqHeadUn.fieldByName('MonthRate').asfloat+
dqHeadUn.FieldByName('ServiceMoney').asfloat;
PawnMoney:=PawnMoney+GotMoney;
dqHeadUn.Next;
end;
end;
//续当或新当时的综合费用
dqHeadUn.Close;
dqHeadUn.SQL.Clear;
Sql:='Select ServiceMoney from PawnMoney_Tbl where PawnDate=:NowDate ';
dqHeadUn.SQL.Add(Sql);
dqHeadUn.ParamByName('NowDate').asDateTime:=NowDate;
dqHeadUn.Open;
GotMoney:=0;
if dqHeadUn.IsEmpty=False then
begin
//self.txtLast.Text:=inttostr(dqHeadUn.RecordCount);
dqHeadUn.First;
while not dqHeadUn.Eof do
begin
GotMoney:=dqHeadUn.FieldByName('ServiceMoney').asfloat;
PawnMoney:=PawnMoney+GotMoney;
dqHeadUn.Next;
end;
end;
self.txtPawnGot.Text:=format('%12.1f',[PawnMoney]);
//统计绝当物品处理的原价及处理价
dqHeadUn.Close;
dqHeadUn.SQL.Clear;
Sql:='Select PawnMoney,SellMoney from Handle_Tbl where HandleDate=:NowDate ';
dqHeadUn.SQL.Add(Sql);
dqHeadUn.ParamByName('NowDate').asDateTime:=NowDate;
dqHeadUn.Open;
//现价
PawnMoney:=0;
GotMoney:=0;
if dqHeadUn.IsEmpty=False then
begin
dqHeadUn.First;
while not dqHeadUn.Eof do
begin
GotMoney:=dqHeadUn.FieldByName('PawnMoney').asfloat;
PawnMoney:=PawnMoney+GotMoney;
dqHeadUn.Next;
end;
end;
self.txtPreMoney.Text:=format('%12.1f',[PawnMoney]);
//处理价
PawnMoney:=0;
GotMoney:=0;
if dqHeadUn.IsEmpty=False then
begin
dqHeadUn.First;
while not dqHeadUn.Eof do
begin
GotMoney:=dqHeadUn.FieldByName('SellMoney').asfloat;
PawnMoney:=PawnMoney+GotMoney;
dqHeadUn.Next;
end;
end;
self.txtNowMoney.Text:=format('%12.1f',[PawnMoney]);
end;
end;
procedure TfrmDayReport.FormShow(Sender: TObject);
var
Present: TDateTime;
Year, Month, Day: Word;
NowDate:TDateTime;
//YesterdayDate:TDateTime;
NYear,NMonth,NDay:word;
NowToTen:TDateTime;
DaysElapsed:TDateTime;
begin
Present:= Now;
DecodeDate(Present, Year, Month, Day);
NowDate:=EncodeDate(Year,Month,Day);
//lbsysdate.Caption := IntToStr(Year) + '年'
//+ IntToStr(Month) + '月' + IntToStr(Day)+'日';
txtBeginYear.Value :=Year;
txtBeginMonth.Value:=Month;
txtBeginDay.Value:=Day;
//逾期或绝当的条件
DaysElapsed:=NowDate-10;
DecodeDate(DaysElapsed,NYear,NMonth,NDay);
NowToTen:=EncodeDate(NYear,NMonth,NDay);
//DaysElapsed:=NowDate-1;
//DecodeDate(DaysElapsed,NYear,NMonth,NDay);
//YesterdayDate:=EncodeDate(NYear,NMonth,NDay);
ShowReport(NowDate,NowToTen);
end;
procedure TfrmDayReport.cmdExitClick(Sender: TObject);
begin
close;
end;
procedure TfrmDayReport.txtBeginYearKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
Present: TDateTime;
Year, Month, Day: Word;
begin
Present:= Now;
DecodeDate(Present, Year, Month, Day);
if txtBeginYear.Text =''then
txtBeginYear.Text := IntToStr(Year);
if (length(txtBeginYear.text)=4) then {or
(length(txtPawnBeginYear.text)=2)then }
txtBeginMonth.SetFocus ;
end;
procedure TfrmDayReport.txtBeginYearExit(Sender: TObject);
var
InputYear : Integer;
Present: TDateTime;
Year, Month, Day: Word;
begin
Present:= Now;
DecodeDate(Present, Year, Month, Day);
if txtBeginYear.Text =''then
txtBeginYear.Text :=IntToStr(Year);
InputYear:=strtoint(txtBeginYear.text);
case InputYear of
0:txtBeginYear.Text :='2000';
1..9:txtBeginYear.Text :='190'+inttostr(InputYear);
10..64:txtBeginYear.Text :='19'+inttostr(InputYear);
65..99:txtBeginYear.Text :='19'+txtBeginYear.Text ;
end;
end;
procedure TfrmDayReport.txtBeginMonthKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
Present: TDateTime;
Year, Month, Day: Word;
InputMonth:integer;
begin
Present:= Now;
DecodeDate(Present, Year, Month, Day);
if txtBeginMonth.Text ='' then
txtBeginMonth.Text:=IntToStr(Month);
if (length(txtBeginMonth.text)=2)then
begin
InputMonth:=strtoint(txtBeginMonth.Text);
if (InputMonth>12)or(InputMonth<1) then
begin
txtBeginMonth.Text :=IntToStr(Month);
end;
txtBeginDay.SetFocus ;
end;
end;
procedure TfrmDayReport.txtBeginDayKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
Present: TDateTime;
Year, Month, Day: Word;
begin
Present:= Now;
DecodeDate(Present, Year, Month, Day);
if txtBeginDay.Text =''then
txtBeginDay.Text:=IntToStr(Day);
if length(txtBeginDay.text)=2 then
begin
if (strtoint(txtBeginDay.text)<1)or
(strtoint(txtBeginDay.text)>31) then
begin
txtBeginDay.Text :=IntToStr(Day);
end;
cmdCacu.SetFocus ;
end;
end;
procedure TfrmDayReport.cmdCacuClick(Sender: TObject);
var
NowDate,NowToTen:TDateTime;
NYear,NMonth,NDay:word;
DaysElapsed:TDateTime;
begin
NowDate:=EncodeDate(txtBeginYear.value,
txtBeginMonth.Value,
txtBeginDay.Value);
DaysElapsed:=NowDate-10;
DecodeDate(DaysElapsed,NYear,NMonth,NDay);
NowToTen:=EncodeDate(NYear,NMonth,NDay);
ShowReport(NowDate,NowToTen);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -