📄 sfc_mninbilllistqry.pas
字号:
unit Sfc_MnInBillListQry;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Qry, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
StdCtrls, ExtCtrls, ComCtrls, ToolWin, DBCtrls;
Type
TFrm_Sfc_MnInBillListQry = 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_MnInBillListQry: TFrm_Sfc_MnInBillListQry;
implementation
uses Sfc_MnInBillListQry_C,Sfc_MnInBillQry,Inv_BillListPrint_C,Inv_Global;
{$R *.DFM}
{ TFrm_Sfc_MnInBillListQry }
procedure TFrm_Sfc_MnInBillListQry.InitForm(AdOConnection: TAdOConnection;
ShowExtendColumn: Boolean);
begin
inherited;
if Param1='0104' then
begin
Caption:='车间半成品生产入库制单列表查询';
Pnl_Title.Caption:='车间半成品生产入库制单列表查询';
end
else if Param1='0105' then
begin
Caption:='车间成品生产入库制单列表查询';
Pnl_Title.Caption:='车间成品生产入库制单列表查询';
end;
SelectFromSQL:='Select InvInBill.InvBillDate'
+',InvInBill.InvBillId'
+',InvInBill.InvBillNo'
+',InvInBill.OverPlan'
+',InvInBill.MoNo'
+',InvInBill.WHCode'
+',InvInBillLine.MoLineNo'
+',InvInBillLine.ItemCode'
+',Item.ItemName'
+',InvInBillLine.ItemCode+'' ''+Item.ItemName As ItemCodeName'
+',Uom.UomName'
+',InvInBillLine.InvBillSfcQty'
+',InvInBill.Sfc_EmployeeCode As EmployeeCode'
+',InvInBill.ShiftType'
+',Employee.EmployeeName'
+',InvInBill.Sfc_EmployeeCode+'' ''+Employee.EmployeeName As EmployeeCodeName'
+',InvInBillLine.BatchNo'
+' From InvInBillLine'
+' Join InvInBill On InvInBillLine.InvBillId=InvInBill.InvBillId'
+' Join Item On InvInBillLine.ItemCode=Item.ItemCode'
+' Join Uom On Item.UomCode=Uom.UomCode'
+' Join Employee On InvInBill.Sfc_EmployeeCode=Employee.EmployeeCode';
OrderByFields:='InvBillDate,InvBillNo,WHCode';
ConditionUserDefine:='InvInBill.BillTypeCode='''+Param1+''''
+' And InvInBill.InvBillWHChck=0';
Frm_Sys_Condition:=TFrm_Sfc_MnInBillListQry_C.Create(Self);
Act_Filter.Execute;
end;
procedure TFrm_Sfc_MnInBillListQry.Act_LookExecute(Sender: TObject);
begin
if AdoQry_Main.active then
begin
inherited;
Application.CreateForm(TFrm_Sfc_MnInBillQry,Frm_Sfc_MnInBillQry);
Frm_Sfc_MnInBillQry.SetUserParam(Param1,Param2,Param3,Param4,Param5,Param6);
Frm_Sfc_MnInBillQry.SetSysParam(UserCode,ModuleCode,MenuId,LoginDate);
Frm_Sfc_MnInBillQry.InitForm(DBConnect,'Query',AdoQry_Main);
Frm_Sfc_MnInBillQry.ShowModal;
Frm_Sfc_MnInBillQry.Release;
end;
end;
procedure TFrm_Sfc_MnInBillListQry.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
,Param1,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 + -