📄 salarysum.pas
字号:
unit salarysum;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ppBands, ppCache, ppClass, ppProd, ppReport, ppComm, ppRelatv,
ppDB, ppDBPipe, ppDBBDE, Db, ADODB, ppCtrls, ppVar, ppPrnabl, Mask,
ExtCtrls;
type
Tsalarysumreport = class(TForm)
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
Edit1: TMaskEdit;
ppReport1: TppReport;
ppHeaderBand8: TppHeaderBand;
ppLabel372: TppLabel;
ppLabel373: TppLabel;
ppLine204: TppLine;
ppLine205: TppLine;
ppLine206: TppLine;
ppLine207: TppLine;
ppLine208: TppLine;
ppLabel374: TppLabel;
ppLabel375: TppLabel;
ppLabel376: TppLabel;
ppLine215: TppLine;
ppLabel377: TppLabel;
ppLine218: TppLine;
ppLabel378: TppLabel;
ppLine220: TppLine;
ppLabel379: TppLabel;
ppLine222: TppLine;
ppLabel380: TppLabel;
ppLine223: TppLine;
ppLabel381: TppLabel;
ppLine225: TppLine;
ppLabel382: TppLabel;
ppLine227: TppLine;
ppLabel383: TppLabel;
ppDetailBand10: TppDetailBand;
ppLine209: TppLine;
ppLine210: TppLine;
ppLine211: TppLine;
ppLine212: TppLine;
ppLine213: TppLine;
ppLine214: TppLine;
ppLine216: TppLine;
ppLine217: TppLine;
ppLine219: TppLine;
ppLine221: TppLine;
ppLine224: TppLine;
ppLine226: TppLine;
ppLine228: TppLine;
ppFooterBand8: TppFooterBand;
RadioGroup1: TRadioGroup;
ppLabel1: TppLabel;
ppLabel2: TppLabel;
ppLabel3: TppLabel;
ppLabel4: TppLabel;
ppSystemVariable1: TppSystemVariable;
ppDBText1: TppDBText;
ppBDEPipeline1: TppBDEPipeline;
DataSource1: TDataSource;
ADODataSet1: TADODataSet;
ppDBText2: TppDBText;
ppDBText3: TppDBText;
ppDBText4: TppDBText;
ppDBText5: TppDBText;
ADODataSet1num1: TIntegerField;
ADODataSet1num2: TIntegerField;
ADODataSet1num3: TIntegerField;
ADODataSet1mustgive: TBCDField;
ADODataSet1jcmoney: TBCDField;
ADODataSet1factmoney: TBCDField;
ADOQuery1: TADOQuery;
ADODataSet1factmoney1: TBCDField;
ppDBText6: TppDBText;
procedure FormCreate(Sender: TObject);
procedure ppReport2PreviewFormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure ppReport3PreviewFormCreate(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure ppReport1PreviewFormCreate(Sender: TObject);
procedure ppReport1BeforePrint(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function printcondtion: string;
end;
var
salarysumreport: Tsalarysumreport;
implementation
uses main,datamol;
{$R *.DFM}
procedure Tsalarysumreport.FormCreate(Sender: TObject);
begin
edit1.Text:=copy(datetostr(date),1,7);
// adoquery1.close;
//combobox1.items.add('请选择部门');
// combobox1.text:='请选择部门'
end;
procedure Tsalarysumreport.ppReport2PreviewFormCreate(Sender: TObject);
begin
tppReport(Sender).PreviewForm.WindowState:=wsMaximized;
end;
procedure Tsalarysumreport.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
salarysumreport:=nil;
action:=cafree;
end;
procedure Tsalarysumreport.FormKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
postmessage(handle,wm_keydown,vk_tab,0);
end;
end;
procedure Tsalarysumreport.ppReport3PreviewFormCreate(Sender: TObject);
begin
tppReport(Sender).PreviewForm.WindowState:=wsMaximized
end;
function tsalarysumreport.printcondtion:string;
begin
result:='';
case radiogroup1.itemindex of
0:result:='';
// 1:if combobox1.items.indexof(combobox1.text)<>-1 then result:='deptname='''+combobox1.text+''' ';
end;
end;
procedure Tsalarysumreport.RadioGroup1Click(Sender: TObject);
var
qry:tadoquery;
begin
case radiogroup1.ItemIndex of
0:
begin
// combobox1.visible:=false;
end;
1:
begin
// combobox1.visible:=true;
// combobox1.SetFocus;
qry:=tadoquery.Create(self);
qry.Connection:=datamod.Database1;
qry.SQL.Text:='select * from pub05010 order by dno';
qry.Open;
// while not qry.Eof do
// begin
// combobox1.Items.Add(qry.fieldbyname('dept').asstring);
// qry.Next;
// end;
// qry.Close;
// combobox1.text:=combobox1.items[0];
end;
2:
begin
// combobox1.Visible:=false;
end;
end;
end;
procedure Tsalarysumreport.Button2Click(Sender: TObject);
begin
close;
end;
procedure Tsalarysumreport.Button1Click(Sender: TObject);
begin
adodataset1.close;
adodataset1.commandtext:='select distinct isnull(a.num1,0) as num1 , isnull(factmoney1,0) as factmoney1, '+
' isnull(b.num2,0) as num2 ,isnull(c.num3,0) as num3 ,isnull(s.mustgive,0) as mustgive '+
' ,isnull(d.jcmoney,0) as jcmoney ,isnull(s.factmoney,0) as factmoney from '+
' (select distinct count(workno) as num1 from per24010 b '+
' where month(indate)<>month(getdate()) or year(indate)<>year(getdate()) ) '+
' a, ( select count(workno) as num2 from per24010 '+
' where month(indate)=month(getdate()) and year(indate)=year(getdate()) ) b '+
' , ( select distinct count(workno) as num3 from per16010 where month(leavedate)=month(getdate()) and '+
' year(leavedate)=year(getdate())) c , ( select distinct sum(jcmoney) jcmoney '+
' from per17010 where jckind=1 and left(convert(varchar,jcdate,111),7)='''+edit1.text+''' ) d, (select sum(factmoney) factmoney1 '+
' from sal21010 where monthy=convert(varchar,left('''+edit1.text+''',5)+convert(varchar,convert(int,substring('''+edit1.text+''',6,7))-1) ) ) e, ' +
' (select max(monthy) monthy,sum(mustgive) as mustgive ,sum(factmoney) factmoney from sal21010 where monthy='''+edit1.text+''' ) s ';
ppreport1.Print;
end;
procedure Tsalarysumreport.ppReport1PreviewFormCreate(Sender: TObject);
begin
tppReport(Sender).PreviewForm.WindowState:=wsMaximized;
end;
procedure Tsalarysumreport.ppReport1BeforePrint(Sender: TObject);
begin
pplabel372.caption:=companyname1;
pplabel373.caption:='月份:'+Edit1.Text;
pplabel3.Caption:=pubworkname;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -