📄 ar_qry_chginfoeachinvoice_c.pas
字号:
unit Ar_Qry_ChgInfoEachInvoice_C;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Condition, Db, AdODB, StdCtrls, Mask, ExtEdit;
Type
TFrm_Ar_Qry_ChgInfoEachInvoice_C = Class(TFrm_Base_Condition)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Edt_ItemCode1: TExtEdit;
Edt_ItemCode2: TExtEdit;
Edt_Operator1: TExtEdit;
Edt_Operator2: TExtEdit;
Medt_Date1: TMaskEdit;
Medt_Date2: TMaskEdit;
procedure btn_okClick(Sender: TObject);
procedure Edt_ItemCode1Exit(Sender: TObject);
procedure Edt_ItemCode2Exit(Sender: TObject);
procedure Edt_Operator1Exit(Sender: TObject);
procedure Edt_Operator2Exit(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
procedure CheckItem(Extedt:TExtedit);
procedure CheckEmployee(Extedt:TExtedit);
public
{ Public declarations }
end;
var
Frm_Ar_Qry_ChgInfoEachInvoice_C: TFrm_Ar_Qry_ChgInfoEachInvoice_C;
implementation
{$R *.DFM}
procedure TFrm_Ar_Qry_ChgInfoEachInvoice_C.btn_okClick(Sender: TObject);
begin
inherited;
condition:=' 1=1 ';
if Trim(Edt_ItemCode1.Text)<>'' then
Condition:=condition+' and Sa_EachInvoiceLineHistory.InvoiceNo>= '+Quotedstr(Edt_ItemCode1.Text);
if Trim(Edt_ItemCode2.Text)<>'ZZZZ' then
condition:=condition+' and Sa_EachInvoiceLineHistory.InvoiceNo<='+Quotedstr(Edt_ItemCode2.Text);
if Trim(Edt_Operator1.Text)<>'' then
condition:=condition+' and Sa_EachInvoiceLineHistory.ChgEmployeeCode>='+Quotedstr(Edt_Operator1.Text);
if Trim(Edt_Operator2.Text)<>'ZZZZ' then
condition:=condition+' and Sa_EachInvoiceLineHistory.ChgEmployeeCode<='+Quotedstr(Edt_Operator2.Text);
condition:=condition+' and Sa_EachInvoiceLineHistory.ChgTime>='+Quotedstr(Medt_Date1.Text)+' and Sa_EachInvoiceLineHistory.ChgTime<='+Quotedstr(Medt_Date2.Text);
conditionHint:= '销售发票单号从:'+Edt_ItemCode1.Text+ '到:'+Edt_ItemCode2.Text+
'/操作员代码从:'+Edt_Operator1.Text+'到:'+Edt_Operator2.Text+
'/操作日期从:'+Medt_Date1.Text+'到:'+Medt_Date2.Text;
Self.ModalResult := mrok;
end;
procedure TFrm_Ar_Qry_ChgInfoEachInvoice_C.CheckItem(
Extedt:TExtedit);
var
S:String;
begin
with AdoQry_tmp do
begin
if Extedt.Text<>'' then
begin
if Extedt.Text='ZZZZ' then exit
else
begin
S:=' select ItemCode from Item where ItemCode='+
Quotedstr(Extedt.Text);
Close;
SQL.clear;
SQL.Add(S);
Open;
if IsEmpty then
begin
Application.MessageBox('代码错误!','信息提示',MB_OK+MB_IconWArNING);
Extedt.SetFocus;
Abort;
end;
end;
end
else
exit;
end;
end;
procedure TFrm_Ar_Qry_ChgInfoEachInvoice_C.CheckEmployee(
Extedt:TExtedit);
var
S:String;
begin
with AdoQry_tmp do
begin
if Extedt.Text<>'' then
begin
if Extedt.Text='ZZZZ' then exit
else
begin
S:=' select EmployeeCode from Employee where EmployeeCode='+
Quotedstr(Extedt.Text);
Close;
SQL.clear;
SQL.Add(S);
Open;
if IsEmpty then
begin
Application.MessageBox('代码错误!','信息提示',MB_OK+MB_IconWArNING);
Extedt.SetFocus;
Abort;
end;
end;
end
else
exit;
end;
end;
procedure TFrm_Ar_Qry_ChgInfoEachInvoice_C.Edt_ItemCode1Exit(
Sender: TObject);
begin
inherited;
CheckItem(Edt_ItemCode1);
end;
procedure TFrm_Ar_Qry_ChgInfoEachInvoice_C.Edt_ItemCode2Exit(
Sender: TObject);
begin
inherited;
if Edt_ItemCode2.Text='' then
begin
Application.MessageBox('代码错误!','信息提示',MB_OK+MB_IconWArNING);
Edt_ItemCode2.SetFocus;
Abort;
end;
CheckItem(Edt_ItemCode2);
end;
procedure TFrm_Ar_Qry_ChgInfoEachInvoice_C.Edt_Operator1Exit(
Sender: TObject);
begin
inherited;
CheckEmployee(Edt_Operator1);
end;
procedure TFrm_Ar_Qry_ChgInfoEachInvoice_C.Edt_Operator2Exit(
Sender: TObject);
begin
inherited;
if Edt_Operator2.Text='' then
begin
Application.MessageBox('代码错误!','信息提示',MB_OK+MB_IconWArNING);
Edt_Operator2.SetFocus;
Abort;
end;
CheckEmployee(Edt_Operator2);
end;
procedure TFrm_Ar_Qry_ChgInfoEachInvoice_C.FormShow(Sender: TObject);
begin
inherited;
Medt_Date1.Text := FormatDateTime('yyyy.mm.dd', date()-30);
Medt_Date2.Text := FormatDateTime('yyyy.mm.dd',date());
Edt_ItemCode1.SetFocus;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -