📄 pasyscx.~pas
字号:
unit pasyscx;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, dxCntner, dxEditor, dxEdLib, cxControls, cxContainer,
cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, cxLookupEdit,
cxDBLookupEdit, ExtCtrls, dxBar, dxBarExtItems, dxExEdtr, dxDBTLCl,
dxGrClms, dxDBCtrl, dxDBGrid, dxTL, Grids, DBGrids,data, DB, ADODB,
FR_PTabl;
type
Tfryscx = class(TForm)
dxBarManager1: TdxBarManager;
dxBarLargeButton5: TdxBarLargeButton;
dxBarLargeButton4: TdxBarLargeButton;
Panel1: TPanel;
Label1: TLabel;
GroupBox2: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
Edit1: TEdit;
Edit2: TEdit;
RadioButton4: TRadioButton;
RadioButton5: TRadioButton;
DBGrid1: TDBGrid;
ADOQuery1: TADOQuery;
DataSource1: TDataSource;
ADOQuery2: TADOQuery;
ADOQuery3: TADOQuery;
dxBarLargeButton1: TdxBarLargeButton;
frPrintGrid1: TfrPrintGrid;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDestroy(Sender: TObject);
procedure dxBarLargeButton5Click(Sender: TObject);
procedure dxBarLargeButton4Click(Sender: TObject);
procedure dxBarLargeButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fryscx: Tfryscx;
implementation
{$R *.dfm}
procedure Tfryscx.FormClose(Sender: TObject; var Action: TCloseAction);
begin
action:=cafree;
end;
procedure Tfryscx.FormDestroy(Sender: TObject);
begin
fryscx:=nil;
end;
procedure Tfryscx.dxBarLargeButton5Click(Sender: TObject);
var stemp,aa,bb,cc,dd:string;
begin
stemp:='';
ADOQuery1.Close;
ADOQuery1.SQL.Text:='delete from tblsb';
ADOQuery1.ExecSQL;
ADOQuery1.Close;
stemp:='select (select Clientname from tbClient where ClientId=a.UnitId) as unitid, Sum(a.RealMoney) as RealMoney ,'+
'((select sum(GetMoney) from InMoneys where unitid=a.unitid )) '+
'as GetMoney ,(Sum(a.RealMoney)-(select sum(GetMoney) from InMoneys'+
' where unitid=a.unitid )) as aa from tbSaleSubs a group by a.unitid';
ADOQuery1.SQL.Text:=stemp;
ADOQuery1.Open;
while not ADOQuery1.Eof do
begin
aa:=ADOQuery1.Fields[0].AsString;
bb:='0';
cc:='0';
dd:='0';
if not ADOQuery1.Fields[1].IsNull then bb:=ADOQuery1.Fields[1].AsString ;
if not ADOQuery1.Fields[2].IsNull then cc:=ADOQuery1.Fields[2].AsString ;
if not ADOQuery1.Fields[3].IsNull then dd:=ADOQuery1.Fields[3].AsString ;
if cc='0' then dd:=bb;
ADOQuery2.Close;
ADOQuery2.SQL.Text:='insert into tblsb values('''+aa+''','+bb+','+cc+','+dd+')';
adoquery2.ExecSQL;
ADOQuery1.Next;
end;
if RadioButton1.Checked then
stemp:='select * from tblsb';
if RadioButton3.Checked then
begin
stemp:='select * from tblsb where realmoney=getmoney';
end;
if RadioButton2.Checked then
begin
stemp:='select * from tblsb where realmoney-getmoney>0';
end;
if RadioButton4.Checked then
begin
if trim(edit2.Text)='' then
begin
application.MessageBox(pchar('输入的数量不能为空!'),'提示',0);
exit;
end;
stemp:='select * from tblsb where realmoney-getmoney>'+edit2.text;
end;
if RadioButton5.Checked then
begin
if trim(edit1.Text)='' then
begin
application.MessageBox(pchar('输入的数量不能为空!'),'提示',0);
exit;
end;
stemp:='select * from tblsb where realmoney-getmoney<'+edit1.text;
end;
ADOQuery3.Close;
ADOQuery3.SQL.Text:=stemp;
ADOQuery3.Open;
end;
procedure Tfryscx.dxBarLargeButton4Click(Sender: TObject);
begin
close;
end;
procedure Tfryscx.dxBarLargeButton1Click(Sender: TObject);
var stemp:string;
begin
if not ADOQuery3.Active then
begin
exit;
end;
frPrintGrid1.Title.Text:=sysname;
if RadioButton1.Checked then stemp:=RadioButton1.Caption ;
if RadioButton2.Checked then stemp:=RadioButton2.Caption ;
if RadioButton3.Checked then stemp:=RadioButton3.Caption ;
if RadioButton4.Checked then stemp:=RadioButton4.Caption +' '+edit2.Text;
if RadioButton5.Checked then stemp:=RadioButton5.Caption +' '+edit1.Text;
frPrintGrid1.PageHeader.Text:='应收查询 ->'+stemp;
frPrintGrid1.PageFooter.Text:=datetimetostr(now);
frPrintGrid1.ShowReport;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -