📄 ar_qry_chginfoaraph.pas
字号:
unit Ar_Qry_ChgInfoArApH;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Qry, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
StdCtrls, ExtCtrls, ComCtrls, ToolWin, jpeg;
Type
TFrm_Ar_Qry_ChgInfoArApH = Class(TFrm_Base_Qry)
AdoQry_MainArApno: TStringField;
AdoQry_MainInvoiceno: TStringField;
AdoQry_Maincreatedate: TDateTimeField;
AdoQry_MainCancelTotalAmount: TFloatField;
AdoQry_MainremArk: TStringField;
AdoQry_MaincreateEmployeeCode: TStringField;
AdoQry_MaincustomerCode: TStringField;
AdoQry_MaincustomerName: TStringField;
AdoQry_Maincustomerflag: TStringField;
AdoQry_MainTotaltaxAmount: TFloatField;
AdoQry_MaincurrencyCode: TStringField;
AdoQry_MaincurrencyName: TStringField;
AdoQry_Maincurrencyflag: TStringField;
AdoQry_MainExchangeRate: TFloatField;
AdoQry_MainEmployeeName: TStringField;
AdoQry_MainEmployeeflag: TStringField;
AdoQry_MainchgType: TStringField;
AdoQry_MainchgEmployeeCode: TStringField;
AdoQry_MainchgEmployeeflag: TStringField;
AdoQry_Mainchgtime: TDateTimeField;
AdoQry_MainchgEmployeeName: TStringField;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
{ Public declarations }
end;
var
Frm_Ar_Qry_ChgInfoArApH: TFrm_Ar_Qry_ChgInfoArApH;
implementation
uses Sys_Global,Ar_Qry_ChgInfoArApH_C;
{$R *.DFM}
procedure TFrm_Ar_Qry_ChgInfoArApH.InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);
var sqltext:string;
date1,date2:string;
customerCode1,customerCode2:string;
EmployeeCode1,EmployeeCode2:string;
begin
Application.ProcessMessages;
inherited;
date1:='';
date2:='';
customerCode1:='';
customerCode2:='';
EmployeeCode1:='';
EmployeeCode2:='';
with TFrm_Ar_Qry_ChgInfoArApH_C.Create(self) do
begin
try
AdoQry_tmp.Connection:=dbconnect;
showmodal;
if modalResult=mrok then
begin
date1:=medts.Text;
date2:=medte.Text;
customerCode1:=edt_CustomerCode1.Text;
customerCode2:=edt_CustomerCode2.Text;
EmployeeCode1:=edt_EmployeeCode1.Text;
EmployeeCode2:=edt_EmployeeCode2.text;
end;
finally
Frm_Ar_Qry_ChgInfoArApH_C.Free;
Frm_Ar_Qry_ChgInfoArApH_C:=nil;
end;
end;
sqltext:=' select sa_ArApHistory.ArApno, '
+' sa_ArApHistory.Invoiceno, '
+' sa_ArApHistory.Createdate, '
+' sa_ArApHistory.CancelTotalAmount, '
+' sa_ArApHistory.remArk, '
+' sa_ArApHistory.CreateEmployeeCode, '
+' sa_SaleInvoice.customerCode, '
+' customer.customerName, '
+' sa_SaleInvoice.customerCode+'' ''+customer.customerName as customerflag, '
+' sa_SaleInvoice.TotaltaxAmount, '
+' sa_SaleInvoice.currencyCode, '
+' currency.currencyName, '
+' sa_SaleInvoice.currencyCode+'' ''+currency.currencyName as currencyflag, '
+' sa_SaleInvoice.ExchangeRate, '
+' Employee.EmployeeName, '
+' sa_ArApHistory.CreateEmployeeCode+'' ''+Employee.EmployeeName as Employeeflag, '
+' sa_ArApHistory.chgType, '
+' sa_ArApHistory.chgEmployeeCode, '
+' e.EmployeeName as chgEmployeeName, '
+' sa_ArApHistory.chgEmployeeCode+'' ''+e.EmployeeName as chgEmployeeflag, '
+' sa_ArApHistory.chgtime '
+' into #QryArApHistory '
+' from sa_ArApHistory '
+' join sa_SaleInvoice on sa_ArApHistory.Invoiceno=sa_SaleInvoice.Invoiceno '
+' left join customer on sa_SaleInvoice.customerCode=customer.customerCode '
+' left join currency on sa_SaleInvoice.currencyCode=currency.currencyCode '
+' left join Employee on sa_ArApHistory.CreateEmployeeCode=Employee.EmployeeCode '
+' left join Employee e on sa_ArApHistory.chgEmployeeCode=e.EmployeeCode ';
Executesql(AdoQry_tmp,sqltext,1) ;
//****************************************************************************************************88888888888888
selectfromsql:='select * from #QryArApHistory';
condition:= ' chgtime between '+quotedstr(date1)+' and '+quotedstr(date2+' 23:59:59')
+' and customerCode between '+quotedstr(customerCode1)+' and '+quotedstr(customerCode2)
+' and chgEmployeeCode between '+quotedstr(EmployeeCode1)+' and '+quotedstr(EmployeeCode2);
Orderbyfields:=' customerCode';
getdata;
// Executesql(AdoQry_Main,'select * from #ttttt '+iifstring(display=1,' ',' where ((debitCount<>0) or (creditCount<>0))')+'Order by kmCode ',0);
lbl_Condition.Caption:='销售客户代码从 '+customerCode1+' 到 '+customerCode2+' /操作员代码从 '+EmployeeCode1+' 到 '+EmployeeCode2+' /操作日期从 '+date1+' 到 '+date2;
end;
procedure TFrm_Ar_Qry_ChgInfoArApH.FormDestroy(Sender: TObject);
begin
inherited;
Frm_Ar_Qry_ChgInfoArApH:=nil;
end;
procedure TFrm_Ar_Qry_ChgInfoArApH.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
try
Executesql(AdoQry_tmp,'drop table #QryArApHistory',1);
except
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -