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

📄 sfc_mnoutbilllistqry.pas

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

Interface

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

Type
  TFrm_Sfc_MnOutBillListQry = Class(TFrm_Base_Qry)
    Label1: TLabel;
    DBText1: TDBText;
    procedure Act_LookExecute(Sender: TObject);
    procedure Act_PrintExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
  end;

var
  Frm_Sfc_MnOutBillListQry: TFrm_Sfc_MnOutBillListQry;

implementation

uses Sfc_MnOutBillListQry_C,Sfc_MnOutBillQry,Inv_BillListPrint_C,Inv_Global;

{$R *.DFM}

{ TFrm_Sfc_MnOutBillListQry }

procedure TFrm_Sfc_MnOutBillListQry.InitForm(AdOConnection: TAdOConnection;
  ShowExtendColumn: Boolean);
begin
  inherited;
  SelectFromSQL:='Select InvOutBill.InvBillDate'
                +',InvOutBill.InvBillId'
                +',InvOutBill.InvBillNo'
                +',InvOutBill.OverPlan'
                +',InvOutBill.MoNo'
                +',InvOutBill.WHCode'
                +',InvOutBillLine.MoLineNo'
                +',InvOutBillLine.ItemCode'
                +',Item.ItemName'
                +',Item.ItemCode2'
                +',InvOutBillLine.ItemCode+'' ''+Item.ItemName As ItemCodeName'
                +',Uom.UomName'
                +',InvOutBillLine.InvBillSfcQty'
                +',InvOutBill.Sfc_EmployeeCode As EmployeeCode'
                +',InvOutBill.ShiftType'
                +',Employee.EmployeeName'
                +',InvOutBill.Sfc_EmployeeCode+'' ''+Employee.EmployeeName As EmployeeCodeName'
                +',InvOutBillLine.BatchNo,'
                +' InvOutBillLine.BillLineRemArk,'
                +' InvOutBillLine.BomRemArk '
                +' From InvOutBillLine'
                +' Join InvOutBill On InvOutBillLine.InvBillId=InvOutBill.InvBillId'
                +' Join Item On InvOutBillLine.ItemCode=Item.ItemCode'
                +' Join Uom On Item.UomCode=Uom.UomCode'
                +' left Join Employee On InvOutBill.Sfc_EmployeeCode=Employee.EmployeeCode';
  OrderByFields:='InvBillDate,InvBillNo,WHCode';
  ConditionUserDefine:='InvOutBill.BillTypeCode=''0201'''
    +' And InvOutBill.InvBillWHChck=0 and InvOutBill.ISMoUnitRequest=0';
  Frm_Sys_Condition:=TFrm_Sfc_MnOutBillListQry_C.Create(Self);
  Act_Filter.Execute;
end;

procedure TFrm_Sfc_MnOutBillListQry.Act_LookExecute(Sender: TObject);
begin
  if AdoQry_Main.active then
  begin
    inherited;
    Application.CreateForm(TFrm_Sfc_MnOutBillQry,Frm_Sfc_MnOutBillQry);
    Frm_Sfc_MnOutBillQry.SetUserParam(Param1,Param2,Param3,Param4,Param5,Param6);
    Frm_Sfc_MnOutBillQry.SetSysParam(UserCode,ModuleCode,MenuId,LoginDate);
    Frm_Sfc_MnOutBillQry.InitForm(DBConnect,'Query',AdoQry_Main);
    Frm_Sfc_MnOutBillQry.ShowModal;
    Frm_Sfc_MnOutBillQry.Release;
  end;
end;

procedure TFrm_Sfc_MnOutBillListQry.Act_PrintExecute(Sender: TObject);
var
  WHCode_InvBillNo:String;
begin
  with TFrm_Inv_BillListPrint_C.Create(Self) do
  begin
    if ShowModal=mrOk then
    begin
      if RdBtn_PrintList.Checked then
        inherited
      else
      begin
        AdoQry_Main.First;
        while not AdoQry_Main.Eof do
        begin
          if WHCode_InvBillNo<>AdoQry_Main.fieldbyname('WHCode').AsString
            +AdoQry_Main.fieldbyname('InvBillNo').AsString then
          begin
            WHCode_InvBillNo:=AdoQry_Main.fieldbyname('WHCode').AsString
              +AdoQry_Main.fieldbyname('InvBillNo').AsString;
            BillPrint(DBConnect,AdoQry_Main.fieldbyname('WHCode').AsString
              ,AdoQry_Main.fieldbyname('InvBillNo').AsString
              ,'0201',ModuleCode,False,False,True,'');
          end;
          AdoQry_Main.Next;
        end;
      end;
    end;
    Release;
  end;
end;

end.

⌨️ 快捷键说明

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