⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mrp_qry_informaltotalmrp_po.pas

📁 一个MRPII系统源代码版本
💻 PAS
字号:
unit Mrp_Qry_InformalTotalMrp_Po;

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_Mrp_Qry_InformalTotalMrp_Po = Class(TFrm_Base_Qry)
    AdoQry_MainPoNo: TStringField;
    AdoQry_Mainpodate: TDateTimeField;
    AdoQry_MainEmployeeCode: TStringField;
    AdoQry_MainEmployeeName: TStringField;
    AdoQry_MaInvendorCode: TStringField;
    AdoQry_MainPoType: TIntegerField;
    AdoQry_Mainpcno: TStringField;
    AdoQry_MainPONO_1: TStringField;
    AdoQry_MainPOLINENo: TIntegerField;
    AdoQry_MainItemCode: TStringField;
    AdoQry_MainPOLineDATE: TDateTimeField;
    AdoQry_MainPOQTY: TFloatField;
    AdoQry_MainPONoFinishQty: TFloatField;
    AdoQry_MainPOREFERENCEDPRICE: TIntegerField;
    AdoQry_MainPOLINESTATUS: TIntegerField;
    AdoQry_MainPoNoTaxPrice: TFloatField;
    AdoQry_MainPONoTaxAmount: TBCDField;
    AdoQry_MainPoTaxPrice: TFloatField;
    AdoQry_MainPoTaxAmount: TBCDField;
    AdoQry_MainPOStArtWorkDate: TDateTimeField;
    AdoQry_MainPoRealInQty: TFloatField;
    AdoQry_MainPoInQty: TFloatField;
    AdoQry_MainPoLineCheck: TIntegerField;
    AdoQry_MainSSQty: TFloatField;
    AdoQry_MainCloseRemArk: TStringField;
    AdoQry_MainItemCode_1: TStringField;
    AdoQry_MainItemName: TStringField;
    AdoQry_MainUomCode: TStringField;
    AdoQry_MainUomName: TStringField;
    AdoQry_MaInvendorName: TStringField;
    AdoQry_MainEmployeeflag: TStringField;
    AdoQry_MaInvendorflag: TStringField;
    AdoQry_MainItemflag: TStringField;
    AdoQry_Mainlinestatus: TStringField;
    procedure FormDestroy(Sender: TObject);
    procedure Act_LookExecute(Sender: TObject);
  private
    { Private declarations }
  public
   ItemCode:string;
    procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
    { Public declarations }
  end;

var
  Frm_Mrp_Qry_InformalTotalMrp_Po: TFrm_Mrp_Qry_InformalTotalMrp_Po;

implementation
uses Mrp_Qry_InformalTotalMrp,Mrp_Qry_InformalTotalMrp_Po_D;
{$R *.DFM}

{ TFrm_Mrp_Qry_InformalTotalMrp_Po }

procedure TFrm_Mrp_Qry_InformalTotalMrp_Po.InitForm(
  AdOConnection: TAdOConnection; ShowExtendColumn: Boolean);
begin
  inherited;
  SelectFromSQL:='Select Po.PoNo,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,'+
                ' linestatus= case poline.polinestatus  '+
                       '  when 5 then ''5 准备'' '+
                       '  when 6 then ''6 下达'' '+
                       '  when 7 then ''7 关闭'' '+
                       '  when 8 then ''8 永久关闭'' '+
                    '  end  '+
            ' From PoLine'+
                 '  left outer Join Item On PoLine.ItemCode=Item.ItemCode'+
                 ' Join Po On PoLine.PoNo=Po.PoNo'+
                 ' 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.polinestatus<=6 and poline.ItemCode='+quotedstr(ItemCode);
  Orderbyfields:='EmployeeCode,Pono,PolineNo';
  GetData;

end;

procedure TFrm_Mrp_Qry_InformalTotalMrp_Po.FormDestroy(Sender: TObject);
begin
  inherited;
  Frm_Mrp_Qry_InformalTotalMrp_Po:=nil;
end;

procedure TFrm_Mrp_Qry_InformalTotalMrp_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:='是';
     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;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -