📄 updinvld.pas
字号:
unit updINVLD;
interface
uses sysUtils, dbtables, db, bde, updBase;
type
TUpdateINVLD = class(TBaseUpdateUnit)
private
FOtherVar: variant;
function update_byAll(xSource: Variant): Boolean;
function update_byINVI08(xQrySource: TQuery): Boolean;
function update_byINVI11(xQrySource: TQuery): Boolean;
function update_byINVI12(xQrySource: TQuery): Boolean;
public
function update(xQrySource: TQuery; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
function update2(xSource: Variant; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
end;
implementation
function TUpdateINVLD.update2(xSource: Variant; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
begin
self.saveVar(xAction, xOtherVar, xUserData);
try
self.setDBname(xSource[0]);
Result := update_byAll(xSource)
finally
self.Query1.close;
end;
xMsg := self.Msg;
end;
function TUpdateINVLD.update(xQrySource: TQuery; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
begin
Result := True;
self.saveVar(xAction, xOtherVar, xUserData);
FOtherVar:= xOtherVar;
try
setDBName(xQrySource.databaseName);
if compareText(self.SourceTxnCode, 'TXNINVI08') = 0 then
Result := update_byINVI08(xQrySource)
else
if compareText(self.SourceTxnCode, 'TXNINVI11') = 0 then
Result := update_byINVI11(xQrySource)
else
if compareText(self.SourceTxnCode, 'TXNINVI12') = 0 then
Result := update_byINVI12(xQrySource)
else
begin
end;
finally
//VarArrayUnlock(self.Msg);
self.Query1.close;
self.Query1.UnPrepare;
end;
xMsg := self.Msg;
end;
function TUpdateINVLD.update_byINVI08(xQrySource: TQuery): Boolean;
var
mExist: Boolean;
mIO: integer;
mLoop: integer;
mQUANTY,mUNIT_COST:Double;
mLD008:string;
begin
Result := True;
self.Msg[0] := 'skip';
self.Msg[1] := 'INVLD';
with xqrySource do
begin
self.Msg[2] := FieldByName('TB004').asString+' '+ self.FConfirmDate+' '+
FieldByName('TB001').asString+' '+
FieldByName('TB002').asString+' '+FieldByName('TB003').asString;
end;
mQUANTY := FOtherVar[1]; //畐
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -