strsql1 = "select cpldattim from trn where inr='" + trninr + "'";
Platform.dbExecuteSql( strsql1 );
Platform.dbFetchFields( "", dattim );
Argument<String> dattimBox= new Argument<String>("","");
Platform.dbFetchFields( "", dattimBox );
dattim = dattimBox.value;
if( Platform.errorCode() <= 0 )
{
}
Platform.dbCloseCursor();
strsql2 = "select nam,substr(SIGIDX,3,1) from trs where objtyp='TRN' and trs.flg='O' and objinr='" + trninr + "' and inr=(select max(inr) from trs where objtyp='TRN' AND objinr='" + trninr + "')";
Platform.dbExecuteSql( strsql2 );
Platform.dbFetchFields( "", usr3, "", maxrow );
Argument<String> usr3Box= new Argument<String>("","");
Argument<String> maxrowBox= new Argument<String>("","");
Platform.dbExecuteSQL( "SELECT PTY.HEQINR, ADR.LOCCTY, CTY.REG FROM PTY, PTA, ADR LEFT OUTER JOIN CTY ON ADR.LOCCTY=CTY.COD WHERE PTA.USG='MAA' AND PTA.PTYINR=PTY.INR AND PTA.OBJTYP='ADR' AND PTA.OBJINR=ADR.INR AND PTY.INR=?", $$arglsr\ptyinr.getValue() );
if( Platform.errorCode() == 0 )
{
Argument<String> heqInrBox= new Argument<String>("","");
Argument<String> ctyBox= new Argument<String>("","");
Argument<String> regBox= new Argument<String>("","");
Platform.dbExecuteSql( "SELECT LSR.NONREVFLG, LSR.INR FROM LSR, LNE, LNB WHERE LSR.INR=LNE.LSRINR AND LNE.LNBINR=LNB.INR AND LNE.EXTID=LNB.EXTID AND LNB.OBJTYP='" + $objtyp.getValue() + "' AND LNB.OBJINR='" + $objinr.getValue() + "' ORDER BY LSR.INR DESC" );
if( Platform.errorCode() == 0 )
{
Platform.dbFetchFields( "", flg );
Argument<String> flgBox= new Argument<String>("","");
Platform.dbExecuteSQL( "select count(*) from NTF where USR = ? AND SHWSSNINR = ' ' and (EXPDATTIM > ? or EXPDATTIM is null)", $\sysmod\usr\extkey.getValue(), Platform.toDay() );
Argument<Integer> cntBox = new Argument<Integer>("",cnt);
Platform.dbExecuteSql( "SELECT LSR.NONREVFLG FROM LSR, LNE, LNB WHERE LSR.INR=LNE.LSRINR AND LNE.LNBINR=LNB.INR AND LNE.EXTID=LNB.EXTID AND LNB.OBJTYP='" + objTyp + "' AND LNB.OBJINR='" + objInr + "'" );
if( Platform.errorCode() == 0 )
{
Platform.dbFetchFields( "", flg );
Argument<String> flgBox= new Argument<String>("","");