unit txsetsub;

interface

uses Sysutils, uss, auxiapi, emapi;

procedure LOG_APP(txSessionName, txDatabaseName:String; inComm: TTinComm; outComm: TToutComm);

implementation

uses i_ebss, i_SYSSJNL1;

procedure LOG_APP(txSessionName, txDatabaseName:String; inComm: TTinComm; outComm: TToutComm);
var
   nthsjnl1: _SYSSJNL1;
   TrxStatusF: Integer;
begin
   try
      nthsjnl1 := _SYSSJNL1.Create;

      Case StrToInt(outComm.TOOVERID) of
         1, 8, 10 : TrxStatusF := 0;
      else
         TrxStatusF := 1;
      end;

      nthsjnl1.Insert(
                      txSessionName, txDatabaseName,
                      VarArrayOf([
                          ''''+inComm.TITRXSQNO+'''',
                          ''''+inComm.TITRXD+'''',
                               TrxStatusF,
                          ''''+inComm.TIFIELD00+'''',
                          ''''+inComm.TIFIELD01+'''',
                          ''''+inComm.TIFIELD02+'''',
                          ''''+inComm.TIFIELD03+'''',
                          ''''+inComm.TIFIELD04+'''',
                          ''''+inComm.TIFIELD05+'''',
                          ''''+inComm.TIFIELD06+'''',
                          ''''+inComm.TIFIELD07+'''',
                          ''''+inComm.TIFIELD08+'''',
                          ''''+inComm.TIFIELD09+'''',
                          ''''+inComm.TIFIELD10+'''',
                          ''''+inComm.TIFIELD11+'''',
                          ''''+inComm.TIFIELD12+'''',
                          ''''+inComm.TIFIELD13+'''',
                          ''''+inComm.TIFIELD14+'''',
                          ''''+inComm.TIFIELD15+'''',
                          ''''+inComm.TIFIELD16+'''',
                          ''''+inComm.TIFIELD17+'''',
                          ''''+inComm.TIFIELD18+'''',
                          ''''+inComm.TIFIELD19+'''',
                          ''''+inComm.TIZONENO+'''',
                          ''''+inComm.TIBRANCH+'''',
                          ''''+inComm.TITELLER+'''',
                          ''''+inComm.TISTATUS+'''',
                          ''''+inComm.TIRANK+'''',
                          ''''+inComm.TISYSDATE+'''',
                               outComm.TOOVERID,
                          ''''+outComm.TOSTATEMENT+''''
                                 ])
                     );

      nthsjnl1.Free;
   except
      Raise;
   end;
end;

end.
