📄 inv_vendorsumqry.pas
字号:
unit Inv_VendorSumQry;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Qry, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
StdCtrls, ExtCtrls, ComCtrls, ToolWin;
Type
TFrm_Inv_VendorSumQry = Class(TFrm_Base_Qry)
Lbl_NoTax: TLabel;
Label2: TLabel;
Lbl_Tax: TLabel;
Label1: TLabel;
procedure AdoQueryAfterOpen(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
end;
var
Frm_Inv_VendorSumQry: TFrm_Inv_VendorSumQry;
implementation
uses Inv_VendorSumQry_C;
{$R *.DFM}
{ TFrm_Inv_VendorSumQry }
procedure TFrm_Inv_VendorSumQry.InitForm(AdOConnection: TAdOConnection;
ShowExtendColumn: Boolean);
begin
inherited;
AmountFields:='AInvBillNoTaxAmount,AInvBillAmount,';
SelectFromSQL:='Select InvInBill.VendorCode'
+',Vendor.VendorName'
+',InvInBill.VendorCode+'' ''+Vendor.VendorName As VendorCodeName'
+',Sum(InvInBillLine.InvBillNoTaxAmount) As AInvBillNoTaxAmount'
+',Sum(InvInBillLine.InvBillAmount) As AInvBillAmount'
+' From InvInBillLine Join InvInBill On InvInBillLine.InvBillId=InvInBill.InvBillId'
+' Join Currency On InvInBill.CurrencyCode=Currency.CurrencyCode'
+' Join Vendor On InvInBill.VendorCode=Vendor.VendorCode';
GroupByFields:='InvInBill.VendorCode,Vendor.VendorName';
OrderByFields:='VendorCodeName';
ConditionUserDefine:='InvInBill.BillTypeCode<>''1201'''
+' And InvInBill.BillTypeCode<>''1202''';
Frm_Sys_Condition:=TFrm_Inv_VendorSumQry_C.Create(Self);
Act_Filter.Execute;
end;
procedure TFrm_Inv_VendorSumQry.AdoQueryAfterOpen(DataSet: TDataSet);
var
Tax,NoTax:Double;
begin
inherited;
DataSet.Last;
Tax:=0;
NoTax:=0;
while not DataSet.Bof do
begin
Tax:=Tax+DataSet.fieldbyname('AInvBillAmount').AsFloat;
NoTax:=NoTax+DataSet.fieldbyname('AInvBillNoTaxAmount').AsFloat;
DataSet.Prior;
end;
Lbl_NoTax.Caption:=FormatFloat('0.##',NoTax);
Lbl_Tax.Caption:=FormatFloat('0.##',Tax);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -