📄 ar_qry_chginfosaleinvoiceh_c.pas
字号:
unit Ar_Qry_ChgInfoSaleInvoiceH_C;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Condition, Db, AdODB, StdCtrls, Mask, ExtEdit;
Type
TFrm_Ar_Qry_ChgInfoSaleInvoiceH_C = Class(TFrm_Base_Condition)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Edt_Customer1: TExtEdit;
Edt_Customer2: TExtEdit;
Edt_Operator1: TExtEdit;
Edt_Operator2: TExtEdit;
Medt_Date1: TMaskEdit;
Medt_Date2: TMaskEdit;
procedure btn_okClick(Sender: TObject);
procedure Edt_Customer1Exit(Sender: TObject);
procedure Edt_Customer2Exit(Sender: TObject);
procedure Edt_Operator1Exit(Sender: TObject);
procedure Edt_Operator2Exit(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
procedure CheckCustomer(Extedt:TExtedit);
procedure CheckEmployee(Extedt:TExtedit);
public
{ Public declarations }
end;
var
Frm_Ar_Qry_ChgInfoSaleInvoiceH_C: TFrm_Ar_Qry_ChgInfoSaleInvoiceH_C;
implementation
{$R *.DFM}
procedure TFrm_Ar_Qry_ChgInfoSaleInvoiceH_C.btn_okClick(Sender: TObject);
begin
inherited;
condition:=' 1=1 ';
if Trim(Edt_Customer1.Text)<>'' then
Condition:=condition+' and Sa_SaleInvoiceHistory.CustomerCode>= '+Quotedstr(Edt_Customer1.Text);
if Trim(Edt_Customer2.Text)<>'ZZZZ' then
condition:=condition+' and Sa_SaleInvoiceHistory.CustomerCode<='+Quotedstr(Edt_Customer2.Text);
if Trim(Edt_Operator1.Text)<>'' then
condition:=condition+' and Sa_SaleInvoiceHistory.ChgEmployeeCode>='+Quotedstr(Edt_Operator1.Text);
if Trim(Edt_Operator2.Text)<>'ZZZZ' then
condition:=condition+' and Sa_SaleInvoiceHistory.ChgEmployeeCode<='+Quotedstr(Edt_Operator2.Text);
condition:=condition+' and Sa_SaleInvoiceHistory.ChgTime>='+Quotedstr(Medt_Date1.Text)+' and Sa_SaleInvoiceHistory.ChgTime<='+Quotedstr(Medt_Date2.Text);
conditionHint:= '销售客户代码从:'+Edt_Customer1.Text+ '到:'+Edt_Customer2.Text+
'/操作员代码从:'+Edt_Operator1.Text+'到:'+Edt_Operator2.Text+
'/操作日期从:'+Medt_Date1.Text+'到:'+Medt_Date2.Text;
Self.ModalResult := mrok;
end;
procedure TFrm_Ar_Qry_ChgInfoSaleInvoiceH_C.CheckCustomer(
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 CUSTOMERCode from CUSTOMER where CUSTOMERCode='+
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_ChgInfoSaleInvoiceH_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_ChgInfoSaleInvoiceH_C.Edt_Customer1Exit(
Sender: TObject);
begin
inherited;
CheckCustomer(Edt_Customer1);
end;
procedure TFrm_Ar_Qry_ChgInfoSaleInvoiceH_C.Edt_Customer2Exit(
Sender: TObject);
begin
inherited;
if Edt_Customer2.Text='' then
begin
Application.MessageBox('代码错误!','信息提示',MB_OK+MB_IconWArNING);
Edt_Customer2.SetFocus;
Abort;
end;
CheckCustomer(Edt_Customer2);
end;
procedure TFrm_Ar_Qry_ChgInfoSaleInvoiceH_C.Edt_Operator1Exit(
Sender: TObject);
begin
inherited;
CheckEmployee(Edt_Operator1);
end;
procedure TFrm_Ar_Qry_ChgInfoSaleInvoiceH_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_ChgInfoSaleInvoiceH_C.FormShow(Sender: TObject);
begin
inherited;
Medt_Date1.Text := FormatDateTime('yyyy.mm.dd', date()-30);
Medt_Date2.Text := FormatDateTime('yyyy.mm.dd',date());
Edt_Customer1.SetFocus;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -