📄 pm_qry_po.pas
字号:
unit Pm_Qry_Po;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Outer, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
StdCtrls, ExtCtrls, ComCtrls, ToolWin, DBCtrls, jpeg;
Type
TFrm_Pm_Qry_Po = Class(TFrm_Base_Outer)
AdoQry_MainPoNo: TStringField;
AdoQry_MaInvendorCode: TStringField;
AdoQry_MainPONO_1: TStringField;
AdoQry_MainPOLINENo: TIntegerField;
AdoQry_MainItemCode: TStringField;
AdoQry_MainPOLineDATE: TDateTimeField;
AdoQry_MainPOQTY: TFloatField;
AdoQry_MainPONoFinishQty: TFloatField;
AdoQry_MainPOREFERENCEDPRICE: TIntegerField;
AdoQry_MainPoNoTaxPrice: TFloatField;
AdoQry_MainPONoTaxAmount: TBCDField;
AdoQry_MainPoTaxPrice: TFloatField;
AdoQry_MainPOStArtWorkDate: TDateTimeField;
AdoQry_MainItemCode_1: TStringField;
AdoQry_MainItemName: TStringField;
AdoQry_MainUomCode: TStringField;
AdoQry_MainUomName: TStringField;
AdoQry_MaInvendorName: TStringField;
AdoQry_MainPoType: TIntegerField;
AdoQry_MainPoTaxAmount: TBCDField;
AdoQry_MainEmployeeCode: TStringField;
AdoQry_MainEmployeeName: TStringField;
AdoQry_Mainpodate: TDateTimeField;
AdoQry_Mainpcno: TStringField;
AdoQry_MainEmployeeflag: TStringField;
AdoQry_MaInvendorflag: TStringField;
AdoQry_MainItemflag: TStringField;
Label3: TLabel;
dbtxTEmployeeflag: TDBText;
dbtxtVendorflag: TDBText;
dbtxtItemflag: TDBText;
Label1: TLabel;
Label2: TLabel;
Label4: TLabel;
AdoQry_MainPOInQty: TFloatField;
AdoQry_MainPOLINESTATUS: TIntegerField;
Label5: TLabel;
AdoQry_MaInvendorordinal: TIntegerField;
procedure FormDestroy(Sender: TObject);
procedure AdoQry_MainAfterScroll(DataSet: TDataSet);
procedure Act_LookExecute(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
disppa:boolean;
procedure InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);Override;
end;
var
Frm_Pm_Qry_Po: TFrm_Pm_Qry_Po;
implementation
uses Mrp_Qry_InformalTotalMrp_Po_D;
{$R *.DFM}
{ TFrm_Pm_Qry_Po }
procedure TFrm_Pm_Qry_Po.InitForm(AdOConnection: TAdOConnection;
ReadOnly: Boolean);
begin
inherited;
Pricefields:='potaxPrice,ponotaxPrice,potaxAmount,ponotaxAmount,';
if disppa=False then
begin
self.Caption:='采购订单数量列表查询';
pnl_title.Caption:=self.Caption;
if not (fsbold in dbgrideh.Columns[17].Font.style) then
begin
dbgrideh.Columns[17].Font.style:=dbgrideh.Columns[17].Font.style+[fsbold];
end;
if not (fsbold in dbgrideh.Columns[14].Font.style) then
begin
dbgrideh.Columns[14].Font.style:=dbgrideh.Columns[14].Font.style+[fsbold];
end;
dbgrideh.Columns[21].FieldName:='';
dbgrideh.Columns[21].Visible:=False;
dbgrideh.Columns[22].FieldName:='';
dbgrideh.Columns[22].Visible:=False;
dbgrideh.Columns[23].FieldName:='';
dbgrideh.Columns[23].Visible:=False;
dbgrideh.Columns[24].FieldName:='';
dbgrideh.Columns[24].Visible:=False;
end;
SelectFromSQL:='Select Po.PoNo,po.Vendorordinal,po.pcno,po.podate,Po.EmployeeCode,Employee.EmployeeName,Po.VendorCode,Po.PoType,PoLine.*,Item.ItemCode,'+
' Item.ItemName,Item.UomCode,Uom.UomName,Vendor.VendorName,'+
' Employeeflag=po.EmployeeCode+'' ''+Employee.EmployeeName,'+
' Vendorflag=po.VendorCode+'' ''+Vendor.VendorName,'+
' Itemflag=poline.ItemCode+'' ''+Item.ItemName'+
' From PoLine'+
' left outer Join Item On PoLine.ItemCode=Item.ItemCode'+
' Join Po On PoLine.PoNo=Po.PoNo and po.PoSpecial=0 '+
' left outer join Employee on Po.EmployeeCode=Employee.EmployeeCode'+
' Left outer Join Vendor On Po.VendorCode=Vendor.VendorCode'+
' Left Outer Join Uom On Item.UomCode=Uom.UomCode';
Condition:=' PoLine.PoNoFinishQty>0 and poline.polinestatus<=6';
Orderbyfields:='ItemCode,polinedate';
GetData;
end;
procedure TFrm_Pm_Qry_Po.FormDestroy(Sender: TObject);
begin
inherited;
Frm_Pm_Qry_Po:=nil;
end;
procedure TFrm_Pm_Qry_Po.AdoQry_MainAfterScroll(DataSet: TDataSet);
begin
inherited;
case AdoQry_Main.fieldbyname('polinestatus').asinteger of
5 : label5.Caption:='5 准备';
6 : label5.Caption:='6 下达';
7 : label5.Caption:='7 关闭';
8 : label5.Caption:='8 永久关闭';
end;
end;
procedure TFrm_Pm_Qry_Po.Act_LookExecute(Sender: TObject);
var poType:string;
linesta:string;
begin
inherited;
case AdoQry_Main.fieldbyname('poType').asinteger of
0: poType:='普通采购';
1: poType:='委外加工';
2: poType:='进口采购';
end;
case AdoQry_Main.fieldbyname('polinestatus').asinteger of
5: linesta:='5 准备';
6: linesta:='6 下达';
7: linesta:='7 关闭';
end;
try
with TFrm_Mrp_Qry_InformalTotalMrp_Po_D.Create(Application) do
begin
maskedit1.Text:=AdoQry_Main.fieldbyname('podate').asstring;
edit1.Text:=AdoQry_Main.fieldbyname('Employeeflag').asstring;
edit2.Text:=AdoQry_Main.fieldbyname('pcno').asstring;
edit3.Text:=AdoQry_Main.fieldbyname('pono').asstring;
edit4.Text:=AdoQry_Main.fieldbyname('Vendorflag').asstring;
edit5.Text:=poType;
edit6.Text:=inttostr(AdoQry_Main.fieldbyname('polineno').asinteger);
edit7.Text:=AdoQry_Main.fieldbyname('Itemflag').asstring;
edit8.Text:=AdoQry_Main.fieldbyname('postArtworkdate').asstring;
edit9.Text:=AdoQry_Main.fieldbyname('polinedate').asstring;
edit10.Text:=floattostr(AdoQry_Main.fieldbyname('poqty').asfloat);
edit11.Text:=floattostr(AdoQry_Main.fieldbyname('ponoFinishqty').asfloat);
edit12.Text:=linesta;
if AdoQry_Main.fieldbyname('poreferencedPrice').asinteger=0 then
edit13.Text:='否'
else edit13.Text:='是';
if disppa=False then
begin
label15.Visible:=False;
label16.Visible:=False;
label17.Visible:=False;
label18.Visible:=False;
edit14.Visible:=False;
edit15.Visible:=False;
edit16.Visible:=False;
edit17.Visible:=False;
end;
edit14.Text:=floattostr(AdoQry_Main.fieldbyname('potaxPrice').asfloat);
edit15.Text:=floattostr(AdoQry_Main.fieldbyname('potaxAmount').asfloat);
edit16.Text:=floattostr(AdoQry_Main.fieldbyname('ponotaxPrice').asfloat);
edit17.Text:=floattostr(AdoQry_Main.fieldbyname('ponotaxAmount').asfloat);
showmodal;
end;
finally
Frm_Mrp_Qry_InformalTotalMrp_Po_D.Free;
end;
end;
procedure TFrm_Pm_Qry_Po.FormCreate(Sender: TObject);
begin
inherited;
disppa:=True;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -