📄 inv_opdiffbilllistqry.pas
字号:
unit Inv_OpDiffBillListQry;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Qry, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
StdCtrls, ExtCtrls, ComCtrls, ToolWin, DBCtrls, jpeg;
Type
TFrm_Inv_OpDiffBillListQry = Class(TFrm_Base_Qry)
Label1: TLabel;
DBText1: TDBText;
Label2: TLabel;
Edit1: TEdit;
procedure Act_LookExecute(Sender: TObject);
procedure AdoQueryAfterOpen(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
end;
var
Frm_Inv_OpDiffBillListQry: TFrm_Inv_OpDiffBillListQry;
implementation
uses Inv_OpDiffBillListQry_C, Inv_OpDiffBillQry, Sys_Global;
{$R *.DFM}
procedure TFrm_Inv_OpDiffBillListQry.InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);
begin
inherited;
Caption:='委外加工材料费单据列表查询';
Pnl_Title.Caption:=Caption;
SelectFromSQL:='Select InvInBill.InvBillDate'
+',InvInBill.InvBillId'
+',InvInBill.InvBillNo'
+',InvInBill.VendorCode+'' ''+Vendor.VendorName As VendorCodeName'
+',InvInBill.WHCode+'' ''+Warehouse.WHName As WHCodeName'
+',InvInBill.PoNo'
+',InvInBillLine.PoLineNo'
+',InvInBillLine.ItemCode+'' ''+Item.ItemName As ItemCodeName'
+',InvInBillLine.InvBillNoTaxAmount'
+',InvInBill.EmployeeCode+'' ''+Employee.EmployeeName As EmployeeCodeName'
+' From InvInBillLine'
+' Join InvInBill On InvInBillLine.InvBillId=InvInBill.InvBillId'
+' Join Item On InvInBillLine.ItemCode=Item.ItemCode'
+' Join Vendor On InvInBill.VendorCode=Vendor.VendorCode'
+' Join Warehouse On InvInBill.WHCode=Warehouse.WHCode'
+' left Join Employee On InvInBill.EmployeeCode=Employee.EmployeeCode';
ConditionUserDefine:='InvInBill.BillTypeCode in (''1201'',''1202'')';
OrderByFields:='InvBillDate,InvBillNo';
Frm_Sys_Condition:=TFrm_Inv_OpDiffBillListQry_C.Create(nil);
Act_Filter.Execute;
end;
procedure TFrm_Inv_OpDiffBillListQry.Act_LookExecute(Sender: TObject);
begin
inherited;
if not AdoQry_Main.IsEmpty then
begin
Application.CreateForm(TFrm_Inv_OpDiffBillQry,Frm_Inv_OpDiffBillQry);
Frm_Inv_OpDiffBillQry.Caption:='委外加工材料费单据';
Frm_Inv_OpDiffBillQry.SetUserParam(Param1,Param2,Param3,Param4,Param5,Param6);
Frm_Inv_OpDiffBillQry.SetSysParam(UserCode,ModuleCode,MenuId,LoginDate);
Frm_Inv_OpDiffBillQry.Getvar(AdoQry_Main.fieldbyname('InvBillNo').asstring,
getCode (AdoQry_Main.fieldbyname('WHCodeName').asstring));
Frm_Inv_OpDiffBillQry.InitForm(DBConnect,'Query',AdoQry_Main);
Frm_Inv_OpDiffBillQry.ShowModal;
Frm_Inv_OpDiffBillQry.Release;
end;
end;
procedure TFrm_Inv_OpDiffBillListQry.AdoQueryAfterOpen(DataSet: TDataSet);
var
sql_txt:string;
i:integer;
sumAmount:real;
begin
inherited;
sumAmount:=0;
//汇总金额
If Not AdoQry_Main.IsEmpty then
begin
AdoQry_Main.First;
for I:=0 to AdoQry_Main.RecordCount-1 do
begin
SumAmount:=SumAmount+AdoQry_Main.fieldbyname('InvBillnotaxAmount').asFloat;
AdoQry_Main.next;
end;
AdoQry_Main.First;
end;
edit1.text:=FormatFloat('#.##',SumAmount);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -