📄 updpaltl.pas
字号:
unit updPALTL;
interface
uses sysUtils, dbtables, bde, updBASE;
type
TUpdatePALTL = class(TBaseUpdateUnit)
private
function update_byPALI12(xQrySource: TQuery): Boolean;
public
function update(xQrySource: TQuery; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
end;
implementation
uses LibStrs,CONSTDEF;
function TUpdatePALTL.update(xQrySource: TQuery; xAction: string;
var xMsg: variant; xOtherVar: variant; xUserData: variant): Boolean;
begin
Result := True;
self.saveVar(xAction, xOtherVar, xUserData);
try
self.setDBname(xQrySource.DatabaseName);
if (compareText(self.SourceTxnCode, 'TXNPALI12') = 0) then
Result := update_byPALI12(xQrySource)
else
begin
end;
finally
self.Query1.close;
self.Query2.close;
end;
xMsg := self.Msg;
end;
function TUpdatePALTL.update_byPALI12(xQrySource: TQuery): Boolean;
var
mTL006,mTL007:Double;
mMC002,mMA009,mMV041:STRING;
begin
Result := True;
self.Msg[0] := 'skip';
self.Msg[1] := 'PALTL';
With xQrySource do
self.Msg[2] := FieldByName('TF001').asString+' '+
FieldByName('TF002').asString+' '+
FieldByName('TF003').asString+' '+
FieldByName('TF004').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 MA009,MV041 from $$PALMA,$$CMSMV WHERE MV001=:MV001 ');
ParamByName('MV001').asString := xQrySource.FieldByName('TF001').asString;
Open;
First;
if not eof then
begin
mMA009:=FieldByName('MA009').asString;
mMV041:=FieldByName('MV041').asString;
end
else
begin
mMA009:='';
mMV041:='';
end;
close;
SQL.clear;
RequestLive := False;
SQL.add('select * from $$PALTL ');
SQL.add(' where TL001=:TL001 AND TL002=:TL002 AND TL003=:TL003 AND TL004=:TL004 ');
ParamByName('TL001').asString := xQrySource.FieldByName('TF001').asString;
ParamByName('TL002').asString := COPY(xQrySource.FieldByName('TF002').asString,1,4);
ParamByName('TL003').asString := COPY(xQrySource.FieldByName('TF002').asString,5,2);
ParamByName('TL004').asString := xQrySource.FieldByName('TF004').asString;
Open;
first;
if not eof then //
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -