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

📄 inv_noorderopin_h.pas

📁 一个MRPII系统源代码版本
💻 PAS
字号:
unit Inv_NoOrderOpIn_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_NoOrderOpIn_H = Class(TFrm_Base_Entry_Head)
    AdoQry_HeadInvBillid: TFloatField;
    AdoQry_HeadwhCode: TStringField;
    AdoQry_HeadWhPositionCode: TStringField;
    AdoQry_HeadwhCodeName: TStringField;
    AdoQry_HeadInvBillno: TStringField;
    AdoQry_HeadcurrencyCode: TStringField;
    AdoQry_HeadInvBilldate: TDateTimeField;
    AdoQry_HeadInvBillremArk: TStringField;
    AdoQry_HeadInvBilltaxrate: TFloatField;
    AdoQry_HeadBillType2Code: TStringField;
    AdoQry_HeadBillType2CodeName: TStringField;
    AdoQry_HeadOutType: TStringField;
    AdoQry_HeadOutCode: TStringField;
    AdoQry_HeadOutName: TStringField;
    AdoQry_HeadWhPositionCode_1: TStringField;
    AdoQry_HeadWhPositionCodeName: TStringField;
    AdoQry_HeadVendorCode: TStringField;
    procedure Act_NewExecute(Sender: TObject);
  private

    { Private declarations }
  public
    InvBillid,BillTypeCode:string;
    Billlines,InvBilllineno:integer;
    procedure InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);Override;
    { Public declarations }
  end;

var
  Frm_Inv_NoOrderOpIn_H: TFrm_Inv_NoOrderOpIn_H;

implementation

uses Inv_NoOrderOpIn_B;
{$R *.DFM}

procedure TFrm_Inv_NoOrderOpIn_H.InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);
begin
  inherited;
  InvBilllineno:=0;
  InvBillid:='';
  BillTypeCode:=Param1;
  SelectFromSQL:='select '+
                    'InvInBill.InvBillid,'+
                    'InvInBill.whCode,'+
                    'InvInBill.WhPositionCode,'+
                    'InvInBill.whCode+'+' '' '' '+'+w.whName as whCodeName, '+
                    'InvInBill.InvBillno,'+
                    'InvInBill.currencyCode,'+
                    'InvInBill.InvBilltaxrate,'+
                    'InvInBill.InvBilldate,'+
                    'InvInBill.InvBillremArk,'+
                    'InvInBill.BillType2Code,'+
                    'InvInBill.BillType2Code+'+''' '''+'+b.BillType2Name as BillType2CodeName, '+
                  //入库对象
                    'OutType='+
                    'case'+
                    '  when InvInBill.DeptCode is not null then ''部门'' '+
                    '  when InvInBill.VendorCode is not null then ''供应商'' '+
                    'else '+
                    ' '''' '+
                    ' end,'+
                  //入库对象代码
                    'OutCode='+
                    'case'+
                    '  when InvInBill.DeptCode is not null then InvInBill.DeptCode '+
                    '  when InvInBill.VendorCode is not null then InvInBill.VendorCode '+
                    'else '+
                    ' '''' '+
                    'end,'+
                  //入库对象描述
                   'OutName='+
                   'case'+
                   '  when InvInBill.DeptCode is not null then D.DeptName '+
                   '  when InvInBill.VendorCode is not null then V.VendorName '+
                   'else '+
                   ' '''' '+
                   'end, '+
                   'InvInBill.WhPositionCode,'+
                   'InvInBill.VendorCode,'+
                   'InvInBill.WhPositionCode+'+''' '''+'+p.WhPositionName as WhPositionCodeName '+
    'from InvInBill  '+
    'left join Dept D on InvInBill.DeptCode=D.DeptCode '+
    'left join Vendor V on InvInBill.VendorCode=V.VendorCode '+
    'left join Warehouse w on InvInBill.whCode=w.whCode '+
    'left join BillType2 b on InvInBill.BillType2Code=b.BillType2Code '+
    'left join WhPosition p on InvInBill.whCode=p.whCode and InvInBill.WhPositionCode=p.WhPositionCode ';

    ConditionUserDefine:=' InvInBill.BillTypeCode='''+BillTypeCode+''' and '+
       //        '      InvInBill.InvBillStkchck=0 and '+
               '      InvInBill.opBill=1 ';
               //'    and   InvInBill.InvBillMonth='+quotedstr(copy(datetostr(now),1,7))+')';
    //                          '      InvInBill.InvBillMonth='''+copy(LoginDate,1,7)+''') ';
    OrderByFields:='whCode,InvBillno';
    getdata;

     //取单据录入的行数
    with AdoQry_tmp do
    begin
      Close;
      sql.clear;
      sql.Add('select Billlines from BillType where BillTypeCode='''+BillTypeCode+'''');
      open;
      Billlines:=fieldbyname('Billlines').asinteger;
    end;

    Frm_Entry_Body:=TFrm_Inv_NoOrderOpIn_B.Create(Self);
end;


procedure TFrm_Inv_NoOrderOpIn_H.Act_NewExecute(Sender: TObject);
begin
  inherited;
  getdata;
  if InvBillid<>'' then
  begin
    AdoQry_Head.First;
    AdoQry_Head.Locate('InvBillid',InvBillid,[]);
  end;
end;

end.

⌨️ 快捷键说明

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