⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usalerep.~pas

📁 在打沙场用的最简单
💻 ~PAS
字号:
unit usalerep;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ubasereport, DBClient, DB, DBTables, Grids, wwdblook,
  wwdbdatetimepicker, StdCtrls, Mask, wwdbedit, Buttons, ExtCtrls,common,MDIbaseinfo,
  ADODB, DBGridEh;

type
  Tfrmsalerep = class(Tfrmbasereport)
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    Label17: TLabel;
    wwDBDateTimePicker3: TwwDBDateTimePicker;
    CheckBox1: TCheckBox;
    procedure spbtnprintClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure search;
    procedure RadioButton2Click(Sender: TObject);
    procedure RadioButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmsalerep: Tfrmsalerep;

implementation
 uses global;
{$R *.dfm}

procedure  Tfrmsalerep.search;
begin
    if billno.text<>'' then
    begin
    adoquery1.SQL.add(' and fsaleno =:fsaleno');
    adoquery1.Parameters.ParamByName('fsaleno').Value:=billno.Text;   //订单号
    end;
    if wwdbedit3.text<>'' then
    begin
    adoquery1.SQL.add(' and frefno =:frefno');
    adoquery1.Parameters.ParamByName('frefno').Value:=refno.text;   //送货单号
    end;
    if edit1.text<>'' then
    begin
    adoquery1.SQL.add(' and hcode =:hcode');
    adoquery1.Parameters.ParamByName('hcode').Value:=edit1.text;
    end;
    if edit2.text<>'' then
    begin
    adoquery1.SQL.add(' and hname like :hname');
    adoquery1.Parameters.ParamByName('hname').Value:='%' + edit2.text+ '%';
    end;
    if edit3.text<>'' then
    begin
    adoquery1.SQL.add(' and ftype like :ftype');
    adoquery1.Parameters.ParamByName('ftype').value:='%'+edit3.text+'%';
    end;
    if wwdbedit4.text<>'' then
    begin
    adoquery1.SQL.add(' and fcreauser=:fcreauser');
    adoquery1.Parameters.ParamByName('fcreauser').Value:=wwdbedit4.text;//负责人
    end;
    if wwdbedit5.text<>'' then
    begin
    adoquery1.SQL.add(' and fsaleer =:fsaleer');
    adoquery1.Parameters.ParamByName('fsaleer').Value:=wwdbedit5.text;
    end;
    if edit4.text<>'' then
    begin
    adoquery1.SQL.add(' and bc =:bc');
    adoquery1.Parameters.ParamByName('bc').Value:=edit4.text;
    end;

    adoquery1.SQL.add(' and fdelivdate >=:fdelivdate1 and fdelivdate <=:fdelivdate2');
    adoquery1.Parameters.ParamByName('fdelivdate1').asdate:=wwDBDateTimePicker2.Date;
    adoquery1.Parameters.ParamByName('fdelivdate2').asdate:=wwDBDateTimePicker3.Date;

end;
procedure Tfrmsalerep.spbtnprintClick(Sender: TObject);
begin
  inherited;
    adoquery1.SQL.Clear;
    adoquery1.SQL.Add('select  *  from Tsale');
    adoquery1.SQL.add('  where fid=fid');
    search;         ///调用过程

    adoquery1.Open;


end;

procedure Tfrmsalerep.FormCreate(Sender: TObject);
var
i:integer;
begin
  inherited;
  wwdbdatetimepicker2.Date:=date;
  wwdbdatetimepicker3.Date:=date;  
     for i:=0 to  dbgrideh1.Columns.Count-1 do
     dbgrideh1.Columns[i].Width:=80;          
end;

procedure Tfrmsalerep.RadioButton2Click(Sender: TObject);
begin
  inherited;
    {adoquery1.SQL.Clear;
    adoquery1.SQL.Add('select  b.fprovider,c.fcode,c.funit,c.ftype,sum(a.fqty) fqty,');
    adoquery1.sql.add('sum(a.total) total');
    adoquery1.SQL.add('   from Tsalesub a,Tsale  b ,titem c');
    adoquery1.SQL.add('  where a.fresid=b.fresid  and c.fid=a.fitemid');
    search;
    adoquery1.SQL.add(' group by     b.fprovider,c.fcode,c.funit,c.ftype');
    adoquery1.Open;   }
end;

procedure Tfrmsalerep.RadioButton1Click(Sender: TObject);
begin
  inherited;
    {adoquery1.SQL.Clear;
    adoquery1.SQL.Add('select  b.fprovider,c.ftype,sum(a.fqty) fqty,');
    adoquery1.sql.add('sum(a.total) total');
    adoquery1.SQL.add('   from Tsalesub a,Tsale  b ,titem c');
    adoquery1.SQL.add('  where a.fresid=b.fresid  and c.fid=a.fitemid');
    search;
    adoquery1.SQL.add(' group by     b.fprovider,c.ftype');
    adoquery1.Open;  }
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -