📄 inv_otheriosum_c.pas
字号:
unit Inv_OtherIoSum_C;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Condition, Db, AdODB, StdCtrls, Mask, ExtEdit;
Type
TFrm_Inv_OtherIoSum_C = Class(TFrm_Base_Condition)
Label1: TLabel;
MEdt_Starttime: TMaskEdit;
MEdt_EndTime: TMaskEdit;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
CmBx_Warehouse: TComboBox;
CmBx_Type: TComboBox;
Lbl_OutName: TLabel;
Label7: TLabel;
Label6: TLabel;
ExtEdt_OutCode: TExtEdit;
cmbbx_OutType: TComboBox;
Label11: TLabel;
procedure FormCreate(Sender: TObject);
procedure btn_okClick(Sender: TObject);
procedure MEdt_EndTimeExit(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure ExtEdt_OutCodeEnter(Sender: TObject);
procedure ExtEdt_OutCodeKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure ExtEdt_OutCodeExit(Sender: TObject);
procedure cmbbx_OutTypeExit(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frm_Inv_OtherIoSum_C: TFrm_Inv_OtherIoSum_C;
implementation
uses Sys_Global,Inv_Global;
{$R *.DFM}
procedure TFrm_Inv_OtherIoSum_C.FormCreate(Sender: TObject);
begin
inherited;
MEdt_Starttime.Text:=FormatDateTime('yyyy.mm',IncMonth(Now,-1));
MEdt_EndTime.Text:=FormatDateTime('yyyy.mm',Now);
end;
procedure TFrm_Inv_OtherIoSum_C.btn_okClick(Sender: TObject);
begin
inherited;
if Param1='0199' then
begin
Condition:='InvInBill.InvBillMonth>='''+MEdt_Starttime.Text+''''
+' And InvInBill.InvBillMonth<='''+MEdt_EndTime.Text+'''';
if CmBx_Warehouse.Text<>'所有仓库' then
Condition:=Condition
+' And InvInBill.WHCode ='''+GetCode(CmBx_Warehouse.Text)+'''';
if(ExtEdt_OutCode.Text<>'')then
begin
if cmbbx_OutType.text='部门' then
begin
Condition:=Condition+' And InvInBill.DeptCode='''+ExtEdt_OutCode.Text+'''';
ConditionHint:=ConditionHint+' 部门: '+ExtEdt_OutCode.Text;
end;
if cmbbx_OutType.text='供应商' then
begin
Condition:=Condition+' And InvInBill.VendorCode='''+ExtEdt_OutCode.Text+'''';
ConditionHint:=ConditionHint+' 供应商: '+ExtEdt_OutCode.Text;
end;
if cmbbx_OutType.text='客户' then
begin
Condition:=Condition+' And InvInBill.customerCode='''+ExtEdt_OutCode.Text+'''';
ConditionHint:=ConditionHint+' 客户: '+ExtEdt_OutCode.Text;
end;
end;
if CmBx_Type.Text<>'全部类型' then
Condition:=Condition
+' And InvInBill.BillType2Code ='''+GetCode(CmBx_Type.Text)+'''';
end
else if Param1='0299' then
begin
Condition:='InvOutBill.InvBillMonth>='''+MEdt_Starttime.Text+''''
+' And InvOutBill.InvBillMonth<='''+MEdt_EndTime.Text+'''';
if CmBx_Warehouse.Text<>'所有仓库' then
Condition:=Condition
+' And InvOutBill.WHCode ='''+GetCode(CmBx_Warehouse.Text)+'''';
if(ExtEdt_OutCode.Text<>'')then
begin
if cmbbx_OutType.text='部门' then
begin
Condition:=Condition+' And InvOutBill.DeptCode='''+ExtEdt_OutCode.Text+'''';
ConditionHint:=ConditionHint+' 部门: '+ExtEdt_OutCode.Text;
end;
if cmbbx_OutType.text='客户' then
begin
Condition:=Condition+' And InvOutBill.customerCode='''+ExtEdt_OutCode.Text+'''';
ConditionHint:=ConditionHint+' 客户: '+ExtEdt_OutCode.Text;
end;
if cmbbx_OutType.text='供应商' then
begin
Condition:=Condition+' And InvOutBill.VendorCode='''+ExtEdt_OutCode.Text+'''';
ConditionHint:=ConditionHint+' 供应商: '+ExtEdt_OutCode.Text;
end;
end;
if CmBx_Type.Text<>'全部类型' then
Condition:=Condition
+' And InvOutBill.BillType2Code ='''+GetCode(CmBx_Type.Text)+'''';
end;
ConditionHint:='月份:'+MEdt_Starttime.Text+' 到 '+MEdt_EndTime.Text
+'/'+'仓库:'+CmBx_Warehouse.Text
+'/'+'出库对象:'+cmbbx_OutType.text+':'+ ExtEdt_OutCode.Text+' '+Lbl_OutName.Caption
+#13+#10
+'/'+Label3.Caption+' '+CmBx_Type.Text;
ModalResult:=mrOk;
end;
procedure TFrm_Inv_OtherIoSum_C.MEdt_EndTimeExit(Sender: TObject);
begin
inherited;
MonthCheck(Sender);
if StrToDateTime(MEdt_Starttime.Text+'.01')>StrToDateTime(MEdt_EndTime.Text+'.01')then
begin
DispInfo('查询终止月份不能小于起始月份!',3);
TWinControl(Sender).SetFocus;
Abort;
end;
if Param2<>'Inv' then
InvDataChangeCheck(AdoQry_Tmp,TEdit(Sender).Text);
end;
procedure TFrm_Inv_OtherIoSum_C.FormActivate(Sender: TObject);
begin
inherited;
if CmBx_Warehouse.Items.Count=0 then
begin
with AdoQry_Tmp do
begin
Close;
SQL.Text:='Select Warehouse.WHCode+'' ''+Warehouse.WHName As CodeName '+
'From Warehouse Join WHAccessCtrl On Warehouse.WHCode=WHAccessCtrl.WHCode '+
'Where WHAccessCtrl.EmployeeCode='''+UserCode+'''';
Open;
CmBx_Warehouse.clear;
if Param2='Stk' then
CmBx_Warehouse.Items.Add('所有仓库');
First;
while not Eof do
begin
CmBx_Warehouse.Items.Add(fieldbyname('CodeName').AsString);
AdoQry_Tmp.Next;
end;
CmBx_Warehouse.ItemIndex:=0;
end;
with AdoQry_Tmp do
begin
Close;
if Param1='0199' then
begin
Label3.Caption:='入库类型:';
Label3.Caption:='入库类型:';
Label11.Caption:='入库对象:';
Label6.Caption:='入库对象代码:';
Label7.Caption:='入库对象名称:';
cmbbx_OutType.Items.clear;
cmbbx_OutType.Items.Add('全部');
cmbbx_OutType.Items.Add('供应商');
cmbbx_OutType.Items.Add('部门');
cmbbx_OutType.Items.Add('客户');
SQL.Text:='Select BillType2Code+'' ''+BillType2Name As CodeName From BillType2'
+' Where IO2=0'
+' Order By BillType2Code';
end
else if Param1='0299' then
begin
Label3.Caption:='出库类型:';
Label11.Caption:='出库对象:';
Label6.Caption:='出库对象代码:';
Label7.Caption:='出库对象名称:';
cmbbx_OutType.Items.clear;
cmbbx_OutType.Items.Add('全部');
cmbbx_OutType.Items.Add('客户');
cmbbx_OutType.Items.Add('部门');
cmbbx_OutType.Items.Add('供应商');
SQL.Text:='Select BillType2Code+'' ''+BillType2Name As CodeName From BillType2'
+' Where IO2=1'
+' Order By BillType2Code';
end;
Open;
CmBx_Type.clear;
First;
while not Eof do
begin
CmBx_Type.Items.Add(fieldbyname('CodeName').AsString);
AdoQry_Tmp.Next;
end;
CmBx_Type.Items.Insert(0,'全部类型');
CmBx_Type.ItemIndex:=0;
end;
end;
end;
procedure TFrm_Inv_OtherIoSum_C.ExtEdt_OutCodeEnter(Sender: TObject);
begin
inherited;
if (cmbbx_OutType.text='全部') or (cmbbx_OutType.text='') then
begin
Extedt_OutCode.ReadOnly:=True;
Extedt_OutCode.text:='';
lbl_OutName.Caption:='';
end;
end;
procedure TFrm_Inv_OtherIoSum_C.ExtEdt_OutCodeKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
//inherited;
if key=vk_F9 then
begin
if cmbbx_OutType.text='客户' then UsablecustomerHint(sender,key,shift);
if cmbbx_OutType.text='部门' then DeptHint(sender,key,shift);
if cmbbx_OutType.text='供应商' then UsableVendorHint(sender,key,shift);
end
end;
procedure TFrm_Inv_OtherIoSum_C.ExtEdt_OutCodeExit(Sender: TObject);
begin
//inherited;
if cmbbx_OutType.text='客户' then
customerCodecheck(sender)
else if cmbbx_OutType.text='部门' then
DeptCodecheck(sender)
else if cmbbx_OutType.text='供应商' then
VendorCodeCheck(sender)
else
lbl_OutName.Caption:='';
end;
procedure TFrm_Inv_OtherIoSum_C.cmbbx_OutTypeExit(Sender: TObject);
begin
//inherited;
if (cmbbx_OutType.text='全部') or (cmbbx_OutType.text='') then
begin
Extedt_OutCode.ReadOnly:=True;
Extedt_OutCode.text:='';
lbl_OutName.Caption:='';
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -