📄 inv_pohint.pas
字号:
unit Inv_PoHint;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Dialog, Grids, DBGridEh, Db, AdODB, StdCtrls, DBCtrls;
Type
TFrm_Inv_PoHint = Class(TFrm_Base_Dialog)
DBGridEh: TDBGridEh;
Label1: TLabel;
Lbl_PoNo1: TLabel;
AdoQry_Hint: TAdoQuery;
DS_Hint: TDataSource;
Label2: TLabel;
DBText1: TDBText;
procedure btn_okClick(Sender: TObject);
procedure DBGridEhGetCellParams(Sender: TObject; Column: TColumnEh;
AFont: TFont; var Background: TColor; State: TGridDrawState);
private
{ Private declarations }
StArtDate,endDate:TDateTime;
OverRate:Double;
public
{ Public declarations }
POLineNo:String;
procedure InitForm(AdOConnection:TAdOConnection;PoNo,POLineNo:String;
StArtDate,endDate:TDateTime;OverRate:Double);virtual;
end;
var
Frm_Inv_PoHint: TFrm_Inv_PoHint;
implementation
{$R *.DFM}
{ TFrm_Inv_MpsHint }
procedure TFrm_Inv_PoHint.InitForm(AdOConnection: TAdOConnection;
PoNo,POLineNo: String;StArtDate,endDate:TDateTime;OverRate:Double);
begin
Lbl_PoNo1.Caption:=PoNo;
SetDBConnect(AdOConnection);
AdoQry_Hint.Connection:=AdOConnection;
AdoQry_Hint.Close;
AdoQry_Hint.SQL.Text:='Select Case When PoLine.PoReferencedPrice=1'
+' Then ''是'' Else Null end As ReferencedPrice,PoLine.PoLineNo'
+',case when Item.iScheck=0 then ''免检'' when Item.iScheck=1 then ''必检'' else '' '' end as iScheck '
+',PoLine.ItemCode+'' ''+Item.ItemName As ItemCodeName'
+',PoLine.PoLineDate,PoLine.PoQty,PoLine.PoRealInQty,PoLine.PoInQty'
+',PoQty-PoRealInQty-PoInQty As Qty'
+',PoRealInQty+PoInQty As SumQty'
+' From PoLine Join Item On PoLine.ItemCode=Item.ItemCode'
+' Where PoLine.PoNo='''+PoNo+''''
+' And PoLine.PoLineStatus=6'
+' Order By PoLine.PoLineNo';
AdoQry_Hint.Open;
if POLineNo<>'' then
AdoQry_Hint.Locate('POLineNo',POLineNo,[loPArtialKey]);
Self.StArtDate:=StArtDate;
Self.endDate:=endDate;
Self.OverRate:=OverRate;
end;
procedure TFrm_Inv_PoHint.btn_okClick(Sender: TObject);
begin
inherited;
POLineNo:=AdoQry_Hint.fieldbyname('POLineNo').AsString;
Self.ModalResult:=mrOk;
end;
procedure TFrm_Inv_PoHint.DBGridEhGetCellParams(Sender: TObject;
Column: TColumnEh; AFont: TFont; var Background: TColor;
State: TGridDrawState);
begin
inherited;
if (AdoQry_Hint.fieldbyname('PoLineDate').AsDateTime>endDate)or
(AdoQry_Hint.fieldbyname('PoLineDate').AsDateTime<StArtDate)or
(Round(AdoQry_Hint.fieldbyname('PoQty').AsFloat*OverRate)<=
Round(AdoQry_Hint.fieldbyname('SumQty').AsFloat)) then
AFont.Color:=clRed;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -