📄 uaccountpayable.pas
字号:
unit uAccountPayable;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ActnList, LBCtrls, ExtCtrls, StdCtrls, FR_DSet, FR_DBSet,
FR_Class, DB, DBClient, SimpleDS, LBDBScrollBar, Grids, LBDBGrid;
type
TfrmAccountPayable = class(TForm)
Panel7: TPanel;
Image2: TImage;
Shape22: TShape;
Shape23: TShape;
Shape24: TShape;
Shape25: TShape;
LBSpeecButton2: TLBSpeecButton;
LBSpeecButton1: TLBSpeecButton;
LBSpeecButton3: TLBSpeecButton;
ActionList1: TActionList;
Action2: TAction;
Action3: TAction;
Action1: TAction;
Panel3: TPanel;
Label1: TLabel;
Panel4: TPanel;
Panel10: TPanel;
Panel2: TPanel;
Shape2: TShape;
Shape3: TShape;
Shape5: TShape;
LBDBGrid1: TLBDBGrid;
Panel5: TPanel;
Panel6: TPanel;
Panel8: TPanel;
Panel13: TPanel;
LBDBScrollBar1: TLBDBScrollBar;
OpenView: TPanel;
Image1: TImage;
Label4: TLabel;
Label6: TLabel;
Label7: TLabel;
Label19: TLabel;
Label20: TLabel;
Label2: TLabel;
Label3: TLabel;
SelectInfoData: TSimpleDataSet;
SelectInfoDataBILLCODE: TStringField;
SelectInfoDataBILLDATE: TSQLTimeStampField;
SelectInfoDataCLIENTNAME: TStringField;
SelectInfoDataTOTALSUM: TBCDField;
SelectInfoDataACCEPTSUM: TBCDField;
SelectInfoDataNOACCEPTSUM: TBCDField;
SelectInfoDataAGIOSUM: TBCDField;
SelectInfoDs: TDataSource;
Report: TfrReport;
ReportDataSet: TfrDBDataSet;
ClassShape1: TShape;
ClassShape2: TShape;
LBButton1: TLBButton;
LBButton2: TLBButton;
ClassShape3: TShape;
LBButton3: TLBButton;
Panel1: TPanel;
Label5: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
procedure FormShow(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure LBButton1Click(Sender: TObject);
procedure LBButton2Click(Sender: TObject);
procedure Action1Execute(Sender: TObject);
procedure Action2Execute(Sender: TObject);
procedure Action3Execute(Sender: TObject);
procedure LBButton3Click(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
procedure SetSubJect(NSh: TShape);
procedure GetSum;
public
{ Public declarations }
end;
var
frmAccountPayable: TfrmAccountPayable;
SelectSh :TShape;
SType: integer;
const
sql1='SELECT BILLCODE, BILLDATE, PROVIDERNAME, TOTALSUM, '+
'ACCEPTSUM, (TOTALSUM-ACCEPTSUM) AS NOACCEPTSUM, AGIOSUM '+
'FROM PARTSINPUTHAND WHERE ISACCEPT='''+'0'''+' AND ISAUDITING='''+'1'''+
'AND (INPUTTYPE='''+'3'''+' OR INPUTTYPE='''+'5'''+')';
sql2='SELECT BILLCODE, BILLDATE, PROVIDERNAME, TOTALSUM, '+
'ACCEPTSUM, (TOTALSUM-ACCEPTSUM) AS NOACCEPTSUM, AGIOSUM '+
'FROM REIMBURSEBILLHAND WHERE ISACCEPT='''+'0'''+' AND ISAUDITING='''+'1'''+
'AND REIMBURSETYPE='''+'2''';
//内部调入
sql3='SELECT BILLCODE, BILLDATE, PROVIDERNAME, TOTALSUM, '+
'ACCEPTSUM, (TOTALSUM-ACCEPTSUM) AS NOACCEPTSUM, AGIOSUM '+
'FROM PARTSINPUTHAND WHERE ISACCEPT='''+'0'''+' AND ISAUDITING='''+'1'''+
'AND INPUTTYPE='''+'4''';
implementation
uses uPublicvar, uMain, uDataMo, uConst, Tools;
{$R *.dfm}
procedure TfrmAccountPayable.SetSubJect(NSh: TShape);
begin
SelectSh.Visible:=False;
NSh.Visible:=True;
SelectSh:=NSh;
end;
procedure TfrmAccountPayable.GetSum;
var
Sum1, Sum2, Sum3, Sum4: Double;
s: string;
begin
dmData.ExistData.Data:=SelectInfoData.Data;
with dmData.ExistData do
begin
while not Eof do
begin
Sum1:=Sum1+Fieldbyname('TOTALSUM').asfloat;
Sum2:=Sum2+Fieldbyname('ACCEPTSUM').asfloat;
Sum3:=Sum3+Fieldbyname('NOACCEPTSUM').asfloat;
Sum4:=Sum4+Fieldbyname('AGIOSUM').asfloat;
Next;
end;
Data:=NULL;
end;
s:=FloatToStr(Sum1);
Label11.Caption:=Addradixpoint(s, 2);
s:=FloatToStr(Sum2);
Label12.Caption:=Addradixpoint(s,2);
s:=FloatToStr(Sum3);
Label13.Caption:=Addradixpoint(s,2);
s:=FloatToStr(Sum4);
Label14.Caption:=Addradixpoint(s,2);
end;
procedure TfrmAccountPayable.FormShow(Sender: TObject);
begin
OpenData(sql1, SelectInfoData);
ClassShape1.Visible:=True;
SelectSh:=ClassShape1;
SType:=1;
GetSum;
end;
procedure TfrmAccountPayable.FormActivate(Sender: TObject);
begin
GetWindowsItem(Caption, Self);
end;
procedure TfrmAccountPayable.FormDestroy(Sender: TObject);
begin
WindowItem.Delete(WindowItem.IndexOfObject(Self));
SelectInfoData.Close;
end;
procedure TfrmAccountPayable.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action:=caFree;
frmAccountPayable:=Nil;
end;
procedure TfrmAccountPayable.LBButton1Click(Sender: TObject);
begin
SetSubJect(ClassShape1);
OpenData(Sql1, SelectInfoData);
SType:=1;
GetSum;
end;
procedure TfrmAccountPayable.LBButton2Click(Sender: TObject);
begin
SetSubJect(ClassShape2);
OpenData(Sql2, SelectInfoData);
SType:=2;
GetSum;
end;
procedure TfrmAccountPayable.LBButton3Click(Sender: TObject);
begin
SetSubJect(ClassShape3);
OpenData(Sql3, SelectInfoData);
SType:=3;
GetSum;
end;
procedure TfrmAccountPayable.Action1Execute(Sender: TObject);
begin
PrintView('RepAccountPayable'+IntToStr(SType)+'.frf', Report);
end;
procedure TfrmAccountPayable.Action2Execute(Sender: TObject);
begin
case SType of
1: SelectBillType:=2;
2: SelectBillType:=4;
3: SelectBillType:=5;
end;
SelectAccountinfo;
if SelectSql<>'' then
begin
if SType=1 then
OpenData(sql1+SelectSql, SelectInfoData)
else
if Stype=2 then
OpenData(sql2+SelectSql, SelectInfoData)
else
if Stype=3 then
OpenData(sql3+SelectSql, SelectInfoData);
GetSum;
end;
end;
procedure TfrmAccountPayable.Action3Execute(Sender: TObject);
begin
if SType=1 then
OpenData(sql1, SelectInfoData)
else
if SType=2 then
OpenData(sql2, SelectInfoData)
else
if SType=3 then
OpenData(sql3, SelectInfoData);
GetSum;
end;
procedure TfrmAccountPayable.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key= 27 then Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -