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

📄 pm_qry_chginfopo_c.pas

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

Interface

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

Type
  TFrm_Pm_Qry_ChgInfoPo_C = Class(TFrm_Base_Condition)
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label6: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    medts: TMaskEdit;
    medte: TMaskEdit;
    edtItemCodes: TEdit;
    edtItemCodee: TEdit;
    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_ChgInfoPo_C: TFrm_Pm_Qry_ChgInfoPo_C;

implementation

uses Pm_Qry_ChgInfoPo,Sys_Global;

{$R *.DFM}

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

end;

procedure TFrm_Pm_Qry_ChgInfoPo_C.btn_okClick(Sender: TObject);
var SqlText:string;
begin
  inherited;
  SqlText:='Select PoLineHistory.*,Employee.EmployeeName,Item.ItemName,'+
                  'Employeeflag=poLineHistory.polchgEmployeeCode+'' ''+Employee.EmployeeName,'+
                  'Itemflag=poLineHistory.ItemCode+'' ''+Item.ItemName,'+
                  'Item.UomCode,Uom.UomName'+
           ' into #poLineHistoryQry '+
           ' From PoLineHistory'+
           ' left outer Join Item On PoLineHistory.ItemCode=Item.ItemCode'+
           ' left outer Join Uom On Item.UomCode=Uom.UomCode'+
           ' left outer Join Employee On PoLineHistory.PolChgEmployeeCode=Employee.EmployeeCode'+
           ' where PoLineHistory.PoNo between '''+edtponos.Text+''''+' and '''+edtponoe.Text+''''+
           '   and PoLineHistory.ItemCode between '''+edtItemCodes.Text+''''+' and '''+edtItemCodee.Text+''''+
           '   and PoLineHistory.PolChgEmployeeCode between '''+edteCodes.Text+''''+' and '''+edteCodee.Text+''''+
           '   and PoLineHistory.PolChgTime between '''+medts.Text+''''+' and '''+medte.Text+' 23:59:59'+''''+
           ' Order By PoNo,PoLineNo,PolChgTime';


 with   Frm_Pm_Qry_ChgInfoPo.AdoQry_Main do
     begin
       Close;
       sql.clear;
       sql.Add(sqltext);
       Prepared;
       execsql;
       
       Close;
       sql.clear;
       sql.Add('select * from #poLineHistoryQry Order by pono,polineno,polchgtime');
       Prepared;
       open;

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

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



end;

end.

⌨️ 快捷键说明

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