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

📄 sfc_mnoutbillqry.pas

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

Interface

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

Type
  TFrm_Sfc_MnOutBillQry = Class(TFrm_Base_Entry_Body)
    Label1: TLabel;
    Label2: TLabel;
    Label4: TLabel;
    Label6: TLabel;
    Label5: TLabel;
    Label11: TLabel;
    Label9: TLabel;
    Label3: TLabel;
    Label10: TLabel;
    Label12: TLabel;
    Label8: TLabel;
    DBText1: TDBText;
    Lbl_Warehouse: TLabel;
    Lbl_Dept: TLabel;
    Lbl_MoNo: TLabel;
    Lbl_RemArk: TLabel;
    Lbl_MoLineNo: TLabel;
    Lbl_WhPosition: TLabel;
    Lbl_Shift: TLabel;
    Lbl_Item: TLabel;
    Lbl_BillNo: TLabel;
    Lbl_BillDate: TLabel;
    procedure Act_PreviewExecute(Sender: TObject);
    procedure Act_PrintExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure InitControls; Override;
  end;

var
  Frm_Sfc_MnOutBillQry: TFrm_Sfc_MnOutBillQry;

implementation

uses Inv_Global,Sys_Global;

{$R *.DFM}

{ TFrm_Sfc_MnOutBillQry }

procedure TFrm_Sfc_MnOutBillQry.InitControls;
begin

  if AdoQry_Head.fieldbyname('InvBillId').AsString='' then
  begin
    Caption:='车间生产领料单查询';
    DispInfo('没有单据',1);
    act_Save.Enabled:=False;
    Act_InsertLine.Enabled:=False;
    Act_DeleteLine.Enabled:=False;
    Act_Modify.Enabled:=False;
    Act_Preview.Enabled:=False;
    Act_Print.Enabled:=False;
    Abort;
  end;
  Caption:='车间生产领料制单';
  inherited;
  AdoQry_Tmp.Close;
  AdoQry_Tmp.SQL.Text:='Select InvOutBill.WHCode+'' ''+Warehouse.WHName As WHCodeName'
                            +',InvOutBill.WhPositionCode+'' ''+WhPosition.WhPositionName As WhPositionCodeName'
                            +',InvOutBill.InvBillNo,InvOutBill.DeptCode+'' ''+Dept.DeptName As DeptCodeName'
                            +',InvOutBill.ShiftType,InvOutBill.InvBillDate,InvOutBill.MoNo,InvOutBill.MoLineNo'
                            +',MoLine.ItemCode+'' ''+Item.ItemName As ItemCodeName,InvOutBill.InvBillRemArk'
                     +' From InvOutBill left Join Warehouse On InvOutBill.WHCode=Warehouse.WHCode'
                                     +' left Join WhPosition On InvOutBill.WhPositionCode=WhPosition.WhPositionCode And InvOutBill.WHCode=WhPosition.WHCode'
                                     +' left Join Dept On InvOutBill.DeptCode=Dept.DeptCode'
                                     +' left Join MoLine On InvOutBill.MoNo=MoLine.MoNo And InvOutBill.MoLineNo=MoLine.MoLineNo'
                                     +' left Join Item On MoLine.ItemCode=Item.ItemCode'
                     +' Where InvOutBill.InvBillId='+AdoQry_Head.fieldbyname('InvBillId').AsString;
  AdoQry_Tmp.Open;

  Lbl_Warehouse.Caption:=AdoQry_Tmp.fieldbyname('WHCodeName').AsString;
  Lbl_Dept.Caption:=AdoQry_Tmp.fieldbyname('DeptCodeName').AsString;
  Lbl_MoNo.Caption:=AdoQry_Tmp.fieldbyname('MoNo').AsString;
  Lbl_RemArk.Caption:=AdoQry_Tmp.fieldbyname('InvBillRemArk').AsString;
  Lbl_MoLineNo.Caption:=AdoQry_Tmp.fieldbyname('MoLineNo').AsString;
  Lbl_WhPosition.Caption:=AdoQry_Tmp.fieldbyname('WhPositionCodeName').AsString;
  Lbl_Shift.Caption:=AdoQry_Tmp.fieldbyname('ShiftType').AsString;
  Lbl_Item.Caption:=AdoQry_Tmp.fieldbyname('ItemCodeName').AsString;
  Lbl_BillNo.Caption:=AdoQry_Tmp.fieldbyname('InvBillNo').AsString;
  Lbl_BillDate.Caption:=AdoQry_Tmp.fieldbyname('InvBillDate').AsString;

  AdoQry_Body.Close;
  AdoQry_Body.SQL.Text:='Select InvOutBillLine.InvBillId'
    +',InvOutBillLine.InvBillLineNo'
    +',MNItemList.MoCtrlQty'
    +',MNItemList.MoRealQty'
    +',InvOutBillLine.ItemCode'
    +',Item.ItemName'
    +',Uom.UomName'
    +',InvOutBillLine.InvBillSfcQty'
    +' From InvOutBillLine'
    +' Left Join MNItemList On InvOutBillLine.MoNo=MNItemList.MoNo'
    +' And InvOutBillLine.MoLineNo=MNItemList.MoLineNo'
    +' And InvOutBillLine.ItemCode=MNItemList.ItemCode'
    +' Join Item On InvOutBillLine.ItemCode=Item.ItemCode'
    +' Join Uom On Item.UomCode=Uom.UomCode'
    +' Where InvOutBillLine.InvBillId='+AdoQry_Head.fieldbyname('InvBillId').AsString;
  AdoQry_Body.Open;
end;

procedure TFrm_Sfc_MnOutBillQry.Act_PreviewExecute(Sender: TObject);
begin
  BillPrint(DBConnect,GetCode(Lbl_Warehouse.Caption),
    Lbl_BillNo.Caption,'0201',ModuleCode,True,False,True,'all');
end;

procedure TFrm_Sfc_MnOutBillQry.Act_PrintExecute(Sender: TObject);
begin
  BillPrint(DBConnect,GetCode(Lbl_Warehouse.Caption),
    Lbl_BillNo.Caption,'0201',ModuleCode,False,False,True,'all');
end;

end.

⌨️ 快捷键说明

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