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

📄 inv_otheropout_h.pas

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

unit Inv_OtherOpOut_H;

Interface

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

Type
  TFrm_Inv_OtherOpOut_H = Class(TFrm_Base_Entry_Head)
    AdoQry_HeadInvBillId: TFloatField;
    AdoQry_HeadWhCodeName: TStringField;
    AdoQry_HeadInvBillNo: TStringField;
    AdoQry_HeadInvBillDate: TDateTimeField;
    AdoQry_HeadBillType2CodeName: TStringField;
    AdoQry_HeadWhPositionName: TStringField;
    AdoQry_HeadVendorFlag: TStringField;
    AdoQry_HeadPriceAdjustBill: TIntegerField;
    AdoQry_HeadInvBillRemArk: TStringField;
    procedure Act_NewExecute(Sender: TObject);
    procedure Act_LookExecute(Sender: TObject);
  private
    BillTypeCode: String;
    HasNegative: String;
    { Private declarations }
  public
   Billlines:    integer;
   procedure InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);OverRide;
    { Public declarations }
  end;

var
  Frm_Inv_OtherOpOut_H: TFrm_Inv_OtherOpOut_H;

implementation

uses Inv_OtherOpOut_B;

{$R *.DFM}

{ TFrm_Inv_OtherOut_H }

procedure TFrm_Inv_OtherOpOut_H.InitForm(AdOConnection: TAdOConnection;
  ReadOnly: Boolean);
begin
  inherited;
  BillTypeCode:=Param1;
  SelectFromSql:='select InvOutBill.InvBillId ,'+
        'InvOutBill.WhCode+'''+' '+'''+Warehouse.WHName As WhCodeName, '+
        'InvOutBill.InvBillNo, '+
        'InvOutBill.InvBillDate, '+
        'InvOutBill.InvBillRemArk,'+
        'InvOutBill.PriceAdjustBill,'+
        'InvOutBill.BillType2Code+'''+' '+'''+BillType2.BillType2Name As BillType2CodeName, '+
        'InvOutBill.WhPositionCode+'''+' '+'''+WhPosition.WhPositionName As WhPositionName, '+
        'InvOutBill.VendorCode+'' ''+V.VendorName VendorFlag '+
    'from InvOutBill  '+
    'left join Vendor V '+
        'on InvOutBill.VendorCode=V.VendorCode '+
    'left Join BillType2 on InvOutBill.BillType2Code=BillType2.BillType2Code '+
    'left Join WhPosition on (InvOutBill.WhPositionCode=WhPosition.WhPositionCode) '+
    '               and (InvOutBill.WhCode=WhPosition.WhCode) '+
    'left Join Warehouse on (Warehouse.WhCode=InvOutBill.WhCode) and InvOutBill.OpBill=1 '+
    '  and (InvOutBill.BillTypeCode='''+BillTypeCode+''')';

    OrderByFields:='WhCodeName,InvBillNo';
    with AdoQry_tmp do
    begin
      Close;
      sql.clear;
      sql.Add('select BillLines from BillType where BillTypeCode='''+BillTypeCode+'''');
      open;
      Billlines:=fieldbyname('Billlines').asinteger;
    end;
   ConditionUserDefine:=' InvOutBill.InvBillMonth='''+copy(datetostr(date),1,7)+''' and InvOutBill.OpBill=1';
   GetData;
   Frm_Entry_Body:=TFrm_Inv_OtherOpOut_B.Create(self);
end;

procedure TFrm_Inv_OtherOpOut_H.Act_NewExecute(Sender: TObject);
var
  Book1:TBookMArk;
begin
  Param2:='NONE';
  Book1:=AdoQry_Head.GetBookmArk;
  inherited;
  AdoQry_Head.GotoBookmArk(Book1);
  AdoQry_Head.FreeBookmArk(Book1);
end;

procedure TFrm_Inv_OtherOpOut_H.Act_LookExecute(Sender: TObject);
begin
  if AdoQry_Head.fieldbyname('InvBillId').Asstring='' then abort;
  With AdoQry_Tmp do
  begin
    Close;
    Sql.clear;
    Sql.Add('select Count(*) As RecCount '+
             ' from InvOutBillLine '+
             ' where InvBillId='+AdoQry_Head.fieldbyname('InvBillId').Asstring+
             ' and InvBillQty<0');
    Open;
    If fieldbyname('RecCount').AsInteger>0 Then
      HasNegative:='Yes'
    Else
    begin
      Close;
      Sql.clear;
      Sql.Add('select Count(*) As RecCount '+
             ' from InvOutBillLine '+
             ' where InvBillId='+AdoQry_Head.fieldbyname('InvBillId').AsString+
             ' and InvBillQty>0');
      Open;
      If fieldbyname('RecCount').AsInteger>0 Then
          HasNegative:='No'
      Else
          HasNegative:='NONE';
    end;
    Param2:=HasNegative;
  end;
  inherited;
end;

end.

⌨️ 快捷键说明

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