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

📄 inv_deptmonthclasssumqry.pas

📁 一个MRPII系统源代码版本
💻 PAS
字号:
unit Inv_DeptMonthClassSumQry;

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Qry, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
  StdCtrls, ExtCtrls, ComCtrls, ToolWin, DBCtrls, jpeg;

Type
  TFrm_Inv_DeptMonthClassSumQry = Class(TFrm_Base_Qry)
    Label4: TLabel;
    Edit4: TEdit;
    Label1: TLabel;
    procedure AdoQueryAfterOpen(DataSet: TDataSet);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
    procedure GetData; Override;
    procedure initReport;Override;
  end;

var
  Frm_Inv_DeptMonthClassSumQry: TFrm_Inv_DeptMonthClassSumQry;

implementation

uses Inv_DeptMonthClassSumQry_C;

{$R *.DFM}

procedure TFrm_Inv_DeptMonthClassSumQry.GetData;
begin
  inherited;
  AdoQry_Main.Close;
  AdoQry_Main.SQL.Text:=Condition;
  AdoQry_Main.Open;
  AdoQry_Main.Sort:=OrderByFields;
end;

procedure TFrm_Inv_DeptMonthClassSumQry.InitForm(AdOConnection: TAdOConnection;
  ShowExtendColumn: Boolean);
begin
  inherited;
  AmountFields:='Amount,';
  if Param1='Inv' then
  begin
  end
  else if Param1='Stk' then
  begin
  end;
  OrderByFields:='DeptCodeName,ClassName';
  Frm_Sys_Condition:=TFrm_Inv_DeptMonthClassSumQry_C.Create(Self);
  Act_Filter.Execute;
end;

procedure TFrm_Inv_DeptMonthClassSumQry.initReport;
var
   userName:string;
begin
  inherited;
  with AdoQry_tmp do
  begin
    Close;
    sql.Text:='select * from Employee where EmployeeCode='''+userCode+'''';
    open;
    userName:=fieldbyname('EmployeeName').asstring;
  end;
  ExtprintReport.Foot1:='制 表:'+userName+'           审核:';
  ExtprintReport.Headers.Items[ExtprintReport.Headers.indexof('Amount')].sum:=True;
end;

procedure TFrm_Inv_DeptMonthClassSumQry.AdoQueryAfterOpen(DataSet: TDataSet);
var
 bc:real;
begin
  inherited;
  bc:=0;
  with AdoQry_Main do
  begin
    DisableControls;
    First;
    while not eof do
    begin
      bc:=bc+fieldbyname('Amount').AsFloat;
      next;
    end;
    EnableControls;
  end;
  edit4.Text:=FloatToStr(bc);
end;

end.

⌨️ 快捷键说明

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