📄 updinvtg.pas
字号:
unit updINVTG;
interface
uses sysUtils, dbtables, db, bde, updBase, ComObj, CONSTDEF, LibStrs;
type
TUpdateINVTG = class(TBaseUpdateUnit)
private
FOtherVar: variant;
function update_byINVI12(xQrySource: TQuery): Boolean;
function update_byCOPI08(xQrySource: TQuery): Boolean;
function update_byPURI09(xQrySource: TQuery): Boolean;
public
function update(xQrySource: TQuery; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
end;
implementation
function TUpdateINVTG.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, 'TXNINVI12') = 0 then
Result := update_byINVI12(xQrySource)
else
if (compareText(self.SourceTxnCode, 'TXNCOPI08') = 0) then
Result := update_byCOPI08(xQrySource)
else
if (compareText(self.SourceTxnCode, 'TXNPURI09') = 0) then
Result := update_byPURI09(xQrySource)
else
begin
end;
finally
self.Query1.Close;
self.Query1.UnPrepare;
end;
xMsg := self.Msg;
end;
function TUpdateINVTG.update_byINVI12(xQrySource: TQuery): Boolean;
var
mExist: Boolean;
mTG021,mTG009,mm:Double;
mTG024:String;
begin
Result := True;
self.Msg[0] := 'skip';
self.Msg[1] := 'INVTG';
with xqrySource do
begin
self.Msg[2] := Format('%s %s %s %s %s',
[FieldByName('TI004').asString, self.FConfirmDate, FieldByName('TI014').asString,
FieldByName('TI015').asString, FieldByName('TI016').asString]);
end;
mTG009:=FOtherVar[1];
mTG021:=FOtherVar[2];
if self.Action = 'A' then self.Sign:=1 else self.Sign:=-1 ;
try
with self.Query1 do
begin
close;
SQL.clear;
RequestLive := False;
SQL.add('select * from $$INVTG ');
SQL.add('where TG001=:TG001 and TG002=:TG002');
SQL.add(' and TG003=:TG003 ');
ParamByName('TG001').asString := xqrySource.FieldByName('TI014').asString;
ParamByName('TG002').asString := xqrySource.FieldByName('TI015').asString;
ParamByName('TG003').asString := xqrySource.FieldByName('TI016').asString;
open;
first;
mExist := not eof;
if mExist then //Τт
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -