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

📄 pm_pobalance_b.pas

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

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Check_Body, Db, ActnList, AdODB, Grids, DBGridEh, StdCtrls,
  ExtCtrls, ComCtrls, ToolWin, Buttons, jpeg;

Type
  TFrm_Pm_PoBalance_B = Class(TFrm_Base_Check_Body)
    Label1: TLabel;
    Lbl_FPoNo: TLabel;
    Label3: TLabel;
    Lbl_VendorCodeName: TLabel;
    AdoQry_BodyPoLineNo: TIntegerField;
    AdoQry_BodyItemCode: TStringField;
    AdoQry_BodyItemName: TStringField;
    AdoQry_BodyUomName: TStringField;
    AdoQry_BodyPoLineDate: TDateTimeField;
    AdoQry_BodyPoQty: TFloatField;
    AdoQry_BodyPoNoFinishQty: TFloatField;
    SpeedButton1: TSpeedButton;
    Label2: TLabel;
    lbl_PoType: TLabel;
    procedure Act_CheckExecute(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
  private
    FPoNo :String;
    FVendorCodeName :String;
    { Private declarations }
  public
    procedure SetUserParam(Param1,Param2,Param3,Param4,Param5,Param6:String);OverRide;
    procedure InitControls;Override;
    { Public declarations }
  end;

var
  Frm_Pm_PoBalance_B: TFrm_Pm_PoBalance_B;

implementation
Uses Sys_Global, Inv_PriceAudit_PoBlnc_B;
{$R *.DFM}

{ TFrm_Pm_PoBalance_B }

procedure TFrm_Pm_PoBalance_B.InitControls;
begin
  inherited;
  Lbl_FPoNo.Caption:=FPoNo;
  Lbl_VendorCodeName.Caption:=FVendorCodeName;
  if AdoQry_Head.fieldbyname('PoType').asinteger=0 then
    Lbl_PoType.Caption:='普通采购'
  else if AdoQry_Head.fieldbyname('PoType').asinteger=1 then
    Lbl_PoType.Caption:='委外加工'
  else
    Lbl_PoType.Caption:='进口采购';
  With AdoQry_Body do
  begin
    Close;
    Sql.clear;
    Sql.Add('Select PoLine.PoLineNo,PoLine.ItemCode,Item.ItemName,Uom.UomName, '+
            '  PoLine.PoLineDate,PoLine.PoQty,PoLine.PoNoFinishQty '+
            '  From PoLine,Item,Uom '+ 
            '  Where PoLine.PoNo='''+FPoNo+''''+
            '    and Item.ItemCode=PoLine.ItemCode '+
            '    and Item.UomCode=Uom.UomCode ');
    Open;
  end;
  Act_Check.Enabled:=True;
end;

procedure TFrm_Pm_PoBalance_B.SetUserParam(Param1, Param2, Param3, Param4,
  Param5, Param6: String);
begin
  inherited;
  FPoNo:=Param3;
  FVendorCodeName:=Param4;
end;

procedure TFrm_Pm_PoBalance_B.Act_CheckExecute(Sender: TObject);
var OldSort :String;
begin
  inherited;
  If DispInfo('确认结算本采购订单吗?结算后,该订单将彻底关闭!',2)='y' then
  begin
    With AdoQry_Tmp do
    begin
      Close;
      Sql.clear;
      Sql.Add('Update PoLine Set PoLineStatus=8 Where PoNo='''+FPoNo+'''');
      ExecSql;
    end;
    Act_Check.Enabled:=False;
    OldSort:=AdoQry_Head.Sort;
    AdoQry_Head.Close;
    AdoQry_Head.Open;
    AdoQry_Head.Sort:=OldSort;
  end;
end;

procedure TFrm_Pm_PoBalance_B.SpeedButton1Click(Sender: TObject);
begin
  inherited;
  Frm_Inv_PriceAudit_PoBlnc_B:=TFrm_Inv_PriceAudit_PoBlnc_B.Create(self);

  if(not AdoQry_Head.IsEmpty)then
  begin
    Frm_Inv_PriceAudit_PoBlnc_B.SetUserParam(Param1,Param2,Param3,Param4,Param5,Param6);
    Frm_Inv_PriceAudit_PoBlnc_B.SetSysParam(UserCode,ModuleCode,MenuId,LoginDate);
    Frm_Inv_PriceAudit_PoBlnc_B.InitForm(DBConnect,'Edit',AdoQry_Head);
    Frm_Inv_PriceAudit_PoBlnc_B.ShowModal;
  end;
  Frm_Inv_PriceAudit_PoBlnc_B.release;
end;

end.

⌨️ 快捷键说明

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