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

📄 inv_otheroutaudit_h.pas

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

Interface

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

Type
  TFrm_Inv_OtherOutAudit_H = Class(TFrm_Base_Check_Head)
    AdoQry_HeadInvBillId: TBCDField;
    AdoQry_HeadWhCodeName: TStringField;
    AdoQry_HeadInvBillNo: TStringField;
    AdoQry_HeadInvBillDate: TDateTimeField;
    AdoQry_HeadBillType2CodeName: TStringField;
    AdoQry_HeadWhPositionName: TStringField;
    AdoQry_HeadOutType: TStringField;
    AdoQry_HeadOutCode: TStringField;
    AdoQry_HeadOutName: TStringField;
    AdoQry_HeadInvBillRemArk: TStringField;
    procedure Act_LookExecute(Sender: TObject);
  private
    BillTypeCode: String;

    { Private declarations }
  public
   procedure InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);OverRide;
    { Public declarations }
  end;

var
  Frm_Inv_OtherOutAudit_H: TFrm_Inv_OtherOutAudit_H;

implementation
uses Inv_OtherOutAudit_B,Sys_Global;

{$R *.DFM}

{ TFrm_Inv_OtherOut_H }

procedure TFrm_Inv_OtherOutAudit_H.InitForm(AdOConnection: TAdOConnection;
  ReadOnly: Boolean);
begin
  inherited;
  BillTypeCode:=Param1;
  Frm_Check_Body:=TFrm_Inv_OtherOutAudit_B.Create(self);
  SelectFromSql:='select B.InvBillId ,'+
        'B.WhCode+'''+' '+'''+Warehouse.WHName As WhCodeName, '+
        'B.InvBillNo, '+
        'B.InvBillDate, '+
        'B.InvBillRemArk,'+
        'B.BillType2Code+'''+' '+'''+BillType2.BillType2Name As BillType2CodeName, '+
        'B.WhPositionCode+'''+' '+'''+WhPosition.WhPositionName As WhPositionName, '+
        'OutType= '+
           'case '+
               'when B.DeptCode is not null then '+'''部门'''+
               'when B.customerCode is not null then '+ '''客户'''+
               'when B.VendorCode is not null then '+'''供应商'''+
               'else  '''+''''+
           'end, '+
        'OutCode= '+
           'case '+
               'when B.DeptCode is not null then B.DeptCode '+
               'when B.customerCode is not null then B.customerCode '+
               'when B.VendorCode is not null then B.VendorCode '+
               'else '''+''' '+
           'end, OutName= '+
            'case '+
                'when B.DeptCode is not null then D.DeptName '+
                'when B.customerCode is not null then C.customerName '+
                'when B.VendorCode is not null then V.VendorName '+
                'else '''+''' '+
            'end '+
    'from InvOutBill B '+
    'left join Dept D '+
        'on B.DeptCode=D.DeptCode '+
    'left join customer C '+
        'on B.customerCode=C.customerCode '+
    'left join Vendor V '+
        'on B.VendorCode=V.VendorCode '+
    'Join BillType2 on B.BillType2Code=BillType2.BillType2Code '+
    'Join WhPosition on (B.WhPositionCode=WhPosition.WhPositionCode) '+
    '          and (B.WhCode=WhPosition.WhCode)  '+
    'Join Warehouse on (Warehouse.WhCode=B.WhCode) '+
    '  and (b.BillTypeCode='''+BillTypeCode+''') and (b.InvBillwhchck=0) '+
    '  and (B.InvBillWhChck=0) '+
    '  and (B.WhCode in (Select WhCode from WhAccessCtrl Where EmployeeCode='''+
    UserCode+'''))';
    OrderByFields:='WhCodeName,InvBillNo';
   GetData();
end;

procedure TFrm_Inv_OtherOutAudit_H.Act_LookExecute(Sender: TObject);
var NextInvBillId: Integer;
begin
   NextInvBillid:=-1;
   AdoQry_Tmp.Close;
   AdoQry_Tmp.SQL.clear;
   AdoQry_Tmp.Sql.Add('Select  PriceType from Warehouse where WhCode='''+
                   GetCode(AdoQry_Head.fieldbyname('WhCodeName').AsString)+'''');
   AdoQry_Tmp.Open;
   Param2:=AdoQry_Tmp.fieldbyname('PriceType').AsString;
   If not AdoQry_Head.Eof then
   begin
     AdoQry_Head.Next;
     NextInvBillId:=AdoQry_Head.fieldbyname('InvBillId').AsInteger;
     AdoQry_Head.Prior;
   end;
   inherited;
   iF NextInvBillId<>-1 then
   AdoQry_Head.Locate('InvBillId',NextInvBillId,[loPArtialKey])
end;

end.

⌨️ 快捷键说明

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