📄 updsfcta.pas
字号:
unit updSFCTA;
interface
uses sysUtils, dbtables, bde, updBASE;
type
TUpdateSFCTA = class(TBaseUpdateUnit)
private
FOtherVar: variant;
function update_bySFCI03(xQrySource: TQuery): Boolean;
function update_bySFCI05(xQrySource: TQuery): Boolean;
function update_byQMSI10(xQrySource: TQuery): Boolean;
public
function update(xQrySource: TQuery; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
end;
implementation
uses LibStrs,CONSTDEF;
function TUpdateSFCTA.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, 'TXNSFCI03') = 0) then
Result := update_bySFCI03(xQrySource)
else
if (compareText(self.SourceTxnCode, 'TXNSFCI05') = 0) then
Result := update_bySFCI05(xQrySource)
else
if (compareText(self.SourceTxnCode, 'TXNQMSI10') = 0) then
Result := update_byQMSI10(xQrySource)
else
begin
end;
finally
self.Query1.close;
self.Query2.close;
end;
xMsg := self.Msg;
end;
function TUpdateSFCTA.update_bySFCI03(xQrySource: TQuery): Boolean;
var
mTA023,mTA036:Double;
mMA002,mMA003,mMA004:String;
begin
Result := True;
self.Msg[0] := 'skip';
self.Msg[1] := 'SFCTA';
With xQrySource do
self.Msg[2] := FieldByName('TE006').asString+' '+
FieldByName('TE007').asString+' '+
FieldByName('TE008').asString+' '+
FieldByName('TD004').asString;
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 $$SFCMA ');
Open;
first;
if (((not eof) and (FieldByName('MA001').asString<>'1')) or eof) then
Exit;
mMA002:=FieldByName('MA002').asString;
mMA003:=FieldByName('MA003').asString;
mMA004:=FieldByName('MA004').asString;
close;
SQL.clear;
RequestLive := False;
SQL.add('select * from $$SFCTA ');
SQL.add(' where TA001=:TA001 AND TA002=:TA002 AND TA003=:TA003 AND TA006=:TA006 ');
ParamByName('TA001').asString := xQrySource.FieldByName('TE006').asString;
ParamByName('TA002').asString := xQrySource.FieldByName('TE007').asString;
ParamByName('TA003').asString := xQrySource.FieldByName('TE008').asString;
ParamByName('TA006').asString := xQrySource.FieldByName('TD004').asString;
Open;
first;
if not eof then //
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -