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

📄 inv_dailypurchin.pas

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

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_DailyPurchIn = Class(TFrm_Base_Qry)
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
  end;

var
  Frm_Inv_DailyPurchIn: TFrm_Inv_DailyPurchIn;

implementation

uses Inv_DailyPurchIn_C, Sys_Global;

{$R *.DFM}

procedure TFrm_Inv_DailyPurchIn.InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);
begin
  inherited;
  try
    AdoQry_Tmp.Close;
    AdoQry_Tmp.SQL.Text:='Drop TABLE #DailyPurchIn';
    AdoQry_Tmp.ExecSQL;
  except
  end;
  AdoQry_Tmp.Close;
  AdoQry_Tmp.SQL.Text:='CREATE TABLE #DailyPurchIn ('
    +' [ItemCode] [varchAr] (16) NULL'
    +',[ItemName] [varchAr] (80) NULL'
    +',[ItemCodeName] [varchAr] (100) NULL'
    +',[UomName] [varchAr] (10) NULL'
    +',[InvBillQty] [float] NULL'
    +',[OnCheckQty] [float] NULL'
    +' )';
  AdoQry_Tmp.ExecSQL;
  SelectFromSQL:='Select ItemCode'
    +',ItemName'
    +',ItemCodeName'
    +',UomName'
    +',Sum(InvBillQty) As SInvBillQty'
    +',Sum(OnCheckQty) As SOnCheckQty'
    +',IsNull(Sum(InvBillQty),0)+IsNull(Sum(OnCheckQty),0) As TatolQty'
    +' From #DailyPurchIn';

  OrderByFields:='ItemCodeName';
  GroupByFields:='ItemCode,ItemName,ItemCodeName,UomName';
  Frm_Sys_Condition:=TFrm_Inv_DailyPurchIn_C.Create(Self);
  Act_Filter.Execute;
end;

procedure TFrm_Inv_DailyPurchIn.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
  AdoQry_Tmp.Close;
  AdoQry_Tmp.SQL.Text:='Drop TABLE #DailyPurchIn';
  AdoQry_Tmp.ExecSQL;
end;

end.

⌨️ 快捷键说明

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