📄 inv_opmaterialsumqry.pas
字号:
unit Inv_OpMaterialSumQry;
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_Inv_OpMaterialSumQry = Class(TFrm_Base_Qry)
Label1: TLabel;
Lbl_TaxAmountTatol: TLabel;
Edit1: TEdit;
procedure AdoQueryAfterOpen(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
procedure initReport;Override;
procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
end;
var
Frm_Inv_OpMaterialSumQry: TFrm_Inv_OpMaterialSumQry;
implementation
uses Inv_OpMaterialSumQry_C;
{$R *.DFM}
{ TFrm_Inv_VendorSumQry }
procedure TFrm_Inv_OpMaterialSumQry.InitForm(AdOConnection: TAdOConnection;
ShowExtendColumn: Boolean);
begin
inherited;
SelectFromSQL:='Select InvInBillLine.ItemCode'
+',Item.ItemName'
+',InvInBillLine.ItemCode+'' ''+Item.ItemName As ItemCodeName'
+',Uom.UomName'
+',Sum(InvInBillLine.InvBillNoTaxAmount) As AInvBillNoTaxAmount'
+' From InvInBillLine Join InvInBill On InvInBillLine.InvBillId=InvInBill.InvBillId'
+' Join Item On InvInBillLine.ItemCode=Item.ItemCode'
+' Join Uom On Item.UomCode=Uom.UomCode';
GroupByFields:='InvInBillLine.ItemCode,Item.ItemName,Uom.UomName';
ConditionUserDefine:='InvInBill.BillTypeCode In (''1201'',''1202'')';
OrderByFields:='ItemCode';
Frm_Sys_Condition:=TFrm_Inv_OpMaterialSumQry_C.Create(Self);
Act_Filter.Execute;
end;
procedure TFrm_Inv_OpMaterialSumQry.AdoQueryAfterOpen(DataSet: TDataSet);
var
TaxAmountTatol:Double;
begin
inherited;
if Param2<>'Inv' then
begin
TaxAmountTatol:=0;
DataSet.DisableControls;
DataSet.Last;
while not DataSet.Bof do
begin
TaxAmountTatol:=TaxAmountTatol+DataSet.fieldbyname('AInvBillNoTaxAmount').AsFloat;
DataSet.Prior;
end;
// Lbl_TaxAmountTatol.Caption:=FloatToStr(TaxAmountTatol);
edit1.text:=FormatFloat('#.##',TaxAmountTatol);
DataSet.EnableControls;
end;
end;
procedure TFrm_Inv_OpMaterialSumQry.initReport;
begin
inherited;
ExtprintReport.Headers.Items[ExtprintReport.Headers.indexof('AInvBillNoTaxAmount')].sum:=True;
ExtprintReport.Headers.Items[ExtprintReport.Headers.indexof('AInvBillNoTaxAmount')].sum:=True;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -