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

📄 pm_qry_chginfopoh_c.pas

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

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Condition, Db, AdODB, StdCtrls, Mask;

Type
  TFrm_Pm_Qry_ChgInfoPoH_C = Class(TFrm_Base_Condition)
    Label3: TLabel;
    Label4: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    medts: TMaskEdit;
    medte: TMaskEdit;
    edteCodes: TEdit;
    edteCodee: TEdit;
    Label1: TLabel;
    edtponos: TEdit;
    Label5: TLabel;
    edtponoe: TEdit;
    procedure FormCreate(Sender: TObject);
    procedure btn_okClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Frm_Pm_Qry_ChgInfoPoH_C: TFrm_Pm_Qry_ChgInfoPoH_C;

implementation

uses Pm_Qry_ChgInfoPoH,Sys_Global;

{$R *.DFM}

procedure TFrm_Pm_Qry_ChgInfoPoH_C.FormCreate(Sender: TObject);
begin
  inherited;
     medts.Text:=formatdatetime('yyyy.mm.dd',now-30);
     medte.Text:=formatdatetime('yyyy.mm.dd',now);
     edteCodes.Text:='0';
     edtponos.Text:='0';
     edtponoe.Text:='ZZZZZ';
     edteCodee.Text:='ZZZZZ';

end;

procedure TFrm_Pm_Qry_ChgInfoPoH_C.btn_okClick(Sender: TObject);
var SqlText:string;
begin
  inherited;
    SqlText:='Select t1.*,t2.VendorName,Vendorflag=t1.VendorCode+'' ''+t2.VendorName,Employeeflag=t1.pochgEmployeeCode+'' ''+t3.EmployeeName,pochgEmployeeName=t3.EmployeeName,t4.CurrencyName,poEmployeeName=t5.EmployeeName'+
             ' into #tmppohistory   '+
             '     From PoHistory t1(nolock),Vendor t2(nolock),Employee t3(nolock),currency t4(nolock),Employee t5(nolock)'+
             ' where t1.pochgEmployeeCode*=t3.EmployeeCode'+
             '  and   t1.VendorCode*=t2.VendorCode'+
             '  and   t1.currencyCode*=t4.currencyCode'+
             '  and   t1.EmployeeCode*=t5.EmployeeCode'+
             '  and   t1.pono between '''+edtponos.Text+''''+' and '''+edtponoe.Text+''''+
             '  and   t1.poChgEmployeeCode between '''+edteCodes.Text+''''+' and '''+edteCodee.Text+''''+
             '  and   t1.PoChgTime  between '''+medts.Text+''''+' and '''+medte.Text+' 23:59:59'+''''+
             '  Order By t1.PoNo,t1.poChgTime';


 with   Frm_Pm_Qry_ChgInfoPoH.AdoQry_Main do
     begin
       Close;
       sql.clear;
       sql.Add(sqltext);
       Prepared;
       execsql;
       Close;
       sql.clear;
       sql.Add('select * from #tmppohistory');
       Prepared;
       open;

       if recordCount=0 then
         begin
           DispInfo('无符合条件的数据!',3);
           exit;
         end;
     end;

   ConditionHint:='采购订单号从 '+Edtponos.Text+' 到 '+Edtponoe.Text+' / 操作员代码从 '+EdteCodes.Text+' 到 '+EdteCodee.Text+' / 操作日期从 '+medts.Text+' 到 '+medte.Text;
   self.ModalResult:=mrOk;




end;

end.

⌨️ 快捷键说明

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