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

📄 inv_opinvqry.pas

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

Interface

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

Type
  TFrm_Inv_OpInvQry = Class(TFrm_Base_Qry)
    Label1: TLabel;
    lbl_SumAmount: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
  private
    { Private declarations }
  public
    procedure GetData; Override;
    procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
    { Public declarations }
  end;

var
  Frm_Inv_OpInvQry: TFrm_Inv_OpInvQry;

implementation

uses Sys_Condition,Inv_OpInvQry_C;

{$R *.DFM}
procedure TFrm_Inv_OpInvQry.getData;
var
  tmp_SumAmount:real;
begin
  AdoQry_Main.Close;
  AdoQry_Main.sql.clear;
  AdoQry_Main.sql.text:=condition;
  AdoQry_Main.Open;
  AdoQry_Main.Sort:='ItemCode';
  tmp_SumAmount:=0;
  with AdoQry_Main do
  begin
    disablecontrols;
    First;
    while not eof do
    begin
      tmp_SumAmount:=tmp_SumAmount+fieldbyname('Amount').asfloat;
      next;
    end;
    First;
    enablecontrols;
  end;

  lbl_SumAmount.Caption:=floattostr(round(tmp_SumAmount*100)/100)+' 元';
  edit1.Text:=FormatFloat('#.##',tmp_SumAmount);
end;

procedure TFrm_Inv_OpInvQry.InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);

begin
  inherited;
      //这两个参数是回传到基类后控制价格及金额的显示格式
  AmountFields:='Amount,';
  PriceFields:='Price,';
  lbl_Order.Caption:='物料代码';

  Frm_Sys_Condition:=TFrm_Inv_OpInvQry_C.Create(Self);
  Act_Filter.Execute;
end;

end.

⌨️ 快捷键说明

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