📄 ar_qry_chginfoarap.pas
字号:
unit Ar_Qry_ChgInfoArAp;
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_ChgInfoArAp = Class(TFrm_Base_Qry)
AdoQry_MainArApno: TStringField;
AdoQry_MainApInvoiceno: TStringField;
AdoQry_MainInvoicedate: TDateTimeField;
AdoQry_MainTotalAmount: TFloatField;
AdoQry_MainreMainTotalAmount: TFloatField;
AdoQry_MainthiSCancelAmount: TFloatField;
AdoQry_MainchgType: TStringField;
AdoQry_MainchgEmployeeCode: TStringField;
AdoQry_MainchgEmployeeName: TStringField;
AdoQry_MainchgEmployeeflag: TStringField;
AdoQry_Mainchgtime: TDateTimeField;
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_ChgInfoArAp: TFrm_Ar_Qry_ChgInfoArAp;
implementation
uses Sys_Global,Ar_Qry_ChgInfoArAp_C;
{$R *.DFM}
procedure TFrm_Ar_Qry_ChgInfoArAp.InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);
var sqltext:string;
date1,date2:string;
Invoiceno1,Invoiceno2:string;
EmployeeCode1,EmployeeCode2:string;
begin
Application.ProcessMessages;
inherited;
date1:='';
date2:='';
Invoiceno1:='';
Invoiceno2:='';
EmployeeCode1:='';
EmployeeCode2:='';
with TFrm_Ar_Qry_ChgInfoArAp_C.Create(self) do
begin
try
AdoQry_tmp.Connection:=dbconnect;
showmodal;
if modalResult=mrok then
begin
date1:=medts.Text;
date2:=medte.Text;
Invoiceno1:=edt_Invoiceno1.Text;
Invoiceno2:=edt_Invoiceno2.Text;
EmployeeCode1:=edt_EmployeeCode1.Text;
EmployeeCode2:=edt_EmployeeCode2.text;
end;
finally
Frm_Ar_Qry_ChgInfoArAp_C.Free;
Frm_Ar_Qry_ChgInfoArAp_C:=nil;
end;
end;
sqltext:=' select sa_ArApLineHistory.ArApno, '
+' sa_ArApLineHistory.ApInvoiceno, '
+' sa_SaleInvoice.Billdate as Invoicedate, '
+' sa_ArApLineHistory.TotalAmount, '
+' sa_ArApLineHistory.reMainTotalAmount, '
+' sa_ArApLineHistory.thiSCancelAmount, '
+' sa_ArApLineHistory.chgType, '
+' sa_ArApLineHistory.chgEmployeeCode, '
+' Employee.EmployeeName as chgEmployeeName, '
+' sa_ArApLineHistory.chgEmployeeCode+Employee.EmployeeName as chgEmployeeflag, '
+' sa_ArApLineHistory.chgtime '
+' into #QryArApLineHistory '
+' from sa_ArApLineHistory '
+' join sa_SaleInvoice on sa_ArApLineHistory.ApInvoiceno=sa_SaleInvoice.Invoiceno '
+' left join Employee on sa_ArApLineHistory.chgEmployeeCode=Employee.EmployeeCode ';
Executesql(AdoQry_tmp,sqltext,1) ;
//****************************************************************************************************88888888888888
selectfromsql:='select * from #QryArApLineHistory';
condition:= ' chgtime between '+quotedstr(date1)+' and '+quotedstr(date2+' 23:59:59')
+' and ApInvoiceno between '+quotedstr(Invoiceno1)+' and '+quotedstr(Invoiceno2)
+' and chgEmployeeCode between '+quotedstr(EmployeeCode1)+' and '+quotedstr(EmployeeCode2);
Orderbyfields:=' ApInvoiceno';
getdata;
// Executesql(AdoQry_Main,'select * from #ttttt '+iifstring(display=1,' ',' where ((debitCount<>0) or (creditCount<>0))')+'Order by kmCode ',0);
lbl_Condition.Caption:='采购发票单号从 '+Invoiceno1+' 到 '+Invoiceno2+' /操作员代码从 '+EmployeeCode1+' 到 '+EmployeeCode2+' /操作日期从 '+date1+' 到 '+date2;
end;
procedure TFrm_Ar_Qry_ChgInfoArAp.FormDestroy(Sender: TObject);
begin
inherited;
Frm_Ar_Qry_ChgInfoArAp:=nil;
end;
procedure TFrm_Ar_Qry_ChgInfoArAp.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
try
Executesql(AdoQry_tmp,'drop table #QryArApLineHistory',1);
except
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -