📄 updinvla.pas
字号:
unit updINVLA;
interface
uses sysUtils, dbtables, db, bde, updBase;
type
TUpdateINVLA = 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;
function update_byBOMI05(xQrySource: TQuery): Boolean;
function update_byBOMI06(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
uses LibStrs;
function TUpdateINVLA.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 TUpdateINVLA.update(xQrySource: TQuery; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
begin
Result := True;
self.saveVar(xAction, xOtherVar, xUserData);
FOtherVar:= xOtherVar;
try
self.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
if (compareText(self.SourceTxnCode, 'TXNBOMI05') = 0) then
Result := update_byBOMI05(xQrySource)
else
if (compareText(self.SourceTxnCode, 'TXNBOMI06') = 0) then
Result := update_byBOMI06(xQrySource)
else
begin
end;
finally
//VarArrayUnlock(self.Msg);
self.Query1.Close;
self.Query1.UnPrepare;
end;
xMsg := self.Msg;
end;
function TUpdateINVLA.update_byINVI08(xQrySource: TQuery): Boolean;
var
mMC004,mLA009:string;
mExist: Boolean;
mIO: integer;
mLoop: integer;
mQUANTY,mUNIT_COST:Double;
mLA013,mLA017,mLA018,mLA019,mLA020:Double;
begin
Result := True;
self.Msg[0] := 'skip';
self.Msg[1] := 'INVLA';
with xqrySource do
begin
self.Msg[2] := Format('%s %s %s %s %s',
[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 + -