📄 inv_otherin_h.pas
字号:
unit Inv_OtherIn_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_OtherIn_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;
procedure Act_NewExecute(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
InvBillid,BillTypeCode:string;
Billlines:integer;
procedure InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);Override;
{ Public declarations }
end;
var
Frm_Inv_OtherIn_H: TFrm_Inv_OtherIn_H;
implementation
uses Inv_OtherIn_B;
{$R *.DFM}
procedure TFrm_Inv_OtherIn_H.InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);
begin
inherited;
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.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 ';
//固定条件单据类型为‘其它入库 0199 BillTypeCode=0199 由菜单调用传入’
ConditionUserDefine:=' (InvInBill.BillTypeCode='''+BillTypeCode+''' and '+
' InvInBill.opBill<>1 and '+
' InvInBill.WHCode In '+
' (Select WHCode From WHAccessCtrl Where EmployeeCode='''+UserCode+''') and '+
' 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;
Billlines:=10000;
end;
Frm_Entry_Body:=TFrm_Inv_OtherIn_B.Create(Self);
end;
procedure TFrm_Inv_OtherIn_H.Act_NewExecute(Sender: TObject);
begin
inherited;
//从BODY返回Head后,数据重新刷新,并且要定位。因为AdO控件对CASE采段进行缓存修改
getdata;
if InvBillid<>'' then
begin
AdoQry_Head.First;
AdoQry_Head.Locate('InvBillid',InvBillid,[]);
end;
end;
procedure TFrm_Inv_OtherIn_H.FormDestroy(Sender: TObject);
begin
inherited;
Frm_Inv_OtherIn_H:=nil;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -