📄 invw00_01.pas.svn-base
字号:
unit InvW00_01;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, HwWork, dxExEdtr, ADODB, DB, Menus, ActnList, ImgList,
dxDBCtrl, dxDBGrid, dxTL, dxDBTLCl, dxGrClms, StdCtrls, Buttons,
wwdbdatetimepicker, ExtCtrls, dxCntner, ComCtrls, dxtree, dxdbtree,
ToolWin;
type
TInvW00_01Form = class(THwWorkForm)
tlbInv100: TToolButton;
tlbInv110: TToolButton;
ToolButton5: TToolButton;
tlbInv120: TToolButton;
tlbInv140: TToolButton;
ToolButton8: TToolButton;
tlbInv500: TToolButton;
tlbInv510: TToolButton;
ToolButton11: TToolButton;
tlbInv600: TToolButton;
tlbInv610: TToolButton;
ToolButton14: TToolButton;
tlbExit: TToolButton;
ActInv500: TAction;
ActInv200: TAction;
ActInvS00: TAction;
ActInv100: TAction;
ActInv110: TAction;
ActInv120: TAction;
N2: TMenuItem;
ActInv140: TAction;
ActInv145: TAction;
ActInv150: TAction;
ActInv510: TAction;
ActInv550: TAction;
ActInv600: TAction;
ActInv610: TAction;
ActInv300: TAction;
ActInv310: TAction;
ActInv400: TAction;
ActInv410: TAction;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
N10: TMenuItem;
N11: TMenuItem;
N12: TMenuItem;
N13: TMenuItem;
N14: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
N17: TMenuItem;
N18: TMenuItem;
N19: TMenuItem;
N20: TMenuItem;
N21: TMenuItem;
N22: TMenuItem;
N23: TMenuItem;
N24: TMenuItem;
N25: TMenuItem;
tlbInv150: TToolButton;
ToolButton3: TToolButton;
qryMasterI150_001: TAutoIncField;
qryMasterI150_002: TWideStringField;
qryMasterI150_003: TWideStringField;
qryMasterI150_004: TWideStringField;
qryMasterI140_003: TWideStringField;
qryMasterFBalance: TFloatField;
qryMasterFIn: TFloatField;
qryMasterFOut: TFloatField;
qryMasterFOpen: TFloatField;
dbgMasterI150_002: TdxDBGridColumn;
dbgMasterI150_003: TdxDBGridColumn;
dbgMasterI150_004: TdxDBGridColumn;
dbgMasterI140_003: TdxDBGridColumn;
dbgMasterFOpen: TdxDBGridMaskColumn;
dbgMasterFIn: TdxDBGridMaskColumn;
dbgMasterFOut: TdxDBGridMaskColumn;
dbgMasterFBalance: TdxDBGridMaskColumn;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure ActInvS00Execute(Sender: TObject);
procedure dbgMasterI150_002DrawSummaryFooter(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; var AText: String;
var AAlignment: TAlignment; AFont: TFont; var AColor: TColor;
var ADone: Boolean);
private
{ Private declarations }
public
procedure SetInterface; override;
procedure SearchEvent; override;
procedure BrowseEvent; override;
procedure ReportGetValue(const ParName: String; var ParValue: Variant); override;
procedure SetModuleName; override;
procedure SetProgramRights; override;
procedure GetAllClass(ADataSet:TADODataSet;AcbClass:TComboBox); override;
{ Public declarations }
end;
var
InvW00_01Form: TInvW00_01Form;
implementation
uses SYSDATA, CommFun, InvComm, Inv310_01;
{$R *.dfm}
procedure TInvW00_01Form.SetInterface;
begin
inherited;
Caption:=GetDBString('INVW0001001'); //库存管理平台
MenuItem11.Caption:=GetDBString('INVW0001002'); //库存盘点(&T)
ToolButton1.Caption:=MenuItem11.Caption;
TabSheet1.Caption:=GetDBString('INVW0001003'); //仓库库存
ActInvS00.Caption:=GetDBString('INVW0001004'); //库存管理参数
ActInv100.Caption:=GetDBString('INVW0001005'); //仓库资料维护
ActInv110.Caption:=GetDBString('INVW0001006'); //库位资料维护
ActInv120.Caption:=GetDBString('INVW0001007'); //料品分类维护
ActInv140.Caption:=GetDBString('INVW0001008'); //计量单位维护
ActInv145.Caption:=GetDBString('INVW0001009'); //单据转换维护
ActInv150.Caption:=GetDBString('INVW0001010'); //料品资料维护
ActInv500.Caption:=GetDBString('INVW0001011'); //料品进出处理
ActInv510.Caption:=GetDBString('INVW0001012'); //料品转仓处理
ActInv550.Caption:=GetDBString('INVW0001013'); //库存操作类型
ActInv600.Caption:=GetDBString('INVW0001014'); //盘点计划维护
ActInv610.Caption:=GetDBString('INVW0001015'); //盘点进度汇报
ActInv200.Caption:=GetDBString('INVW0001016'); //库存缺料报告
ActInv300.Caption:=GetDBString('INVW0001017'); //仓库状况查询
ActInv310.Caption:=GetDBString('INVW0001018'); //料品状况查询
ActInv400.Caption:=GetDBString('INVW0001019'); //料品用量分析
ActInv410.Caption:=GetDBString('INVW0001020'); //周转次数分析
tlbInv100.Caption:=GetDBString('INVW0001021'); //仓库资料
tlbInv110.Caption:=GetDBString('INVW0001022'); //库位资料
tlbInv120.Caption:=GetDBString('INVW0001023'); //料品分类
tlbInv140.Caption:=GetDBString('INVW0001024'); //计量单位
tlbInv150.Caption:=GetDBString('INVW0001025'); //料品资料
tlbInv500.Caption:=GetDBString('INVW0001026'); //料品进出
tlbInv510.Caption:=GetDBString('INVW0001027'); //料品转仓
tlbInv600.Caption:=GetDBString('INVW0001028'); //盘点计划
tlbInv610.Caption:=GetDBString('INVW0001029'); //盘点汇报
tlbExit.Caption:=GetDBString('INVW0001030'); //退出
lblClass.Caption:=GetDBString('INVW0001031'); //仓库
pnLists.Caption:=GetDBString('INVW0001032'); //仓库列表
qryMaster.FieldByName('I150_002').DisplayLabel:=GetDBString('INVW0001034'); //料品编号
qryMaster.FieldByName('I150_003').DisplayLabel:=GetDBString('INVW0001035'); //料品名称
qryMaster.FieldByName('I150_004').DisplayLabel:=GetDBString('INVW0001036'); //规格型号
qryMaster.FieldByName('I140_003').DisplayLabel:=GetDBString('INVW0001037'); //计量单位
qryMaster.FieldByName('FOpen').DisplayLabel:=GetDBString('INVW0001038'); //期初数量
qryMaster.FieldByName('FIn').DisplayLabel:=GetDBString('INVW0001039'); //入库数量
qryMaster.FieldByName('FOut').DisplayLabel:=GetDBString('INVW0001040'); //出库数量
qryMaster.FieldByName('FBalance').DisplayLabel:=GetDBString('INVW0001041'); //库存数量
end;
procedure TInvW00_01Form.FormCreate(Sender: TObject);
begin
inherited;
//
end;
procedure TInvW00_01Form.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
//
end;
procedure TInvW00_01Form.BrowseEvent;
var
AWhsNo,AItemNo:Integer;
AFromDate,AToDate:TDateTime;
begin
inherited;
if adsLists.IsEmpty then Exit;
adsLists.Locate('FName',cbClass.Text,[]);
AWhsNo:=adsLists.FieldByName('FNo').AsInteger;
AItemNo:=qryMasterI150_001.AsInteger;
AFromDate:=edtFromDate.Date;
AToDate:=edtToDate.Date;
Inv310_01Form:=TInv310_01Form.Create(Application);
Inv310_01Form.OpenData(AWhsNo,AItemNo,AFromDate,AToDate);
Inv310_01Form.ShowModal;
end;
procedure TInvW00_01Form.GetAllClass(ADataSet: TADODataSet;
AcbClass: TComboBox);
begin
inherited;
GetAllWhs(ADataSet,AcbClass);
end;
procedure TInvW00_01Form.ReportGetValue(const ParName: String;
var ParValue: Variant);
begin
inherited;
end;
procedure TInvW00_01Form.SearchEvent;
var
AWhsNo,ALocNo:Integer;
AFromDate,AToDate:TDateTime;
begin
inherited;
if adsLists.IsEmpty then Exit;
adsLists.Locate('FName',cbClass.Text,[]);
AWhsNo:=adsLists.FieldByName('FNo').AsInteger;
ALocNo:=0;
if AWhsNo<0 then
AWhsNo:=AWhsNo*-1
else if AWhsNo>0 then
begin
ALocNo:=AWhsNo;
AWhsNo:=0;
end;
AFromDate:=edtFromDate.Date;
AToDate:=edtToDate.Date;
//取得所有物料的出入数量及库存数量
GetAllItemInvBalance(qryMaster,AWhsNo,ALocNo,AFromDate,AToDate);
ARecordCount:=GetDataSetCount(qryMaster);
end;
procedure TInvW00_01Form.SetModuleName;
begin
inherited;
AModule:='INV';
AProgramID:='INV300';
end;
procedure TInvW00_01Form.SetProgramRights;
var
ARights:String;
begin
inherited;
ARights:=GetRights('INV310','INV');
ActOpen.Enabled:=ARights[1]='Y';
ARights:=GetRights('INV500','INV');
// ActIONew.Enabled:=ARights[1]='Y';
ARights:=GetRights('INV510','INV');
// ActTRNew.Enabled:=ARights[1]='Y';
end;
procedure TInvW00_01Form.ActInvS00Execute(Sender: TObject);
var
S:String;
begin
inherited;
S:=TAction(Sender).Name;
S:=copy(S,4,6);
CreateFormInPackage('T'+S+'_01Form',True);
end;
procedure TInvW00_01Form.dbgMasterI150_002DrawSummaryFooter(
Sender: TObject; ACanvas: TCanvas; ARect: TRect; var AText: String;
var AAlignment: TAlignment; AFont: TFont; var AColor: TColor;
var ADone: Boolean);
begin
inherited;
AColor:=clWhite;
AText:=GetDBString('COM00004002')+IntToStr(ARecordCount); //记录总数:
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -