Commit 9e16915d by 潘际乾

S脚本文件修改goto

parent 58e63d06
#Tue Oct 12 16:26:34 CST 2021
#Mon Oct 18 18:02:27 CST 2021
LastTarget=eIBS
ScalePercent=80
DefaultTransName=ditopn
......
......@@ -6,7 +6,8 @@ void ptsmodSetPtsPtaFromChilds(#ptspta argptspta)
String dbfadrblkcn = NULLSTR;
if( Platform.isEmpty( $$argptspta\adr\inr ) )
{
Platform.clear( $$argptspta\dbfadrblk );
// Platform.clear( $$argptspta\dbfadrblk );
$$argptspta\dbfadrblk =NULLSTR;
}
else
{
......
......@@ -80,7 +80,8 @@ void ptsmodSetPtsFromPta(#ptspta argptspta)
switch( Platform.streamCount( adrstm ) )
{
case 0:
Platform.clear( $$argptspta\pts\nam );
//Platform.clear( $$argptspta\pts\nam );
$$argptspta\pts\nam = NULLSTR;
break;
case 1:
$$argptspta\pts\nam = Platform.getLine( adrstm, 1 );
......
......@@ -3,26 +3,33 @@ void recalcSetfegBog()
int rclCnt = 0;
Platform.postDefaultRule( $macbog );
String rclMacOld = $macbog;
// #######TODO 改写 LABEL与GOTO #### label RclStart
boolean firstCall = false;
Argument<Boolean> firstCallBox = new Argument<Boolean>("",firstCall);
getFepEntries( firstCallBox );
// #### label RclStart
boolean firstCall;
Argument<Boolean> firstCallBox;
RclStart:
while(true) {
firstCall = false;
firstCallBox = new Argument<Boolean>("",firstCall);
getFepEntries( firstCallBox );
firstCall = firstCallBox.value;
firstCall = firstCallBox.value;
defaultSetfel();
if( firstCall )
{
ptsAdjust();
defaultSetfel();
if( firstCall )
{
ptsAdjust();
}
Platform.postDefaultRule( $macbog );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $macbog.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $macbog;
rclCnt = rclCnt + 1;
// return ; // #### goto RclStart
continue RclStart;
}
$macbogold = $macbog;
return;
}
Platform.postDefaultRule( $macbog );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $macbog.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $macbog;
rclCnt = rclCnt + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto RclStart
}
$macbogold = $macbog;
}
\ No newline at end of file
......@@ -43,7 +43,8 @@ void addTrnFee(String id,String feetyp,String feeflg,int feeunt,Date from,Date t
// check, if fee is defined
if( Platform.streamSearch( $avbfeecod, feetyp ) == 0 )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto done
//return ; // #### goto done
return;
}
// check, if transaction fee is already in stream
// if so, define it
......@@ -116,6 +117,6 @@ void addTrnFee(String id,String feetyp,String feeflg,int feeunt,Date from,Date t
mac = Platform.macGen( feetyp + feeflg + Platform.toString( feeunt ) + Platform.fmtDateShort( from ) + Platform.fmtDateShort( till ) + Platform.toString( rate ) + Platform.toString( basamt ) + cdtoldflg + addinf, 0 );
Platform.cacheWrite( mac, "SETFEG", "MAC", idx );
}
// #######TODO 改写 LABEL与GOTO #### label done
// #### label done
}
\ No newline at end of file
......@@ -4,92 +4,104 @@ void recalcSetfegEog()
int rclCnt = 0;
Platform.postDefaultRule( $maceog );
String rclMacOld = $maceog;
// #######TODO 改写 LABEL与GOTO #### label RclStart
// #### label RclStart
// move amounts to settlement
$\setmod\setglg.setglgClrAmount ( "*SETFEG" );
int gridcnt = 0;
String act = NULLSTR;
int err = 0;
String dflg = NULLSTR;
int error = 0;
String cdtKey = NULLSTR;
String amtkey = NULLSTR;
if( Platform.isVisible( $\setmod\setpan ) )
{
gridcnt = Platform.gridCount( $setfel );
for(int i = 1;i <= gridcnt;i++)
{
if( ! Platform.isEmpty( $setfel[i]\rol ) && ! Platform.isEmpty( $setfel[i]\amt ) )
int gridcnt;
String act;
int err;
String dflg;
int error;
String cdtKey;
String amtkey;
RclStart:
while(true){
$\setmod\setglg.setglgClrAmount ( "*SETFEG" );
gridcnt = 0;
act = NULLSTR;
err = 0;
dflg = NULLSTR;
error = 0;
cdtKey = NULLSTR;
amtkey = NULLSTR;
if( Platform.isVisible( $\setmod\setpan ) )
{
if( Platform.compareTo($setfel[i]\dsp, "X" )== 0 || Platform.compareTo($setfel[i]\dsp, "S" )== 0 )
gridcnt = Platform.gridCount( $setfel );
for(int i = 1;i <= gridcnt;i++)
{
if( Platform.compareTo( $setfel[i]\rol , "OWN" ) == 0 )
if( ! Platform.isEmpty( $setfel[i]\rol ) && ! Platform.isEmpty( $setfel[i]\amt ) )
{
// HDQ 扣收国外费用跟国外付汇的账务分录合并
if( Platform.pos( Platform.getTransName(), "CPT" ) == 0 )
if( Platform.compareTo($setfel[i]\dsp, "X" )== 0 || Platform.compareTo($setfel[i]\dsp, "S" )== 0 )
{
// 内扣费用不再走SP
// $act = \SETMOD\GLEMOD.GetAvailAcc ( "SP-OTH", SETFEL( $i )\CUR, "", self, -SETFEL( $i )\AMT )
act = $\setmod\glemod.getAvailAcc ( "CA-OTH", $setfel[i]\cur.getValue(), "", this, $setfel[i]\amt.getValue().negate() );
}
else
{
if( Platform.compareTo( Platform.getTransName() , "CPTRET" ) == 0 || Platform.compareTo( Platform.getTransName() , "CPTOPN" ) == 0 )
{
act = $\setmod\glemod.getAvailAcc ( "CA-OTH", $setfel[i]\cur.getValue(), "", this, $setfel[i]\amt.getValue().negate() );
}
else
{
act = $\setmod\glemod.getAvailAcc ( "SP-OTH", $setfel[i]\cur.getValue(), "", this, $setfel[i]\amt.getValue().negate() );
}
}
if( Platform.compareTo( $\sysmod\bch\branch , "6701" ) == 0 )
{
//6701网点的待划转直接取codetable中的值
//$act = GetTblText( SETFEL( $i )\CUR, "FTACT1", GetUIL )
act = Platform.getCodetableLabelOfTd( $setfel[i]\cur.getValue(), "FTACA", Platform.getLang() );
err = Platform.errorCode();
}
switch( Platform.getTransName() )
{
case "TRTSET":
dflg = Platform.getContent( "\\LIDGRP\\REC\\DFLG" );
error = Platform.errorCode();
//国内证费用承担为OWN角色为RPC
if( Platform.compareTo( dflg , "D" ) == 0 )
if( Platform.compareTo( $setfel[i]\rol , "OWN" ) == 0 )
{
cdtKey = $\setmod\setglg.setglgAddAmount ( "*SETFEG", "OWN", $setfel[i]\cur.getValue(), $setfel[i]\amt.getValue(), "", "RPC", "", act, "" );
// HDQ 扣收国外费用跟国外付汇的账务分录合并
if( Platform.pos( Platform.getTransName(), "CPT" ) == 0 )
{
// 内扣费用不再走SP
// $act = \SETMOD\GLEMOD.GetAvailAcc ( "SP-OTH", SETFEL( $i )\CUR, "", self, -SETFEL( $i )\AMT )
act = $\setmod\glemod.getAvailAcc ( "CA-OTH", $setfel[i]\cur.getValue(), "", this, $setfel[i]\amt.getValue().negate() );
}
else
{
if( Platform.compareTo( Platform.getTransName() , "CPTRET" ) == 0 || Platform.compareTo( Platform.getTransName() , "CPTOPN" ) == 0 )
{
act = $\setmod\glemod.getAvailAcc ( "CA-OTH", $setfel[i]\cur.getValue(), "", this, $setfel[i]\amt.getValue().negate() );
}
else
{
act = $\setmod\glemod.getAvailAcc ( "SP-OTH", $setfel[i]\cur.getValue(), "", this, $setfel[i]\amt.getValue().negate() );
}
}
if( Platform.compareTo( $\sysmod\bch\branch , "6701" ) == 0 )
{
//6701网点的待划转直接取codetable中的值
//$act = GetTblText( SETFEL( $i )\CUR, "FTACT1", GetUIL )
act = Platform.getCodetableLabelOfTd( $setfel[i]\cur.getValue(), "FTACA", Platform.getLang() );
err = Platform.errorCode();
}
switch( Platform.getTransName() )
{
case "TRTSET":
dflg = Platform.getContent( "\\LIDGRP\\REC\\DFLG" );
error = Platform.errorCode();
//国内证费用承担为OWN角色为RPC
if( Platform.compareTo( dflg , "D" ) == 0 )
{
cdtKey = $\setmod\setglg.setglgAddAmount ( "*SETFEG", "OWN", $setfel[i]\cur.getValue(), $setfel[i]\amt.getValue(), "", "RPC", "", act, "" );
}
else
{
cdtKey = $\setmod\setglg.setglgAddAmount ( "*SETFEG", "OWN", $setfel[i]\cur.getValue(), $setfel[i]\amt.getValue(), "", "SPC", "", act, "" );
}
break;
case "CPTRET":
cdtKey = $\setmod\setglg.setglgAddAmount ( "*SETFEG", "OWN", $setfel[i]\cur.getValue(), $setfel[i]\amt.getValue(), "", "CAC", "C", act, "" );
break;
default:
// 内扣费用不再走SP
//$CdtKey = \SETMOD\SETGLG.SetglgAddAmount ( "*SETFEG", "OWN", SETFEL( $i )\CUR, SETFEL( $i )\AMT, "", "SPC", "C", $act, "" )
cdtKey = $\setmod\setglg.setglgAddAmount ( "*SETFEG", "OWN", $setfel[i]\cur.getValue(), $setfel[i]\amt.getValue(), "", "CAC", "C", act, "" );
}
}
else
{
cdtKey = $\setmod\setglg.setglgAddAmount ( "*SETFEG", "OWN", $setfel[i]\cur.getValue(), $setfel[i]\amt.getValue(), "", "SPC", "", act, "" );
amtkey = $\setmod\setglg.setglgAddAmount ( "*SETFEG", $setfel[i]\rol.getValue(), $setfel[i]\cur.getValue(), $setfel[i]\amt.getValue(), "FEG", "", "", "", "" );
}
break;
case "CPTRET":
cdtKey = $\setmod\setglg.setglgAddAmount ( "*SETFEG", "OWN", $setfel[i]\cur.getValue(), $setfel[i]\amt.getValue(), "", "CAC", "C", act, "" );
break;
default:
// 内扣费用不再走SP
//$CdtKey = \SETMOD\SETGLG.SetglgAddAmount ( "*SETFEG", "OWN", SETFEL( $i )\CUR, SETFEL( $i )\AMT, "", "SPC", "C", $act, "" )
cdtKey = $\setmod\setglg.setglgAddAmount ( "*SETFEG", "OWN", $setfel[i]\cur.getValue(), $setfel[i]\amt.getValue(), "", "CAC", "C", act, "" );
}
}
else
{
amtkey = $\setmod\setglg.setglgAddAmount ( "*SETFEG", $setfel[i]\rol.getValue(), $setfel[i]\cur.getValue(), $setfel[i]\amt.getValue(), "FEG", "", "", "", "" );
}
}
}
}
}
Platform.postDefaultRule( $maceog );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $maceog.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $maceog;
rclCnt = rclCnt + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto RclStart
Platform.postDefaultRule( $maceog );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $maceog.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $maceog;
rclCnt = rclCnt + 1;
//return ; // #### goto RclStart
continue RclStart;
}
$maceogold = $maceog;
return;
}
$maceogold = $maceog;
}
\ No newline at end of file
void registerSettlementCorrCha()
{
int line = 0;
/**
if Mid( GetFramename, 1, 2 ) == "FT" or Mid( GetFramename, 1, 2 ) == "FX" or GetFramename == "CPTOUT" or GetFramename == "CLOOPN" then
**/
......@@ -148,310 +149,311 @@ void registerSettlementCorrCha()
StreamSetLine( $CorTypStm, $I, StreamGetLine( $CorTypStm, $I ) + TAB + "0" )
next
**/
if( ! Platform.isEmpty( $corchaflg ) )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto setFees
}
// ensure recalculation of documents
$\trnmod\trndoc.assertDOCS();
// count correspondence items
IStream docMods = new StreamImpl();
Platform.streamClear( docMods );
getmodulesoftype( docMods, $\, "DOCEOT" );
IModule rmbclm = Platform.getModule( "\\RMBCLM" );
if( Platform.errorCode() == 0 )
{
getmodulesoftype( docMods, rmbclm, "DOCEOT" );
}
// using gridcount results in circular ref,.
String ins = NULLSTR;
IModule mod = null;
for(int i = 1;i <= 50;i++)
{
ins = "\\TRNMOD\\TRNDOC\\DOCEOT(" + Platform.toString( i ) + ")";
mod = Platform.getModule( ins );
if( Platform.errorCode() == 0 )
{
Platform.streamInsert( docMods, 0, ins );
}
}
int stmCntDoc = Platform.streamCount( docMods );
String eot = NULLSTR;
String delFlg = NULLSTR;
String lev = NULLSTR;
String oriFlg = NULLSTR;
String adrBic = NULLSTR;
String mTTyp = NULLSTR;
String pandsc = NULLSTR;
String docEotCorTyp = NULLSTR;
String loccty = NULLSTR;
String postfind = NULLSTR;
String postsql = NULLSTR;
int line = 0;
int value = 0;
String find = NULLSTR;
String sql = NULLSTR;
int gridcnt = 0;
String mt = NULLSTR;
String useEot = NULLSTR;
for(int i = 1;i <= stmCntDoc;i++)
if( Platform.isEmpty( $corchaflg ) )
{
eot = Platform.getLine( docMods, i );
delFlg = Platform.getContent( eot + "\\DELFLG" );
lev = Platform.getContent( eot + "\\LEV" );
oriFlg = Platform.getContent( eot + "\\ORIFLG" );
adrBic = Platform.getContent( eot + "\\ADRBIC" );
mTTyp = Platform.getContent( eot + "\\MSGTYP" );
pandsc = Platform.getContent( eot + "\\PANDSC" );
if( Platform.compareTo( Platform.mid( pandsc, 1, 3 ) , "GPI" ) == 0 && Platform.compareTo( mTTyp , "199" ) == 0 )
{
continue;
}
// do not count suppressed or deleted messages or send-to-copies
if( Platform.compareTo(delFlg, "D") != 0 && ( Platform.compareTo( lev , "1" ) == 0 || ( Platform.compareTo(lev, "1") != 0 && Platform.compareTo( oriFlg , "C" ) == 0 ) ) )
{
docEotCorTyp = Platform.getContent( eot + "\\CORTYP" );
if( Platform.compareTo( docEotCorTyp , "LET" ) == 0 && Platform.isEmpty( $\setmod\chgpstflg ) )
//return ; // #### goto setFees
// ensure recalculation of documents
$\trnmod\trndoc.assertDOCS();
// count correspondence items
IStream docMods = new StreamImpl();
Platform.streamClear( docMods );
getmodulesoftype( docMods, $\, "DOCEOT" );
IModule rmbclm = Platform.getModule( "\\RMBCLM" );
if( Platform.errorCode() == 0 )
{
getmodulesoftype( docMods, rmbclm, "DOCEOT" );
}
// using gridcount results in circular ref,.
String ins = NULLSTR;
IModule mod = null;
for(int i = 1;i <= 50;i++)
{
ins = "\\TRNMOD\\TRNDOC\\DOCEOT(" + Platform.toString( i ) + ")";
mod = Platform.getModule( ins );
if( Platform.errorCode() == 0 )
{
Platform.streamInsert( docMods, 0, ins );
}
}
int stmCntDoc = Platform.streamCount( docMods );
String eot = NULLSTR;
String delFlg = NULLSTR;
String lev = NULLSTR;
String oriFlg = NULLSTR;
String adrBic = NULLSTR;
String mTTyp = NULLSTR;
String pandsc = NULLSTR;
String docEotCorTyp = NULLSTR;
String loccty = NULLSTR;
String postfind = NULLSTR;
String postsql = NULLSTR;
line = 0;
int value = 0;
String find = NULLSTR;
String sql = NULLSTR;
int gridcnt = 0;
String mt = NULLSTR;
String useEot = NULLSTR;
for(int i = 1;i <= stmCntDoc;i++)
{
// if GetContent( $Eot + "\\DOCSNF" ) = "LETCOU" then
// $CouAnz = $CouAnz + 1
// $CouSw = "Y"
// endif
if( Platform.compareTo( Platform.getContent( eot + "\\DOCSNF" ) , "LETAML" ) == 0 )
eot = Platform.getLine( docMods, i );
delFlg = Platform.getContent( eot + "\\DELFLG" );
lev = Platform.getContent( eot + "\\LEV" );
oriFlg = Platform.getContent( eot + "\\ORIFLG" );
adrBic = Platform.getContent( eot + "\\ADRBIC" );
mTTyp = Platform.getContent( eot + "\\MSGTYP" );
pandsc = Platform.getContent( eot + "\\PANDSC" );
if( Platform.compareTo( Platform.mid( pandsc, 1, 3 ) , "GPI" ) == 0 && Platform.compareTo( mTTyp , "199" ) == 0 )
{
continue;
}
// do not count suppressed or deleted messages or send-to-copies
if( Platform.compareTo(delFlg, "D") != 0 && ( Platform.compareTo( lev , "1" ) == 0 || ( Platform.compareTo(lev, "1") != 0 && Platform.compareTo( oriFlg , "C" ) == 0 ) ) )
{
//按照不同的地区,收取平邮费
loccty = Platform.getContent( eot + "\\RCV\\ADR\\LOCCTY" );
postfind = "";
postsql = "select REG from CTY where CTY.COD='" + loccty + "'";
Platform.dbExecuteSql( postsql );
Platform.dbFetchFields( "", postfind );
if( ! ( Platform.errorCode() == 228 ) )
docEotCorTyp = Platform.getContent( eot + "\\CORTYP" );
if( Platform.compareTo( docEotCorTyp , "LET" ) == 0 && Platform.isEmpty( $\setmod\chgpstflg ) )
{
switch( postfind )
{
case "01":
case "11":
line = Platform.streamSearch( postfee, "POS" + postfind );
break;
default:
line = Platform.streamSearch( postfee, "POST" );
}
if( line == 0 )
// if GetContent( $Eot + "\\DOCSNF" ) = "LETCOU" then
// $CouAnz = $CouAnz + 1
// $CouSw = "Y"
// endif
if( Platform.compareTo( Platform.getContent( eot + "\\DOCSNF" ) , "LETAML" ) == 0 )
{
if( Platform.compareTo( postfind , "01" ) == 0 || Platform.compareTo( postfind , "11" ) == 0 )
//按照不同的地区,收取平邮费
loccty = Platform.getContent( eot + "\\RCV\\ADR\\LOCCTY" );
postfind = "";
postsql = "select REG from CTY where CTY.COD='" + loccty + "'";
Platform.dbExecuteSql( postsql );
Platform.dbFetchFields( "", postfind );
if( ! ( Platform.errorCode() == 228 ) )
{
Platform.streamInsert( postfee, 0, "POS" + postfind );
switch( postfind )
{
case "01":
case "11":
line = Platform.streamSearch( postfee, "POS" + postfind );
break;
default:
line = Platform.streamSearch( postfee, "POST" );
}
if( line == 0 )
{
if( Platform.compareTo( postfind , "01" ) == 0 || Platform.compareTo( postfind , "11" ) == 0 )
{
Platform.streamInsert( postfee, 0, "POS" + postfind );
}
else
{
Platform.streamInsert( postfee, 0, "POST" );
}
Platform.streamInsert( postfee, 0, Platform.toString( 1 ) );
}
else
{
value = Platform.parseInt( Platform.getLine( postfee, line + 1 ) ) + 1;
Platform.streamSetLine( postfee, line + 1, Platform.toString( value ) );
}
}
Platform.dbCloseCursor();
amlAnz = amlAnz + 1;
amlSw = "Y";
}
if( Platform.compareTo( Platform.getContent( eot + "\\DOCSNF" ) , "LETCOU" ) == 0 )
{
//按照不同的地区,收取快邮费
// $ptyinr = GetContent( $Eot + "\\PTA\\PTYINR" )
loccty = Platform.getContent( eot + "\\RCV\\ADR\\LOCCTY" );
find = "";
sql = "select REG from CTY where CTY.COD='" + loccty + "'";
Platform.dbExecuteSql( sql );
Platform.dbFetchFields( "", find );
/**
if not ( ErrorCode == 228 ) then
$line = StreamSearch( $DHLFEE, "DHL" + $FIND )
if $line == 0 then
StreamInsert( $DHLFEE, 0, "DHL" + $FIND )
StreamInsert( $DHLFEE, 0, Str( 1 ) )
else
$value = Val( StreamGetLine( $DHLFEE, $line + 1 ) ) + 1
StreamSetLine( $DHLFEE, $line + 1, Str( $value ) )
endif
endif
**/
if( ! ( Platform.errorCode() == 228 ) )
{
Platform.streamInsert( postfee, 0, "POST" );
// $line = StreamSearch( $DHLFEE, "NDHL" + $FIND )
//2019邮费新需求
if( Platform.compareTo( find , "00" ) == 0 )
{
line = Platform.streamSearch( dhlfee, "NDHL" + find );
}
else
{
line = Platform.streamSearch( dhlfee, "9DHL" + find );
}
if( line == 0 )
{
// StreamInsert( $DHLFEE, 0, "NDHL" + $FIND )
if( Platform.compareTo( find , "00" ) == 0 )
{
Platform.streamInsert( dhlfee, 0, "NDHL" + find );
}
else
{
Platform.streamInsert( dhlfee, 0, "9DHL" + find );
}
Platform.streamInsert( dhlfee, 0, Platform.toString( 1 ) );
}
else
{
value = Platform.parseInt( Platform.getLine( dhlfee, line + 1 ) ) + 1;
Platform.streamSetLine( dhlfee, line + 1, Platform.toString( value ) );
}
}
Platform.streamInsert( postfee, 0, Platform.toString( 1 ) );
}
else
{
value = Platform.parseInt( Platform.getLine( postfee, line + 1 ) ) + 1;
Platform.streamSetLine( postfee, line + 1, Platform.toString( value ) );
Platform.dbCloseCursor();
couAnz = couAnz + 1;
couSw = "Y";
}
}
Platform.dbCloseCursor();
amlAnz = amlAnz + 1;
amlSw = "Y";
}
if( Platform.compareTo( Platform.getContent( eot + "\\DOCSNF" ) , "LETCOU" ) == 0 )
{
//按照不同的地区,收取快邮费
// $ptyinr = GetContent( $Eot + "\\PTA\\PTYINR" )
loccty = Platform.getContent( eot + "\\RCV\\ADR\\LOCCTY" );
find = "";
sql = "select REG from CTY where CTY.COD='" + loccty + "'";
Platform.dbExecuteSql( sql );
Platform.dbFetchFields( "", find );
/**
if not ( ErrorCode == 228 ) then
$line = StreamSearch( $DHLFEE, "DHL" + $FIND )
if $line == 0 then
StreamInsert( $DHLFEE, 0, "DHL" + $FIND )
StreamInsert( $DHLFEE, 0, Str( 1 ) )
else
$value = Val( StreamGetLine( $DHLFEE, $line + 1 ) ) + 1
StreamSetLine( $DHLFEE, $line + 1, Str( $value ) )
endif
endif
**/
if( ! ( Platform.errorCode() == 228 ) )
// swift fee
if( Platform.compareTo( docEotCorTyp , "SWT" ) == 0 )
{
// $line = StreamSearch( $DHLFEE, "NDHL" + $FIND )
//2019邮费新需求
if( Platform.compareTo( find , "00" ) == 0 )
//杭州银行汇出汇款的快有费用特殊处理
//用和上一个循环一样的变量导致某些情况会死循环
if( Platform.compareTo( Platform.getTransName() , "CPTOPN" ) == 0 )
{
line = Platform.streamSearch( dhlfee, "NDHL" + find );
gridcnt = Platform.gridCount( $\setmod\setglg\setgll );
for(int ic = 1;ic <= gridcnt;ic++)
{
mt = $\setmod\setglg\setgll[ic]\sftmt;
useEot = "\\SETMOD\\SETGLG\\SETGLL";
if( Platform.compareTo( mTTyp , mt ) == 0 )
{
switch( mTTyp )
{
case "103":
// $AdrBic = GetContent( $UseEot + ( $I ) + "\\AWIP\\PTSPTA\\PTS\\BIC" )
adrBic = $\setmod\setglg\setgll[ic]\awip\ptspta\pta\bic;
break;
case "202":
break;
default:
}
}
else
{
}
}
/**
if GetFramename == "CPTOPN" then
$Gridcnt = GridCount( \SETMOD\SETGLG\SETGLL )
for $I = 1 to $Gridcnt
$MT = \SETMOD\SETGLG\SETGLL( $I )\sftmt
$UseEot = "\\SETMOD\\SETGLG\\SETGLL"
if $MTTyp == $MT then
select case $MTTyp
case "103"
// $AdrBic = GetContent( $UseEot + ( $I ) + "\\AWIP\\PTSPTA\\PTS\\BIC" )
$AdrBic = \SETMOD\SETGLG\SETGLL( $I )\AWIP\PTSPTA\PTA\BIC
case "202"
case else
end select
else
endif
next $I
**/
}
else
switch( Platform.mid( adrBic, 5, 2 ) )
{
line = Platform.streamSearch( dhlfee, "9DHL" + find );
case "CN": // China
swifeecod = "SWI01";
break;
case "HK":
case "MO":
case "TW":
case "JP":
case "KR": // hongkong,macao and taiwan japan korea
swifeecod = "SWI02";
break;
default: // foreign
swifeecod = "SWI03";
}
if( line == 0 )
switch( Platform.getTransName() )
{
// StreamInsert( $DHLFEE, 0, "NDHL" + $FIND )
if( Platform.compareTo( find , "00" ) == 0 )
{
Platform.streamInsert( dhlfee, 0, "NDHL" + find );
}
else
{
Platform.streamInsert( dhlfee, 0, "9DHL" + find );
}
Platform.streamInsert( dhlfee, 0, Platform.toString( 1 ) );
case "LITOPN": //, "LTTOPN", "GITOPN"
swifeecod = swifeecod + "O";
break;
case "LITAME": //, "LTTAME"
swifeecod = swifeecod + "E";
break;
}
else
//xuebin 添加
switch( Platform.getTransName() )
{
value = Platform.parseInt( Platform.getLine( dhlfee, line + 1 ) ) + 1;
Platform.streamSetLine( dhlfee, line + 1, Platform.toString( value ) );
case "GITOPN": //, "LTTOPN", "GITOPN"
swifeecod = swifeecod + "O";
break;
case "GITAME": //, "LTTAME"
swifeecod = swifeecod + "E";
break;
}
}
Platform.dbCloseCursor();
couAnz = couAnz + 1;
couSw = "Y";
}
}
// swift fee
if( Platform.compareTo( docEotCorTyp , "SWT" ) == 0 )
{
//杭州银行汇出汇款的快有费用特殊处理
//用和上一个循环一样的变量导致某些情况会死循环
if( Platform.compareTo( Platform.getTransName() , "CPTOPN" ) == 0 )
{
gridcnt = Platform.gridCount( $\setmod\setglg\setgll );
for(int ic = 1;ic <= gridcnt;ic++)
{
mt = $\setmod\setglg\setgll[ic]\sftmt;
useEot = "\\SETMOD\\SETGLG\\SETGLL";
if( Platform.compareTo( mTTyp , mt ) == 0 )
//if $swifeecod = "SWI02O" then
// $swifeecod = "SWI01O"
//endif
//if $swifeecod = "SWI02E" then
// $swifeecod = "SWI01E"
//endif
// 730报文需要收取电报费
// if $MTTyp = "730" then
// $swifeecod = ""
// endif
if( Platform.compareTo( Platform.getTransName() , "DLTOPN" ) == 0 )
{
switch( mTTyp )
{
case "103":
// $AdrBic = GetContent( $UseEot + ( $I ) + "\\AWIP\\PTSPTA\\PTS\\BIC" )
adrBic = $\setmod\setglg\setgll[ic]\awip\ptspta\pta\bic;
break;
case "202":
break;
default:
}
swifeecod = "";
}
else
switch( swifeecod )
{
case "SWI01":
swi01Anz = swi01Anz + 1;
break;
case "SWI02":
swi02Anz = swi02Anz + 1;
break;
case "SWI03":
swi03Anz = swi03Anz + 1;
break;
case "SWI01O":
swi01OAnz = swi01OAnz + 1;
break;
case "SWI02O":
swi02OAnz = swi02OAnz + 1;
break;
case "SWI03O":
swi03OAnz = swi03OAnz + 1;
break;
case "SWI01E":
swi01EAnz = swi01EAnz + 1;
break;
case "SWI02E":
swi02EAnz = swi02EAnz + 1;
break;
case "SWI03E":
swi03EAnz = swi03EAnz + 1;
break;
}
}
/**
if GetFramename == "CPTOPN" then
$Gridcnt = GridCount( \SETMOD\SETGLG\SETGLL )
for $I = 1 to $Gridcnt
$MT = \SETMOD\SETGLG\SETGLL( $I )\sftmt
$UseEot = "\\SETMOD\\SETGLG\\SETGLL"
if $MTTyp == $MT then
select case $MTTyp
case "103"
// $AdrBic = GetContent( $UseEot + ( $I ) + "\\AWIP\\PTSPTA\\PTS\\BIC" )
$AdrBic = \SETMOD\SETGLG\SETGLL( $I )\AWIP\PTSPTA\PTA\BIC
case "202"
case else
end select
else
endif
next $I
// set count of available messages
$SeaIdx = StreamSearch( $CorTypStm, $DocEotCorTyp )
$SeaLin = StreamGetLine( $CorTypStm, $SeaIdx )
$Idx = Val( Mid( $SeaLin, Pos( $SeaLin, TAB ) + 1 ) ) + 1
StreamSetLine( $CorTypStm, $SeaIdx, $DocEotCorTyp + TAB + Str( $Idx ) )
**/
}
switch( Platform.mid( adrBic, 5, 2 ) )
{
case "CN": // China
swifeecod = "SWI01";
break;
case "HK":
case "MO":
case "TW":
case "JP":
case "KR": // hongkong,macao and taiwan japan korea
swifeecod = "SWI02";
break;
default: // foreign
swifeecod = "SWI03";
}
switch( Platform.getTransName() )
{
case "LITOPN": //, "LTTOPN", "GITOPN"
swifeecod = swifeecod + "O";
break;
case "LITAME": //, "LTTAME"
swifeecod = swifeecod + "E";
break;
}
//xuebin 添加
switch( Platform.getTransName() )
{
case "GITOPN": //, "LTTOPN", "GITOPN"
swifeecod = swifeecod + "O";
break;
case "GITAME": //, "LTTAME"
swifeecod = swifeecod + "E";
break;
}
//if $swifeecod = "SWI02O" then
// $swifeecod = "SWI01O"
//endif
//if $swifeecod = "SWI02E" then
// $swifeecod = "SWI01E"
//endif
// 730报文需要收取电报费
// if $MTTyp = "730" then
// $swifeecod = ""
// endif
if( Platform.compareTo( Platform.getTransName() , "DLTOPN" ) == 0 )
{
swifeecod = "";
}
switch( swifeecod )
{
case "SWI01":
swi01Anz = swi01Anz + 1;
break;
case "SWI02":
swi02Anz = swi02Anz + 1;
break;
case "SWI03":
swi03Anz = swi03Anz + 1;
break;
case "SWI01O":
swi01OAnz = swi01OAnz + 1;
break;
case "SWI02O":
swi02OAnz = swi02OAnz + 1;
break;
case "SWI03O":
swi03OAnz = swi03OAnz + 1;
break;
case "SWI01E":
swi01EAnz = swi01EAnz + 1;
break;
case "SWI02E":
swi02EAnz = swi02EAnz + 1;
break;
case "SWI03E":
swi03EAnz = swi03EAnz + 1;
break;
}
}
/**
// set count of available messages
$SeaIdx = StreamSearch( $CorTypStm, $DocEotCorTyp )
$SeaLin = StreamGetLine( $CorTypStm, $SeaIdx )
$Idx = Val( Mid( $SeaLin, Pos( $SeaLin, TAB ) + 1 ) ) + 1
StreamSetLine( $CorTypStm, $SeaIdx, $DocEotCorTyp + TAB + Str( $Idx ) )
**/
}
return;
}
// #######TODO 改写 LABEL与GOTO #### label setFees
// #### label setFees
String isstyp = NULLSTR;
String bic = NULLSTR;
if( Platform.compareTo( Platform.getTransName() , "LITAME" ) == 0 && Platform.isEmpty( swifeecod ) )
......
......@@ -43,7 +43,8 @@ void addTrnFee1(String id,String feetyp,String feeflg,int feeunt,Date from,Date
// check, if fee is defined
if( Platform.streamSearch( $avbfeecod, feetyp ) == 0 )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto done
// return ; // #### goto done
return;
}
// check, if transaction fee is already in stream
// if so, define it
......@@ -116,6 +117,6 @@ void addTrnFee1(String id,String feetyp,String feeflg,int feeunt,Date from,Date
mac = Platform.macGen( feetyp + feeflg + Platform.toString( feeunt ) + Platform.fmtDateShort( from ) + Platform.fmtDateShort( till ) + Platform.toString( rate ) + Platform.toString( basamt ) + cdtoldflg + addinf, 0 );
Platform.cacheWrite( mac, "SETFEG", "MAC", idx );
}
// #######TODO 改写 LABEL与GOTO #### label done
// #### label done
}
\ No newline at end of file
......@@ -4,399 +4,408 @@ void recalcSetfel(String argrow)
int rclCnt = 0;
Platform.postDefaultRule( $mac );
String rclMacOld = $mac;
// #######TODO 改写 LABEL与GOTO #### label RclStart
String wrn = "";
if( Platform.isEmpty( $feecod ) )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto fecend
}
String bcur = $\cbsmod\xrtmod.sysiso();
$doccur = $\setmod\doccur;
Platform.cacheDbReadSql( $\setmod\setfeg\wrkfee, Platform.sdbEtyGenSql( $\setmod\setfeg\wrkfee, "Where COD = " + Platform.sqlLit( $feecod.getValue() ) ) );
// no errorcode-handling as Not found is a severe error (Code in AVBFEECOD, but not in database)
if( Platform.streamSearch( $\trnmod\wrkstm\stm1, "FEEGRPCOD-" + $\setmod\setfeg\wrkfee\cod.getValue() + "\t" ) == 0 )
{
if( Platform.isEmpty( $\setmod\setfeg\wrkfee\grpcod ) )
{
Platform.streamInsert( $\trnmod\wrkstm\stm1.getValue(), 0, "FEEGRPCOD-" + $\setmod\setfeg\wrkfee\cod.getValue() + "\t" );
}
else
{
Platform.streamInsert( $\trnmod\wrkstm\stm1.getValue(), 0, "FEEGRPCOD-" + $\setmod\setfeg\wrkfee\cod.getValue() + "\t" + $\setmod\setfeg\wrkfee\grpcod.getValue() );
}
if( ! Platform.isEmpty( $\setmod\setfeg\wrkfee\dscmodflg ) )
{
Platform.streamInsert( $\trnmod\wrkstm\stm1.getValue(), 0, "FEEDSCMODFLG" + $\setmod\setfeg\wrkfee\cod.getValue() + "\t" + $\setmod\setfeg\wrkfee\dscmodflg.getValue() );
}
}
$accacr = $\setmod\setfeg\wrkfee\accacr;
String ptyinr = "";
String ptainr = "";
String actptyinr = "";
String rol = NULLSTR;
if( ! Platform.isModified( $rol ) )
{
// if role to debit is set it must not be redefaulted (900574)
if( Platform.isEmpty( $roldbt ) )
{
$rol = $\setmod\setfeg\wrkfee\rol;
rol = $rol;
Argument<String> rolBox = new Argument<String>("",rol);
Argument<String> ptyinrBox = new Argument<String>("",ptyinr);
Argument<String> ptainrBox = new Argument<String>("",ptainr);
$\setmod\setfeg.getrolandptxinr ( rolBox, ptyinrBox, ptainrBox, $\setmod\chato.getValue(), $\setmod\setfeg\wrkfee\rol.getValue() );
// #### label RclStart
RclStart:
while(true){
String wrn = "";
INNER:
while(true){
if( Platform.isEmpty( $feecod ) )
{
break INNER; // #### goto fecend
}
String bcur = $\cbsmod\xrtmod.sysiso();
$doccur = $\setmod\doccur;
Platform.cacheDbReadSql( $\setmod\setfeg\wrkfee, Platform.sdbEtyGenSql( $\setmod\setfeg\wrkfee, "Where COD = " + Platform.sqlLit( $feecod.getValue() ) ) );
// no errorcode-handling as Not found is a severe error (Code in AVBFEECOD, but not in database)
if( Platform.streamSearch( $\trnmod\wrkstm\stm1, "FEEGRPCOD-" + $\setmod\setfeg\wrkfee\cod.getValue() + "\t" ) == 0 )
{
if( Platform.isEmpty( $\setmod\setfeg\wrkfee\grpcod ) )
{
Platform.streamInsert( $\trnmod\wrkstm\stm1.getValue(), 0, "FEEGRPCOD-" + $\setmod\setfeg\wrkfee\cod.getValue() + "\t" );
}
else
{
Platform.streamInsert( $\trnmod\wrkstm\stm1.getValue(), 0, "FEEGRPCOD-" + $\setmod\setfeg\wrkfee\cod.getValue() + "\t" + $\setmod\setfeg\wrkfee\grpcod.getValue() );
}
if( ! Platform.isEmpty( $\setmod\setfeg\wrkfee\dscmodflg ) )
{
Platform.streamInsert( $\trnmod\wrkstm\stm1.getValue(), 0, "FEEDSCMODFLG" + $\setmod\setfeg\wrkfee\cod.getValue() + "\t" + $\setmod\setfeg\wrkfee\dscmodflg.getValue() );
}
}
$accacr = $\setmod\setfeg\wrkfee\accacr;
String ptyinr = "";
String ptainr = "";
String actptyinr = "";
String rol = NULLSTR;
if( ! Platform.isModified( $rol ) )
{
// if role to debit is set it must not be redefaulted (900574)
if( Platform.isEmpty( $roldbt ) )
{
$rol = $\setmod\setfeg\wrkfee\rol;
rol = $rol;
Argument<String> rolBox = new Argument<String>("",rol);
Argument<String> ptyinrBox = new Argument<String>("",ptyinr);
Argument<String> ptainrBox = new Argument<String>("",ptainr);
$\setmod\setfeg.getrolandptxinr ( rolBox, ptyinrBox, ptainrBox, $\setmod\chato.getValue(), $\setmod\setfeg\wrkfee\rol.getValue() );
rol = rolBox.value;
ptyinr = ptyinrBox.value;
ptainr = ptainrBox.value;
rol = rolBox.value;
ptyinr = ptyinrBox.value;
ptainr = ptainrBox.value;
$rol = rol;
}
else
{
$rol = $roldbt;
rol = $rol;
Argument<String> ptyinrBox1 = new Argument<String>("",ptyinr);
Argument<String> ptainrBox1 = new Argument<String>("",ptainr);
Platform.getPtxInr( rol, ptyinrBox1, ptainrBox1 );
$rol = rol;
}
else
{
$rol = $roldbt;
rol = $rol;
Argument<String> ptyinrBox1 = new Argument<String>("",ptyinr);
Argument<String> ptainrBox1 = new Argument<String>("",ptainr);
Platform.getPtxInr( rol, ptyinrBox1, ptainrBox1 );
ptyinr = ptyinrBox1.value;
ptainr = ptainrBox1.value;
ptyinr = ptyinrBox1.value;
ptainr = ptainrBox1.value;
}
}
else
{
rol = $rol;
Argument<String> ptyinrBox2 = new Argument<String>("",ptyinr);
Argument<String> ptainrBox2 = new Argument<String>("",ptainr);
Platform.getPtxInr( rol, ptyinrBox2, ptainrBox2 );
}
}
else
{
rol = $rol;
Argument<String> ptyinrBox2 = new Argument<String>("",ptyinr);
Argument<String> ptainrBox2 = new Argument<String>("",ptainr);
Platform.getPtxInr( rol, ptyinrBox2, ptainrBox2 );
ptyinr = ptyinrBox2.value;
ptainr = ptainrBox2.value;
ptyinr = ptyinrBox2.value;
ptainr = ptainrBox2.value;
}
$feeacc = $\setmod\setfeg\wrkfee\acc;
$feedtacod = $\setmod\setfeg\wrkfee\dtacod;
$feesftcod = $\setmod\setfeg\wrkfee\sftcod;
$rolptyinr = ptyinr;
$rolptainr = ptainr;
String cur = NULLSTR;
if( Platform.isModified( $cur ) )
{
cur = $cur;
}
else
{
if( Platform.compareTo( $rol.getValue() , "OWN" ) == 0 && ! Platform.isEmpty( $cur ) )
{
cur = $cur;
}
else
{
cur = getFeeCur( $rol.getValue() );
}
}
String feetyp = NULLSTR;
if( Platform.isEmpty( $fepinrlst ) )
{
feetyp = "MAN";
$inftxt = #CT000008;
if( ! Platform.isModified( $unt ) )
{
$unt = 1;
}
}
else
{
feetyp = $\setmod\setfeg.getfepval ( Platform.getLine( $fepinrlst.getValue(), 1 ), "TYP" );
if( ! Platform.isModified( $inftxt ) )
{
$inftxt = $\setmod\setfeg.getfepval ( Platform.getLine( $fepinrlst.getValue(), 1 ), "INFTXT" );
}
}
BigDecimal tiramt = $\setmod.getRelAmount ( $\setmod\setfeg\wrkfee\reltir.getValue(), $rol.getValue(), this );
BigDecimal tirbca = $\cbsmod\xrtmod.amtConvTypes( $doccur.getValue(), tiramt, "M", bcur, "M", Platform.today() );
if( Platform.isEmpty( $fecmod ) && ! Platform.isModified( $wrkfec ) )
{
$\setmod\setfeg\fecmod.getFec ( bcur, tirbca, $rol.getValue(), ptyinr, $\setmod\setfeg\wrkfee, $wrkfec, $feclst.getValue() );
}
// get condition
int inrMod = Platform.getAttribute( $wrkfec\inr.getValue(), tdAttrModified );
Platform.resetModified( $wrkfec\inr.getValue() );
Platform.clear( $detstm );
IModule fecmod = null;
if( Platform.isEmpty( $fecmod ) )
{
if( Platform.compareTo($wrkfec\lowamt.getValue(), 0) != 0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000024, Platform.getCodetableLabelOfTd( $\setmod\setfeg\wrkfee\reltir.getValue(), "FECAMT", Platform.getLang() ), $doccur.getValue(), Platform.fmtAmount( tiramt, $doccur.getValue() ) );
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000025, bcur, Platform.fmtAmount( tirbca, bcur ) );
if( Platform.compareTo( $wrkfec\higamt , 0 ) == 0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000026, bcur, Platform.fmtAmount( $wrkfec\lowamt.getValue(), bcur ), Platform.fmtAmount( $wrkfec\higamt.getValue(), bcur ) );
}
else
{
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000027, bcur, Platform.fmtAmount( $wrkfec\lowamt.getValue(), bcur ), Platform.fmtAmount( $wrkfec\higamt.getValue(), bcur ) );
}
}
}
else
{
if( ! Platform.isModified( $wrkfec ) )
{
fecmod = Platform.getModule( $fecmod.getValue() );
if( Platform.errorCode() <= 0 )
{
Platform.copyValues( $wrkfec, fecmod );
}
else
{
Platform.clear( $wrkfec );
}
Platform.resetModified( $wrkfec );
}
}
if( ! Platform.isEmpty( $fecirt ) )
{
$wrkfec\ratirs = $fecirt;
$wrkfec\ratcal = $ratcal;
}
Platform.setAttribute( $wrkfec\inr.getValue(), tdAttrModified, inrMod );
// take rate from condition if.
// 1. this is not a combination of more than one fee line (Stramcount < 2 ) and
// 2. the rate is not modified manually and
// 3. the condition sets an amount
if( Platform.streamCount( $fepinrlst.getValue() ) < 2 && ( ! Platform.isModified( $untamt ) ) && ( ! Platform.isEmpty( $wrkfec\untamt ) || ( ! Platform.isEmpty( $wrkfec\ratfcc ) && Platform.compareTo($wrkfec\ratfcc.getValue(), "N") != 0 ) ) )
{
$untamt = $wrkfec\untamt;
}
// same for RATCAL
if( Platform.streamCount( $fepinrlst.getValue() ) < 2 && ( ! Platform.isModified( $ratcal ) ) && ( ! Platform.isEmpty( $wrkfec\ratcal ) || ( ! Platform.isEmpty( $wrkfec\ratfcc ) && Platform.compareTo($wrkfec\ratfcc.getValue(), "N") != 0 ) ) )
{
$ratcal = $wrkfec\ratcal;
}
if( Platform.compareTo( feetyp , "FEP" ) == 0 && Platform.compareTo( cur , $cur.getValue() ) == 0 )
{
if( ! Platform.isEmpty( $infdetstm ) )
{
$inftxt = Platform.toString( $infdetstm.getValue() );
}
return ; // #######TODO 改写 LABEL与GOTO #### goto fecend
}
if( Platform.compareTo(Platform.getTransName(), "BOTSET") != 0 )
{
if( Platform.compareTo( $modflg.getValue() , "a" ) == 0 )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto fecend
}
}
if( ! Platform.IsEnabled( $cur.getValue() ) )
{
if( Platform.compareTo($cur.getValue(), cur) != 0 )
{
$amt = $\cbsmod\xrtmod.amtConvTypes( $cur.getValue(), $amt.getValue(), "S", cur, "B", Platform.today() );
$cur = cur;
}
}
if( Platform.compareTo( $wrkfec\calrul , "T" ) == 0 )
{
if( ! Platform.isEmpty( $infdetstm ) )
{
$inftxt = Platform.toString( $infdetstm.getValue() );
}
return ; // #######TODO 改写 LABEL与GOTO #### goto fecend
}
if( ! Platform.isModified( $cur ) )
{
$cur = cur;
}
// if no currency yet, fee cannot be calculated.
if( Platform.isEmpty( $cur ) )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto fecend
}
// Display all Infotexts on the Details Settlement Panel
String maxLev = "";
String cr = "";
String infTxt = "";
IStream oitStm = new StreamImpl();
Platform.streamClear( oitStm );
IStream inftxtStm = new StreamImpl();
Platform.streamClear( inftxtStm );
int fecCount = Platform.streamCount( $feclst.getValue() );
String fecLin = NULLSTR;
String fecInr = NULLSTR;
int count = 0;
String oitLin = NULLSTR;
for(int i = 1;i <= fecCount;i++)
{
fecLin = Platform.getLine( $feclst.getValue(), i );
fecInr = Platform.mid( fecLin, 1, Platform.pos( fecLin, "\t" ) - 1 );
Argument<String> maxLevBox = new Argument<String>("",maxLev);
$\trnmod\mtabut\syswrn.oitGetOitData( "FEC", fecInr, "", maxLevBox, oitStm );
}
$feeacc = $\setmod\setfeg\wrkfee\acc;
$feedtacod = $\setmod\setfeg\wrkfee\dtacod;
$feesftcod = $\setmod\setfeg\wrkfee\sftcod;
$rolptyinr = ptyinr;
$rolptainr = ptainr;
String cur = NULLSTR;
if( Platform.isModified( $cur ) )
{
cur = $cur;
}
else
{
if( Platform.compareTo( $rol.getValue() , "OWN" ) == 0 && ! Platform.isEmpty( $cur ) )
{
cur = $cur;
}
else
{
cur = getFeeCur( $rol.getValue() );
}
}
String feetyp = NULLSTR;
if( Platform.isEmpty( $fepinrlst ) )
{
feetyp = "MAN";
$inftxt = #CT000008;
if( ! Platform.isModified( $unt ) )
{
$unt = 1;
}
}
else
{
feetyp = $\setmod\setfeg.getfepval ( Platform.getLine( $fepinrlst.getValue(), 1 ), "TYP" );
if( ! Platform.isModified( $inftxt ) )
{
$inftxt = $\setmod\setfeg.getfepval ( Platform.getLine( $fepinrlst.getValue(), 1 ), "INFTXT" );
}
}
BigDecimal tiramt = $\setmod.getRelAmount ( $\setmod\setfeg\wrkfee\reltir.getValue(), $rol.getValue(), this );
BigDecimal tirbca = $\cbsmod\xrtmod.amtConvTypes( $doccur.getValue(), tiramt, "M", bcur, "M", Platform.today() );
if( Platform.isEmpty( $fecmod ) && ! Platform.isModified( $wrkfec ) )
{
$\setmod\setfeg\fecmod.getFec ( bcur, tirbca, $rol.getValue(), ptyinr, $\setmod\setfeg\wrkfee, $wrkfec, $feclst.getValue() );
}
// get condition
int inrMod = Platform.getAttribute( $wrkfec\inr.getValue(), tdAttrModified );
Platform.resetModified( $wrkfec\inr.getValue() );
Platform.clear( $detstm );
IModule fecmod = null;
if( Platform.isEmpty( $fecmod ) )
{
if( Platform.compareTo($wrkfec\lowamt.getValue(), 0) != 0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000024, Platform.getCodetableLabelOfTd( $\setmod\setfeg\wrkfee\reltir.getValue(), "FECAMT", Platform.getLang() ), $doccur.getValue(), Platform.fmtAmount( tiramt, $doccur.getValue() ) );
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000025, bcur, Platform.fmtAmount( tirbca, bcur ) );
if( Platform.compareTo( $wrkfec\higamt , 0 ) == 0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000026, bcur, Platform.fmtAmount( $wrkfec\lowamt.getValue(), bcur ), Platform.fmtAmount( $wrkfec\higamt.getValue(), bcur ) );
}
else
{
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000027, bcur, Platform.fmtAmount( $wrkfec\lowamt.getValue(), bcur ), Platform.fmtAmount( $wrkfec\higamt.getValue(), bcur ) );
}
}
}
else
{
if( ! Platform.isModified( $wrkfec ) )
{
fecmod = Platform.getModule( $fecmod.getValue() );
if( Platform.errorCode() <= 0 )
{
Platform.copyValues( $wrkfec, fecmod );
}
else
{
Platform.clear( $wrkfec );
}
Platform.resetModified( $wrkfec );
}
}
if( ! Platform.isEmpty( $fecirt ) )
{
$wrkfec\ratirs = $fecirt;
$wrkfec\ratcal = $ratcal;
}
Platform.setAttribute( $wrkfec\inr.getValue(), tdAttrModified, inrMod );
// take rate from condition if.
// 1. this is not a combination of more than one fee line (Stramcount < 2 ) and
// 2. the rate is not modified manually and
// 3. the condition sets an amount
if( Platform.streamCount( $fepinrlst.getValue() ) < 2 && ( ! Platform.isModified( $untamt ) ) && ( ! Platform.isEmpty( $wrkfec\untamt ) || ( ! Platform.isEmpty( $wrkfec\ratfcc ) && Platform.compareTo($wrkfec\ratfcc.getValue(), "N") != 0 ) ) )
{
$untamt = $wrkfec\untamt;
}
// same for RATCAL
if( Platform.streamCount( $fepinrlst.getValue() ) < 2 && ( ! Platform.isModified( $ratcal ) ) && ( ! Platform.isEmpty( $wrkfec\ratcal ) || ( ! Platform.isEmpty( $wrkfec\ratfcc ) && Platform.compareTo($wrkfec\ratfcc.getValue(), "N") != 0 ) ) )
{
$ratcal = $wrkfec\ratcal;
}
if( Platform.compareTo( feetyp , "FEP" ) == 0 && Platform.compareTo( cur , $cur.getValue() ) == 0 )
{
if( ! Platform.isEmpty( $infdetstm ) )
{
$inftxt = Platform.toString( $infdetstm.getValue() );
}
break INNER; // #### goto fecend
}
if( Platform.compareTo(Platform.getTransName(), "BOTSET") != 0 )
{
if( Platform.compareTo( $modflg.getValue() , "a" ) == 0 )
{
break INNER; // #### goto fecend
}
}
if( ! Platform.IsEnabled( $cur.getValue() ) )
{
if( Platform.compareTo($cur.getValue(), cur) != 0 )
{
$amt = $\cbsmod\xrtmod.amtConvTypes( $cur.getValue(), $amt.getValue(), "S", cur, "B", Platform.today() );
$cur = cur;
}
}
if( Platform.compareTo( $wrkfec\calrul , "T" ) == 0 )
{
if( ! Platform.isEmpty( $infdetstm ) )
{
$inftxt = Platform.toString( $infdetstm.getValue() );
}
break INNER; // #### goto fecend
}
if( ! Platform.isModified( $cur ) )
{
$cur = cur;
}
// if no currency yet, fee cannot be calculated.
if( Platform.isEmpty( $cur ) )
{
break INNER; // #### goto fecend
}
// Display all Infotexts on the Details Settlement Panel
String maxLev = "";
String cr = "";
String infTxt = "";
IStream oitStm = new StreamImpl();
Platform.streamClear( oitStm );
IStream inftxtStm = new StreamImpl();
Platform.streamClear( inftxtStm );
int fecCount = Platform.streamCount( $feclst.getValue() );
String fecLin = NULLSTR;
String fecInr = NULLSTR;
int count = 0;
String oitLin = NULLSTR;
for(int i = 1;i <= fecCount;i++)
{
fecLin = Platform.getLine( $feclst.getValue(), i );
fecInr = Platform.mid( fecLin, 1, Platform.pos( fecLin, "\t" ) - 1 );
Argument<String> maxLevBox = new Argument<String>("",maxLev);
$\trnmod\mtabut\syswrn.oitGetOitData( "FEC", fecInr, "", maxLevBox, oitStm );
maxLev = maxLevBox.value;
maxLev = maxLevBox.value;
count = Platform.streamCount( oitStm );
if( count > 0 )
{
for(int j = 1;j <= count;j++)
{
oitLin = Platform.getLine( oitStm, j );
Platform.streamInsert( inftxtStm, 0, "***" + Platform.mid( oitLin, Platform.pos( oitLin, "\t" ) + 1 ) );
}
}
}
$inftxt = Platform.toString( inftxtStm );
$feesftcod = $\setmod\setfeg\wrkfee\sftcod;
// if relevant amount from pool, use it, otherwise recalculate
if( Platform.compareTo( feetyp , "FEP" ) == 0 && Platform.compareTo($relamt.getValue(), 0) != 0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + #CT000006;
}
else
{
if( Platform.compareTo( feetyp , "FEP" ) == 0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + #CT000007;
}
$relamt = $\setmod.getRelAmount ( $wrkfec\calcbs.getValue(), $rol.getValue(), this );
$relcur = $doccur;
}
Argument<String> pathBox = new Argument<String>("",$relcur.getValue());
$\setmod\setfeg\fecism.clcFecAmt ( this, pathBox, $relamt.getValue(), $cur.getValue() );
count = Platform.streamCount( oitStm );
if( count > 0 )
{
for(int j = 1;j <= count;j++)
{
oitLin = Platform.getLine( oitStm, j );
Platform.streamInsert( inftxtStm, 0, "***" + Platform.mid( oitLin, Platform.pos( oitLin, "\t" ) + 1 ) );
}
}
}
$inftxt = Platform.toString( inftxtStm );
$feesftcod = $\setmod\setfeg\wrkfee\sftcod;
// if relevant amount from pool, use it, otherwise recalculate
if( Platform.compareTo( feetyp , "FEP" ) == 0 && Platform.compareTo($relamt.getValue(), 0) != 0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + #CT000006;
}
else
{
if( Platform.compareTo( feetyp , "FEP" ) == 0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + #CT000007;
}
$relamt = $\setmod.getRelAmount ( $wrkfec\calcbs.getValue(), $rol.getValue(), this );
$relcur = $doccur;
}
Argument<String> pathBox = new Argument<String>("",$relcur.getValue());
$\setmod\setfeg\fecism.clcFecAmt ( this, pathBox, $relamt.getValue(), $cur.getValue() );
$relcur = pathBox.value;
$relcur = pathBox.value;
// recredit already paid fees according to CLCDIFFLG
String relobjtyp = NULLSTR;
String relobjinr = NULLSTR;
IModule rejObjmod = null;
IStream retStream = new StreamImpl();
String fepsql = NULLSTR;
int oldFepAmt = 0;
int stmCnt = 0;
String line = NULLSTR;
int amt = 0;
String modFlg = NULLSTR;
if( ! Platform.isEmpty( $cur ) )
{
switch( $wrkfec\clcdifflg.getValue() )
{
case "A":
case "R":
if( Platform.isEmpty( $objmod ) )
{
relobjtyp = Platform.recGetObj( $\mtabut\rec );
relobjinr = Platform.recGetInr( $\mtabut\rec );
}
else
{
rejObjmod = Platform.getModule( $objmod.getValue() );
if( Platform.errorCode() <= 0 )
{
relobjtyp = Platform.recGetObj( rejObjmod );
relobjinr = Platform.recGetInr( rejObjmod );
}
else
{
relobjtyp = Platform.recGetObj( $\mtabut\rec );
relobjinr = Platform.recGetInr( $\mtabut\rec );
}
}
Platform.streamClear( retStream );
Platform.cacheRead( retStream, "$OldFepStm", relobjtyp, relobjinr, $feecod.getValue(), $src.getValue(), $dat1.getValue(), $dat2.getValue() );
if( Platform.errorCode() == tdCacheNotFound )
{
fepsql = "SELECT AMT,CUR,MODFLG from FEP " + Platform.sdbEtyGenSql( $\setmod\setfeg\wrkfep, " WHERE RELOBJTYP = ? AND RELOBJINR = ? AND FEECOD = ? AND RPLTRNINR = ' '" );
// do not use own FEP row if entry from pool is recalculated
if( ! Platform.isEmpty( $fepinrlst ) )
{
switch( $src.getValue() )
// recredit already paid fees according to CLCDIFFLG
String relobjtyp = NULLSTR;
String relobjinr = NULLSTR;
IModule rejObjmod = null;
IStream retStream = new StreamImpl();
String fepsql = NULLSTR;
int oldFepAmt = 0;
int stmCnt = 0;
String line = NULLSTR;
int amt = 0;
String modFlg = NULLSTR;
if( ! Platform.isEmpty( $cur ) )
{
case "P":
case "D":
case "A":
case "O":
fepsql = fepsql + " AND ( NOT INR = '" + Platform.getLine( $fepinrlst.getValue(), 1 ) + "' ) ";
break;
switch( $wrkfec\clcdifflg.getValue() )
{
case "A":
case "R":
if( Platform.isEmpty( $objmod ) )
{
relobjtyp = Platform.recGetObj( $\mtabut\rec );
relobjinr = Platform.recGetInr( $\mtabut\rec );
}
else
{
rejObjmod = Platform.getModule( $objmod.getValue() );
if( Platform.errorCode() <= 0 )
{
relobjtyp = Platform.recGetObj( rejObjmod );
relobjinr = Platform.recGetInr( rejObjmod );
}
else
{
relobjtyp = Platform.recGetObj( $\mtabut\rec );
relobjinr = Platform.recGetInr( $\mtabut\rec );
}
}
Platform.streamClear( retStream );
Platform.cacheRead( retStream, "$OldFepStm", relobjtyp, relobjinr, $feecod.getValue(), $src.getValue(), $dat1.getValue(), $dat2.getValue() );
if( Platform.errorCode() == tdCacheNotFound )
{
fepsql = "SELECT AMT,CUR,MODFLG from FEP " + Platform.sdbEtyGenSql( $\setmod\setfeg\wrkfep, " WHERE RELOBJTYP = ? AND RELOBJINR = ? AND FEECOD = ? AND RPLTRNINR = ' '" );
// do not use own FEP row if entry from pool is recalculated
if( ! Platform.isEmpty( $fepinrlst ) )
{
switch( $src.getValue() )
{
case "P":
case "D":
case "A":
case "O":
fepsql = fepsql + " AND ( NOT INR = '" + Platform.getLine( $fepinrlst.getValue(), 1 ) + "' ) ";
break;
}
}
// use FEPs in range calulated now only
if( ! Platform.isEmpty( $dat1 ) && ! Platform.isEmpty( $dat2 ) )
{
fepsql = fepsql + " AND ( not DAT1 < " + Platform.sqlDate( $dat1.getValue() ) + " ) and ( not DAT2 > " + Platform.sqlDate( $dat2.getValue() ) + " ) ";
}
Platform.dbExecuteSQL( fepsql, relobjtyp, relobjinr, $feecod.getValue() );
Platform.dbFetchStream( retStream );
Platform.dbCloseCursor();
Platform.cacheWrite( retStream, "$OldFepStm", relobjtyp, relobjinr, $feecod.getValue(), $src.getValue(), $dat1.getValue(), $dat2.getValue() );
}
oldFepAmt = 0;
stmCnt = Platform.streamCount( retStream );
for(int i = 1;i <= stmCnt;i++)
{
line = Platform.getLine( retStream, i );
amt = Platform.parseInt( Platform.mid( line, 1, Platform.pos( line, "\t" ) - 1 ) );
line = Platform.mid( line, Platform.pos( line, "\t" ) + 1 );
cur = Platform.mid( line, 1, Platform.pos( line, "\t" ) - 1 );
line = Platform.mid( line, Platform.pos( line, "\t" ) + 1 );
modFlg = line;
if( Platform.compareTo( cur , $cur.getValue() ) == 0 && ( Platform.isEmpty( modFlg ) || Platform.compareTo( modFlg , "r" ) == 0 ) )
{
oldFepAmt = oldFepAmt + amt;
}
else
{
wrn = Platform.getText( #CT000045, $feecod.getValue() );
$inftxt = $inftxt.getValue() + "\r\n" + "\r\n" + wrn;
$amt = new BigDecimal("0");
break INNER; // #### goto fecend
}
}
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000044, $cur.getValue(), Platform.fmtAmount( oldFepAmt, $cur.getValue() ) );
if( Platform.compareTo($wrkfec\clcdifflg, "A" )== 0 && Platform.compareTo(oldFepAmt , $amt.getValue())>0 && Platform.compareTo($amt.getValue() , 0)>0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000041 );
$amt = new BigDecimal("0");
}
else
{
$amt = Platform.numSub($amt.getValue() , oldFepAmt);
if( Platform.compareTo($amt.getValue() , 0)<0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000042, $cur.getValue(), Platform.fmtAmount( $amt.getValue().negate(), $cur.getValue() ) );
}
else
{
if( Platform.compareTo($amt.getValue() , 0)>0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000043, $cur.getValue(), Platform.fmtAmount( $amt.getValue(), $cur.getValue() ) );
}
}
}
break;
}
}
}
// use FEPs in range calulated now only
if( ! Platform.isEmpty( $dat1 ) && ! Platform.isEmpty( $dat2 ) )
{
fepsql = fepsql + " AND ( not DAT1 < " + Platform.sqlDate( $dat1.getValue() ) + " ) and ( not DAT2 > " + Platform.sqlDate( $dat2.getValue() ) + " ) ";
}
Platform.dbExecuteSQL( fepsql, relobjtyp, relobjinr, $feecod.getValue() );
Platform.dbFetchStream( retStream );
Platform.dbCloseCursor();
Platform.cacheWrite( retStream, "$OldFepStm", relobjtyp, relobjinr, $feecod.getValue(), $src.getValue(), $dat1.getValue(), $dat2.getValue() );
break;
}
oldFepAmt = 0;
stmCnt = Platform.streamCount( retStream );
for(int i = 1;i <= stmCnt;i++)
// #### label fecend
$\trnmod\mtabut\syswrn.sysWarningSet( SYSWRNTypeWarning, wrn, "RalcSetfel" + argrow );
setCusPanelDescription();
// Default fields standard
recalcSetfelStdDft( argrow );
// Do installation specific defaulting
recalcSetfelIsfDft( argrow );
// Default FEC fields in FECP1 Modul
$fecp1.recalcFecp1();
Platform.postDefaultRule( $mac );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $mac.getValue()) != 0 && rclCnt <= 20 )
{
line = Platform.getLine( retStream, i );
amt = Platform.parseInt( Platform.mid( line, 1, Platform.pos( line, "\t" ) - 1 ) );
line = Platform.mid( line, Platform.pos( line, "\t" ) + 1 );
cur = Platform.mid( line, 1, Platform.pos( line, "\t" ) - 1 );
line = Platform.mid( line, Platform.pos( line, "\t" ) + 1 );
modFlg = line;
if( Platform.compareTo( cur , $cur.getValue() ) == 0 && ( Platform.isEmpty( modFlg ) || Platform.compareTo( modFlg , "r" ) == 0 ) )
{
oldFepAmt = oldFepAmt + amt;
}
else
{
wrn = Platform.getText( #CT000045, $feecod.getValue() );
$inftxt = $inftxt.getValue() + "\r\n" + "\r\n" + wrn;
$amt = new BigDecimal("0");
return ; // #######TODO 改写 LABEL与GOTO #### goto fecend
}
rclMacOld = $mac;
rclCnt = rclCnt + 1;
//return ; // #### goto RclStart
continue RclStart;
}
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000044, $cur.getValue(), Platform.fmtAmount( oldFepAmt, $cur.getValue() ) );
if( Platform.compareTo($wrkfec\clcdifflg, "A" )== 0 && Platform.compareTo(oldFepAmt , $amt.getValue())>0 && Platform.compareTo($amt.getValue() , 0)>0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000041 );
$amt = new BigDecimal("0");
}
else
{
$amt = Platform.numSub($amt.getValue() , oldFepAmt);
if( Platform.compareTo($amt.getValue() , 0)<0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000042, $cur.getValue(), Platform.fmtAmount( $amt.getValue().negate(), $cur.getValue() ) );
}
else
{
if( Platform.compareTo($amt.getValue() , 0)>0 )
{
$inftxt = $inftxt.getValue() + "\r\n" + Platform.getText( #CT000043, $cur.getValue(), Platform.fmtAmount( $amt.getValue(), $cur.getValue() ) );
}
}
}
break;
}
}
// #######TODO 改写 LABEL与GOTO #### label fecend
$\trnmod\mtabut\syswrn.sysWarningSet( SYSWRNTypeWarning, wrn, "RalcSetfel" + argrow );
setCusPanelDescription();
// Default fields standard
recalcSetfelStdDft( argrow );
// Do installation specific defaulting
recalcSetfelIsfDft( argrow );
// Default FEC fields in FECP1 Modul
$fecp1.recalcFecp1();
Platform.postDefaultRule( $mac );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $mac.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $mac;
rclCnt = rclCnt + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto RclStart
$macold = $mac;
return;
}
$macold = $mac;
}
\ No newline at end of file
......@@ -4,92 +4,97 @@ void recalcSetfogEog()
int rclCnt = 0;
Platform.postDefaultRule( $maceog );
String rclMacOld = $maceog;
// #######TODO 改写 LABEL与GOTO #### label RclStart
$\setmod\setglg.setglgClrAmount ( "*SETFOG" );
int gridcnt = Platform.gridCount( $setfol );
String act = NULLSTR;
String amtkeyCdt = NULLSTR;
int err = 0;
String amtkeyDbt = NULLSTR;
if( Platform.isVisible( $\setmod\setpan ) )
{
for(int i = 1;i <= gridcnt;i++)
{
if( ! Platform.isEmpty( $setfol[i]\ptypay ) && ! Platform.isEmpty( $setfol[i]\ptydbt ) && ! Platform.isEmpty( $setfol[i]\amt ) )
// #### label RclStart
RclStart:
while(true){
$\setmod\setglg.setglgClrAmount ( "*SETFOG" );
int gridcnt = Platform.gridCount( $setfol );
String act = NULLSTR;
String amtkeyCdt = NULLSTR;
int err = 0;
String amtkeyDbt = NULLSTR;
if( Platform.isVisible( $\setmod\setpan ) )
{
if( Platform.compareTo($setfol[i]\dsp, "X" )== 0 || Platform.compareTo($setfol[i]\dsp, "S" )== 0 )
for(int i = 1;i <= gridcnt;i++)
{
//cgl 出口收汇国外扣费费用合并xxf
if( Platform.compareTo( Platform.getTransName() , "BETSET" ) == 0 || Platform.compareTo( Platform.getTransName() , "BTTSET" ) == 0 || Platform.compareTo( Platform.getTransName() , "BOTSET" ) == 0 || Platform.compareTo( Platform.getTransName() , "CPTADV" ) == 0 || Platform.compareTo( Platform.getTransName() , "GETSET" ) == 0 || Platform.compareTo( Platform.getTransName() , "TRTSET" ) == 0 )
if( ! Platform.isEmpty( $setfol[i]\ptypay ) && ! Platform.isEmpty( $setfol[i]\ptydbt ) && ! Platform.isEmpty( $setfol[i]\amt ) )
{
if( Platform.compareTo( Platform.getTransName() , "CPTADV" ) == 0 )
if( Platform.compareTo($setfol[i]\dsp, "X" )== 0 || Platform.compareTo($setfol[i]\dsp, "S" )== 0 )
{
act = $\setmod\glemod.getAvailAcc ( "SP-OTH", $setfol[i]\cur.getValue(), "", this, $setfol[i]\amt.getValue().negate() );
}
else
{
// 修改trtset交易收取利息的情况下CAC无法取对金额的问题
if( Platform.compareTo( Platform.getTransName() , "TRTSET" ) == 0 )
{
act = $\setmod\glemod.getAvailAcc ( "CA-OTH", $setfol[i]\cur.getValue(), "", this, $setfol[i]\amt.getValue().negate() );
}
else
{
act = $\setmod\glemod.getAvailAcc ( "SP-OTH", $setfol[i]\cur.getValue(), "", this, $setfol[i]\amt.getValue().negate() );
}
}
if( Platform.compareTo( Platform.getTransName() , "TRTSET" ) == 0 )
{
if( Platform.compareTo( Platform.getContent( "\\LIDGRP\\REC\\DFLG" ) , "D" ) == 0 )
//cgl 出口收汇国外扣费费用合并xxf
if( Platform.compareTo( Platform.getTransName() , "BETSET" ) == 0 || Platform.compareTo( Platform.getTransName() , "BTTSET" ) == 0 || Platform.compareTo( Platform.getTransName() , "BOTSET" ) == 0 || Platform.compareTo( Platform.getTransName() , "CPTADV" ) == 0 || Platform.compareTo( Platform.getTransName() , "GETSET" ) == 0 || Platform.compareTo( Platform.getTransName() , "TRTSET" ) == 0 )
{
amtkeyCdt = $\setmod\setglg.setglgAddAmount ( "*SETFOG", $setfol[i]\ptypay.getValue(), $setfol[i]\cur.getValue(), $setfol[i]\amt.getValue().negate(), "FOG", "RPC", "", "", "" );
if( Platform.compareTo( Platform.getTransName() , "CPTADV" ) == 0 )
{
act = $\setmod\glemod.getAvailAcc ( "SP-OTH", $setfol[i]\cur.getValue(), "", this, $setfol[i]\amt.getValue().negate() );
}
else
{
// 修改trtset交易收取利息的情况下CAC无法取对金额的问题
if( Platform.compareTo( Platform.getTransName() , "TRTSET" ) == 0 )
{
act = $\setmod\glemod.getAvailAcc ( "CA-OTH", $setfol[i]\cur.getValue(), "", this, $setfol[i]\amt.getValue().negate() );
}
else
{
act = $\setmod\glemod.getAvailAcc ( "SP-OTH", $setfol[i]\cur.getValue(), "", this, $setfol[i]\amt.getValue().negate() );
}
}
if( Platform.compareTo( Platform.getTransName() , "TRTSET" ) == 0 )
{
if( Platform.compareTo( Platform.getContent( "\\LIDGRP\\REC\\DFLG" ) , "D" ) == 0 )
{
amtkeyCdt = $\setmod\setglg.setglgAddAmount ( "*SETFOG", $setfol[i]\ptypay.getValue(), $setfol[i]\cur.getValue(), $setfol[i]\amt.getValue().negate(), "FOG", "RPC", "", "", "" );
}
else
{
if( Platform.compareTo( $\sysmod\bch\branch , "6701" ) == 0 )
{
//6701网点的待划转直接取codetable中的值
act = Platform.getCodetableLabelOfTd( $setfol[i]\cur.getValue(), "FTACT1", Platform.getLang() );
act = Platform.getCodetableLabelOfTd( $setfol[i]\cur.getValue(), "FTACA", Platform.getLang() );
err = Platform.errorCode();
}
/** // 修改trtset交易收取利息的情况下CAC无法取对金额的问题
$amtkeyCdt = \SETMOD\SETGLG.SetglgAddAmount ( "*SETFOG", SETFOL( $i )\PTYPAY, SETFOL( $i )\CUR, -SETFOL( $i )\AMT, "FOG", "SPC", "", $act, "" )
**/
amtkeyCdt = $\setmod\setglg.setglgAddAmount ( "*SETFOG", $setfol[i]\ptypay.getValue(), $setfol[i]\cur.getValue(), $setfol[i]\amt.getValue().negate(), "FOG", "CAC", "", act, "" );
}
}
else
{
amtkeyCdt = $\setmod\setglg.setglgAddAmount ( "*SETFOG", $setfol[i]\ptypay.getValue(), $setfol[i]\cur.getValue(), $setfol[i]\amt.getValue().negate(), "FOG", "SPD", "C", act, "" );
}
}
else
{
if( Platform.compareTo( $\sysmod\bch\branch , "6701" ) == 0 )
{
//6701网点的待划转直接取codetable中的值
act = Platform.getCodetableLabelOfTd( $setfol[i]\cur.getValue(), "FTACT1", Platform.getLang() );
act = Platform.getCodetableLabelOfTd( $setfol[i]\cur.getValue(), "FTACA", Platform.getLang() );
err = Platform.errorCode();
}
/** // 修改trtset交易收取利息的情况下CAC无法取对金额的问题
$amtkeyCdt = \SETMOD\SETGLG.SetglgAddAmount ( "*SETFOG", SETFOL( $i )\PTYPAY, SETFOL( $i )\CUR, -SETFOL( $i )\AMT, "FOG", "SPC", "", $act, "" )
**/
amtkeyCdt = $\setmod\setglg.setglgAddAmount ( "*SETFOG", $setfol[i]\ptypay.getValue(), $setfol[i]\cur.getValue(), $setfol[i]\amt.getValue().negate(), "FOG", "CAC", "", act, "" );
//
amtkeyCdt = $\setmod\setglg.setglgAddAmount ( "*SETFOG", $setfol[i]\ptypay.getValue(), $setfol[i]\cur.getValue(), $setfol[i]\amt.getValue().negate(), "FOG", "", "", "", "" );
}
amtkeyDbt = $\setmod\setglg.setglgAddAmount ( "*SETFOG", $setfol[i]\ptydbt.getValue(), $setfol[i]\cur.getValue(), $setfol[i]\amt.getValue(), "FOG", "", "", "", "" );
}
else
{
amtkeyCdt = $\setmod\setglg.setglgAddAmount ( "*SETFOG", $setfol[i]\ptypay.getValue(), $setfol[i]\cur.getValue(), $setfol[i]\amt.getValue().negate(), "FOG", "SPD", "C", act, "" );
}
}
else
{
//
amtkeyCdt = $\setmod\setglg.setglgAddAmount ( "*SETFOG", $setfol[i]\ptypay.getValue(), $setfol[i]\cur.getValue(), $setfol[i]\amt.getValue().negate(), "FOG", "", "", "", "" );
}
amtkeyDbt = $\setmod\setglg.setglgAddAmount ( "*SETFOG", $setfol[i]\ptydbt.getValue(), $setfol[i]\cur.getValue(), $setfol[i]\amt.getValue(), "FOG", "", "", "", "" );
}
}
}
}
$netamt = $docamt;
if( gridcnt > 0 )
{
for(int i = 1;i <= gridcnt;i++)
{
$netamt = Platform.numAdd($netamt.getValue() , Platform.numMul($setfol[i]\amt.getValue() , $forsgn.getValue()));
}
}
Platform.postDefaultRule( $maceog );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $maceog.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $maceog;
rclCnt = rclCnt + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto RclStart
$netamt = $docamt;
if( gridcnt > 0 )
{
for(int i = 1;i <= gridcnt;i++)
{
$netamt = Platform.numAdd($netamt.getValue() , Platform.numMul($setfol[i]\amt.getValue() , $forsgn.getValue()));
}
}
Platform.postDefaultRule( $maceog );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $maceog.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $maceog;
rclCnt = rclCnt + 1;
//return ; // #### goto RclStart
continue RclStart;
}
$maceogold = $maceog;
break;
}
$maceogold = $maceog;
}
\ No newline at end of file
......@@ -8,262 +8,273 @@ void recalcSetfogBog()
int rclCnt = 0;
Platform.postDefaultRule( $macbog );
String rclMacOld = $macbog;
// #######TODO 改写 LABEL与GOTO #### label RclStart
// load only if roles are completely (incl. SETPTY-Cache) loaded
String chkrol = NULLSTR;
IStream sqlStm = new StreamImpl();
IStream cacsql = new StreamImpl();
IStream oldInrStm = new StreamImpl();
IStream oldIdxStm = new StreamImpl();
IStream empIdxStm = new StreamImpl();
int gridcnt = 0;
int nxtEmp = 0;
IStream inrStm = new StreamImpl();
int sqlStmCnt = 0;
String sql = NULLSTR;
String sepWrn = NULLSTR;
IStream sepStm = new StreamImpl();
int stmCntSep = 0;
IStream ptyinrs = new StreamImpl();
int stmCntInr = 0;
String ptynam = NULLSTR;
String ptyextkey = NULLSTR;
int oldidx = 0;
int fnd = 0;
int add = 0;
int stmCnt = 0;
if( Platform.streamCount( $\setmod\roldsc.getValue() ) > 0 )
{
chkrol = Platform.getLine( $\setmod\roldsc.getValue(), 1 );
Platform.readSetPtyfromCache( Platform.mid( chkrol, 1, Platform.pos( chkrol, "\t" ) - 1 ),$\setmod\setpty );
if( ! Platform.isEmpty( $\setmod\setpty\rol ) )
{
Platform.streamClear( sqlStm );
setFcpSql( sqlStm );
if( ! Platform.isEmpty( sqlStm ) )
{
// read Sql from cache
Platform.streamClear( cacsql );
Platform.cacheRead( cacsql, "SEFMOD", "FCPSQL" );
if( Platform.errorCode() != tdCacheNotFound )
{
Platform.reraise();
if( Platform.compareTo( Platform.toString( sqlStm ) , Platform.toString( cacsql ) ) == 0 )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto setmac
}
}
Platform.cacheWrite( sqlStm, "SEFMOD", "FCPSQL" );
// get information about lines in SETFOL
Platform.streamClear( oldInrStm );
Platform.streamClear( oldIdxStm );
Platform.streamClear( empIdxStm );
gridcnt = Platform.gridCount( $setfol );
for(int i = 1;i <= gridcnt;i++)
{
if( ! Platform.isEmpty( $setfol[i]\srcfcpinr ) )
{
Platform.streamInsert( oldInrStm, 0, $setfol[i]\srcfcpinr.getValue() );
Platform.streamInsert( oldIdxStm, 0, Platform.toString( i ) );
}
else
{
if( Platform.isEmpty( $setfol[i]\amt ) )
{
Platform.streamInsert( empIdxStm, 0, Platform.toString( i ) );
}
}
}
// merge SETFOL and database contents
nxtEmp = 1;
Platform.streamClear( inrStm );
sqlStmCnt = Platform.streamCount( sqlStm );
for(int sqlCnt = 1;sqlCnt <= sqlStmCnt;sqlCnt++)
{
sql = Platform.getLine( sqlStm, sqlCnt );
Platform.dbExecuteSql( "select inr from fcp " + Platform.sdbEtyGenSql( $wrkfcp, sql ) );
Platform.dbFetchStream( inrStm );
Platform.dbCloseCursor();
}
sepWrn = "";
if( ! Platform.isEmpty( $\setmod\sep\inr ) && Platform.isEmpty( $\setmod\tmpnotfnlflg ) )
{
Platform.streamClear( sepStm );
Platform.dbExecuteSQL( "select inr from fcp where sepinr = ? and dontrninr = ' ' and rpltrninr = ' ' ", $\setmod\sep\inr.getValue() );
Platform.dbFetchStream( sepStm );
Platform.dbCloseCursor();
stmCntSep = Platform.streamCount( sepStm );
for(int i = 1;i <= stmCntSep;i++)
{
if( Platform.streamSearch( inrStm, Platform.getLine( sepStm, i ) ) == 0 )
{
Platform.streamInsert( inrStm, 0, Platform.getLine( sepStm, i ) );
sepWrn = #CT000051;
}
}
$\trnmod\mtabut\syswrn.sysWarningSet( SYSWRNTypeWarning, sepWrn, "SETFOGBOGSEPWRN" );
}
Platform.streamClear( ptyinrs );
$\setmod.fillPtyInrStm ( ptyinrs );
stmCntInr = Platform.streamCount( inrStm );
for(int idx = 1;idx <= stmCntInr;idx++)
{
Platform.sdbRead( $wrkfcp, Platform.getLine( inrStm, idx ) );
cnt = cnt + 1;
// check if there are fees for contract, which can not be settled in this transaction
if( Platform.streamSearch( ptyinrs, $wrkfcp\dbtptyinr ) == 0 )
// #### label RclStart
RclStart:
while(true){
// load only if roles are completely (incl. SETPTY-Cache) loaded
String chkrol = NULLSTR;
IStream sqlStm = new StreamImpl();
IStream cacsql = new StreamImpl();
IStream oldInrStm = new StreamImpl();
IStream oldIdxStm = new StreamImpl();
IStream empIdxStm = new StreamImpl();
int gridcnt = 0;
int nxtEmp = 0;
IStream inrStm = new StreamImpl();
int sqlStmCnt = 0;
String sql = NULLSTR;
String sepWrn = NULLSTR;
IStream sepStm = new StreamImpl();
int stmCntSep = 0;
IStream ptyinrs = new StreamImpl();
int stmCntInr = 0;
String ptynam = NULLSTR;
String ptyextkey = NULLSTR;
int oldidx = 0;
int fnd = 0;
int add = 0;
int stmCnt = 0;
setmac:
while (true){
if( Platform.streamCount( $\setmod\roldsc.getValue() ) > 0 )
{
Platform.dbExecuteSQL( "SELECT NAM,EXTKEY FROM PTY WHERE INR = ?", $wrkfcp\dbtptyinr.getValue() );
ptynam = "";
ptyextkey = "";
Platform.dbFetchFields( "NAM", ptynam, "EXTKEY", ptyextkey );
if( Platform.errorCode() != tdOdbcNotFound )
chkrol = Platform.getLine( $\setmod\roldsc.getValue(), 1 );
Platform.readSetPtyfromCache( Platform.mid( chkrol, 1, Platform.pos( chkrol, "\t" ) - 1 ),$\setmod\setpty );
if( ! Platform.isEmpty( $\setmod\setpty\rol ) )
{
Platform.reraise();
}
Platform.dbCloseCursor();
$\trnmod\mtabut\syswrn.sysWarningSet( SYSWRNTypeWarning, Platform.getText( #CT000046, ptyextkey, ptynam ), "FCPWRN-" + $wrkfcp\inr.getValue() );
}
else
{
// check, if already in SETFOL
oldidx = Platform.streamSearch( oldInrStm, $wrkfcp\inr );
if( oldidx > 0 )
{ // if so, that is the line to update
fnd = Platform.parseInt( Platform.getLine( oldIdxStm, oldidx ) );
Platform.streamDelete( oldIdxStm, oldidx );
Platform.streamDelete( oldInrStm, oldidx );
}
else
{ // add additional lines if grid is full
if( nxtEmp > Platform.streamCount( empIdxStm ) )
Platform.streamClear( sqlStm );
setFcpSql( sqlStm );
if( ! Platform.isEmpty( sqlStm ) )
{
add = 5;
for(int i = 1;i <= add;i++)
// read Sql from cache
Platform.streamClear( cacsql );
Platform.cacheRead( cacsql, "SEFMOD", "FCPSQL" );
if( Platform.errorCode() != tdCacheNotFound )
{
Platform.streamInsert( empIdxStm, 0, Platform.toString( i + gridcnt ) );
Platform.reraise();
if( Platform.compareTo( Platform.toString( sqlStm ) , Platform.toString( cacsql ) ) == 0 )
{
//return ; // #### goto setmac
break setmac;
}
}
Platform.gridInsertRow( $setfol, 0, add );
Platform.cacheWrite( sqlStm, "SEFMOD", "FCPSQL" );
// get information about lines in SETFOL
Platform.streamClear( oldInrStm );
Platform.streamClear( oldIdxStm );
Platform.streamClear( empIdxStm );
gridcnt = Platform.gridCount( $setfol );
}
// take first empty line
fnd = Platform.parseInt( Platform.getLine( empIdxStm, nxtEmp ) );
Platform.resetModified( $setfol[fnd] );
nxtEmp = nxtEmp + 1;
}
// set technical fields from database to grid
$setfol[fnd]\srcfcpinr = $wrkfcp\inr;
$setfol[fnd]\advdat = $wrkfcp\advdat;
$setfol[fnd]\advtrninr = $wrkfcp\advtrninr;
$setfol[fnd]\sepinr = $wrkfcp\sepinr;
$setfol[fnd]\modflg = $wrkfcp\modflg;
// set user fields if not modified
if( ! Platform.isModified( $setfol[fnd]\amt ) )
{
$setfol[fnd]\amt = $wrkfcp\amt;
}
if( ! Platform.isModified( $setfol[fnd]\cur ) )
{
$setfol[fnd]\cur = $wrkfcp\cur;
}
if( ! Platform.isModified( $setfol[fnd]\ptydbt ) )
{
Platform.clear( $\setmod\setpty );
if( ! Platform.isEmpty( $wrkfcp\dbtrol ) )
{
Platform.cacheRead( $\setmod\setpty, "SETPTY", $wrkfcp\dbtrol.getValue() );
if( Platform.errorCode() == tdCacheNotFound )
for(int i = 1;i <= gridcnt;i++)
{
Platform.clear( $\setmod\setpty );
if( ! Platform.isEmpty( $setfol[i]\srcfcpinr ) )
{
Platform.streamInsert( oldInrStm, 0, $setfol[i]\srcfcpinr.getValue() );
Platform.streamInsert( oldIdxStm, 0, Platform.toString( i ) );
}
else
{
if( Platform.isEmpty( $setfol[i]\amt ) )
{
Platform.streamInsert( empIdxStm, 0, Platform.toString( i ) );
}
}
}
else
// merge SETFOL and database contents
nxtEmp = 1;
Platform.streamClear( inrStm );
sqlStmCnt = Platform.streamCount( sqlStm );
for(int sqlCnt = 1;sqlCnt <= sqlStmCnt;sqlCnt++)
{
Platform.reraise();
sql = Platform.getLine( sqlStm, sqlCnt );
Platform.dbExecuteSql( "select inr from fcp " + Platform.sdbEtyGenSql( $wrkfcp, sql ) );
Platform.dbFetchStream( inrStm );
Platform.dbCloseCursor();
}
}
if( Platform.isEmpty( $\setmod\setpty\rol ) )
{
Platform.cacheRead( $\setmod\setpty, "SETPTYINR", $wrkfcp\dbtptyinr.getValue() );
if( Platform.errorCode() == tdCacheNotFound )
sepWrn = "";
if( ! Platform.isEmpty( $\setmod\sep\inr ) && Platform.isEmpty( $\setmod\tmpnotfnlflg ) )
{
Platform.clear( $\setmod\setpty );
Platform.streamClear( sepStm );
Platform.dbExecuteSQL( "select inr from fcp where sepinr = ? and dontrninr = ' ' and rpltrninr = ' ' ", $\setmod\sep\inr.getValue() );
Platform.dbFetchStream( sepStm );
Platform.dbCloseCursor();
stmCntSep = Platform.streamCount( sepStm );
for(int i = 1;i <= stmCntSep;i++)
{
if( Platform.streamSearch( inrStm, Platform.getLine( sepStm, i ) ) == 0 )
{
Platform.streamInsert( inrStm, 0, Platform.getLine( sepStm, i ) );
sepWrn = #CT000051;
}
}
$\trnmod\mtabut\syswrn.sysWarningSet( SYSWRNTypeWarning, sepWrn, "SETFOGBOGSEPWRN" );
}
else
{
Platform.reraise();
}
}
$setfol[fnd]\ptydbt = $\setmod\setpty\rol;
}
if( ! Platform.isModified( $setfol[fnd]\ptypay ) )
{
Platform.clear( $\setmod\setpty );
if( ! Platform.isEmpty( $wrkfcp\payrol ) )
{
Platform.cacheRead( $\setmod\setpty, "SETPTY", $wrkfcp\payrol.getValue() );
if( Platform.errorCode() == tdCacheNotFound )
Platform.streamClear( ptyinrs );
$\setmod.fillPtyInrStm ( ptyinrs );
stmCntInr = Platform.streamCount( inrStm );
for(int idx = 1;idx <= stmCntInr;idx++)
{
Platform.clear( $\setmod\setpty );
Platform.sdbRead( $wrkfcp, Platform.getLine( inrStm, idx ) );
cnt = cnt + 1;
// check if there are fees for contract, which can not be settled in this transaction
if( Platform.streamSearch( ptyinrs, $wrkfcp\dbtptyinr ) == 0 )
{
Platform.dbExecuteSQL( "SELECT NAM,EXTKEY FROM PTY WHERE INR = ?", $wrkfcp\dbtptyinr.getValue() );
ptynam = "";
ptyextkey = "";
Platform.dbFetchFields( "NAM", ptynam, "EXTKEY", ptyextkey );
if( Platform.errorCode() != tdOdbcNotFound )
{
Platform.reraise();
}
Platform.dbCloseCursor();
$\trnmod\mtabut\syswrn.sysWarningSet( SYSWRNTypeWarning, Platform.getText( #CT000046, ptyextkey, ptynam ), "FCPWRN-" + $wrkfcp\inr.getValue() );
}
else
{
// check, if already in SETFOL
oldidx = Platform.streamSearch( oldInrStm, $wrkfcp\inr );
if( oldidx > 0 )
{ // if so, that is the line to update
fnd = Platform.parseInt( Platform.getLine( oldIdxStm, oldidx ) );
Platform.streamDelete( oldIdxStm, oldidx );
Platform.streamDelete( oldInrStm, oldidx );
}
else
{ // add additional lines if grid is full
if( nxtEmp > Platform.streamCount( empIdxStm ) )
{
add = 5;
for(int i = 1;i <= add;i++)
{
Platform.streamInsert( empIdxStm, 0, Platform.toString( i + gridcnt ) );
}
Platform.gridInsertRow( $setfol, 0, add );
gridcnt = Platform.gridCount( $setfol );
}
// take first empty line
fnd = Platform.parseInt( Platform.getLine( empIdxStm, nxtEmp ) );
Platform.resetModified( $setfol[fnd] );
nxtEmp = nxtEmp + 1;
}
// set technical fields from database to grid
$setfol[fnd]\srcfcpinr = $wrkfcp\inr;
$setfol[fnd]\advdat = $wrkfcp\advdat;
$setfol[fnd]\advtrninr = $wrkfcp\advtrninr;
$setfol[fnd]\sepinr = $wrkfcp\sepinr;
$setfol[fnd]\modflg = $wrkfcp\modflg;
// set user fields if not modified
if( ! Platform.isModified( $setfol[fnd]\amt ) )
{
$setfol[fnd]\amt = $wrkfcp\amt;
}
if( ! Platform.isModified( $setfol[fnd]\cur ) )
{
$setfol[fnd]\cur = $wrkfcp\cur;
}
if( ! Platform.isModified( $setfol[fnd]\ptydbt ) )
{
Platform.clear( $\setmod\setpty );
if( ! Platform.isEmpty( $wrkfcp\dbtrol ) )
{
Platform.cacheRead( $\setmod\setpty, "SETPTY", $wrkfcp\dbtrol.getValue() );
if( Platform.errorCode() == tdCacheNotFound )
{
Platform.clear( $\setmod\setpty );
}
else
{
Platform.reraise();
}
}
if( Platform.isEmpty( $\setmod\setpty\rol ) )
{
Platform.cacheRead( $\setmod\setpty, "SETPTYINR", $wrkfcp\dbtptyinr.getValue() );
if( Platform.errorCode() == tdCacheNotFound )
{
Platform.clear( $\setmod\setpty );
}
else
{
Platform.reraise();
}
}
$setfol[fnd]\ptydbt = $\setmod\setpty\rol;
}
if( ! Platform.isModified( $setfol[fnd]\ptypay ) )
{
Platform.clear( $\setmod\setpty );
if( ! Platform.isEmpty( $wrkfcp\payrol ) )
{
Platform.cacheRead( $\setmod\setpty, "SETPTY", $wrkfcp\payrol.getValue() );
if( Platform.errorCode() == tdCacheNotFound )
{
Platform.clear( $\setmod\setpty );
}
else
{
Platform.reraise();
}
}
if( Platform.isEmpty( $\setmod\setpty\rol ) )
{
Platform.cacheRead( $\setmod\setpty, "SETPTYINR", $wrkfcp\payptyinr.getValue() );
if( Platform.errorCode() == tdCacheNotFound )
{
Platform.clear( $\setmod\setpty );
}
else
{
Platform.reraise();
}
}
$setfol[fnd]\ptypay = $\setmod\setpty\rol;
}
if( ! Platform.isModified( $setfol[fnd]\txtdbt ) )
{
$setfol[fnd]\txtdbt = $wrkfcp\dbttxt;
}
if( ! Platform.isModified( $setfol[fnd]\txtpay ) )
{
$setfol[fnd]\txtpay = $wrkfcp\paytxt;
}
if( ! Platform.isModified( $setfol[fnd]\dat1 ) )
{
$setfol[fnd]\dat1 = $wrkfcp\dat1;
}
if( ! Platform.isModified( $setfol[fnd]\dat2 ) )
{
$setfol[fnd]\dat2 = $wrkfcp\dat2;
}
}
}
else
if( Platform.errorCode() != tdOdbcNotFound )
{
Platform.reraise();
}
}
if( Platform.isEmpty( $\setmod\setpty\rol ) )
{
Platform.cacheRead( $\setmod\setpty, "SETPTYINR", $wrkfcp\payptyinr.getValue() );
if( Platform.errorCode() == tdCacheNotFound )
// remove entries not longer in database
stmCnt = Platform.streamCount( oldIdxStm );
for(int i = 1;i <= stmCnt;i++)
{
Platform.clear( $\setmod\setpty );
}
else
{
Platform.reraise();
fnd = Platform.parseInt( Platform.getLine( oldIdxStm, i ) );
Platform.clear( $setfol[fnd] );
}
}
$setfol[fnd]\ptypay = $\setmod\setpty\rol;
}
if( ! Platform.isModified( $setfol[fnd]\txtdbt ) )
{
$setfol[fnd]\txtdbt = $wrkfcp\dbttxt;
}
if( ! Platform.isModified( $setfol[fnd]\txtpay ) )
{
$setfol[fnd]\txtpay = $wrkfcp\paytxt;
}
if( ! Platform.isModified( $setfol[fnd]\dat1 ) )
{
$setfol[fnd]\dat1 = $wrkfcp\dat1;
}
if( ! Platform.isModified( $setfol[fnd]\dat2 ) )
{
$setfol[fnd]\dat2 = $wrkfcp\dat2;
}
}
}
if( Platform.errorCode() != tdOdbcNotFound )
{
Platform.reraise();
}
// remove entries not longer in database
stmCnt = Platform.streamCount( oldIdxStm );
for(int i = 1;i <= stmCnt;i++)
{
fnd = Platform.parseInt( Platform.getLine( oldIdxStm, i ) );
Platform.clear( $setfol[fnd] );
}
break;
}
}
}
// #######TODO 改写 LABEL与GOTO #### label setmac
Platform.postDefaultRule( $macbog );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $macbog.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $macbog;
rclCnt = rclCnt + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto RclStart
// #### label setmac
Platform.postDefaultRule( $macbog );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $macbog.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $macbog;
rclCnt = rclCnt + 1;
//return ; // #### goto RclStart
continue RclStart;
}
break;
}
$macbogold = $macbog;
......
......@@ -5,18 +5,23 @@ void recalcSetfol(String argrow)
int rclCnt = 0;
Platform.postDefaultRule( $mac );
String rclMacOld = $mac;
// #######TODO 改写 LABEL与GOTO #### label RclStart
// #### label RclStart
// Default fields standard
recalcSetfolStdDft( argrow );
// Do installation specific defaulting
recalcSetfolIsfDft( argrow );
Platform.postDefaultRule( $mac );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $mac.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $mac;
rclCnt = rclCnt + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto RclStart
RclStart:
while(true){
recalcSetfolStdDft( argrow );
// Do installation specific defaulting
recalcSetfolIsfDft( argrow );
Platform.postDefaultRule( $mac );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $mac.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $mac;
rclCnt = rclCnt + 1;
//return ; // #### goto RclStart
continue RclStart;
}
break;
}
$macold = $mac;
setCusPanelDescription();
......
......@@ -3,39 +3,44 @@ void recalcSetglgBog()
int rclCnt = 0;
Platform.postDefaultRule( $mac );
String rclMacOld = $mac;
// #######TODO 改写 LABEL与GOTO #### label RclStart
// Collect amounts
internalWrkSumCollect();
// load temporary info (if picked up)
if( ! Platform.isEmpty( $\setmod\sep\inr ) )
{
internalGetGlp();
}
// distribue to booking grid
internalGlgDistrib();
$totamt = new BigDecimal("0");
int gridcnt = Platform.gridCount( $setgll );
for(int i = 1;i <= gridcnt;i++)
{
$totamt = Platform.numAdd($totamt.getValue() , Platform.abs( $setgll[i]\amt.getValue() ));
}
// set label showing temporary settlement
if( Platform.compareTo( $dspflg.getValue() , "C" ) == 0 )
{
Platform.visible( $labdspflg );
$labdspflg = Platform.getCodetableLabelOfTd( $dspflg.getValue(), "SETMOD:DSPFLG", Platform.getLang() );
}
else
{
Platform.invisible( $labdspflg );
}
Platform.postDefaultRule( $mac );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $mac.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $mac;
rclCnt = rclCnt + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto RclStart
// #### label RclStart
RclStart:
while(true){
// Collect amounts
internalWrkSumCollect();
// load temporary info (if picked up)
if( ! Platform.isEmpty( $\setmod\sep\inr ) )
{
internalGetGlp();
}
// distribue to booking grid
internalGlgDistrib();
$totamt = new BigDecimal("0");
int gridcnt = Platform.gridCount( $setgll );
for(int i = 1;i <= gridcnt;i++)
{
$totamt = Platform.numAdd($totamt.getValue() , Platform.abs( $setgll[i]\amt.getValue() ));
}
// set label showing temporary settlement
if( Platform.compareTo( $dspflg.getValue() , "C" ) == 0 )
{
Platform.visible( $labdspflg );
$labdspflg = Platform.getCodetableLabelOfTd( $dspflg.getValue(), "SETMOD:DSPFLG", Platform.getLang() );
}
else
{
Platform.invisible( $labdspflg );
}
Platform.postDefaultRule( $mac );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $mac.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $mac;
rclCnt = rclCnt + 1;
//return ; // #### goto RclStart
continue RclStart;
}
break;
}
$macold = $mac;
......
......@@ -60,73 +60,73 @@ void internalGllAdjust(BigDecimal argamt,String argcur,String srcmod,int srcidx)
BigDecimal b = argamt;
int free = -1;
int gridcnt = Platform.gridCount( $setgll );
// #######TODO 改写 LABEL与GOTO #### label lopfee
// #### label lopfee
lopfee:
while(true){
f = f + 1;
if( f > gridcnt ) {
//return ; // #######TODO #### goto lopend
//return ; // #### goto lopend
break lopfee;
}
if( Platform.isEmpty( $setgll[f]\rol ) ) {
if( free < 0 ) {
free = f;
}
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo(r, $setgll[f]\rol.getValue()) != 0 ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo(argcur, $setgll[f]\cur.getValue()) != 0 ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo(d, $setgll[f]\flg.getValue()) != 0 ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo(gllGrp, $setgll[f]\gllgrp.getValue()) != 0 ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo(fcdinr, $setgll[f]\fcdinr.getValue()) != 0 ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo(act, $setgll[f]\act.getValue()) != 0 && Platform.compareTo( dspflg , "A" ) == 0 ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo( dspflg , "A" ) == 0 && Platform.compareTo($setgll[f]\dspflg.getValue(), "A") != 0 ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo(dspflg, "A") != 0 && Platform.compareTo( $setgll[f]\dspflg , "A" ) == 0 ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo( dspflg , "C" ) == 0 && Platform.compareTo($setgll[f]\dspflg.getValue(), "C") != 0 ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo(dspflg, "C") != 0 && Platform.compareTo( $setgll[f]\dspflg , "C" ) == 0 ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo( dspflg , "F" ) == 0 && Platform.compareTo($setgll[f]\dspflg.getValue(), "F") != 0 ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo(dspflg, "F") != 0 && Platform.compareTo( $setgll[f]\dspflg , "F" ) == 0 ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
// don`t mix debits and credits (if not allowed by SetDebCreAlw)
if( Platform.Sgn( $setgll[f]\amt.getValue() ) * Platform.Sgn( argamt ) < 0 && Platform.isEmpty( $\setmod\debcrealwflg ) ) {
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
if( Platform.compareTo( $setgll[f]\modflg , "-" ) == 0 ) {
......@@ -144,14 +144,14 @@ void internalGllAdjust(BigDecimal argamt,String argcur,String srcmod,int srcidx)
$setgll[f]\donflg = "x";
internalSetValdat( f, valdat );
}
//return ; // #######TODO #### goto lopfee
//return ; // #### goto lopfee
continue lopfee;
}
// #######TODO 改写 LABEL与GOTO #### label lopend
// #### label lopend
if( Platform.compareTo( b , 0 ) == 0 && ( Platform.isEmpty( amtIDsStm ) || Platform.isEmpty( $creemplinflg ) ) )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto subend
return ; // #### goto subend
}
if( n < 0 )
{
......@@ -331,6 +331,6 @@ void internalGllAdjust(BigDecimal argamt,String argcur,String srcmod,int srcidx)
}
}
Platform.resetModified( $setgll[f]\amt.getValue() );
// #######TODO 改写 LABEL与GOTO #### label subend
// #### label subend
}
\ No newline at end of file
......@@ -22,12 +22,12 @@ void internalGlgDistrib()
int i = 1;
String trnset = "";
// #### label lop1
lop1:
while(true){
// #######TODO 改写 LABEL与GOTO #### label lop1
if( i > gridcnt )
{
//return ; // #######TODO 改写 LABEL与GOTO #### goto don1
//return ; // #### goto don1
break lop1;
}
$setgll[i]\donflg = " ";
......@@ -46,10 +46,10 @@ void internalGlgDistrib()
$setgll[i]\setxxxrow = setSumMax;
}
i = i + 1;
//return ; // #######TODO 改写 LABEL与GOTO #### goto lop1
//return ; // #### goto lop1
continue lop1;
}
// #######TODO 改写 LABEL与GOTO #### label don1
// #### label don1
// Check all lines of Workgrid and add, if necessary
for(int f = 1;f <= gridcnt;f++)
{
......@@ -61,27 +61,27 @@ void internalGlgDistrib()
lopwrk:
while(true){
// #######TODO 改写 LABEL与GOTO #### label lopwrk
// #### label lopwrk
w = w + 1;
if( w > Platform.streamCount( $wrksumcon.getValue() ) )
{
//return ; // #######TODO 改写 LABEL与GOTO #### goto donwrk
//return ; // #### goto donwrk
break lopwrk;
}
internalWrksumGetByIdx( w );
internalGllAdjust( $wrksum\amt.getValue(), $wrksum\cur.getValue(), "WRKSUM", w );
// return ; // #######TODO 改写 LABEL与GOTO #### goto lopwrk
// return ; // #### goto lopwrk
continue lopwrk;
}
// #######TODO 改写 LABEL与GOTO #### label donwrk
// #### label donwrk
int f = 1;
lopfee2:
while(true){
// #######TODO 改写 LABEL与GOTO #### label lopfee2
// #### label lopfee2
if( f > gridcnt )
{
//return ; // #######TODO 改写 LABEL与GOTO #### goto donfee2
//return ; // #### goto donfee2
break lopfee2;
}
if( Platform.compareTo( $setgll[f]\donflg , " " ) == 0 )
......@@ -98,11 +98,11 @@ void internalGlgDistrib()
}
}
f = f + 1;
//return ; // #######TODO 改写 LABEL与GOTO #### goto lopfee2
//return ; // #### goto lopfee2
continue lopfee2;
}
// #######TODO 改写 LABEL与GOTO #### label donfee2
// #### label donfee2
for( f = 1;f <= gridcnt;f++)
{
if( Platform.compareTo($setgll[f]\accamtfix.getValue(), "T") != 0 )
......
......@@ -3,92 +3,97 @@ void recalcSetglgEog()
int rclCnt = 0;
Platform.postDefaultRule( $maceog );
String rclMacOld = $maceog;
// #######TODO 改写 LABEL与GOTO #### label RclStart
// #### label RclStart
// redistibute ACCCPRAMT
// Control stream holding line for acccpramt for CPRMACs
// Format : MAC+TAB+ Str(line)
IStream ctlStm = new StreamImpl();
Platform.streamClear( ctlStm );
int gridcnt = Platform.gridCount( $setgll );
int ctlIdx = 0;
String ctllin = NULLSTR;
int oldlin = 0;
for(int i = 1;i <= gridcnt;i++)
{
if( Platform.isEmpty( $setgll[i]\accamt ) )
{
Platform.clear( $setgll[i]\acccpramt );
}
else
{
ctlIdx = Platform.streamSearch( ctlStm, $setgll[i]\cprmac.getValue() + "\t" );
if( ctlIdx == 0 )
RclStart:
while(true){
IStream ctlStm = new StreamImpl();
Platform.streamClear( ctlStm );
int gridcnt = Platform.gridCount( $setgll );
int ctlIdx = 0;
String ctllin = NULLSTR;
int oldlin = 0;
for(int i = 1;i <= gridcnt;i++)
{
$setgll[i]\acccpramt = $setgll[i]\accamt;
Platform.streamInsert( ctlStm, 0, $setgll[i]\cprmac.getValue() + "\t" + Platform.toString( i ) );
Platform.streamClear( $setgll[i]\cprlinlst.getValue() );
Platform.streamInsert( $setgll[i]\cprlinlst.getValue(), 0, Platform.toString( i ) );
}
else
{
ctllin = Platform.getLine( ctlStm, ctlIdx );
oldlin = Platform.parseInt( Platform.mid( ctllin, Platform.pos( ctllin, "\t" ) + 1 ) );
Platform.clear( $setgll[i]\acccpramt );
// the old line gets amount of this line, if same direction or amount in old line is greater or equal amount of this line
if( Platform.Sgn( $setgll[oldlin]\acccpramt.getValue() ) == Platform.Sgn( $setgll[i]\accamt.getValue() ) || Platform.abs( $setgll[oldlin]\acccpramt.getValue() ).compareTo(Platform.abs( $setgll[i]\accamt.getValue() )) >= 0 )
if( Platform.isEmpty( $setgll[i]\accamt ) )
{
$setgll[oldlin]\acccpramt = Platform.numAdd($setgll[oldlin]\acccpramt.getValue() , $setgll[i]\accamt.getValue());
Platform.streamClear( $setgll[i]\cprlinlst.getValue() );
Platform.streamInsert( $setgll[oldlin]\cprlinlst.getValue(), 0, Platform.toString( i ) );
Platform.clear( $setgll[i]\acccpramt );
}
else
{
// otherwise this line is the new line for the compressed amount
$setgll[i]\acccpramt = Platform.numAdd($setgll[oldlin]\acccpramt.getValue() , $setgll[i]\accamt.getValue());
Platform.streamSetLine( ctlStm, ctlIdx, $setgll[i]\cprmac.getValue() + "\t" + Platform.toString( i ) );
Platform.streamSet( $setgll[i]\cprlinlst.getValue(), $setgll[oldlin]\cprlinlst.getValue() );
Platform.streamInsert( $setgll[i]\cprlinlst.getValue(), 0, Platform.toString( i ) );
$setgll[oldlin]\acccpramt = new BigDecimal("0");
Platform.streamClear( $setgll[oldlin]\cprlinlst.getValue() );
ctlIdx = Platform.streamSearch( ctlStm, $setgll[i]\cprmac.getValue() + "\t" );
if( ctlIdx == 0 )
{
$setgll[i]\acccpramt = $setgll[i]\accamt;
Platform.streamInsert( ctlStm, 0, $setgll[i]\cprmac.getValue() + "\t" + Platform.toString( i ) );
Platform.streamClear( $setgll[i]\cprlinlst.getValue() );
Platform.streamInsert( $setgll[i]\cprlinlst.getValue(), 0, Platform.toString( i ) );
}
else
{
ctllin = Platform.getLine( ctlStm, ctlIdx );
oldlin = Platform.parseInt( Platform.mid( ctllin, Platform.pos( ctllin, "\t" ) + 1 ) );
Platform.clear( $setgll[i]\acccpramt );
// the old line gets amount of this line, if same direction or amount in old line is greater or equal amount of this line
if( Platform.Sgn( $setgll[oldlin]\acccpramt.getValue() ) == Platform.Sgn( $setgll[i]\accamt.getValue() ) || Platform.abs( $setgll[oldlin]\acccpramt.getValue() ).compareTo(Platform.abs( $setgll[i]\accamt.getValue() )) >= 0 )
{
$setgll[oldlin]\acccpramt = Platform.numAdd($setgll[oldlin]\acccpramt.getValue() , $setgll[i]\accamt.getValue());
Platform.streamClear( $setgll[i]\cprlinlst.getValue() );
Platform.streamInsert( $setgll[oldlin]\cprlinlst.getValue(), 0, Platform.toString( i ) );
}
else
{
// otherwise this line is the new line for the compressed amount
$setgll[i]\acccpramt = Platform.numAdd($setgll[oldlin]\acccpramt.getValue() , $setgll[i]\accamt.getValue());
Platform.streamSetLine( ctlStm, ctlIdx, $setgll[i]\cprmac.getValue() + "\t" + Platform.toString( i ) );
Platform.streamSet( $setgll[i]\cprlinlst.getValue(), $setgll[oldlin]\cprlinlst.getValue() );
Platform.streamInsert( $setgll[i]\cprlinlst.getValue(), 0, Platform.toString( i ) );
$setgll[oldlin]\acccpramt = new BigDecimal("0");
Platform.streamClear( $setgll[oldlin]\cprlinlst.getValue() );
}
}
}
}
}
}
for(int i = 1;i <= gridcnt;i++)
{
$setgll[i]\fmtacccpramt = Platform.abs( $setgll[i]\acccpramt.getValue() );
switch( Platform.streamCount( $setgll[i]\cprlinlst.getValue() ) )
{
case 1:
Platform.setTDStyle( "", $setgll[i]\fmtaccamt );
Platform.setHint( $setgll[i]\fmtaccamt.getValue(), "" );
Platform.invisible( $setgll[i]\cprbut );
Platform.invisible( $setgll[i]\cprp );
break;
case 0:
Platform.setTDStyle( "green", $setgll[i]\fmtaccamt );
Platform.setHint( $setgll[i]\fmtaccamt.getValue(), #CT000006 );
Platform.visible( $setgll[i]\cprbut );
Platform.invisible( $setgll[i]\cprp );
for(int i = 1;i <= gridcnt;i++)
{
$setgll[i]\fmtacccpramt = Platform.abs( $setgll[i]\acccpramt.getValue() );
switch( Platform.streamCount( $setgll[i]\cprlinlst.getValue() ) )
{
case 1:
Platform.setTDStyle( "", $setgll[i]\fmtaccamt );
Platform.setHint( $setgll[i]\fmtaccamt.getValue(), "" );
Platform.invisible( $setgll[i]\cprbut );
Platform.invisible( $setgll[i]\cprp );
break;
case 0:
Platform.setTDStyle( "green", $setgll[i]\fmtaccamt );
Platform.setHint( $setgll[i]\fmtaccamt.getValue(), #CT000006 );
Platform.visible( $setgll[i]\cprbut );
Platform.invisible( $setgll[i]\cprp );
break;
default:
Platform.setTDStyle( "blue", $setgll[i]\fmtaccamt );
Platform.setHint( $setgll[i]\fmtaccamt.getValue(), #CT000005, $setgll[i]\acccur.getValue(), Platform.fmtAmount( Platform.abs( $setgll[i]\acccpramt.getValue() ), $setgll[i]\acccur.getValue() ), getCprAdd( i ) );
Platform.invisible( $setgll[i]\cprbut );
Platform.visible( $setgll[i]\cprp );
}
}
if( ! Platform.isEmpty( $\setmod\sep\inr ) )
{
internalGlpCheck();
}
Platform.postDefaultRule( $maceog );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $maceog.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $maceog;
rclCnt = rclCnt + 1;
//return ; // #### goto RclStart
continue RclStart;
}
break;
default:
Platform.setTDStyle( "blue", $setgll[i]\fmtaccamt );
Platform.setHint( $setgll[i]\fmtaccamt.getValue(), #CT000005, $setgll[i]\acccur.getValue(), Platform.fmtAmount( Platform.abs( $setgll[i]\acccpramt.getValue() ), $setgll[i]\acccur.getValue() ), getCprAdd( i ) );
Platform.invisible( $setgll[i]\cprbut );
Platform.visible( $setgll[i]\cprp );
}
}
if( ! Platform.isEmpty( $\setmod\sep\inr ) )
{
internalGlpCheck();
}
Platform.postDefaultRule( $maceog );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $maceog.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $maceog;
rclCnt = rclCnt + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto RclStart
}
$maceogold = $maceog;
......
......@@ -103,7 +103,7 @@ boolean checkXrtChg()
return true;
}
}
// #######TODO 改写 LABEL与GOTO #### label done
// #### label done
return false;
}
\ No newline at end of file
......@@ -4,30 +4,35 @@ void recalcSetgll(String argrow)
int rclCnt = 0;
Platform.postDefaultRule( $mac );
String rclMacOld = $mac;
// #######TODO 改写 LABEL与GOTO #### label RclStart
// #### label RclStart
// Reset depending fields on changes
internalResetDependingFields();
// Default fields standard
recalcSetgllStdDft( argrow );
// Do installation specific defaulting
recalcSetgllIsfDft();
$cprmac = getCprMac();
// from default ROLACTID (as PAOFLG is defaulted in RecalcSetgllIsfDft)
if( Platform.isEmpty( $paoflg ) )
{
$\sysmod.disableAndClearField( Platform.getDatafield(this,"rolactid") );
}
else
{
Platform.enable( $rolactid );
}
Platform.postDefaultRule( $mac );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $mac.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $mac;
rclCnt = rclCnt + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto RclStart
RclStart:
while(true){
internalResetDependingFields();
// Default fields standard
recalcSetgllStdDft( argrow );
// Do installation specific defaulting
recalcSetgllIsfDft();
$cprmac = getCprMac();
// from default ROLACTID (as PAOFLG is defaulted in RecalcSetgllIsfDft)
if( Platform.isEmpty( $paoflg ) )
{
$\sysmod.disableAndClearField( Platform.getDatafield(this,"rolactid") );
}
else
{
Platform.enable( $rolactid );
}
Platform.postDefaultRule( $mac );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $mac.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $mac;
rclCnt = rclCnt + 1;
//return ; // #### goto RclStart
continue RclStart;
}
break;
}
setCusPanelDescription();
$macold = $mac;
......
......@@ -3,537 +3,542 @@ void clcrat()
//! calulation of rates and rate types
boolean restarted = false;
boolean valuesSet = false;
// #######TODO 改写 LABEL与GOTO #### label restart
// #### label restart
// use valdat as rate date. If valdat not available use Today
Date vald = null;
if( Platform.isEmpty( $valdat ) )
{
vald = Platform.today();
}
else
{
vald = $valdat;
}
vald = Platform.today();
clcratSetTypes();
boolean ininflg = false;
// no conversion if currencies are the same
String sysCur = NULLSTR;
String newcur = NULLSTR;
String newacccur = NULLSTR;
String cur1 = NULLSTR;
String cur2 = NULLSTR;
Date curdat = null;
BigDecimal cur1dif = null;
BigDecimal cur2dif = null;
Date accdat = null;
if( Platform.compareTo( $acccur.getValue() , $cur.getValue() ) == 0 )
{
Platform.disable( $dcbextrat );
Platform.disable( $dcbsqrrat );
Platform.disable( $dcbrattyp );
Platform.disable( $scbextrat );
Platform.disable( $scbsqrrat );
Platform.disable( $scbrattyp );
Platform.disable( $rat );
$rat = new BigDecimal("1");
$dcbextrat = new BigDecimal("1");
$dcbsqrrat = new BigDecimal("1");
$scbextrat = new BigDecimal("1");
$scbsqrrat = new BigDecimal("1");
$dcbresrat = new BigDecimal("1");
$dcbrebrat = new BigDecimal("1");
$scbresrat = new BigDecimal("1");
$scbrebrat = new BigDecimal("1");
Platform.clear( $ratcurlab );
Platform.clear( $dcbratlab );
Platform.clear( $scbratlab );
$\sysmod.disableAndClearField( Platform.getDatafield(this,"rattyp") );
Platform.clear( $xrtdatacc );
Platform.clear( $xrtdatcur );
Platform.setFieldValue( $rattyp, "" );
valuesSet = true;
}
else
{
//取牌价时间、卖价、买价和中间价
Argument<String> pathBox = new Argument<String>("",$xrttim.getValue());
Argument<BigDecimal> pathBox1 = new Argument<BigDecimal>("",$buyrat.getValue());
Argument<BigDecimal> pathBox2 = new Argument<BigDecimal>("",$selrat.getValue());
Argument<BigDecimal> pathBox3 = new Argument<BigDecimal>("",$midrat.getValue());
Argument<BigDecimal> pathBox4 = new Argument<BigDecimal>("",$buy1rat.getValue());
$\cbsmod\xrtmod.getratCebTim ( $cur.getValue(), $acccur.getValue(), Platform.today(), pathBox, pathBox1, pathBox2, pathBox3, pathBox4 );
$xrttim = pathBox.value;
$buyrat = pathBox1.value;
$selrat = pathBox2.value;
$midrat = pathBox3.value;
$buy1rat = pathBox4.value;
//-------modify by zt ------
//取出汇率优惠值
/**
$BuyRat = BUYRAT
$SelRat = SELRAT
GetFavRatForPTY( \TRNMOD\PTSMOD\PTY, $BuyRatTyp, $BuyRat, $SelRatTyp, $SelRat )
PREBUYRAT = $BuyRat
PRESELRAT = $SelRat
BUYRATTYP = $BuyRatTyp
SELRATTYP = $SelRatTyp
**/
sysCur = $\cbsmod\xrtmod.sysiso();
if( Platform.compareTo( $cur.getValue() , sysCur ) == 0 && Platform.compareTo($acccur.getValue(), sysCur) != 0 )
{
Platform.dbRead( $\trnmod\ptsmod\ptyrat, $\trnmod\ptsmod\pty\inr.getValue(), "PTYINR", $acccur.getValue(), "CUR" );
if( Platform.errorCode() == tdOdbcNotFound )
restart:
while(true){
Date vald = null;
if( Platform.isEmpty( $valdat ) )
{
Platform.clear( $\trnmod\ptsmod\ptyrat );
}
}
else
{
if( Platform.compareTo( $acccur.getValue() , sysCur ) == 0 && Platform.compareTo($cur.getValue(), sysCur) != 0 )
{
Platform.dbRead( $\trnmod\ptsmod\ptyrat, $\trnmod\ptsmod\pty\inr.getValue(), "PTYINR", $cur.getValue(), "CUR" );
if( Platform.errorCode() == tdOdbcNotFound )
{
Platform.clear( $\trnmod\ptsmod\ptyrat );
}
vald = Platform.today();
}
else
{
Platform.clear( $\trnmod\ptsmod\ptyrat );
vald = $valdat;
}
}
$prebuyrat = $\trnmod\ptsmod\ptyrat\buyrat;
$preselrat = $\trnmod\ptsmod\ptyrat\selrat;
$buyrattyp = $\trnmod\ptsmod\ptyrat\buytyp;
$selrattyp = $\trnmod\ptsmod\ptyrat\seltyp;
//-----------end--------------
// set currencies involved in conversion (incl. IN/IN specials)
ininflg = false;
Argument<String> newcurBox = new Argument<String>();
Argument<String> newacccurBox = new Argument<String>();
Argument<String> pathBox5 = new Argument<String>("",$bascur.getValue());
Argument<Boolean> ininflgBox = new Argument<Boolean>("",ininflg);
$\cbsmod\xrtmod.xrtCheckInIn( $cur.getValue(), $acccur.getValue(), newcurBox, newacccurBox, pathBox5, ininflgBox );
newcur = newcurBox.value;
newacccur = newacccurBox.value;
$bascur = pathBox5.value;
ininflg = ininflgBox.value;
if( Platform.isEmpty( newcur ) || ininflg )
{
cur1 = $cur;
}
else
{
cur1 = newcur;
}
if( Platform.isEmpty( newacccur ) || ininflg )
{
cur2 = $acccur;
}
else
{
cur2 = newacccur;
}
$ratcurlab = cur1 + "/" + cur2;
$dcbratlab = cur1 + "/" + $bascur.getValue();
$scbratlab = $bascur.getValue() + "/" + cur2;
// if in/in or forward contract disable everything
if( ininflg || ( ! Platform.isEmpty( $fcdinr ) ) )
{
Platform.disable( $dcbextrat );
Platform.disable( $dcbsqrrat );
Platform.disable( $dcbrattyp );
Platform.disable( $scbextrat );
Platform.disable( $scbsqrrat );
Platform.disable( $scbrattyp );
Platform.disable( $rat );
Platform.disable( $rattyp );
// for forward contract set forward contract rate type
if( ! Platform.isEmpty( $fcdinr ) )
{
$rattyp = "C";
Platform.setFieldValue( $rattyp, "C" );
valuesSet = true;
$dcbrattyp = "R";
$scbrattyp = "R";
// SCBEXTRAT & DCBEXTRAT are already set via SetglgAddAmtFldExtRat
}
else
vald = Platform.today();
clcratSetTypes();
boolean ininflg = false;
// no conversion if currencies are the same
String sysCur = NULLSTR;
String newcur = NULLSTR;
String newacccur = NULLSTR;
String cur1 = NULLSTR;
String cur2 = NULLSTR;
Date curdat = null;
BigDecimal cur1dif = null;
BigDecimal cur2dif = null;
Date accdat = null;
if( Platform.compareTo( $acccur.getValue() , $cur.getValue() ) == 0 )
{
Platform.disable( $dcbextrat );
Platform.disable( $dcbsqrrat );
Platform.disable( $dcbrattyp );
Platform.disable( $scbextrat );
Platform.disable( $scbsqrrat );
Platform.disable( $scbrattyp );
Platform.disable( $rat );
$rat = new BigDecimal("1");
$dcbextrat = new BigDecimal("1");
$dcbsqrrat = new BigDecimal("1");
$scbextrat = new BigDecimal("1");
$scbsqrrat = new BigDecimal("1");
$dcbresrat = new BigDecimal("1");
$dcbrebrat = new BigDecimal("1");
$scbresrat = new BigDecimal("1");
$scbrebrat = new BigDecimal("1");
Platform.clear( $ratcurlab );
Platform.clear( $dcbratlab );
Platform.clear( $scbratlab );
$\sysmod.disableAndClearField( Platform.getDatafield(this,"rattyp") );
Platform.clear( $xrtdatacc );
Platform.clear( $xrtdatcur );
Platform.setFieldValue( $rattyp, "" );
valuesSet = true;
}
}
else
{
// otherwise allow change of ratetype
Platform.disable( $dcbextrat );
Platform.disable( $dcbsqrrat );
Platform.disable( $dcbrattyp );
Platform.disable( $scbextrat );
Platform.disable( $scbsqrrat );
Platform.disable( $scbrattyp );
/**
//需要灰显
Disable( RATTYP )
**/
Platform.enable( $rattyp );
// get currency with bigger margin (only in crosrate calculations i.e. both currencies are not base currency)
$\cbsmod\xrtmod.getXrt( cur1, vald, $\cbsmod\xrtmod\cur, $\cbsmod\xrtmod\xrt );
// show begin-date of exchange rate of CUR
curdat = $\cbsmod\xrtmod\xrt\begdat;
$xrtdatcur = curdat;
// avoid dump if rate is not available (no difference for BASCUR)
if( Platform.compareTo( cur1 , $bascur.getValue() ) == 0 )
{
cur1dif = new BigDecimal("0");
}
else
{
if( Platform.compareTo($\cbsmod\xrtmod\xrt\buyrat.getValue(), 0) != 0 && Platform.compareTo($\cbsmod\xrtmod\xrt\selrat.getValue(), 0) != 0 )
//取牌价时间、卖价、买价和中间价
Argument<String> pathBox = new Argument<String>("",$xrttim.getValue());
Argument<BigDecimal> pathBox1 = new Argument<BigDecimal>("",$buyrat.getValue());
Argument<BigDecimal> pathBox2 = new Argument<BigDecimal>("",$selrat.getValue());
Argument<BigDecimal> pathBox3 = new Argument<BigDecimal>("",$midrat.getValue());
Argument<BigDecimal> pathBox4 = new Argument<BigDecimal>("",$buy1rat.getValue());
$\cbsmod\xrtmod.getratCebTim ( $cur.getValue(), $acccur.getValue(), Platform.today(), pathBox, pathBox1, pathBox2, pathBox3, pathBox4 );
$xrttim = pathBox.value;
$buyrat = pathBox1.value;
$selrat = pathBox2.value;
$midrat = pathBox3.value;
$buy1rat = pathBox4.value;
//-------modify by zt ------
//取出汇率优惠值
/**
$BuyRat = BUYRAT
$SelRat = SELRAT
GetFavRatForPTY( \TRNMOD\PTSMOD\PTY, $BuyRatTyp, $BuyRat, $SelRatTyp, $SelRat )
PREBUYRAT = $BuyRat
PRESELRAT = $SelRat
BUYRATTYP = $BuyRatTyp
SELRATTYP = $SelRatTyp
**/
sysCur = $\cbsmod\xrtmod.sysiso();
if( Platform.compareTo( $cur.getValue() , sysCur ) == 0 && Platform.compareTo($acccur.getValue(), sysCur) != 0 )
{
cur1dif = Platform.numDiv($\cbsmod\xrtmod\xrt\selrat.getValue() , $\cbsmod\xrtmod\xrt\buyrat.getValue());
Platform.dbRead( $\trnmod\ptsmod\ptyrat, $\trnmod\ptsmod\pty\inr.getValue(), "PTYINR", $acccur.getValue(), "CUR" );
if( Platform.errorCode() == tdOdbcNotFound )
{
Platform.clear( $\trnmod\ptsmod\ptyrat );
}
}
else
{
cur1dif = new BigDecimal("0");
Platform.error( $rat, #CT000118, cur1 );
if(1==1) return;
if( Platform.compareTo( $acccur.getValue() , sysCur ) == 0 && Platform.compareTo($cur.getValue(), sysCur) != 0 )
{
Platform.dbRead( $\trnmod\ptsmod\ptyrat, $\trnmod\ptsmod\pty\inr.getValue(), "PTYINR", $cur.getValue(), "CUR" );
if( Platform.errorCode() == tdOdbcNotFound )
{
Platform.clear( $\trnmod\ptsmod\ptyrat );
}
}
else
{
Platform.clear( $\trnmod\ptsmod\ptyrat );
}
}
}
$\cbsmod\xrtmod.getXrt( cur2, vald, $\cbsmod\xrtmod\cur, $\cbsmod\xrtmod\xrt );
// avoid dump if rate is not available (no difference for BASCUR)
if( Platform.compareTo( cur2 , $bascur.getValue() ) == 0 )
{
cur2dif = new BigDecimal("0");
}
else
{
if( Platform.compareTo($\cbsmod\xrtmod\xrt\buyrat.getValue(), 0) != 0 && Platform.compareTo($\cbsmod\xrtmod\xrt\selrat.getValue(), 0) != 0 )
$prebuyrat = $\trnmod\ptsmod\ptyrat\buyrat;
$preselrat = $\trnmod\ptsmod\ptyrat\selrat;
$buyrattyp = $\trnmod\ptsmod\ptyrat\buytyp;
$selrattyp = $\trnmod\ptsmod\ptyrat\seltyp;
//-----------end--------------
// set currencies involved in conversion (incl. IN/IN specials)
ininflg = false;
Argument<String> newcurBox = new Argument<String>();
Argument<String> newacccurBox = new Argument<String>();
Argument<String> pathBox5 = new Argument<String>("",$bascur.getValue());
Argument<Boolean> ininflgBox = new Argument<Boolean>("",ininflg);
$\cbsmod\xrtmod.xrtCheckInIn( $cur.getValue(), $acccur.getValue(), newcurBox, newacccurBox, pathBox5, ininflgBox );
newcur = newcurBox.value;
newacccur = newacccurBox.value;
$bascur = pathBox5.value;
ininflg = ininflgBox.value;
if( Platform.isEmpty( newcur ) || ininflg )
{
cur2dif = Platform.numDiv($\cbsmod\xrtmod\xrt\selrat.getValue() , $\cbsmod\xrtmod\xrt\buyrat.getValue());
cur1 = $cur;
}
else
{
cur2dif = new BigDecimal("0");
Platform.error( $rat, #CT000120, cur2 );
if(1==1) return;
cur1 = newcur;
}
}
// show begin-date of exchange rate of ACCCUR
accdat = $\cbsmod\xrtmod\xrt\begdat;
$xrtdatacc = accdat;
// set middle rate for curreny with smaller margin, selling/buying for the other
/**
if ( $cur2 <> BASCUR and $cur1dif > $cur2dif ) or $cur1 == BASCUR then
if DCBRATTYP <> "F" and Len( RATTYP ) <> 1 then
DCBRATTYP = "M"
endif
**/
if( Platform.len( $rattyp.getValue() ) == 1 )
{
Platform.enable( $scbrattyp );
}
/**
else
if SCBRATTYP <> "F" and Len( RATTYP ) <> 1 then
SCBRATTYP = "M"
endif
**/
if( Platform.len( $rattyp.getValue() ) == 1 )
{
Platform.enable( $dcbrattyp );
}
// endif
}
// rate calulation:
switch( $rattyp.getValue() )
{
// for crossrates, the crossrate can be entered and the rate not beeing the middle rate is calculated from crossrate ane middle rate
case "RX":
case "FX":
Platform.enable( $rat );
if( Platform.compareTo( $dcbrattyp.getValue() , "M" ) == 0 )
{
if( Platform.compareTo( cur1 , $bascur.getValue() ) == 0 || Platform.compareTo( cur2 , $bascur.getValue() ) == 0 )
if( Platform.isEmpty( newacccur ) || ininflg )
{
$scbextrat = $rat;
cur2 = $acccur;
}
else
{
cur2 = newacccur;
}
$ratcurlab = cur1 + "/" + cur2;
$dcbratlab = cur1 + "/" + $bascur.getValue();
$scbratlab = $bascur.getValue() + "/" + cur2;
// if in/in or forward contract disable everything
if( ininflg || ( ! Platform.isEmpty( $fcdinr ) ) )
{
Platform.disable( $dcbextrat );
Platform.disable( $dcbsqrrat );
Platform.disable( $dcbrattyp );
Platform.disable( $scbextrat );
Platform.disable( $scbsqrrat );
Platform.disable( $scbrattyp );
Platform.disable( $rat );
Platform.disable( $rattyp );
// for forward contract set forward contract rate type
if( ! Platform.isEmpty( $fcdinr ) )
{
$rattyp = "C";
Platform.setFieldValue( $rattyp, "C" );
valuesSet = true;
$dcbrattyp = "R";
$scbrattyp = "R";
// SCBEXTRAT & DCBEXTRAT are already set via SetglgAddAmtFldExtRat
}
else
{
Platform.setFieldValue( $rattyp, "" );
valuesSet = true;
}
}
else
{
if( $\cbsmod\xrtmod.xrtCrossRateDirFlg( cur1, cur2, $dcbextrat.getValue(), $scbextrat.getValue() ) )
// otherwise allow change of ratetype
Platform.disable( $dcbextrat );
Platform.disable( $dcbsqrrat );
Platform.disable( $dcbrattyp );
Platform.disable( $scbextrat );
Platform.disable( $scbsqrrat );
Platform.disable( $scbrattyp );
/**
//需要灰显
Disable( RATTYP )
**/
Platform.enable( $rattyp );
// get currency with bigger margin (only in crosrate calculations i.e. both currencies are not base currency)
$\cbsmod\xrtmod.getXrt( cur1, vald, $\cbsmod\xrtmod\cur, $\cbsmod\xrtmod\xrt );
// show begin-date of exchange rate of CUR
curdat = $\cbsmod\xrtmod\xrt\begdat;
$xrtdatcur = curdat;
// avoid dump if rate is not available (no difference for BASCUR)
if( Platform.compareTo( cur1 , $bascur.getValue() ) == 0 )
{
cur1dif = new BigDecimal("0");
}
else
{
if( Platform.compareTo($\cbsmod\xrtmod\xrt\buyrat.getValue(), 0) != 0 && Platform.compareTo($\cbsmod\xrtmod\xrt\selrat.getValue(), 0) != 0 )
{
cur1dif = Platform.numDiv($\cbsmod\xrtmod\xrt\selrat.getValue() , $\cbsmod\xrtmod\xrt\buyrat.getValue());
}
else
{
cur1dif = new BigDecimal("0");
Platform.error( $rat, #CT000118, cur1 );
if(1==1) return;
}
}
$\cbsmod\xrtmod.getXrt( cur2, vald, $\cbsmod\xrtmod\cur, $\cbsmod\xrtmod\xrt );
// avoid dump if rate is not available (no difference for BASCUR)
if( Platform.compareTo( cur2 , $bascur.getValue() ) == 0 )
{
cur2dif = new BigDecimal("0");
}
else
{
if( Platform.compareTo( $rat.getValue() , 0 ) == 0 )
if( Platform.compareTo($\cbsmod\xrtmod\xrt\buyrat.getValue(), 0) != 0 && Platform.compareTo($\cbsmod\xrtmod\xrt\selrat.getValue(), 0) != 0 )
{
$scbextrat = new BigDecimal("0");
cur2dif = Platform.numDiv($\cbsmod\xrtmod\xrt\selrat.getValue() , $\cbsmod\xrtmod\xrt\buyrat.getValue());
}
else
{
$scbextrat = Platform.numMul(Platform.numDiv($dcbextrat.getValue() , $rat.getValue()) , $\cbsmod\xrtmod.crossRatebas( cur1, cur2 ));
cur2dif = new BigDecimal("0");
Platform.error( $rat, #CT000120, cur2 );
if(1==1) return;
}
}
// show begin-date of exchange rate of ACCCUR
accdat = $\cbsmod\xrtmod\xrt\begdat;
$xrtdatacc = accdat;
// set middle rate for curreny with smaller margin, selling/buying for the other
/**
if ( $cur2 <> BASCUR and $cur1dif > $cur2dif ) or $cur1 == BASCUR then
if DCBRATTYP <> "F" and Len( RATTYP ) <> 1 then
DCBRATTYP = "M"
endif
**/
if( Platform.len( $rattyp.getValue() ) == 1 )
{
Platform.enable( $scbrattyp );
}
/**
else
if SCBRATTYP <> "F" and Len( RATTYP ) <> 1 then
SCBRATTYP = "M"
endif
**/
if( Platform.len( $rattyp.getValue() ) == 1 )
{
$scbextrat = Platform.numMul(Platform.numMul($dcbextrat.getValue() , $rat.getValue()) , $\cbsmod\xrtmod.crossRatebas( cur1, cur2 ));
Platform.enable( $dcbrattyp );
}
// endif
}
Argument<BigDecimal> pathBox6 = new Argument<BigDecimal>("",$dcbextrat.getValue());
Argument<BigDecimal> pathBox7 = new Argument<BigDecimal>("",$dcbsqrrat.getValue());
Argument<BigDecimal> pathBox8 = new Argument<BigDecimal>("",$dcbresrat.getValue());
Argument<BigDecimal> pathBox9 = new Argument<BigDecimal>("",$dcbrebrat.getValue());
$\setmod\setglg.getRateXrtWithResRatesZZZ( $cur.getValue(), $bascur.getValue(), ininflg, $dcbrattyp.getValue(), vald, pathBox6, pathBox7, pathBox8, pathBox9 );
$dcbextrat = pathBox6.value;
$dcbsqrrat = pathBox7.value;
$dcbresrat = pathBox8.value;
$dcbrebrat = pathBox9.value;
}
else
{
if( Platform.compareTo( cur1 , $bascur.getValue() ) == 0 || Platform.compareTo( cur2 , $bascur.getValue() ) == 0 )
{
$dcbextrat = $rat;
}
else
// rate calulation:
switch( $rattyp.getValue() )
{
if( $\cbsmod\xrtmod.xrtCrossRateDirFlg( cur1, cur2, $dcbextrat.getValue(), $scbextrat.getValue() ) )
// for crossrates, the crossrate can be entered and the rate not beeing the middle rate is calculated from crossrate ane middle rate
case "RX":
case "FX":
Platform.enable( $rat );
if( Platform.compareTo( $dcbrattyp.getValue() , "M" ) == 0 )
{
$dcbextrat = Platform.numMul(Platform.numMul($rat.getValue() , $scbextrat.getValue()) , $\cbsmod\xrtmod.crossRatebas( cur2, cur1 ));
if( Platform.compareTo( cur1 , $bascur.getValue() ) == 0 || Platform.compareTo( cur2 , $bascur.getValue() ) == 0 )
{
$scbextrat = $rat;
}
else
{
if( $\cbsmod\xrtmod.xrtCrossRateDirFlg( cur1, cur2, $dcbextrat.getValue(), $scbextrat.getValue() ) )
{
if( Platform.compareTo( $rat.getValue() , 0 ) == 0 )
{
$scbextrat = new BigDecimal("0");
}
else
{
$scbextrat = Platform.numMul(Platform.numDiv($dcbextrat.getValue() , $rat.getValue()) , $\cbsmod\xrtmod.crossRatebas( cur1, cur2 ));
}
}
else
{
$scbextrat = Platform.numMul(Platform.numMul($dcbextrat.getValue() , $rat.getValue()) , $\cbsmod\xrtmod.crossRatebas( cur1, cur2 ));
}
}
Argument<BigDecimal> pathBox6 = new Argument<BigDecimal>("",$dcbextrat.getValue());
Argument<BigDecimal> pathBox7 = new Argument<BigDecimal>("",$dcbsqrrat.getValue());
Argument<BigDecimal> pathBox8 = new Argument<BigDecimal>("",$dcbresrat.getValue());
Argument<BigDecimal> pathBox9 = new Argument<BigDecimal>("",$dcbrebrat.getValue());
$\setmod\setglg.getRateXrtWithResRatesZZZ( $cur.getValue(), $bascur.getValue(), ininflg, $dcbrattyp.getValue(), vald, pathBox6, pathBox7, pathBox8, pathBox9 );
$dcbextrat = pathBox6.value;
$dcbsqrrat = pathBox7.value;
$dcbresrat = pathBox8.value;
$dcbrebrat = pathBox9.value;
}
else
{
if( Platform.compareTo( $rat.getValue() , 0 ) == 0 )
if( Platform.compareTo( cur1 , $bascur.getValue() ) == 0 || Platform.compareTo( cur2 , $bascur.getValue() ) == 0 )
{
$dcbextrat = new BigDecimal("0");
$dcbextrat = $rat;
}
else
{
$dcbextrat = Platform.numMul(Platform.numDiv($scbextrat.getValue() , $rat.getValue()) , $\cbsmod\xrtmod.crossRatebas( cur2, cur1 ));
if( $\cbsmod\xrtmod.xrtCrossRateDirFlg( cur1, cur2, $dcbextrat.getValue(), $scbextrat.getValue() ) )
{
$dcbextrat = Platform.numMul(Platform.numMul($rat.getValue() , $scbextrat.getValue()) , $\cbsmod\xrtmod.crossRatebas( cur2, cur1 ));
}
else
{
if( Platform.compareTo( $rat.getValue() , 0 ) == 0 )
{
$dcbextrat = new BigDecimal("0");
}
else
{
$dcbextrat = Platform.numMul(Platform.numDiv($scbextrat.getValue() , $rat.getValue()) , $\cbsmod\xrtmod.crossRatebas( cur2, cur1 ));
}
}
}
}
}
Argument<BigDecimal> pathBox10 = new Argument<BigDecimal>("",$scbextrat.getValue());
Argument<BigDecimal> pathBox11 = new Argument<BigDecimal>("",$scbsqrrat.getValue());
Argument<BigDecimal> pathBox12 = new Argument<BigDecimal>("",$scbresrat.getValue());
Argument<BigDecimal> pathBox13 = new Argument<BigDecimal>("",$scbrebrat.getValue());
$\setmod\setglg.getRateXrtWithResRatesZZZ( $acccur.getValue(), $bascur.getValue(), ininflg, $scbrattyp.getValue(), vald, pathBox10, pathBox11, pathBox12, pathBox13 );
Argument<BigDecimal> pathBox10 = new Argument<BigDecimal>("",$scbextrat.getValue());
Argument<BigDecimal> pathBox11 = new Argument<BigDecimal>("",$scbsqrrat.getValue());
Argument<BigDecimal> pathBox12 = new Argument<BigDecimal>("",$scbresrat.getValue());
Argument<BigDecimal> pathBox13 = new Argument<BigDecimal>("",$scbrebrat.getValue());
$\setmod\setglg.getRateXrtWithResRatesZZZ( $acccur.getValue(), $bascur.getValue(), ininflg, $scbrattyp.getValue(), vald, pathBox10, pathBox11, pathBox12, pathBox13 );
$scbextrat = pathBox10.value;
$scbsqrrat = pathBox11.value;
$scbresrat = pathBox12.value;
$scbrebrat = pathBox13.value;
$scbextrat = pathBox10.value;
$scbsqrrat = pathBox11.value;
$scbresrat = pathBox12.value;
$scbrebrat = pathBox13.value;
}
break;
default:
// in other cases the crossrate is disabled
Platform.disable( $rat );
// the rates are read (according to rate type if not free)
switch( $dcbrattyp.getValue() )
{
case "F":
// clear begin-date of exchange-rate, if crossrate can be entered
Platform.clear( $xrtdatcur );
break;
case "C":
case "R":
break;
default:
Argument<BigDecimal> pathBox14 = new Argument<BigDecimal>("",$dcbextrat.getValue());
Argument<BigDecimal> pathBox15 = new Argument<BigDecimal>("",$dcbsqrrat.getValue());
Argument<BigDecimal> pathBox16 = new Argument<BigDecimal>("",$dcbresrat.getValue());
Argument<BigDecimal> pathBox17 = new Argument<BigDecimal>("",$dcbrebrat.getValue());
$\setmod\setglg.getRateXrtWithResRatesZZZ( $cur.getValue(), $bascur.getValue(), ininflg, $dcbrattyp.getValue(), vald, pathBox14, pathBox15, pathBox16, pathBox17 );
}
break;
default:
// in other cases the crossrate is disabled
Platform.disable( $rat );
// the rates are read (according to rate type if not free)
switch( $dcbrattyp.getValue() )
{
case "F":
// clear begin-date of exchange-rate, if crossrate can be entered
Platform.clear( $xrtdatcur );
break;
case "C":
case "R":
break;
default:
Argument<BigDecimal> pathBox14 = new Argument<BigDecimal>("",$dcbextrat.getValue());
Argument<BigDecimal> pathBox15 = new Argument<BigDecimal>("",$dcbsqrrat.getValue());
Argument<BigDecimal> pathBox16 = new Argument<BigDecimal>("",$dcbresrat.getValue());
Argument<BigDecimal> pathBox17 = new Argument<BigDecimal>("",$dcbrebrat.getValue());
$\setmod\setglg.getRateXrtWithResRatesZZZ( $cur.getValue(), $bascur.getValue(), ininflg, $dcbrattyp.getValue(), vald, pathBox14, pathBox15, pathBox16, pathBox17 );
$dcbextrat = pathBox14.value;
$dcbsqrrat = pathBox15.value;
$dcbresrat = pathBox16.value;
$dcbrebrat = pathBox17.value;
$dcbextrat = pathBox14.value;
$dcbsqrrat = pathBox15.value;
$dcbresrat = pathBox16.value;
$dcbrebrat = pathBox17.value;
}
switch( $scbrattyp.getValue() )
{
case "F":
// clear begin-date of exchange-rate, if crossrate can be entered
Platform.clear( $xrtdatacc );
break;
case "C":
case "R":
break;
default:
Argument<BigDecimal> pathBox18 = new Argument<BigDecimal>("",$scbextrat.getValue());
Argument<BigDecimal> pathBox19 = new Argument<BigDecimal>("",$scbsqrrat.getValue());
Argument<BigDecimal> pathBox20 = new Argument<BigDecimal>("",$scbresrat.getValue());
Argument<BigDecimal> pathBox21 = new Argument<BigDecimal>("",$scbrebrat.getValue());
$\setmod\setglg.getRateXrtWithResRatesZZZ( $acccur.getValue(), $bascur.getValue(), ininflg, $scbrattyp.getValue(), vald, pathBox18, pathBox19, pathBox20, pathBox21 );
}
switch( $scbrattyp.getValue() )
{
case "F":
// clear begin-date of exchange-rate, if crossrate can be entered
Platform.clear( $xrtdatacc );
break;
case "C":
case "R":
break;
default:
Argument<BigDecimal> pathBox18 = new Argument<BigDecimal>("",$scbextrat.getValue());
Argument<BigDecimal> pathBox19 = new Argument<BigDecimal>("",$scbsqrrat.getValue());
Argument<BigDecimal> pathBox20 = new Argument<BigDecimal>("",$scbresrat.getValue());
Argument<BigDecimal> pathBox21 = new Argument<BigDecimal>("",$scbrebrat.getValue());
$\setmod\setglg.getRateXrtWithResRatesZZZ( $acccur.getValue(), $bascur.getValue(), ininflg, $scbrattyp.getValue(), vald, pathBox18, pathBox19, pathBox20, pathBox21 );
$scbextrat = pathBox18.value;
$scbsqrrat = pathBox19.value;
$scbresrat = pathBox20.value;
$scbrebrat = pathBox21.value;
$scbextrat = pathBox18.value;
$scbsqrrat = pathBox19.value;
$scbresrat = pathBox20.value;
$scbrebrat = pathBox21.value;
}
// and the crossrate (RAT) is calculated. ( the logic has to match with the setting of the direction in CnvAmtAccamt)
if( Platform.compareTo( $cur.getValue() , $bascur.getValue() ) == 0 )
{
$rat = $scbextrat;
// clear begin-date of exchange rate, if exchange = 1
Platform.clear( $xrtdatcur );
}
else
{
if( Platform.compareTo( $acccur.getValue() , $bascur.getValue() ) == 0 )
{
$rat = $dcbextrat;
}
else
{
if( Platform.compareTo( $dcbextrat.getValue() , 0 ) == 0 || Platform.compareTo( $scbextrat.getValue() , 0 ) == 0 )
}
// and the crossrate (RAT) is calculated. ( the logic has to match with the setting of the direction in CnvAmtAccamt)
if( Platform.compareTo( $cur.getValue() , $bascur.getValue() ) == 0 )
{
$rat = new BigDecimal("0");
$rat = $scbextrat;
// clear begin-date of exchange rate, if exchange = 1
Platform.clear( $xrtdatcur );
}
else
{
if( ininflg )
if( Platform.compareTo( $acccur.getValue() , $bascur.getValue() ) == 0 )
{
$rat = new BigDecimal("1");
$ratcurlab = $bascur.getValue() + "/" + $bascur.getValue();
$rat = $dcbextrat;
}
else
{
if( $\cbsmod\xrtmod.xrtCrossRateDirFlg( cur1, cur2, $dcbextrat.getValue(), $scbextrat.getValue() ) )
if( Platform.compareTo( $dcbextrat.getValue() , 0 ) == 0 || Platform.compareTo( $scbextrat.getValue() , 0 ) == 0 )
{
$rat = Platform.numMul(Platform.numDiv($dcbextrat.getValue() , $scbextrat.getValue()) , $\cbsmod\xrtmod.crossRatebas( cur1, cur2 ));
$rat = new BigDecimal("0");
}
else
{
$rat = Platform.numDiv(Platform.numDiv($scbextrat.getValue() , $dcbextrat.getValue()) , $\cbsmod\xrtmod.crossRatebas( cur1, cur2 ));
if( ininflg )
{
$rat = new BigDecimal("1");
$ratcurlab = $bascur.getValue() + "/" + $bascur.getValue();
}
else
{
if( $\cbsmod\xrtmod.xrtCrossRateDirFlg( cur1, cur2, $dcbextrat.getValue(), $scbextrat.getValue() ) )
{
$rat = Platform.numMul(Platform.numDiv($dcbextrat.getValue() , $scbextrat.getValue()) , $\cbsmod\xrtmod.crossRatebas( cur1, cur2 ));
}
else
{
$rat = Platform.numDiv(Platform.numDiv($scbextrat.getValue() , $dcbextrat.getValue()) , $\cbsmod\xrtmod.crossRatebas( cur1, cur2 ));
}
}
}
}
}
}
}
}
}
// convert amounts (only if currency has been changed, if to account with AmtRndUnt to respect rounding unit)
if( Platform.isEmpty( $accamtfix ) )
{
cnvAmtAccamt();
}
// set modification in case of free or reserved rate
int xrfamt = 0;
BigDecimal curMaxAmt = null;
int curXrfAmt = 0;
BigDecimal accCurMaxAmt = null;
int accCurXrfAmt = 0;
if( ( ! ininflg ) && ( Platform.compareTo($cur.getValue(), $acccur.getValue()) != 0 ) )
{
// if couter value in system currency is greater as maximum rate amount for account or contract currency only allow reserved rates (if not forward contract)
xrfamt = Platform.abs( $\cbsmod\xrtmod.basCurEqu ( $acccur.getValue(), $accamt.getValue(), vald ) ).intValue();
curMaxAmt = $\cbsmod\xrtmod.getCurMaxAmt( $cur.getValue() );
curXrfAmt = Platform.abs( $\cbsmod\xrtmod.basCurEqu ( $\cbsmod\xrtmod\caccur\maxcur.getValue(), curMaxAmt, vald ) ).intValue();
accCurMaxAmt = $\cbsmod\xrtmod.getCurMaxAmt( $acccur.getValue() );
accCurXrfAmt = Platform.abs( $\cbsmod\xrtmod.basCurEqu ( $\cbsmod\xrtmod\caccur\maxcur.getValue(), accCurMaxAmt, vald ) ).intValue();
if( ( xrfamt > curXrfAmt || xrfamt > accCurXrfAmt ) && Platform.isEmpty( $fcdinr ) )
{
Platform.setFieldValue( $rattyp, "RX" + "\r\n" + "R" );
valuesSet = true;
}
switch( $rattyp.getValue() )
{
// if reserved rate, set both rate types to
case "R":
Platform.resetModified( $scbrattyp.getValue() );
Platform.disable( $scbrattyp );
if( Platform.compareTo(cur2, $bascur.getValue()) != 0 )
// convert amounts (only if currency has been changed, if to account with AmtRndUnt to respect rounding unit)
if( Platform.isEmpty( $accamtfix ) )
{
$scbrattyp = "F";
Platform.enable( $scbextrat );
cnvAmtAccamt();
}
else
// set modification in case of free or reserved rate
int xrfamt = 0;
BigDecimal curMaxAmt = null;
int curXrfAmt = 0;
BigDecimal accCurMaxAmt = null;
int accCurXrfAmt = 0;
if( ( ! ininflg ) && ( Platform.compareTo($cur.getValue(), $acccur.getValue()) != 0 ) )
{
$scbrattyp = "M";
Platform.disable( $scbextrat );
}
Platform.resetModified( $dcbrattyp.getValue() );
Platform.disable( $dcbrattyp );
if( Platform.compareTo(cur1, $bascur.getValue()) != 0 )
{
$dcbrattyp = "F";
Platform.enable( $dcbextrat );
}
else
{
$dcbrattyp = "M";
Platform.disable( $dcbextrat );
}
break;
case "F":
// Enable( DCBRATTYP )
//光大要求选择free时灰掉
Platform.disable( $dcbrattyp );
if( ! Platform.isModified( $dcbrattyp ) )
{
if( Platform.compareTo(cur1, $bascur.getValue()) != 0 )
// if couter value in system currency is greater as maximum rate amount for account or contract currency only allow reserved rates (if not forward contract)
xrfamt = Platform.abs( $\cbsmod\xrtmod.basCurEqu ( $acccur.getValue(), $accamt.getValue(), vald ) ).intValue();
curMaxAmt = $\cbsmod\xrtmod.getCurMaxAmt( $cur.getValue() );
curXrfAmt = Platform.abs( $\cbsmod\xrtmod.basCurEqu ( $\cbsmod\xrtmod\caccur\maxcur.getValue(), curMaxAmt, vald ) ).intValue();
accCurMaxAmt = $\cbsmod\xrtmod.getCurMaxAmt( $acccur.getValue() );
accCurXrfAmt = Platform.abs( $\cbsmod\xrtmod.basCurEqu ( $\cbsmod\xrtmod\caccur\maxcur.getValue(), accCurMaxAmt, vald ) ).intValue();
if( ( xrfamt > curXrfAmt || xrfamt > accCurXrfAmt ) && Platform.isEmpty( $fcdinr ) )
{
$dcbrattyp = "F";
Platform.setFieldValue( $rattyp, "RX" + "\r\n" + "R" );
valuesSet = true;
}
else
switch( $rattyp.getValue() )
{
$dcbrattyp = "M";
// if reserved rate, set both rate types to
case "R":
Platform.resetModified( $scbrattyp.getValue() );
Platform.disable( $scbrattyp );
if( Platform.compareTo(cur2, $bascur.getValue()) != 0 )
{
$scbrattyp = "F";
Platform.enable( $scbextrat );
}
else
{
$scbrattyp = "M";
Platform.disable( $scbextrat );
}
Platform.resetModified( $dcbrattyp.getValue() );
Platform.disable( $dcbrattyp );
if( Platform.compareTo(cur1, $bascur.getValue()) != 0 )
{
$dcbrattyp = "F";
Platform.enable( $dcbextrat );
}
else
{
$dcbrattyp = "M";
Platform.disable( $dcbextrat );
}
break;
case "F":
// Enable( DCBRATTYP )
//光大要求选择free时灰掉
Platform.disable( $dcbrattyp );
if( ! Platform.isModified( $dcbrattyp ) )
{
if( Platform.compareTo(cur1, $bascur.getValue()) != 0 )
{
$dcbrattyp = "F";
}
else
{
$dcbrattyp = "M";
}
}
// Enable( SCBRATTYP )
Platform.disable( $scbrattyp );
if( ! Platform.isModified( $scbrattyp ) )
{
if( Platform.compareTo(cur2, $bascur.getValue()) != 0 )
{
$scbrattyp = "F";
}
else
{
$scbrattyp = "M";
}
}
break;
}
}
// Enable( SCBRATTYP )
Platform.disable( $scbrattyp );
if( ! Platform.isModified( $scbrattyp ) )
IStream allval = new StreamImpl();
int cIdx = 0;
if( ! valuesSet )
{
if( Platform.compareTo(cur2, $bascur.getValue()) != 0 )
// get available rate types
Platform.streamSet( allval, Platform.getTblKeyList( Platform.getAttributeText( $rattyp.getValue(), tdAttrCodetable ), Platform.getLang() ) );
// Remove selection "C" for forward contracts (if forward contract this is not executed)
// set values
cIdx = Platform.streamSearch( allval, "C" );
if( cIdx > 0 )
{
$scbrattyp = "F";
Platform.streamDelete( allval, cIdx );
}
else
Platform.setFieldValue( $rattyp, Platform.toString( allval ) );
}
// if selected type is not available any more, reset it
if( Platform.searchBlock( Platform.getValues( $rattyp.getValue() ), $rattyp.getValue() ) == 0 )
{
Platform.resetModified( $rattyp.getValue() );
}
// if type has been redefaulted, restart the caclulation
if( ! Platform.isModified( $rattyp ) && Platform.compareTo($rattyp.getValue(), Platform.getLine( Platform.getValues( $rattyp ), 1 )) != 0 )
{
$rattyp = Platform.getLine( Platform.getValues( $rattyp ), 1 );
if( ! restarted )
{
$scbrattyp = "M";
restarted = true;
//return ; // #### goto restart
continue restart;
}
}
break;
}
}
IStream allval = new StreamImpl();
int cIdx = 0;
if( ! valuesSet )
{
// get available rate types
Platform.streamSet( allval, Platform.getTblKeyList( Platform.getAttributeText( $rattyp.getValue(), tdAttrCodetable ), Platform.getLang() ) );
// Remove selection "C" for forward contracts (if forward contract this is not executed)
// set values
cIdx = Platform.streamSearch( allval, "C" );
if( cIdx > 0 )
{
Platform.streamDelete( allval, cIdx );
}
Platform.setFieldValue( $rattyp, Platform.toString( allval ) );
}
// if selected type is not available any more, reset it
if( Platform.searchBlock( Platform.getValues( $rattyp.getValue() ), $rattyp.getValue() ) == 0 )
{
Platform.resetModified( $rattyp.getValue() );
}
// if type has been redefaulted, restart the caclulation
if( ! Platform.isModified( $rattyp ) && Platform.compareTo($rattyp.getValue(), Platform.getLine( Platform.getValues( $rattyp ), 1 )) != 0 )
{
$rattyp = Platform.getLine( Platform.getValues( $rattyp ), 1 );
if( ! restarted )
{
restarted = true;
return ; // #######TODO 改写 LABEL与GOTO #### goto restart
}
}
// enable rates for free rate types
if( Platform.compareTo( $scbrattyp.getValue() , "F" ) == 0 )
......
......@@ -79,182 +79,187 @@ void defaultSFTMT()
}
// set flags for creation of payment message. If flags set, SESPAY is active, otherwise not
//! If RTGSPlus, show always MT103
if( Platform.compareTo( $dsp.getValue() , "RTC" ) == 0 || Platform.compareTo( $dsp.getValue() , "TGC" ) == 0 )
{
Platform.setFieldValue( $sftmt, "103" );
$sftmt = "103";
return ; // #######TODO 改写 LABEL与GOTO #### goto setdirindflg
}
if( Platform.compareTo( Platform.mid( $dsp.getValue(), 1, 2 ) , "IZ" ) == 0 )
{
//SetValues( SFTMT, "IZV" )
$sftmt = "IZV";
return ; // #######TODO 改写 LABEL与GOTO #### goto setdirindflg
}
Platform.disable( $sftmt );
// main message is MT103, if beneficiary (:59: RMS) is set and not a bank
if( ! Platform.isModified( $sftmt ) )
{
if( Platform.compareTo( $dsp.getValue() , "DAC" ) == 0 )
{
Platform.clear( $sftmt );
}
else
{
if( Platform.pos( $setgrp\rms\ptytyp.getValue(), "B" ) == 0 && $setgrp\rms.isRolSet() )
int err = 0;
setdirindflg:
while(true){
if( Platform.compareTo( $dsp.getValue() , "RTC" ) == 0 || Platform.compareTo( $dsp.getValue() , "TGC" ) == 0 )
{
Platform.setFieldValue( $sftmt, "103" );
$sftmt = "103";
break ; // #### goto setdirindflg
}
if( Platform.compareTo( Platform.mid( $dsp.getValue(), 1, 2 ) , "IZ" ) == 0 )
{
//SetValues( SFTMT, "IZV" )
$sftmt = "IZV";
break ; // #### goto setdirindflg
}
Platform.disable( $sftmt );
// main message is MT103, if beneficiary (:59: RMS) is set and not a bank
if( ! Platform.isModified( $sftmt ) )
{
if( Platform.compareTo( $dsp.getValue() , "DAC" ) == 0 )
{
Platform.clear( $sftmt );
}
else
{
if( Platform.pos( $setgrp\rms\ptytyp.getValue(), "B" ) == 0 && $setgrp\rms.isRolSet() )
{
Platform.setFieldValue( $sftmt, "103" );
$sftmt = "103";
}
else
{
Platform.setFieldValue( $sftmt, "202" );
$sftmt = "202";
}
}
}
// check, if there are settings for special message types from registersettlement/SetPtyAvbMt
Platform.readSetPtyfromCache( $rol.getValue(), $\setmod\setpty );
boolean doit = false;
// special message types 400 and/or 756 only possible, if
// currency in line not changed or In-In settlement (i.e. DEM/EUR)
String refcur = NULLSTR;
String newcur1 = NULLSTR;
String newcur2 = NULLSTR;
Boolean ininflg = null;
if( Platform.compareTo( $\setmod\setpty\rol , $rol.getValue() ) == 0 && ( ! Platform.isEmpty( $\setmod\setpty\avbmt ) ) )
{
if( Platform.compareTo( $acccur.getValue() , $cur.getValue() ) == 0 )
{
doit = true;
}
else
{
refcur = $\cbsmod\xrtmod.sysiso();
Argument<String> newcur1Box = new Argument<String>();
Argument<String> newcur2Box = new Argument<String>();
Argument<String> refcurBox = new Argument<String>("",refcur);
Argument<Boolean> ininflgBox = new Argument<Boolean>();
$\cbsmod\xrtmod.xrtCheckInIn( $acccur.getValue(), $cur.getValue(), newcur1Box, newcur2Box, refcurBox, ininflgBox );
newcur1 = newcur1Box.value;
newcur2 = newcur2Box.value;
refcur = refcurBox.value;
ininflg = ininflgBox.value;
if( ininflg )
{
doit = true;
}
}
}
if( doit )
{
// only the message types set by SetPtyAvbMt are valid, 103/202 should be set explicitely in registersettlement, if allowed
Platform.setFieldValue( $sftmt, $\setmod\setpty\avbmt );
if( Platform.isEmpty( Platform.getLine( $\setmod\setpty\avbmt, 2 ) ) )
{
$sftmt = Platform.getLine( $\setmod\setpty\avbmt, 1 );
}
else
{
Platform.enable( $sftmt );
if( ! Platform.isModified( $sftmt ) )
{
$sftmt = Platform.getLine( $\setmod\setpty\avbmt, 1 );
}
}
}
else
//汇款交易特殊处理,以主界面报文类型为主
/**
if GetFramename == "CPTADV" or GetFramename == "CPTOPN" or GetFramename == "CPTOUT" or GetFramename == "CPTOTH" then
**/
String sfttyp = NULLSTR;
err = 0;
if( Platform.compareTo( Platform.getTransName() , "CPTADV" ) == 0 || Platform.compareTo( Platform.getTransName() , "CPTOPN" ) == 0 || Platform.compareTo( Platform.getTransName() , "CPTOUT" ) == 0 || Platform.compareTo( Platform.getTransName() , "CPTOTH" ) == 0 || Platform.compareTo( Platform.getTransName() , "CPTSUB" ) == 0 )
{
sfttyp = Platform.getContent( "\\CPTP\\CPDGRP\\REC\\SWFTYP" );
err = Platform.errorCode();
$sftmt = sfttyp;
}
String crefinflg = Platform.getContent( "\\TRTCRE\\CREFINFLG" );
err = Platform.errorCode();
if( Platform.compareTo( Platform.getTransName() , "GITSET" ) == 0 || Platform.compareTo( Platform.getTransName() , "BRTSET" ) == 0 )
{
if( Platform.isEmpty( crefinflg ) )
{
$sftmt = "756";
}
}
if( Platform.compareTo( Platform.getTransName() , "CPTOPN" ) == 0 && ! Platform.isEmpty( crefinflg ) )
{
Platform.clear( $sftmt );
}
//if GetFramename = "TRTSET" then
// SFTMT = "756"
//endif
if( Platform.compareTo( Platform.getTransName() , "BETSET" ) == 0 )
{
Platform.setFieldValue( $sftmt, "202" );
$sftmt = "202";
}
}
}
// check, if there are settings for special message types from registersettlement/SetPtyAvbMt
Platform.readSetPtyfromCache( $rol.getValue(), $\setmod\setpty );
boolean doit = false;
// special message types 400 and/or 756 only possible, if
// currency in line not changed or In-In settlement (i.e. DEM/EUR)
String refcur = NULLSTR;
String newcur1 = NULLSTR;
String newcur2 = NULLSTR;
Boolean ininflg = null;
if( Platform.compareTo( $\setmod\setpty\rol , $rol.getValue() ) == 0 && ( ! Platform.isEmpty( $\setmod\setpty\avbmt ) ) )
{
if( Platform.compareTo( $acccur.getValue() , $cur.getValue() ) == 0 )
{
doit = true;
}
else
{
refcur = $\cbsmod\xrtmod.sysiso();
Argument<String> newcur1Box = new Argument<String>();
Argument<String> newcur2Box = new Argument<String>();
Argument<String> refcurBox = new Argument<String>("",refcur);
Argument<Boolean> ininflgBox = new Argument<Boolean>();
$\cbsmod\xrtmod.xrtCheckInIn( $acccur.getValue(), $cur.getValue(), newcur1Box, newcur2Box, refcurBox, ininflgBox );
newcur1 = newcur1Box.value;
newcur2 = newcur2Box.value;
refcur = refcurBox.value;
ininflg = ininflgBox.value;
if( ininflg )
//CPTREP
String rep = NULLSTR;
String swt = NULLSTR;
if( Platform.compareTo( Platform.getTransName() , "CPTREP" ) == 0 )
{
rep = Platform.getContent( "\\CPDGRP\\REC\\RTGMOD" );
err = Platform.errorCode();
swt = Platform.getContent( "\\CPDGRP\\REC\\SWFTYP" );
err = Platform.errorCode();
if( Platform.compareTo( rep , "ZH" ) == 0 && Platform.compareTo( swt , "COV" ) == 0 )
{
$sftmt = "COV";
$dirindflg = "";
}
else
{
$sftmt = "";
$dirindflg = "";
}
}
//代理他行福费廷
if( Platform.compareTo( Platform.getTransName() , "DLTOPN" ) == 0 )
{
doit = true;
Platform.clear( $sftmt );
}
}
}
if( doit )
{
// only the message types set by SetPtyAvbMt are valid, 103/202 should be set explicitely in registersettlement, if allowed
Platform.setFieldValue( $sftmt, $\setmod\setpty\avbmt );
if( Platform.isEmpty( Platform.getLine( $\setmod\setpty\avbmt, 2 ) ) )
{
$sftmt = Platform.getLine( $\setmod\setpty\avbmt, 1 );
}
else
{
Platform.enable( $sftmt );
if( ! Platform.isModified( $sftmt ) )
//风参结清
if( Platform.compareTo( Platform.getTransName() , "RPTPAY" ) == 0 )
{
$sftmt = Platform.getLine( $\setmod\setpty\avbmt, 1 );
$sftmt = "202";
}
}
}
//汇款交易特殊处理,以主界面报文类型为主
/**
if GetFramename == "CPTADV" or GetFramename == "CPTOPN" or GetFramename == "CPTOUT" or GetFramename == "CPTOTH" then
**/
String sfttyp = NULLSTR;
int err = 0;
if( Platform.compareTo( Platform.getTransName() , "CPTADV" ) == 0 || Platform.compareTo( Platform.getTransName() , "CPTOPN" ) == 0 || Platform.compareTo( Platform.getTransName() , "CPTOUT" ) == 0 || Platform.compareTo( Platform.getTransName() , "CPTOTH" ) == 0 || Platform.compareTo( Platform.getTransName() , "CPTSUB" ) == 0 )
{
sfttyp = Platform.getContent( "\\CPTP\\CPDGRP\\REC\\SWFTYP" );
err = Platform.errorCode();
$sftmt = sfttyp;
}
String crefinflg = Platform.getContent( "\\TRTCRE\\CREFINFLG" );
err = Platform.errorCode();
if( Platform.compareTo( Platform.getTransName() , "GITSET" ) == 0 || Platform.compareTo( Platform.getTransName() , "BRTSET" ) == 0 )
{
if( Platform.isEmpty( crefinflg ) )
{
$sftmt = "756";
}
}
if( Platform.compareTo( Platform.getTransName() , "CPTOPN" ) == 0 && ! Platform.isEmpty( crefinflg ) )
{
Platform.clear( $sftmt );
}
//if GetFramename = "TRTSET" then
// SFTMT = "756"
//endif
if( Platform.compareTo( Platform.getTransName() , "BETSET" ) == 0 )
{
$sftmt = "202";
}
//CPTREP
String rep = NULLSTR;
String swt = NULLSTR;
if( Platform.compareTo( Platform.getTransName() , "CPTREP" ) == 0 )
{
rep = Platform.getContent( "\\CPDGRP\\REC\\RTGMOD" );
err = Platform.errorCode();
swt = Platform.getContent( "\\CPDGRP\\REC\\SWFTYP" );
err = Platform.errorCode();
if( Platform.compareTo( rep , "ZH" ) == 0 && Platform.compareTo( swt , "COV" ) == 0 )
{
$sftmt = "COV";
$dirindflg = "";
}
else
{
$sftmt = "";
$dirindflg = "";
}
}
//代理他行福费廷
if( Platform.compareTo( Platform.getTransName() , "DLTOPN" ) == 0 )
{
Platform.clear( $sftmt );
}
//风参结清
if( Platform.compareTo( Platform.getTransName() , "RPTPAY" ) == 0 )
{
$sftmt = "202";
}
if( Platform.compareTo( Platform.getTransName() , "BTTSET" ) == 0 )
{
$sftmt = "202";
}
if( Platform.compareTo( Platform.getTransName() , "FTTPCM" ) == 0 )
{
switch( Platform.getContent( "\\FTTP\\MSGTYP" ) )
{
case "103":
$sftmt = "103";
break;
case "202":
$sftmt = "202";
break;
default:
$\sysmod.disableAndClearField( Platform.getDatafield(this,"sftmt") );
}
}
// 汇出总行清算
String msgtyp = NULLSTR;
if( Platform.compareTo( Platform.getTransName() , "CLOOPN" ) == 0 )
{
msgtyp = Platform.getContent( "\\PREMSGTYP" );
err = Platform.errorCode();
$sftmt = msgtyp;
if( Platform.compareTo( Platform.getTransName() , "BTTSET" ) == 0 )
{
$sftmt = "202";
}
if( Platform.compareTo( Platform.getTransName() , "FTTPCM" ) == 0 )
{
switch( Platform.getContent( "\\FTTP\\MSGTYP" ) )
{
case "103":
$sftmt = "103";
break;
case "202":
$sftmt = "202";
break;
default:
$\sysmod.disableAndClearField( Platform.getDatafield(this,"sftmt") );
}
}
// 汇出总行清算
String msgtyp = NULLSTR;
if( Platform.compareTo( Platform.getTransName() , "CLOOPN" ) == 0 )
{
msgtyp = Platform.getContent( "\\PREMSGTYP" );
err = Platform.errorCode();
$sftmt = msgtyp;
}
return;
}
//--------end------------------------
// #######TODO 改写 LABEL与GOTO #### label setdirindflg
// #### label setdirindflg
//! If a special MT is sent (not 202 or 103), it has to be indirect to ensure sending of special message to beneficiary
// if authorisation for rembourse, no 202
//由于光大银行的帐户行的帐号不在国结维护
......
......@@ -8,7 +8,7 @@ void cnv2RatCeb(String scbcur,String dcbcur,int scbrat,int dcbrat,Argument<Strin
{
dpy.value = "???/???";
rate.value = 0;
return ; // #######TODO 改写 LABEL与GOTO #### goto done
return ; // #### goto done
}
if( ( Platform.compareTo( dcbcur , #CT000169 ) == 0 || Platform.compareTo( scbcur , #CT000170 ) == 0 ) )
{
......@@ -16,13 +16,13 @@ void cnv2RatCeb(String scbcur,String dcbcur,int scbrat,int dcbrat,Argument<Strin
{
rate.value = dcbrat / scbrat;
dpy.value = dcbcur + "/" + scbcur;
return ; // #######TODO 改写 LABEL与GOTO #### goto done
return ; // #### goto done
}
else
{
rate.value = scbrat / dcbrat;
dpy.value = scbcur + "/" + dcbcur;
return ; // #######TODO 改写 LABEL与GOTO #### goto done
return ; // #### goto done
}
}
else
......@@ -33,13 +33,13 @@ void cnv2RatCeb(String scbcur,String dcbcur,int scbrat,int dcbrat,Argument<Strin
{
rate.value = dcbrat / scbrat;
dpy.value = dcbcur + "/" + scbcur;
return ; // #######TODO 改写 LABEL与GOTO #### goto done
return ; // #### goto done
}
else
{
rate.value = scbrat / dcbrat;
dpy.value = scbcur + "/" + dcbcur;
return ; // #######TODO 改写 LABEL与GOTO #### goto done
return ; // #### goto done
}
}
else
......@@ -50,13 +50,13 @@ void cnv2RatCeb(String scbcur,String dcbcur,int scbrat,int dcbrat,Argument<Strin
{
rate.value = dcbrat / scbrat;
dpy.value = dcbcur + "/" + scbcur;
return ; // #######TODO 改写 LABEL与GOTO #### goto done
return ; // #### goto done
}
else
{
rate.value = scbrat / dcbrat;
dpy.value = scbcur + "/" + dcbcur;
return ; // #######TODO 改写 LABEL与GOTO #### goto done
return ; // #### goto done
}
}
else
......@@ -67,24 +67,24 @@ void cnv2RatCeb(String scbcur,String dcbcur,int scbrat,int dcbrat,Argument<Strin
{
rate.value = scbrat / dcbrat;
dpy.value = scbcur + "/" + dcbcur;
return ; // #######TODO 改写 LABEL与GOTO #### goto done
return ; // #### goto done
}
else
{
rate.value = dcbrat / scbrat;
dpy.value = dcbcur + "/" + scbcur;
return ; // #######TODO 改写 LABEL与GOTO #### goto done
return ; // #### goto done
}
}
else
{
rate.value = scbrat / dcbrat;
dpy.value = scbcur + "/" + dcbcur;
return ; // #######TODO 改写 LABEL与GOTO #### goto done
return ; // #### goto done
}
}
}
}
// #######TODO 改写 LABEL与GOTO #### label done
// #### label done
}
\ No newline at end of file
......@@ -29,7 +29,7 @@ String printSwiftFees(String rol,String tag,String argdirflg,String argdspflg,in
boolean allMisc = false;
// DO5CS.703597
String altCT = getAlternateFeeCodetable( tag, $\trnmod\trndoc\doccur\mt.getValue() );
// #######TODO 改写 LABEL与GOTO #### label Restart
// #### label Restart
int entCnt = 0;
IStream res = new StreamImpl();
Platform.streamClear( res );
......@@ -167,7 +167,7 @@ String printSwiftFees(String rol,String tag,String argdirflg,String argdspflg,in
if( ! allMisc )
{
allMisc = true;
//return ""; // #######TODO 改写 LABEL与GOTO #### goto Restart
//return ""; // #### goto Restart
continue Restart;
}
else
......
......@@ -27,7 +27,7 @@ String printSwiftFolFees(String rol,String tag,String argdirflg,String argdspflg
}
boolean allMisc = false;
String wrnBlkNegAmt = "";
// #######TODO 改写 LABEL与GOTO #### label Restart
// #### label Restart
Restart:
while (true){
......@@ -76,7 +76,7 @@ String printSwiftFolFees(String rol,String tag,String argdirflg,String argdspflg
if( ! allMisc )
{
allMisc = true;
//return ; // #######TODO 改写 LABEL与GOTO #### goto Restart
//return ; // #### goto Restart
continue Restart;
}
else
......
......@@ -26,7 +26,7 @@ String printSwiftFelFees(String rol,String tag,String argdirflg,String argdspflg
chkdspflg = "S";
}
boolean allMisc = false;
// #######TODO 改写 LABEL与GOTO #### label Restart
// #### label Restart
int entCnt = 0;
IStream res = new StreamImpl();
Platform.streamClear( res );
......@@ -79,7 +79,7 @@ String printSwiftFelFees(String rol,String tag,String argdirflg,String argdspflg
if( ! allMisc )
{
allMisc = true;
//return ; // #######TODO 改写 LABEL与GOTO #### goto Restart
//return ; // #### goto Restart
continue Restart;
}
else
......
......@@ -3,16 +3,21 @@ void recalcSetDetMac()
int rclCnt = 0;
Platform.postDefaultRule( $macdet );
String rclMacOld = $macdet;
// #######TODO 改写 LABEL与GOTO #### label RclStart
recalcSetdet();
// #######TODO 改写 LABEL与GOTO #### label setmac
Platform.postDefaultRule( $macdet );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $macdet.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $macdet;
rclCnt = rclCnt + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto RclStart
// #### label RclStart
RclStart:
while(true){
recalcSetdet();
// #### label setmac
Platform.postDefaultRule( $macdet );
// if this recalculation has changed internal MAC, restart calculation up to 20 times directly
if( Platform.compareTo(rclMacOld, $macdet.getValue()) != 0 && rclCnt <= 20 )
{
rclMacOld = $macdet;
rclCnt = rclCnt + 1;
//return ; // #### goto RclStart
continue RclStart;
}
break;
}
$macdetold = $macdet;
......
......@@ -22,7 +22,7 @@ String dtaGetFeesOwn(String argrol,String argdirflg,String argdspflg,int arglinn
chkdspflg = "S";
}
boolean allMisc = false;
// #######TODO 改写 LABEL与GOTO #### label Restart
// #### label Restart
RestartLabel:
while(true){
IStream res = new StreamImpl();
......@@ -79,7 +79,7 @@ String dtaGetFeesOwn(String argrol,String argdirflg,String argdspflg,int arglinn
if( ! allMisc )
{
allMisc = true;
//return ; // #######TODO 改写 LABEL与GOTO #### goto Restart
//return ; // #### goto Restart
continue RestartLabel;
}
else
......
......@@ -29,7 +29,7 @@ String printSwiftFeeDetDspFun(String rol,String tag,String sel)
allow = 6;
}
boolean allMisc = false;
// #######TODO 改写 LABEL与GOTO #### label restart
// #### label restart
int entCnt = 0;
IStream res = new StreamImpl();
Platform.streamClear( res );
......@@ -194,7 +194,7 @@ String printSwiftFeeDetDspFun(String rol,String tag,String sel)
if( ! allMisc && ( Platform.compareTo( tag , "73" ) == 0 || Platform.compareTo( tag , "73A" ) == 0 ) && Platform.compareTo( $\trnmod\trndoc\doccur\mt , "754" ) == 0 )
{
allMisc = true;
//return ; // #######TODO 改写 LABEL与GOTO #### goto restart
//return ; // #### goto restart
continue restartLabel;
}
else
......
......@@ -12,336 +12,339 @@ void printDetailledSettlement(String rol)
IStream curstm = new StreamImpl();
Platform.streamSet( curstm, getSettledCur( rol, "X" + "\r\n" + "S", "X" + "\r\n" + "S", "FNC" + "\r\n" + "FND" + "\r\n" + "HLD" ) );
// if nothing settled, skip to print of advised fees
if( Platform.isEmpty( curstm ) )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto PrtAdv
}
// get settled amount to be shown i.e. all amounts except amounts booked to internal financed accounts
BigDecimal setamt = $setglg.getSetAmtSysByRolTypDsp ( rol, "", "" );
setamt = Platform.numSub(setamt , $setglg.getSetAmtSysByRolTypDsp ( rol, "", "FNC,FND,HLD" ));
//Platform.printTemp( protect);
//header
if( Platform.pos( $dspflg.getValue(), "G" ) == 0 )
{
Platform.printTempUsing( "setmod.SetSetADVHEA");
}
else
{
if( Platform.compareTo(setamt , 0)>0 )
{
Platform.printTempUsing( "setmod.DETHEAdbt");
}
else
{
// avoid header if sum = 0
if( Platform.compareTo(setamt , 0)<0 )
while(true){
if( Platform.isEmpty( curstm ) )
{
Platform.printTempUsing( "setmod.DETHEAcdt");
break ; // #### goto PrtAdv
}
}
}
int stmCnt = Platform.streamCount( curstm );
String doccur = NULLSTR;
int gridcnt = 0;
int fnd = 0;
String line = NULLSTR;
int tabpos = 0;
String modid = NULLSTR;
BigDecimal diff = null;
String details = NULLSTR;
IStream enostm = new StreamImpl();
IStream groupedfees = new StreamImpl();
int stmCntEno = 0;
int i = 0;
String feegrp = NULLSTR;
String grp = NULLSTR;
int oldidx = 0;
String oldlin = NULLSTR;
int oldamt = 0;
int stmCntGro = 0;
String lin = NULLSTR;
BigDecimal amt = null;
String feetxt = NULLSTR;
String newcur1 = NULLSTR;
BigDecimal rat1 = null;
BigDecimal newamt1 = null;
String refcur = NULLSTR;
String newcur2 = NULLSTR;
Boolean ininflg = null;
String amtcur = NULLSTR;
String newcurc = NULLSTR;
BigDecimal newamtc = null;
BigDecimal rat2 = null;
for(int curstmidx = 1;curstmidx <= stmCnt;curstmidx++)
{
if( curstmidx > 1 )
{
// get settled amount to be shown i.e. all amounts except amounts booked to internal financed accounts
BigDecimal setamt = $setglg.getSetAmtSysByRolTypDsp ( rol, "", "" );
setamt = Platform.numSub(setamt , $setglg.getSetAmtSysByRolTypDsp ( rol, "", "FNC,FND,HLD" ));
//Platform.printTemp( protect);
}
doccur = Platform.getLine( curstm, curstmidx );
// initialization
$prtdetcnt = 0;
$prtdetamt = new BigDecimal("0");
setamt = new BigDecimal("0");
gridcnt = Platform.gridCount( $setglg\setgll );
for(i = 1;i <= gridcnt;i++)
{
if( Platform.compareTo( $setglg\setgll[i]\rol , rol ) == 0 && Platform.compareTo( $setglg\setgll[i]\cur , doccur ) == 0 )
//header
if( Platform.pos( $dspflg.getValue(), "G" ) == 0 )
{
switch( $setglg\setgll[i]\dsp.getValue() )
{
case "FNC":
case "FND":
case "HLD":
break;
default:
setamt = Platform.numAdd(setamt , $setglg\setgll[i]\amt.getValue());
}
Platform.printTempUsing( "setmod.SetSetADVHEA");
}
}
// print main amounts settled to that role in this transaction (ABB02) except amounts booked to internal financed accounts
// DO5DOS.003093
// sort amounts set by transaction to top
// because "Amount financed" must not be at 1st position
fnd = Platform.streamSearch( $setglg\setglgamtcon, "TRN" );
while( fnd > 0 )
{
line = Platform.getLine( $setglg\setglgamtcon.getValue(), fnd );
Platform.streamDelete( $setglg\setglgamtcon.getValue(), fnd );
Platform.streamInsert( $setglg\setglgamtcon.getValue(), 1, line );
fnd = Platform.streamSearch( $setglg\setglgamtcon, "TRN", fnd + 1 );
}
for(i = 1;i <= Platform.streamCount( $setglg\setglgamtcon.getValue() );i++)
{
line = Platform.getLine( $setglg\setglgamtcon.getValue(), i );
tabpos = Platform.pos( line, "\t" );
modid = Platform.mid( line, 1, tabpos - 1 );
// do not show amounts internally set by modules of SETMOD
if( Platform.compareTo(Platform.mid( modid, 1, 4 ), "*SET") != 0 )
else
{
line = Platform.mid( line, tabpos + 1 );
line = Platform.mid( line, 1, Platform.pos( line, "\r\n" ) - 1 );
Platform.cacheRead( $setglg\wrksum, modid, line );
if( Platform.compareTo( $setglg\wrksum\rol , rol ) == 0 )
if( Platform.compareTo(setamt , 0)>0 )
{
if( Platform.compareTo( $setglg\wrksum\cur , doccur ) == 0 )
Platform.printTempUsing( "setmod.DETHEAdbt");
}
else
{
// avoid header if sum = 0
if( Platform.compareTo(setamt , 0)<0 )
{
if( Platform.compareTo(Platform.mid( $setglg\wrksum\dsp.getValue(), 1, 2 ), "FN") != 0 && Platform.compareTo($setglg\wrksum\dsp.getValue(), "HLD") != 0 )
{
// DO5DOS.005004
// do not output internal credit entry for BR that pays our finance account
if( ! ( Platform.compareTo( $setglg\wrksum\dsp , "BRF" ) == 0 && Platform.compareTo($setglg\wrksum\amt.getValue() , 0)<0 ) )
{
// (DOS.005028)
// get difference between document amount and calculated basic amount
diff = Platform.numSub($docamt.getValue() , $setglg\wrksum\amt.getValue());
// If difference is equal with reduction amount, DOCAMT and WRKSUM\AMT are equal.
// That indicates that document amount will be settled only.
if( Platform.compareTo( diff , $redamt.getValue() ) == 0 )
{
// DOCAMT - REDAMT = WRKSUM\AMT
printDetailledAmount( $\trnmod\trndoc.xmlGetTblText( $setglg\wrksum\docamttyp.getValue(), "SETSUMW:DOCAMTTYP" ), doccur, $docamt.getValue(), setamt );
// print details for reduction of document amount
details = Platform.getText( #CT000454, $redamttxt.getValue() );
printDetailledAmount( details, doccur, $redamt.getValue().negate(), setamt );
}
else
{
// If difference is unequal with REDAMT, other amounts than DOCAMT will be settled.
printDetailledAmount( $\trnmod\trndoc.xmlGetTblText( $setglg\wrksum\docamttyp.getValue(), "SETSUMW:DOCAMTTYP" ), doccur, $setglg\wrksum\amt.getValue(), setamt );
}
}
}
Platform.printTempUsing( "setmod.DETHEAcdt");
}
}
}
}
// print foreign charges (ABB03)
gridcnt = Platform.gridCount( $setfog\setfol );
for(i = 1;i <= gridcnt;i++)
{
if( Platform.compareTo( $setfog\setfol[i]\cur , doccur ) == 0 && ( Platform.compareTo($setfog\setfol[i]\dsp, "X" )== 0 || Platform.compareTo($setfog\setfol[i]\dsp, "S" )== 0 ) )
int stmCnt = Platform.streamCount( curstm );
String doccur = NULLSTR;
int gridcnt = 0;
int fnd = 0;
String line = NULLSTR;
int tabpos = 0;
String modid = NULLSTR;
BigDecimal diff = null;
String details = NULLSTR;
IStream enostm = new StreamImpl();
IStream groupedfees = new StreamImpl();
int stmCntEno = 0;
int i = 0;
String feegrp = NULLSTR;
String grp = NULLSTR;
int oldidx = 0;
String oldlin = NULLSTR;
int oldamt = 0;
int stmCntGro = 0;
String lin = NULLSTR;
BigDecimal amt = null;
String feetxt = NULLSTR;
String newcur1 = NULLSTR;
BigDecimal rat1 = null;
BigDecimal newamt1 = null;
String refcur = NULLSTR;
String newcur2 = NULLSTR;
Boolean ininflg = null;
String amtcur = NULLSTR;
String newcurc = NULLSTR;
BigDecimal newamtc = null;
BigDecimal rat2 = null;
for(int curstmidx = 1;curstmidx <= stmCnt;curstmidx++)
{
if( Platform.compareTo( getGllRol( $setfog\setfol[i]\ptypay.getValue() ) , rol ) == 0 )
if( curstmidx > 1 )
{
printDetailledAmount( $setfog\setfol[i].setFolGetTxtpay ( $\trnmod\trndoc\doccur\docuil.getValue() ), doccur, $setfog\setfol[i]\amt.getValue().negate(), setamt );
//Platform.printTemp( protect);
}
if( Platform.compareTo( getGllRol( $setfog\setfol[i]\ptydbt.getValue() ) , rol ) == 0 )
doccur = Platform.getLine( curstm, curstmidx );
// initialization
$prtdetcnt = 0;
$prtdetamt = new BigDecimal("0");
setamt = new BigDecimal("0");
gridcnt = Platform.gridCount( $setglg\setgll );
for(i = 1;i <= gridcnt;i++)
{
printDetailledAmount( $setfog\setfol[i].setFolGetTxtdbt ( $\trnmod\trndoc\doccur\docuil.getValue() ), doccur, $setfog\setfol[i]\amt.getValue(), setamt );
if( Platform.compareTo( $setglg\setgll[i]\rol , rol ) == 0 && Platform.compareTo( $setglg\setgll[i]\cur , doccur ) == 0 )
{
switch( $setglg\setgll[i]\dsp.getValue() )
{
case "FNC":
case "FND":
case "HLD":
break;
default:
setamt = Platform.numAdd(setamt , $setglg\setgll[i]\amt.getValue());
}
}
}
}
}
// sort charges by ENO
Platform.streamClear( enostm );
Platform.streamSort( enostm, true );
gridcnt = Platform.gridCount( $setfeg\setfel );
for(i = 1;i <= gridcnt;i++)
{
Platform.cacheDbReadSql( $setfeg\wrkfee, Platform.sdbEtyGenSql( $setfeg\wrkfee, "where COD = " + Platform.sqlLit( $setfeg\setfel[i]\feecod.getValue() ) ) );
if( Platform.errorCode() <= 0 )
{
Platform.streamInsert( enostm, 0, $setfeg\wrkfee\eno.getValue() + Platform.toString( i, -3 ) + "\t" + Platform.toString( i, -3 ) );
}
else
{
if( Platform.errorCode() != tdOdbcNotFound )
// print main amounts settled to that role in this transaction (ABB02) except amounts booked to internal financed accounts
// DO5DOS.003093
// sort amounts set by transaction to top
// because "Amount financed" must not be at 1st position
fnd = Platform.streamSearch( $setglg\setglgamtcon, "TRN" );
while( fnd > 0 )
{
Platform.reraise();
line = Platform.getLine( $setglg\setglgamtcon.getValue(), fnd );
Platform.streamDelete( $setglg\setglgamtcon.getValue(), fnd );
Platform.streamInsert( $setglg\setglgamtcon.getValue(), 1, line );
fnd = Platform.streamSearch( $setglg\setglgamtcon, "TRN", fnd + 1 );
}
}
}
// print our charges (ABB05)
Platform.streamClear( groupedfees );
stmCntEno = Platform.streamCount( enostm );
for(int enorow = 1;enorow <= stmCntEno;enorow++)
{
line = Platform.getLine( enostm, enorow );
i = Platform.parseInt( Platform.mid( line, Platform.pos( line, "\t" ) + 1 ) );
if( Platform.compareTo( getGllRol( $setfeg\setfel[i]\rol.getValue() ) , rol ) == 0 && Platform.compareTo($setfeg\setfel[i]\amt.getValue(), 0) != 0 && Platform.compareTo( $setfeg\setfel[i]\cur , doccur ) == 0 )
{
if( Platform.compareTo($setfeg\setfel[i]\dsp, "X" )== 0 || Platform.compareTo($setfeg\setfel[i]\dsp, "S" )== 0 )
for(i = 1;i <= Platform.streamCount( $setglg\setglgamtcon.getValue() );i++)
{
feegrp = $setfeg.getFeeGrp( $setfeg\setfel[i]\feecod.getValue() );
if( ( Platform.isEmpty( feegrp ) && ( Platform.isEmpty( $cprflg ) ) ) || ( Platform.isModified( $setfeg\setfel[i]\feetxtinf ) ) )
line = Platform.getLine( $setglg\setglgamtcon.getValue(), i );
tabpos = Platform.pos( line, "\t" );
modid = Platform.mid( line, 1, tabpos - 1 );
// do not show amounts internally set by modules of SETMOD
if( Platform.compareTo(Platform.mid( modid, 1, 4 ), "*SET") != 0 )
{
printDetailledAmount( getFeetxtInfDocUil( i ), $setfeg\setfel[i]\cur.getValue(), $setfeg\setfel[i]\amt.getValue(), setamt );
// more details are available only if not from pool
if( ! ( Platform.compareTo($setfeg\setfel[i]\src, "D" )== 0 || Platform.compareTo($setfeg\setfel[i]\src, "A" )== 0 || Platform.compareTo($setfeg\setfel[i]\src, "P" )== 0 ) )
line = Platform.mid( line, tabpos + 1 );
line = Platform.mid( line, 1, Platform.pos( line, "\r\n" ) - 1 );
Platform.cacheRead( $setglg\wrksum, modid, line );
if( Platform.compareTo( $setglg\wrksum\rol , rol ) == 0 )
{
printFeeDetails( i );
if( Platform.compareTo( $setglg\wrksum\cur , doccur ) == 0 )
{
if( Platform.compareTo(Platform.mid( $setglg\wrksum\dsp.getValue(), 1, 2 ), "FN") != 0 && Platform.compareTo($setglg\wrksum\dsp.getValue(), "HLD") != 0 )
{
// DO5DOS.005004
// do not output internal credit entry for BR that pays our finance account
if( ! ( Platform.compareTo( $setglg\wrksum\dsp , "BRF" ) == 0 && Platform.compareTo($setglg\wrksum\amt.getValue() , 0)<0 ) )
{
// (DOS.005028)
// get difference between document amount and calculated basic amount
diff = Platform.numSub($docamt.getValue() , $setglg\wrksum\amt.getValue());
// If difference is equal with reduction amount, DOCAMT and WRKSUM\AMT are equal.
// That indicates that document amount will be settled only.
if( Platform.compareTo( diff , $redamt.getValue() ) == 0 )
{
// DOCAMT - REDAMT = WRKSUM\AMT
printDetailledAmount( $\trnmod\trndoc.xmlGetTblText( $setglg\wrksum\docamttyp.getValue(), "SETSUMW:DOCAMTTYP" ), doccur, $docamt.getValue(), setamt );
// print details for reduction of document amount
details = Platform.getText( #CT000454, $redamttxt.getValue() );
printDetailledAmount( details, doccur, $redamt.getValue().negate(), setamt );
}
else
{
// If difference is unequal with REDAMT, other amounts than DOCAMT will be settled.
printDetailledAmount( $\trnmod\trndoc.xmlGetTblText( $setglg\wrksum\docamttyp.getValue(), "SETSUMW:DOCAMTTYP" ), doccur, $setglg\wrksum\amt.getValue(), setamt );
}
}
}
}
}
else
}
}
// print foreign charges (ABB03)
gridcnt = Platform.gridCount( $setfog\setfol );
for(i = 1;i <= gridcnt;i++)
{
if( Platform.compareTo( $setfog\setfol[i]\cur , doccur ) == 0 && ( Platform.compareTo($setfog\setfol[i]\dsp, "X" )== 0 || Platform.compareTo($setfog\setfol[i]\dsp, "S" )== 0 ) )
{
if( Platform.compareTo( getGllRol( $setfog\setfol[i]\ptypay.getValue() ) , rol ) == 0 )
{
// hint that this fee has been advised before may be printed here
printDetailledAmount( $setfog\setfol[i].setFolGetTxtpay ( $\trnmod\trndoc\doccur\docuil.getValue() ), doccur, $setfog\setfol[i]\amt.getValue().negate(), setamt );
}
if( Platform.compareTo( getGllRol( $setfog\setfol[i]\ptydbt.getValue() ) , rol ) == 0 )
{
printDetailledAmount( $setfog\setfol[i].setFolGetTxtdbt ( $\trnmod\trndoc\doccur\docuil.getValue() ), doccur, $setfog\setfol[i]\amt.getValue(), setamt );
}
}
}
// sort charges by ENO
Platform.streamClear( enostm );
Platform.streamSort( enostm, true );
gridcnt = Platform.gridCount( $setfeg\setfel );
for(i = 1;i <= gridcnt;i++)
{
Platform.cacheDbReadSql( $setfeg\wrkfee, Platform.sdbEtyGenSql( $setfeg\wrkfee, "where COD = " + Platform.sqlLit( $setfeg\setfel[i]\feecod.getValue() ) ) );
if( Platform.errorCode() <= 0 )
{
Platform.streamInsert( enostm, 0, $setfeg\wrkfee\eno.getValue() + Platform.toString( i, -3 ) + "\t" + Platform.toString( i, -3 ) );
}
else
{
grp = $setfeg.getFeeGrp( $setfeg\setfel[i]\feecod.getValue() );
if( Platform.isEmpty( grp ) )
if( Platform.errorCode() != tdOdbcNotFound )
{
grp = $setfeg\setfel[i]\feecod;
Platform.reraise();
}
oldidx = Platform.streamSearch( groupedfees, grp + "\t" );
if( oldidx == 0 )
}
}
// print our charges (ABB05)
Platform.streamClear( groupedfees );
stmCntEno = Platform.streamCount( enostm );
for(int enorow = 1;enorow <= stmCntEno;enorow++)
{
line = Platform.getLine( enostm, enorow );
i = Platform.parseInt( Platform.mid( line, Platform.pos( line, "\t" ) + 1 ) );
if( Platform.compareTo( getGllRol( $setfeg\setfel[i]\rol.getValue() ) , rol ) == 0 && Platform.compareTo($setfeg\setfel[i]\amt.getValue(), 0) != 0 && Platform.compareTo( $setfeg\setfel[i]\cur , doccur ) == 0 )
{
if( Platform.compareTo($setfeg\setfel[i]\dsp, "X" )== 0 || Platform.compareTo($setfeg\setfel[i]\dsp, "S" )== 0 )
{
Platform.streamInsert( groupedfees, 0, grp + "\t" + Platform.toString( $setfeg\setfel[i]\amt.getValue() ) );
feegrp = $setfeg.getFeeGrp( $setfeg\setfel[i]\feecod.getValue() );
if( ( Platform.isEmpty( feegrp ) && ( Platform.isEmpty( $cprflg ) ) ) || ( Platform.isModified( $setfeg\setfel[i]\feetxtinf ) ) )
{
printDetailledAmount( getFeetxtInfDocUil( i ), $setfeg\setfel[i]\cur.getValue(), $setfeg\setfel[i]\amt.getValue(), setamt );
// more details are available only if not from pool
if( ! ( Platform.compareTo($setfeg\setfel[i]\src, "D" )== 0 || Platform.compareTo($setfeg\setfel[i]\src, "A" )== 0 || Platform.compareTo($setfeg\setfel[i]\src, "P" )== 0 ) )
{
printFeeDetails( i );
}
else
{
// hint that this fee has been advised before may be printed here
}
}
else
{
grp = $setfeg.getFeeGrp( $setfeg\setfel[i]\feecod.getValue() );
if( Platform.isEmpty( grp ) )
{
grp = $setfeg\setfel[i]\feecod;
}
oldidx = Platform.streamSearch( groupedfees, grp + "\t" );
if( oldidx == 0 )
{
Platform.streamInsert( groupedfees, 0, grp + "\t" + Platform.toString( $setfeg\setfel[i]\amt.getValue() ) );
}
else
{
oldlin = Platform.getLine( groupedfees, oldidx );
oldamt = Platform.parseInt( Platform.mid( oldlin, Platform.pos( oldlin, "\t" ) + 1 ) );
Platform.streamSetLine( groupedfees, oldidx, grp + "\t" + Platform.toString( Platform.numAdd($setfeg\setfel[i]\amt.getValue() , oldamt) ) );
}
}
}
else
}
}
// print compressed fee information
stmCntGro = Platform.streamCount( groupedfees );
if( stmCntGro > 0 )
{
Platform.streamSort( groupedfees, true );
for( i = 1;i <= stmCntGro;i++)
{
lin = Platform.getLine( groupedfees, i );
grp = Platform.mid( lin, 1, Platform.pos( lin, "\t" ) - 1 );
amt = new BigDecimal(Platform.parseInt( Platform.mid( lin, Platform.pos( lin, "\t" ) + 1 ) ));
feetxt = $\trnmod\trndoc.xmlGetTblText( grp, "FEEGRP" );
if( Platform.isEmpty( feetxt ) )
{
oldlin = Platform.getLine( groupedfees, oldidx );
oldamt = Platform.parseInt( Platform.mid( oldlin, Platform.pos( oldlin, "\t" ) + 1 ) );
Platform.streamSetLine( groupedfees, oldidx, grp + "\t" + Platform.toString( Platform.numAdd($setfeg\setfel[i]\amt.getValue() , oldamt) ) );
feetxt = $\trnmod\trndoc.xmlGetTblText( grp, "FEETXT" );
}
printDetailledAmount( feetxt, doccur, amt, setamt );
}
}
}
}
// print compressed fee information
stmCntGro = Platform.streamCount( groupedfees );
if( stmCntGro > 0 )
{
Platform.streamSort( groupedfees, true );
for( i = 1;i <= stmCntGro;i++)
{
lin = Platform.getLine( groupedfees, i );
grp = Platform.mid( lin, 1, Platform.pos( lin, "\t" ) - 1 );
amt = new BigDecimal(Platform.parseInt( Platform.mid( lin, Platform.pos( lin, "\t" ) + 1 ) ));
feetxt = $\trnmod\trndoc.xmlGetTblText( grp, "FEEGRP" );
if( Platform.isEmpty( feetxt ) )
// print total amount (ABB06)
if( Platform.compareTo(setamt , 0)>0 )
{
feetxt = $\trnmod\trndoc.xmlGetTblText( grp, "FEETXT" );
printDETSETTAB( #CT000323, " ", doccur, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( $prtdetamt.getValue() ), doccur ) );
}
printDetailledAmount( feetxt, doccur, amt, setamt );
}
}
// print total amount (ABB06)
if( Platform.compareTo(setamt , 0)>0 )
{
printDETSETTAB( #CT000323, " ", doccur, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( $prtdetamt.getValue() ), doccur ) );
}
else
{
// avoid "Total" line if sum = 0
if( Platform.compareTo(setamt , 0)<0 )
{
printDETSETTAB( #CT000324, " ", doccur, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( $prtdetamt.getValue() ), doccur ) );
}
}
// conversion information (ABB07+ABB08+ABB09 )
// print if final or temporary settlement
if( Platform.pos( $dspflg.getValue(), "G" ) >= 0 )
{
gridcnt = Platform.gridCount( $setglg\setgll );
for( i = 1;i <= gridcnt;i++)
{
if( Platform.compareTo( $setglg\setgll[i]\rol , rol ) == 0 && Platform.compareTo($setglg\setgll[i]\amt.getValue(), 0) != 0 && Platform.compareTo( $setglg\setgll[i]\cur , doccur ) == 0 )
else
{
if( Platform.compareTo( $setglg\setgll[i]\acccur , $setglg\setgll[i]\cur ) == 0 )
// avoid "Total" line if sum = 0
if( Platform.compareTo(setamt , 0)<0 )
{
newcur1 = $\cbsmod\xrtmod.getCurNewCur( $setglg\setgll[i]\cur.getValue() );
if( ! Platform.isEmpty( newcur1 ) )
{
$\trnmod\trndoc.xmlPrtEmptyLine( 1 );
rat1 = $\cbsmod\xrtmod.getCurGlbRat( $setglg\setgll[i]\cur.getValue() );
newamt1 = Platform.numDiv(Platform.abs( $setglg\setgll[i]\accamt.getValue() ) , rat1);
printDETSETTAB( Platform.getText( #CT000325, $setglg\setgll[i]\cur.getValue(), newcur1, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( $setglg\setgll[i]\amt.getValue() ), $setglg\setgll[i]\cur.getValue() ), rat1 ), " ", newcur1, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( newamt1 ), newcur1 ) );
}
printDETSETTAB( #CT000324, " ", doccur, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( $prtdetamt.getValue() ), doccur ) );
}
else
}
// conversion information (ABB07+ABB08+ABB09 )
// print if final or temporary settlement
if( Platform.pos( $dspflg.getValue(), "G" ) >= 0 )
{
gridcnt = Platform.gridCount( $setglg\setgll );
for( i = 1;i <= gridcnt;i++)
{
$\trnmod\trndoc.xmlPrtEmptyLine( 1 );
refcur = $\cbsmod\xrtmod.sysiso();
Argument<String> newcur1Box = new Argument<String>("",newcur1);
Argument<String> newcur2Box = new Argument<String>();
Argument<String> refcurBox = new Argument<String>("",refcur);
Argument<Boolean> ininflgBox = new Argument<Boolean>();
$\cbsmod\xrtmod.xrtCheckInIn( $setglg\setgll[i]\cur.getValue(), $setglg\setgll[i]\acccur.getValue(), newcur1Box, newcur2Box, refcurBox, ininflgBox );
newcur1 = newcur1Box.value;
newcur2 = newcur2Box.value;
refcur = refcurBox.value;
ininflg = ininflgBox.value;
amtcur = $setglg\setgll[i]\cur;
amt = $setglg\setgll[i]\amt;
if( ! Platform.isEmpty( newcur1 ) )
if( Platform.compareTo( $setglg\setgll[i]\rol , rol ) == 0 && Platform.compareTo($setglg\setgll[i]\amt.getValue(), 0) != 0 && Platform.compareTo( $setglg\setgll[i]\cur , doccur ) == 0 )
{
rat1 = $\cbsmod\xrtmod.getCurGlbRat( $setglg\setgll[i]\cur.getValue() );
newamt1 = $\cbsmod\xrtmod.amtRnd( Platform.numDiv(Platform.abs( $setglg\setgll[i]\amt.getValue() ) , rat1), newcur1 );
printDETSETTAB( Platform.getText( #CT000326, $setglg\setgll[i]\cur.getValue(), newcur1, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( $setglg\setgll[i]\amt.getValue() ), $setglg\setgll[i]\cur.getValue() ), rat1 ), " ", newcur1, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( newamt1 ), newcur1 ) );
amtcur = newcur1;
amt = newamt1;
}
if( ! ininflg )
{
if( Platform.isEmpty( newcur2 ) )
if( Platform.compareTo( $setglg\setgll[i]\acccur , $setglg\setgll[i]\cur ) == 0 )
{
newcurc = $setglg\setgll[i]\acccur;
newamtc = $setglg\setgll[i]\accamt;
newcur1 = $\cbsmod\xrtmod.getCurNewCur( $setglg\setgll[i]\cur.getValue() );
if( ! Platform.isEmpty( newcur1 ) )
{
$\trnmod\trndoc.xmlPrtEmptyLine( 1 );
rat1 = $\cbsmod\xrtmod.getCurGlbRat( $setglg\setgll[i]\cur.getValue() );
newamt1 = Platform.numDiv(Platform.abs( $setglg\setgll[i]\accamt.getValue() ) , rat1);
printDETSETTAB( Platform.getText( #CT000325, $setglg\setgll[i]\cur.getValue(), newcur1, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( $setglg\setgll[i]\amt.getValue() ), $setglg\setgll[i]\cur.getValue() ), rat1 ), " ", newcur1, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( newamt1 ), newcur1 ) );
}
}
else
{
newcurc = newcur2;
newamtc = $\cbsmod\xrtmod.amtRnd( Platform.numDiv($setglg\setgll[i]\accamt.getValue() , $\cbsmod\xrtmod.getCurGlbRat( $setglg\setgll[i]\acccur.getValue() )), newcur2 );
$\trnmod\trndoc.xmlPrtEmptyLine( 1 );
refcur = $\cbsmod\xrtmod.sysiso();
Argument<String> newcur1Box = new Argument<String>("",newcur1);
Argument<String> newcur2Box = new Argument<String>();
Argument<String> refcurBox = new Argument<String>("",refcur);
Argument<Boolean> ininflgBox = new Argument<Boolean>();
$\cbsmod\xrtmod.xrtCheckInIn( $setglg\setgll[i]\cur.getValue(), $setglg\setgll[i]\acccur.getValue(), newcur1Box, newcur2Box, refcurBox, ininflgBox );
newcur1 = newcur1Box.value;
newcur2 = newcur2Box.value;
refcur = refcurBox.value;
ininflg = ininflgBox.value;
amtcur = $setglg\setgll[i]\cur;
amt = $setglg\setgll[i]\amt;
if( ! Platform.isEmpty( newcur1 ) )
{
rat1 = $\cbsmod\xrtmod.getCurGlbRat( $setglg\setgll[i]\cur.getValue() );
newamt1 = $\cbsmod\xrtmod.amtRnd( Platform.numDiv(Platform.abs( $setglg\setgll[i]\amt.getValue() ) , rat1), newcur1 );
printDETSETTAB( Platform.getText( #CT000326, $setglg\setgll[i]\cur.getValue(), newcur1, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( $setglg\setgll[i]\amt.getValue() ), $setglg\setgll[i]\cur.getValue() ), rat1 ), " ", newcur1, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( newamt1 ), newcur1 ) );
amtcur = newcur1;
amt = newamt1;
}
if( ! ininflg )
{
if( Platform.isEmpty( newcur2 ) )
{
newcurc = $setglg\setgll[i]\acccur;
newamtc = $setglg\setgll[i]\accamt;
}
else
{
newcurc = newcur2;
newamtc = $\cbsmod\xrtmod.amtRnd( Platform.numDiv($setglg\setgll[i]\accamt.getValue() , $\cbsmod\xrtmod.getCurGlbRat( $setglg\setgll[i]\acccur.getValue() )), newcur2 );
}
printDETSETTAB( Platform.getText( #CT000327, amtcur, newcurc, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( amt ), amtcur ), $setglg\setgll[i]\rat.getValue() ), " ", newcurc, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( newamtc ), newcurc ) );
amt = newamtc;
amtcur = newcurc;
}
if( ! Platform.isEmpty( newcur2 ) )
{
rat2 = $\cbsmod\xrtmod.getCurGlbRat( $setglg\setgll[i]\acccur.getValue() );
printDETSETTAB( Platform.getText( #CT000328, newcur2, $setglg\setgll[i]\acccur.getValue(), $\trnmod\trndoc.xmlFmtAmount( Platform.abs( amt ), amtcur ), rat2 ), " ", $setglg\setgll[i]\acccur.getValue(), $\trnmod\trndoc.xmlFmtAmount( Platform.abs( $setglg\setgll[i]\accamt.getValue() ), $setglg\setgll[i]\acccur.getValue() ) );
}
}
printDETSETTAB( Platform.getText( #CT000327, amtcur, newcurc, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( amt ), amtcur ), $setglg\setgll[i]\rat.getValue() ), " ", newcurc, $\trnmod\trndoc.xmlFmtAmount( Platform.abs( newamtc ), newcurc ) );
amt = newamtc;
amtcur = newcurc;
}
if( ! Platform.isEmpty( newcur2 ) )
{
rat2 = $\cbsmod\xrtmod.getCurGlbRat( $setglg\setgll[i]\acccur.getValue() );
printDETSETTAB( Platform.getText( #CT000328, newcur2, $setglg\setgll[i]\acccur.getValue(), $\trnmod\trndoc.xmlFmtAmount( Platform.abs( amt ), amtcur ), rat2 ), " ", $setglg\setgll[i]\acccur.getValue(), $\trnmod\trndoc.xmlFmtAmount( Platform.abs( $setglg\setgll[i]\accamt.getValue() ), $setglg\setgll[i]\acccur.getValue() ) );
}
}
$\trnmod\trndoc.xmlPrtEmptyLine( 1 );
}
}
$\trnmod\trndoc.xmlPrtEmptyLine( 1 );
}
break;
}
// #######TODO 改写 LABEL与GOTO #### label PrtAdv
// #### label PrtAdv
// Print fees advised
boolean firstfee = false;
/**
......
......@@ -53,7 +53,7 @@ void getRecvType()
if( Platform.compareTo( yn , "Y" ) == 0 )
{
Platform.message( #CT000540, recvType );
return ; // #######TODO 改写 LABEL与GOTO #### goto Done
return ; // #### goto Done
}
}
}
......@@ -61,6 +61,6 @@ void getRecvType()
}
}
}
// #######TODO 改写 LABEL与GOTO #### label Done
// #### label Done
}
\ No newline at end of file
......@@ -31,73 +31,80 @@ static void foruseSockCall(IStream instm,IStream outstm,Argument<Boolean> failed
{
while( trycount <= 5 && cmpFlag != true )
{
Platform.writeLog( "ForuseSEQ", #CT000013 );
fd = Platform.SockOpen( ip, port );
callError = Platform.errorCode();
if( callError != 0 )
{
Platform.writeLog( "ForuseSEQ", Platform.getText( #CT000014, Platform.errorCode() ) );
trnflg = "E";
trycount = trycount + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto endlab
}
Platform.setContext( "SOCKTIMEOUT", timeout );
Platform.SockCall( fd, instm, outStream );
//500
callError = Platform.errorCode();
if( callError != 0 )
{
Platform.writeLog( "ForuseSEQ", Platform.getText( #CT000015, Platform.errorCode() ) );
trnflg = "E";
trycount = trycount + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto endlab
}
Platform.SockClose( fd );
callError = Platform.errorCode();
if( callError != 0 )
{
Platform.writeLog( "ForuseSEQ", Platform.getText( #CT000016, Platform.errorCode() ) );
trnflg = "E";
trycount = trycount + 1;
return ; // #######TODO 改写 LABEL与GOTO #### goto endlab
}
/**
if $OutStream <> "0" then
WriteLog( "ForuseSEQ", GetText( 'L0000020', ErrorCode ) )
$TRNFLG = "E"
$Trycount = $Trycount + 1
goto endlab
endif
**/
if( ! Platform.isEmpty( outStream ) )
{
msg = "";
for(int i = 1;i <= Platform.streamCount( outStream );i++)
{
msg = msg + Platform.getLine( outStream, i );
}
pos = Platform.pos( msg, "|" );
outresult = Platform.mid( msg, 1, pos - 1 );
if( Platform.compareTo(outresult, "0") != 0 )
{
trnflg = "E";
}
else
{
trnflg = "";
}
/**
else
$result = -3
Error( 'L0000022' )
**/
}
if( Platform.compareTo(trnflg, "E") != 0 )
{
cmpFlag = true;
failed.value = true;
endlab:
while(true){
Platform.writeLog( "ForuseSEQ", #CT000013 );
fd = Platform.SockOpen( ip, port );
callError = Platform.errorCode();
if( callError != 0 )
{
Platform.writeLog( "ForuseSEQ", Platform.getText( #CT000014, Platform.errorCode() ) );
trnflg = "E";
trycount = trycount + 1;
//return ; // #### goto endlab
break endlab;
}
Platform.setContext( "SOCKTIMEOUT", timeout );
Platform.SockCall( fd, instm, outStream );
//500
callError = Platform.errorCode();
if( callError != 0 )
{
Platform.writeLog( "ForuseSEQ", Platform.getText( #CT000015, Platform.errorCode() ) );
trnflg = "E";
trycount = trycount + 1;
//return ; // #### goto endlab
break endlab;
}
Platform.SockClose( fd );
callError = Platform.errorCode();
if( callError != 0 )
{
Platform.writeLog( "ForuseSEQ", Platform.getText( #CT000016, Platform.errorCode() ) );
trnflg = "E";
trycount = trycount + 1;
//return ; // #### goto endlab
break endlab;
}
/**
if $OutStream <> "0" then
WriteLog( "ForuseSEQ", GetText( 'L0000020', ErrorCode ) )
$TRNFLG = "E"
$Trycount = $Trycount + 1
goto endlab
endif
**/
if( ! Platform.isEmpty( outStream ) )
{
msg = "";
for(int i = 1;i <= Platform.streamCount( outStream );i++)
{
msg = msg + Platform.getLine( outStream, i );
}
pos = Platform.pos( msg, "|" );
outresult = Platform.mid( msg, 1, pos - 1 );
if( Platform.compareTo(outresult, "0") != 0 )
{
trnflg = "E";
}
else
{
trnflg = "";
}
/**
else
$result = -3
Error( 'L0000022' )
**/
}
if( Platform.compareTo(trnflg, "E") != 0 )
{
cmpFlag = true;
failed.value = true;
}
break endlab;
}
// #######TODO 改写 LABEL与GOTO #### label endlab
// #### label endlab
trycount = trycount + 1;
}
if( callError == 502 )
......
......@@ -50,7 +50,7 @@ void updateSptSpr(#spt argspt,String argsptsta,String argsprsta)
Platform.dbCommit();
Platform.status( #CT000104, $spt\objnam.getValue(), $spt\txt.getValue() );
//ReadSPTSTM
// #######TODO 改写 LABEL与GOTO #### label LblEnd
// #### label LblEnd
Platform.sdbFree( argspt );
}
\ No newline at end of file
......@@ -54,7 +54,7 @@ void printSwtWithSMH(#smh insmh,String intitle)
default:
Platform.setErrorCode( 599, Platform.formatText( "GetViewFromSMH returned unknown format \'$1\'", viewFmt ) );
}
// #######TODO 改写 LABEL与GOTO #### label ErrorLabel
// #### label ErrorLabel
if( Platform.errorCode() > 0 )
{
Platform.message( #CT000259, $docimm\filename.getValue(), Platform.getErrorText(), Platform.errorCode() );
......
......@@ -112,7 +112,7 @@ void executeReject(String argsptinr)
//##########
msg = Platform.getText( #CT000285, filename, "Error", Platform.errorCode(), Platform.getErrorText() );
Platform.message( #CT000299, msg );
return ; // #######TODO 改写 LABEL与GOTO #### goto LblEnd
return ; // #### goto LblEnd
}
else
{
......@@ -126,7 +126,7 @@ void executeReject(String argsptinr)
if( flag == false )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto LblEnd
return ; // #### goto LblEnd
}
Platform.streamClear( strstream1 );
Platform.streamInsert( strstream1, 0, $infor.getValue() );
......@@ -148,7 +148,7 @@ void executeReject(String argsptinr)
// PromptOK( 'RG000292
}
}
// #######TODO 改写 LABEL与GOTO #### label LblEnd
// #### label LblEnd
Platform.clear( $smh );
}
else
......
......@@ -56,7 +56,7 @@ void printBOPWithNET(#bopnet insmh,String intitle)
default:
Platform.setErrorCode( 599, Platform.formatText( "GetViewFromSMH returned unknown format \'$1\'", viewFmt ) );
}
// #######TODO 改写 LABEL与GOTO #### label ErrorLabel
// #### label ErrorLabel
if( Platform.errorCode() > 0 )
{
Platform.message( #CT000613, $docimm\filename.getValue(), Platform.getErrorText(), Platform.errorCode() );
......
......@@ -114,7 +114,7 @@ void doHandle(Argument<String> rc,Argument<String> errmsg,String subnam,String t
goto CloEnd
endif
**/
// #######TODO 改写 LABEL与GOTO #### label CloEnd
// #### label CloEnd
if( Platform.compareTo( rc.value , "E" ) == 0 )
{
Platform.dbRollback();
......
......@@ -9,257 +9,268 @@ void gridCfgLoadTds(IModule argrec,String argtds)
String tbl = Platform.toUpper( Platform.trim( Platform.getTableName( argrec ) ) );
String modPth = Platform.getModuleInfo( argrec, tdModuleInfoFullName );
String tdsFil = Platform.tdVCSReadName( "FRAME", tbl + ".tds" );
if( Platform.errorCode() == 100 )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto AutoGen
}
else
{
Platform.reraise();
}
String tdsGrdValSec = tbl + "." + argtds;
// modi for weihai
String tdsIniLab = NULLSTR;
if( Platform.compareTo( Platform.getLang() , "CN" ) == 0 )
{
tdsIniLab = "[" + argtds + "-" + "EN" + "-Init-GridCfg]";
}
else
{
tdsIniLab = "[" + argtds + "-" + Platform.getLang() + "-Init-GridCfg]";
}
IStream tdsStm = new StreamImpl();
Platform.streamLoad( tdsStm, tdsFil );
IStream tdsIniStm = new StreamImpl();
Platform.streamClear( tdsIniStm );
int tdsTxtBeg = 0;
if( Platform.compareTo( Platform.getLang() , "CN" ) == 0 )
{
tdsTxtBeg = Platform.streamSearch( tdsStm, "[" + "EN" + "-" + tdsGrdValSec + "-Caption]" ) + 1;
}
else
{
tdsTxtBeg = Platform.streamSearch( tdsStm, "[" + Platform.getLang() + "-" + tdsGrdValSec + "-Caption]" ) + 1;
}
if( tdsTxtBeg < 2 )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto AutoGen
}
int tdsTxtEnd = Platform.streamSearch( tdsStm, "[", tdsTxtBeg ) - 1;
if( tdsTxtEnd < tdsTxtBeg )
{
tdsTxtEnd = Platform.streamCount( tdsStm );
}
int tdsGrdBeg = Platform.streamSearch( tdsStm, "[" + tdsGrdValSec + "-GridValues]" ) + 1;
if( tdsGrdBeg < 2 )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto AutoGen
}
int tdsGrdEnd = Platform.streamSearch( tdsStm, "[", tdsGrdBeg ) - 1;
if( tdsGrdEnd < tdsGrdBeg )
{
tdsGrdEnd = Platform.streamCount( tdsStm );
}
// Determine the heading of the promptstream
int idx = Platform.streamSearch( tdsStm, "FormCaption=", tdsTxtBeg, tdsTxtEnd );
String stgHea = NULLSTR;
String lin = NULLSTR;
int idx;
String stgHea = null;
String lin = null;
int pos = 0;
if( idx == 0 )
{
stgHea = argtds;
}
else
{
lin = Platform.getLine( tdsStm, idx );
pos = Platform.pos( lin, "=" );
stgHea = Platform.mid( lin, pos + 1 );
}
// Prepare the streamgrid
gridCfgInit();
Platform.streamInsert( tdsIniStm, 0, "GridCfgInit" );
gridCfgAddJoinIns( tbl, "", "" );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "GridCfgAddJoinIns( \"$1\", \"\", \"\" )", tbl ) );
gridCfgAddFld( "", Platform.getField( modPth + "\\INR" ), 0, "INR", -1, "" );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "GridCfgAddFld( \"\", $1\\INR, 0, \"INR\", -1, \"\" )", modPth ) );
String pmtTop = "";
String pmtLft = "";
String pmtWth = "";
int posCom = 0;
String col = NULLSTR;
String fmtPar = NULLSTR;
int posEqu = 0;
String fld = NULLSTR;
IDatafield colFld = null;
int siz = 0;
int posCom2 = 0;
String add = NULLSTR;
int seaIdx = 0;
String seaLin = NULLSTR;
int seaPos = 0;
String hea = NULLSTR;
int dtaTyp = 0;
int curIdx = 0;
int decPos = 0;
int fldLen = 0;
String codTbl = NULLSTR;
String codVal = NULLSTR;
String val = NULLSTR;
for( idx = tdsGrdBeg;idx <= tdsGrdEnd;idx++)
{
lin = Platform.toUpper( Platform.getLine( tdsStm, idx ) );
if( Platform.compareTo( Platform.mid( lin, 1, 1 ) , "[" ) == 0 )
{
break;
}
pos = Platform.pos( lin, "-" );
switch( Platform.mid( lin, 1, pos ) )
{
case "COLUMN-":
posCom = Platform.pos( lin, "," );
col = Platform.mid( lin, posCom + 1 );
if( Platform.compareTo(col , "0")>0 )
String tdsGrdValSec = "";
String tdsIniLab = "";
IStream tdsStm = new StreamImpl();
AutoGen:
while(true){
if( Platform.errorCode() == 100 )
{
break AutoGen ; // #### goto AutoGen
}
else
{
Platform.reraise();
}
tdsGrdValSec = tbl + "." + argtds;
// modi for weihai
tdsIniLab = NULLSTR;
if( Platform.compareTo( Platform.getLang() , "CN" ) == 0 )
{
tdsIniLab = "[" + argtds + "-" + "EN" + "-Init-GridCfg]";
}
else
{
tdsIniLab = "[" + argtds + "-" + Platform.getLang() + "-Init-GridCfg]";
}
tdsStm = new StreamImpl();
Platform.streamLoad( tdsStm, tdsFil );
IStream tdsIniStm = new StreamImpl();
Platform.streamClear( tdsIniStm );
int tdsTxtBeg = 0;
if( Platform.compareTo( Platform.getLang() , "CN" ) == 0 )
{
tdsTxtBeg = Platform.streamSearch( tdsStm, "[" + "EN" + "-" + tdsGrdValSec + "-Caption]" ) + 1;
}
else
{
tdsTxtBeg = Platform.streamSearch( tdsStm, "[" + Platform.getLang() + "-" + tdsGrdValSec + "-Caption]" ) + 1;
}
if( tdsTxtBeg < 2 )
{
break AutoGen ; // #### goto AutoGen
}
int tdsTxtEnd = Platform.streamSearch( tdsStm, "[", tdsTxtBeg ) - 1;
if( tdsTxtEnd < tdsTxtBeg )
{
tdsTxtEnd = Platform.streamCount( tdsStm );
}
int tdsGrdBeg = Platform.streamSearch( tdsStm, "[" + tdsGrdValSec + "-GridValues]" ) + 1;
if( tdsGrdBeg < 2 )
{
break AutoGen ; // #### goto AutoGen
}
int tdsGrdEnd = Platform.streamSearch( tdsStm, "[", tdsGrdBeg ) - 1;
if( tdsGrdEnd < tdsGrdBeg )
{
tdsGrdEnd = Platform.streamCount( tdsStm );
}
// Determine the heading of the promptstream
idx = Platform.streamSearch( tdsStm, "FormCaption=", tdsTxtBeg, tdsTxtEnd );
stgHea = NULLSTR;
lin = NULLSTR;
pos = 0;
if( idx == 0 )
{
stgHea = argtds;
}
else
{
fmtPar = "";
posEqu = Platform.pos( lin, "=" );
// Determine fieldname
fld = Platform.mid( lin, 8, posEqu - 8 );
colFld = Platform.getField( modPth + "\\" + fld );
if( Platform.errorCode() == 0 )
lin = Platform.getLine( tdsStm, idx );
pos = Platform.pos( lin, "=" );
stgHea = Platform.mid( lin, pos + 1 );
}
// Prepare the streamgrid
gridCfgInit();
Platform.streamInsert( tdsIniStm, 0, "GridCfgInit" );
gridCfgAddJoinIns( tbl, "", "" );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "GridCfgAddJoinIns( \"$1\", \"\", \"\" )", tbl ) );
gridCfgAddFld( "", Platform.getField( modPth + "\\INR" ), 0, "INR", -1, "" );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "GridCfgAddFld( \"\", $1\\INR, 0, \"INR\", -1, \"\" )", modPth ) );
String pmtTop = "";
String pmtLft = "";
String pmtWth = "";
int posCom = 0;
String col = NULLSTR;
String fmtPar = NULLSTR;
int posEqu = 0;
String fld = NULLSTR;
IDatafield colFld = null;
int siz = 0;
int posCom2 = 0;
String add = NULLSTR;
int seaIdx = 0;
String seaLin = NULLSTR;
int seaPos = 0;
String hea = NULLSTR;
int dtaTyp = 0;
int curIdx = 0;
int decPos = 0;
int fldLen = 0;
String codTbl = NULLSTR;
String codVal = NULLSTR;
String val = NULLSTR;
for( idx = tdsGrdBeg;idx <= tdsGrdEnd;idx++)
{
lin = Platform.toUpper( Platform.getLine( tdsStm, idx ) );
if( Platform.compareTo( Platform.mid( lin, 1, 1 ) , "[" ) == 0 )
{
// Determine size of column
siz = Platform.parseInt( Platform.mid( lin, posEqu + 1, posCom - posEqu - 1 ) );
// Determine column number within display streamgrid
posCom2 = Platform.pos( col, "," );
if( posCom2 > 0 )
{
add = Platform.mid( col, posCom2 + 1 );
col = Platform.mid( col, 1, posCom2 - 1 );
}
else
{
add = "";
}
// Search for column heading
seaIdx = Platform.streamSearch( tdsStm, "Header-" + fld + "=", tdsTxtBeg, tdsTxtEnd );
seaLin = Platform.getLine( tdsStm, seaIdx );
seaPos = Platform.pos( seaLin, "=" );
hea = Platform.mid( seaLin, seaPos + 1 );
// Determine datatype
dtaTyp = Platform.getAttribute( colFld, tdAttrDatatype );
switch( dtaTyp )
break;
}
pos = Platform.pos( lin, "-" );
switch( Platform.mid( lin, 1, pos ) )
{
case "COLUMN-":
posCom = Platform.pos( lin, "," );
col = Platform.mid( lin, posCom + 1 );
if( Platform.compareTo(col , "0")>0 )
{
case tdDataTypeNumeric:
if( ! Platform.isEmpty( add ) )
fmtPar = "";
posEqu = Platform.pos( lin, "=" );
// Determine fieldname
fld = Platform.mid( lin, 8, posEqu - 8 );
colFld = Platform.getField( modPth + "\\" + fld );
if( Platform.errorCode() == 0 )
{
// Determine relevant currency for amount columns
// Search for the requested currency column
curIdx = Platform.streamSearch( $fldstm, tbl + "." + add + "\t" );
if( curIdx == 0 )
// Determine size of column
siz = Platform.parseInt( Platform.mid( lin, posEqu + 1, posCom - posEqu - 1 ) );
// Determine column number within display streamgrid
posCom2 = Platform.pos( col, "," );
if( posCom2 > 0 )
{
// if column not found integrate as hidden column
// (this might lead to double access to the same column, when column is defined later)
gridCfgAddCol( tbl + "." + add, 0, "", -1, tdDataTypeText, "" );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "GridCfgAddCol( $1.$Add, 0, \"\", -1, tdDataTypeText, \"\" )", tbl, add ) );
curIdx = Platform.streamCount( $fldstm.getValue() );
add = Platform.mid( col, posCom2 + 1 );
col = Platform.mid( col, 1, posCom2 - 1 );
}
fmtPar = Platform.toString( tdViewTypeAmount ) + " 1 " + Platform.toString( curIdx - 1 );
}
else
{
decPos = Platform.getAttribute( colFld, tdAttrDecpos );
fldLen = Platform.getAttribute( colFld, tdAttrLength );
fmtPar = Platform.toString( tdViewTypeEdit ) + " 1 " + Platform.toString( fldLen ) + "." + Platform.toString( decPos );
}
break;
case tdDataTypeText:
// check and determine codetable
seaIdx = Platform.streamSearch( tdsStm, "Codetable-" + fld + "=", tdsGrdBeg, tdsGrdEnd );
codTbl = "";
if( seaIdx > 0 )
{
else
{
add = "";
}
// Search for column heading
seaIdx = Platform.streamSearch( tdsStm, "Header-" + fld + "=", tdsTxtBeg, tdsTxtEnd );
seaLin = Platform.getLine( tdsStm, seaIdx );
seaPos = Platform.pos( seaLin, "=" );
codVal = Platform.mid( seaLin, seaPos + 1 );
posCom = Platform.pos( codVal, "," );
if( Platform.compareTo(Platform.mid( codVal, posCom + 1, 1 ), "Y") != 0 )
hea = Platform.mid( seaLin, seaPos + 1 );
// Determine datatype
dtaTyp = Platform.getAttribute( colFld, tdAttrDatatype );
switch( dtaTyp )
{
codTbl = Platform.toUpper( Platform.mid( codVal, 1, posCom - 1 ) );
if( Platform.compareTo( codTbl , "<EMBEDDED>" ) == 0 )
case tdDataTypeNumeric:
if( ! Platform.isEmpty( add ) )
{
codTbl = tbl + ":" + fld;
// Determine relevant currency for amount columns
// Search for the requested currency column
curIdx = Platform.streamSearch( $fldstm, tbl + "." + add + "\t" );
if( curIdx == 0 )
{
// if column not found integrate as hidden column
// (this might lead to double access to the same column, when column is defined later)
gridCfgAddCol( tbl + "." + add, 0, "", -1, tdDataTypeText, "" );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "GridCfgAddCol( $1.$Add, 0, \"\", -1, tdDataTypeText, \"\" )", tbl, add ) );
curIdx = Platform.streamCount( $fldstm.getValue() );
}
fmtPar = Platform.toString( tdViewTypeAmount ) + " 1 " + Platform.toString( curIdx - 1 );
}
else
{
decPos = Platform.getAttribute( colFld, tdAttrDecpos );
fldLen = Platform.getAttribute( colFld, tdAttrLength );
fmtPar = Platform.toString( tdViewTypeEdit ) + " 1 " + Platform.toString( fldLen ) + "." + Platform.toString( decPos );
}
break;
case tdDataTypeText:
// check and determine codetable
seaIdx = Platform.streamSearch( tdsStm, "Codetable-" + fld + "=", tdsGrdBeg, tdsGrdEnd );
codTbl = "";
if( seaIdx > 0 )
{
seaLin = Platform.getLine( tdsStm, seaIdx );
seaPos = Platform.pos( seaLin, "=" );
codVal = Platform.mid( seaLin, seaPos + 1 );
posCom = Platform.pos( codVal, "," );
if( Platform.compareTo(Platform.mid( codVal, posCom + 1, 1 ), "Y") != 0 )
{
codTbl = Platform.toUpper( Platform.mid( codVal, 1, posCom - 1 ) );
if( Platform.compareTo( codTbl , "<EMBEDDED>" ) == 0 )
{
codTbl = tbl + ":" + fld;
}
}
fmtPar = Platform.toString( tdViewTypeEdit ) + " 1 " + codTbl;
}
break;
case tdDataTypeDate:
fmtPar = Platform.toString( tdViewTypeDate );
break;
case tdDataTypeDateTime:
fmtPar = Platform.toString( tdViewTypeDateTime );
break;
}
fmtPar = Platform.toString( tdViewTypeEdit ) + " 1 " + codTbl;
// Add column
gridCfgAddCol( tbl + "." + fld, Platform.parseInt( col ), hea, siz, dtaTyp, fmtPar );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "// GridCfgAddFld( \"\", $1\\$2, 0, '$3', 0, \"\" )", modPth, fld, hea ) );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "GridCfgAddCol( \"$1.$2\", $3, '$4', $5, $6, \"$7\" )", tbl, fld, col, hea, siz, dtaTyp, fmtPar ) );
}
}
break;
case "GRID-":
posEqu = Platform.pos( lin, "=" );
fld = Platform.mid( lin, 6, posEqu - 6 );
val = Platform.mid( lin, posEqu + 1 );
switch( fld )
{
case "TOP":
pmtTop = val;
break;
case tdDataTypeDate:
fmtPar = Platform.toString( tdViewTypeDate );
case "LEFT":
pmtLft = val;
break;
case tdDataTypeDateTime:
fmtPar = Platform.toString( tdViewTypeDateTime );
case "WIDTH":
pmtWth = val;
break;
}
// Add column
gridCfgAddCol( tbl + "." + fld, Platform.parseInt( col ), hea, siz, dtaTyp, fmtPar );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "// GridCfgAddFld( \"\", $1\\$2, 0, '$3', 0, \"\" )", modPth, fld, hea ) );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "GridCfgAddCol( \"$1.$2\", $3, '$4', $5, $6, \"$7\" )", tbl, fld, col, hea, siz, dtaTyp, fmtPar ) );
break;
}
}
break;
case "GRID-":
posEqu = Platform.pos( lin, "=" );
fld = Platform.mid( lin, 6, posEqu - 6 );
val = Platform.mid( lin, posEqu + 1 );
switch( fld )
gridCfgSetPromptStream( argtds, stgHea, pmtTop, pmtLft, pmtWth );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "GridCfgSetPromptStream( \"$1\", '$2', $3, $4, $5 )", argtds, stgHea, pmtTop, pmtLft, pmtWth ) );
gridCfgStore( argtds );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "GridCfgStore( \"$1\" )", argtds ) );
String chkLin = Platform.getLine( tdsStm, tdsTxtBeg );
int tdsIniBeg = 0;
int tdsIniEnd = 0;
int ignore = 0;
if( Platform.compareTo(Platform.mid( chkLin, 1, 9 ), "; Autogen") != 0 )
{
case "TOP":
pmtTop = val;
break;
case "LEFT":
pmtLft = val;
break;
case "WIDTH":
pmtWth = val;
break;
}
break;
}
}
gridCfgSetPromptStream( argtds, stgHea, pmtTop, pmtLft, pmtWth );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "GridCfgSetPromptStream( \"$1\", '$2', $3, $4, $5 )", argtds, stgHea, pmtTop, pmtLft, pmtWth ) );
gridCfgStore( argtds );
Platform.streamInsert( tdsIniStm, 0, Platform.formatText( "GridCfgStore( \"$1\" )", argtds ) );
String chkLin = Platform.getLine( tdsStm, tdsTxtBeg );
int tdsIniBeg = 0;
int tdsIniEnd = 0;
int ignore = 0;
if( Platform.compareTo(Platform.mid( chkLin, 1, 9 ), "; Autogen") != 0 )
{
Platform.streamInsert( tdsStm, tdsTxtBeg, Platform.formatText( "; Autogen of Section $1 on $2 at $3 with Basic source", tdsIniLab, Platform.today(), Platform.fmtTime( Platform.Time() ) ) );
tdsIniBeg = Platform.streamSearch( tdsStm, tdsIniLab );
if( tdsIniBeg > 0 )
{
tdsIniEnd = Platform.streamSearch( tdsStm, "[", tdsIniBeg + 1 ) - 1;
if( tdsIniEnd <= 0 )
{
tdsIniEnd = Platform.streamCount( tdsStm );
}
for( idx = tdsIniBeg;idx <= tdsIniEnd;idx++)
{
Platform.streamDelete( tdsStm, tdsIniBeg );
Platform.streamInsert( tdsStm, tdsTxtBeg, Platform.formatText( "; Autogen of Section $1 on $2 at $3 with Basic source", tdsIniLab, Platform.today(), Platform.fmtTime( Platform.Time() ) ) );
tdsIniBeg = Platform.streamSearch( tdsStm, tdsIniLab );
if( tdsIniBeg > 0 )
{
tdsIniEnd = Platform.streamSearch( tdsStm, "[", tdsIniBeg + 1 ) - 1;
if( tdsIniEnd <= 0 )
{
tdsIniEnd = Platform.streamCount( tdsStm );
}
for( idx = tdsIniBeg;idx <= tdsIniEnd;idx++)
{
Platform.streamDelete( tdsStm, tdsIniBeg );
}
}
// store the generated basic ruletext which creates a streamgrid with the current tds settings
// this ruletext might be used to implement a basic rule to configure the streamgrid instead of tds
Platform.streamInsert( tdsIniStm, 1, tdsIniLab );
Platform.streamInsert( tdsStm, tdsIniBeg, tdsIniStm );
Platform.streamSave( tdsStm, tdsFil );
ignore = Platform.errorCode();
}
}
// store the generated basic ruletext which creates a streamgrid with the current tds settings
// this ruletext might be used to implement a basic rule to configure the streamgrid instead of tds
Platform.streamInsert( tdsIniStm, 1, tdsIniLab );
Platform.streamInsert( tdsStm, tdsIniBeg, tdsIniStm );
Platform.streamSave( tdsStm, tdsFil );
ignore = Platform.errorCode();
if(1==1) return;
}
if(1==1) return;
//--------------------------------------------------------------------
// #######TODO 改写 LABEL与GOTO #### label AutoGen
// #### label AutoGen
// autogenerate fieldlist in case no valid tds file (entry) available
gridCfgInit();
gridCfgAddJoinIns( tbl, "", "" );
......
......@@ -31,44 +31,48 @@ void svsFldTblSet2VisibleFields()
stmCntFld = Platform.streamCount( fldStream );
for(int fldIdx = 1;fldIdx <= stmCntFld;fldIdx++)
{
fieldName = Platform.trim( Platform.getLine( fldStream, fldIdx ) );
if( Platform.isEmpty( fieldName ) )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto NextField
NextField:
while(true){
fieldName = Platform.trim( Platform.getLine( fldStream, fldIdx ) );
if( Platform.isEmpty( fieldName ) )
{
break NextField ; // #### goto NextField
}
field = Platform.getField( fieldName );
datatype = Platform.getAttribute( field, tdAttrDatatype );
switch( datatype )
{
case tdDataTypeText:
if( ! Platform.IsEnabled( field ) )
{
break NextField ; // #### goto NextField
}
viewType = Platform.getAttribute( field, tdAttrViewtype );
int tdViewTypeLabel = 0;
if( viewType == tdViewTypeLabel )
{
break NextField ; // #### goto NextField
}
break;
case tdDataTypeNumeric:
case tdDataTypeDate:
if( ! Platform.IsEnabled( field ) )
{
break NextField ; // #### goto NextField
}
break;
default:
break NextField ; // #### goto NextField
}
// if the same field appears twice, store only once
found = Platform.streamSearch( $frmfld, fieldName + " " );
if( found == 0 )
{
Platform.streamInsert( $frmfld.getValue(), 0, fieldName + " " );
}
break NextField;
}
field = Platform.getField( fieldName );
datatype = Platform.getAttribute( field, tdAttrDatatype );
switch( datatype )
{
case tdDataTypeText:
if( ! Platform.IsEnabled( field ) )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto NextField
}
viewType = Platform.getAttribute( field, tdAttrViewtype );
int tdViewTypeLabel = 0;
if( viewType == tdViewTypeLabel )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto NextField
}
break;
case tdDataTypeNumeric:
case tdDataTypeDate:
if( ! Platform.IsEnabled( field ) )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto NextField
}
break;
default:
return ; // #######TODO 改写 LABEL与GOTO #### goto NextField
}
// if the same field appears twice, store only once
found = Platform.streamSearch( $frmfld, fieldName + " " );
if( found == 0 )
{
Platform.streamInsert( $frmfld.getValue(), 0, fieldName + " " );
}
// #######TODO 改写 LABEL与GOTO #### label NextField
// #### label NextField
}
}
}
......
......@@ -30,47 +30,52 @@ void svsSsnSave(String argfld,String savetype)
Platform.streamSet( $frmfld.getValue(), $svsfld.getValue() );
int stmCnt = 0;
String content = NULLSTR;
if( Platform.isEmpty( $svs\inr ) || Platform.compareTo(Platform.getTransName(), $svs\dst.getValue()) != 0 || Platform.compareTo("S", $svs\subtyp.getValue()) != 0 || Platform.compareTo($\sysmod\ssn\inr.getValue(), $svs\subkey.getValue()) != 0 )
{
// if SVS is already read the following read/create on demand is not required
stmCnt = Platform.streamCount( $svsfld.getValue() );
if( stmCnt <= 0 )
{
if(1==1) return;
}
else
{
// read/ create SVS only if any SVE entry is required
for(int idx = 1;idx <= stmCnt;idx++)
SaveContent:
while(true){
if( Platform.isEmpty( $svs\inr ) || Platform.compareTo(Platform.getTransName(), $svs\dst.getValue()) != 0 || Platform.compareTo("S", $svs\subtyp.getValue()) != 0 || Platform.compareTo($\sysmod\ssn\inr.getValue(), $svs\subkey.getValue()) != 0 )
{
content = Platform.getLine( $svscon.getValue(), idx );
if( Platform.compareTo(content, "-") != 0 )
// if SVS is already read the following read/create on demand is not required
stmCnt = Platform.streamCount( $svsfld.getValue() );
if( stmCnt <= 0 )
{
if(1==1) return;
}
else
{
if( Platform.isEmpty( $svs\inr ) || Platform.compareTo(Platform.getTransName(), $svs\dst.getValue()) != 0 || Platform.compareTo("S", $svs\subtyp.getValue()) != 0 || Platform.compareTo($\sysmod\ssn\inr.getValue(), $svs\subkey.getValue()) != 0 )
// read/ create SVS only if any SVE entry is required
for(int idx = 1;idx <= stmCnt;idx++)
{
// Check whether a SVS-Entry for the session is stored
Platform.dbRead( $svs, Platform.getTransName(), "DST", "S", "SUBTYP", $\sysmod\ssn\inr.getValue(), "SUBKEY" );
if( Platform.errorCode() == tdOdbcNotFound )
content = Platform.getLine( $svscon.getValue(), idx );
if( Platform.compareTo(content, "-") != 0 )
{
$svs\nam = Platform.GetTitle();
$svs\dst = Platform.getTransName();
$svs\subtyp = "S";
$svs\subkey = $\sysmod\ssn\inr;
Platform.sdbInsert( $svs );
Platform.streamClear( $oldsvsfld.getValue() );
Platform.streamClear( $oldsvscon.getValue() );
$oldsubtyp = "S";
$oldsubkey = $\sysmod\ssn\inr;
if( Platform.isEmpty( $svs\inr ) || Platform.compareTo(Platform.getTransName(), $svs\dst.getValue()) != 0 || Platform.compareTo("S", $svs\subtyp.getValue()) != 0 || Platform.compareTo($\sysmod\ssn\inr.getValue(), $svs\subkey.getValue()) != 0 )
{
// Check whether a SVS-Entry for the session is stored
Platform.dbRead( $svs, Platform.getTransName(), "DST", "S", "SUBTYP", $\sysmod\ssn\inr.getValue(), "SUBKEY" );
if( Platform.errorCode() == tdOdbcNotFound )
{
$svs\nam = Platform.GetTitle();
$svs\dst = Platform.getTransName();
$svs\subtyp = "S";
$svs\subkey = $\sysmod\ssn\inr;
Platform.sdbInsert( $svs );
Platform.streamClear( $oldsvsfld.getValue() );
Platform.streamClear( $oldsvscon.getValue() );
$oldsubtyp = "S";
$oldsubkey = $\sysmod\ssn\inr;
}
break SaveContent ; // #### goto SaveContent
}
}
return ; // #######TODO 改写 LABEL与GOTO #### goto SaveContent
}
}
// no SVE handling necessary, as no modified entry exists
if(1==1) return;
}
}
// no SVE handling necessary, as no modified entry exists
if(1==1) return;
return;
}
// #######TODO 改写 LABEL与GOTO #### label SaveContent
// #### label SaveContent
svsSaveContent();
}
\ No newline at end of file
......@@ -6,50 +6,56 @@ static void lnkReturnToCallerKeepSPT(String argflg)
//! Corresponding functions: LnkReturnToCaller, LnkReturnToFirst, LnkExit
// To solve the problem in INFTRN (return to the same TRN, DO5DOS.2664)
Platform.streamClear( Platform.ddeSTREAM() );
// #######TODO 改写 LABEL与GOTO #### label PopFromStack
if( Platform.streamCount( $\sysmod\frmstk\stk.getValue() ) < 1 )
{
Platform.lnkReturnToFirst();
}
String lin = Platform.getLine( $\sysmod\frmstk\stk.getValue(), 1 );
int pos = Platform.pos( lin, "\t" );
String frm = NULLSTR;
if( pos == 0 )
{
frm = lin;
}
else
{
frm = Platform.mid( lin, 1, pos - 1 );
}
if( Platform.isEmpty( frm ) )
{
Platform.lnkReturnToFirst();
}
if( ! Platform.canLoad( frm + ".TRN" ) )
{
Platform.lnkReturnToFirst();
}
if( IsDesigner )
{
$\sysmod.internalCheckLocks( argflg );
$\sysmod.internalCheckDbCursor();
}
// In case any message is pending prompt the message
$\sysmod.internalPromptMsg();
if( Platform.compareTo( Platform.mid( Platform.toUpper( frm ), 1, 3 ) , "DIT" ) == 0 || Platform.compareTo( Platform.mid( Platform.toUpper( frm ), 1, 3 ) , "BDT" ) == 0 || Platform.compareTo( Platform.mid( Platform.toUpper( frm ), 1, 3 ) , "DET" ) == 0 || Platform.compareTo( Platform.mid( Platform.toUpper( frm ), 1, 3 ) , "BFT" ) == 0 || Platform.compareTo( Platform.toUpper( frm ) , "INFDID" ) == 0 || Platform.compareTo( Platform.toUpper( frm ) , "INFBDD" ) == 0 || Platform.compareTo( Platform.toUpper( frm ) , "INFDET" ) == 0 || Platform.compareTo( Platform.toUpper( frm ) , "INFBFD" ) == 0 )
{
Platform.setLang( "CN" );
}
else
{
Platform.setLang( "EN" );
}
$\sysmod\frmstk\curctx = Platform.mid( lin, pos + 1 );
Platform.streamDelete( $\sysmod\frmstk\stk.getValue(), 1 );
if( Platform.compareTo( Platform.toUpper( Platform.getTransName() ) , frm ) == 0 )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto PopFromStack
// #### label PopFromStack
String frm = null;
PopFromStack:
while(true){
if( Platform.streamCount( $\sysmod\frmstk\stk.getValue() ) < 1 )
{
Platform.lnkReturnToFirst();
}
String lin = Platform.getLine( $\sysmod\frmstk\stk.getValue(), 1 );
int pos = Platform.pos( lin, "\t" );
frm = NULLSTR;
if( pos == 0 )
{
frm = lin;
}
else
{
frm = Platform.mid( lin, 1, pos - 1 );
}
if( Platform.isEmpty( frm ) )
{
Platform.lnkReturnToFirst();
}
if( ! Platform.canLoad( frm + ".TRN" ) )
{
Platform.lnkReturnToFirst();
}
if( IsDesigner )
{
$\sysmod.internalCheckLocks( argflg );
$\sysmod.internalCheckDbCursor();
}
// In case any message is pending prompt the message
$\sysmod.internalPromptMsg();
if( Platform.compareTo( Platform.mid( Platform.toUpper( frm ), 1, 3 ) , "DIT" ) == 0 || Platform.compareTo( Platform.mid( Platform.toUpper( frm ), 1, 3 ) , "BDT" ) == 0 || Platform.compareTo( Platform.mid( Platform.toUpper( frm ), 1, 3 ) , "DET" ) == 0 || Platform.compareTo( Platform.mid( Platform.toUpper( frm ), 1, 3 ) , "BFT" ) == 0 || Platform.compareTo( Platform.toUpper( frm ) , "INFDID" ) == 0 || Platform.compareTo( Platform.toUpper( frm ) , "INFBDD" ) == 0 || Platform.compareTo( Platform.toUpper( frm ) , "INFDET" ) == 0 || Platform.compareTo( Platform.toUpper( frm ) , "INFBFD" ) == 0 )
{
Platform.setLang( "CN" );
}
else
{
Platform.setLang( "EN" );
}
$\sysmod\frmstk\curctx = Platform.mid( lin, pos + 1 );
Platform.streamDelete( $\sysmod\frmstk\stk.getValue(), 1 );
if( Platform.compareTo( Platform.toUpper( Platform.getTransName() ) , frm ) == 0 )
{
//return ; // #### goto PopFromStack
continue PopFromStack;
}
break;
}
Platform.saveData( $\sysmod\spt, Platform.sysStream(), "SPT" );
$\sysmod.internalHandlePassingEty();
......
......@@ -8,46 +8,51 @@ static void ddeSendStream(String argtrn,String argtop,IStream argstr)
String ddeTopic = argtop + "_" + $\sysmod.getSystemName();
BigDecimal del = new BigDecimal("0");
BigDecimal tim = new BigDecimal("0");
// #######TODO 改写 LABEL与GOTO #### label CheckTarget
IStream str = new StreamImpl();
String msg = NULLSTR;
if( Platform.ddeTestTopic( trigger, ddeTopic ) )
{
Platform.ddeSend( trigger, ddeTopic, argstr );
if( Platform.compareTo(del , 0)>0 )
{
Platform.status( "" );
}
}
else
{
if( Platform.compareTo( del , 0 ) == 0 )
{
Platform.streamClear( str );
Platform.ddeSend( trigger, argtrn, str );
Platform.status( #CT000358, argtrn );
del = new BigDecimal("0.4");
}
if( Platform.compareTo(tim , 15)<0 )
{
Platform.pause( del );
tim = Platform.numAdd(tim , del);
// $Del = $Del * 2
return ; // #######TODO 改写 LABEL与GOTO #### goto CheckTarget
}
else
{
Platform.status( #CT000359, argtrn );
msg = Platform.getText( #CT000357, argtrn, Platform.toInt( tim ) );
if( Platform.compareTo($\sysmod\ssn\bckgrd, "F" )== 0 )
// #### label CheckTarget
CheckTarget:
while(true){
IStream str = new StreamImpl();
String msg = NULLSTR;
if( Platform.ddeTestTopic( trigger, ddeTopic ) )
{
Platform.message( "$1", msg );
Platform.ddeSend( trigger, ddeTopic, argstr );
if( Platform.compareTo(del , 0)>0 )
{
Platform.status( "" );
}
}
else
{
Platform.setContext( "LOGFILEENTRY", msg );
if( Platform.compareTo( del , 0 ) == 0 )
{
Platform.streamClear( str );
Platform.ddeSend( trigger, argtrn, str );
Platform.status( #CT000358, argtrn );
del = new BigDecimal("0.4");
}
if( Platform.compareTo(tim , 15)<0 )
{
Platform.pause( del );
tim = Platform.numAdd(tim , del);
// $Del = $Del * 2
//return ; // #### goto CheckTarget
continue CheckTarget;
}
else
{
Platform.status( #CT000359, argtrn );
msg = Platform.getText( #CT000357, argtrn, Platform.toInt( tim ) );
if( Platform.compareTo($\sysmod\ssn\bckgrd, "F" )== 0 )
{
Platform.message( "$1", msg );
}
else
{
Platform.setContext( "LOGFILEENTRY", msg );
}
}
}
}
break;
}
}
\ No newline at end of file
......@@ -20,7 +20,7 @@ void getbranch()
{
Platform.sysDump( Platform.getText( #CT000551, $\sysmod\usr\extkey.getValue() ) );
}
return ; // #######TODO 改写 LABEL与GOTO #### goto ENDDO
return ; // #### goto ENDDO
}
// if a default client exists then take this client
int err = 0;
......@@ -67,7 +67,7 @@ void getbranch()
{
Platform.errorMessage( #CT000414, Platform.errorCode(), errmsg );
Platform.dbCloseCursor();
return ; // #######TODO 改写 LABEL与GOTO #### goto ENDDO
return ; // #### goto ENDDO
}
branch = "";
Platform.dbFetchFields( "", branch );
......@@ -80,7 +80,7 @@ void getbranch()
Platform.dbCloseCursor();
}
}
// #######TODO 改写 LABEL与GOTO #### label ENDDO
// #### label ENDDO
if(1==1) return;
}
\ No newline at end of file
......@@ -20,7 +20,8 @@ void getbchkey_cp()
{
Platform.sysDump( Platform.getText( #CT000549, $\sysmod\usr\extkey.getValue() ) );
}
return ; // #######TODO 改写 LABEL与GOTO #### goto ENDDO
Platform.sqlSetCommittedRead();
return ; // #### goto ENDDO
}
// if a default client exists then take this client
int err = 0;
......@@ -54,7 +55,8 @@ void getbchkey_cp()
if( Platform.compareTo( $bch\bchtyp , "0" ) == 0 )
{ //THE BRANCH TYPE JUDGED
Platform.streamSet( $frmstk\bchkey.getValue(), "FALSE" );
return ; // #######TODO 改写 LABEL与GOTO #### goto ENDDO
Platform.sqlSetCommittedRead();
return ; // #### goto ENDDO
}
streamcount = 0;
Platform.streamClear( errmsg );
......@@ -72,7 +74,8 @@ void getbchkey_cp()
{
Platform.errorMessage( #CT000420, Platform.errorCode(), errmsg );
Platform.dbCloseCursor();
return ; // #######TODO 改写 LABEL与GOTO #### goto ENDDO
Platform.sqlSetCommittedRead();
return ; // #### goto ENDDO
}
branch = "";
Platform.dbFetchFields( "", branch );
......@@ -84,7 +87,7 @@ void getbchkey_cp()
}
Platform.dbCloseCursor();
}
// #######TODO 改写 LABEL与GOTO #### label ENDDO
// #### label ENDDO
Platform.sqlSetCommittedRead();
if(1==1) return;
......
......@@ -18,7 +18,8 @@ void getbranch_cp()
{
Platform.sysDump( Platform.getText( #CT000547, $\sysmod\usr\extkey.getValue() ) );
}
return ; // #######TODO 改写 LABEL与GOTO #### goto ENDDO
Platform.sqlSetCommittedRead();
return ; // #### goto ENDDO
}
// if a default client exists then take this client
int err = 0;
......@@ -66,7 +67,8 @@ void getbranch_cp()
{
Platform.errorMessage( #CT000418, Platform.errorCode(), errmsg );
Platform.dbCloseCursor();
return ; // #######TODO 改写 LABEL与GOTO #### goto ENDDO
Platform.sqlSetCommittedRead();
return ; // #### goto ENDDO
}
branch = "";
Platform.dbFetchFields( "", branch );
......@@ -79,7 +81,7 @@ void getbranch_cp()
Platform.dbCloseCursor();
}
}
// #######TODO 改写 LABEL与GOTO #### label ENDDO
// #### label ENDDO
Platform.sqlSetCommittedRead();
if(1==1) return;
......
......@@ -20,7 +20,7 @@ void getbchkey()
{
Platform.sysDump( Platform.getText( #CT000553, $\sysmod\usr\extkey.getValue() ) );
}
return ; // #######TODO 改写 LABEL与GOTO #### goto ENDDO
return ; // #### goto ENDDO
}
// if a default client exists then take this client
int err = 0;
......@@ -51,7 +51,7 @@ void getbchkey()
if( Platform.compareTo( $bch\bchtyp , "0" ) == 0 )
{ //THE BRANCH TYPE JUDGED
Platform.streamSet( $frmstk\bchkey.getValue(), "FALSE" );
return ; // #######TODO 改写 LABEL与GOTO #### goto ENDDO
return ; // #### goto ENDDO
}
streamcount = 0;
Platform.streamClear( errmsg );
......@@ -78,7 +78,7 @@ void getbchkey()
{
Platform.errorMessage( #CT000424, Platform.errorCode(), errmsg );
Platform.dbCloseCursor();
return ; // #######TODO 改写 LABEL与GOTO #### goto ENDDO
return ; // #### goto ENDDO
}
branch = "";
Platform.dbFetchFields( "", branch );
......@@ -90,7 +90,7 @@ void getbchkey()
}
Platform.dbCloseCursor();
}
// #######TODO 改写 LABEL与GOTO #### label ENDDO
// #### label ENDDO
if(1==1) return;
}
\ No newline at end of file
......@@ -64,7 +64,7 @@ String runTrngetData(String srvnam,String calltp,String trninr,String itfinr,Str
}
else
{
return ""; // #######TODO 改写 LABEL与GOTO #### goto enddo
return outtxt; // #### goto enddo
}
}
break;
......@@ -77,11 +77,11 @@ String runTrngetData(String srvnam,String calltp,String trninr,String itfinr,Str
}
else
{
return ""; // #######TODO 改写 LABEL与GOTO #### goto enddo
return outtxt; // #### goto enddo
}
break;
}
// #######TODO 改写 LABEL与GOTO #### label enddo
// #### label enddo
return outtxt;
}
\ No newline at end of file
......@@ -72,7 +72,7 @@ void getXDInfo()
if( ! Platform.isEmpty( Platform.getContent( "\\FFTFLAG" ) ) )
{
pjjh = "";
return ; // #######TODO 改写 LABEL与GOTO #### goto done
return ; // #### goto done
}
xxd = "BPD";
break;
......@@ -1215,7 +1215,7 @@ void getXDInfo()
{
Platform.exitEvent();
}
// #######TODO 改写 LABEL与GOTO #### label done
// #### label done
}
}
\ No newline at end of file
......@@ -13,251 +13,267 @@ init $$\ order 9000550
int ssn = 0;
String canTxt = NULLSTR;
boolean can = false;
if( Platform.isEmpty( $\sysmod\ssn\inr ) )
{
// only on first Execution of rule try to load SPT-Inr
sptInr = Platform.lnkGetSwitch( "SPTINR" );
// only on first Execution of rule try to load a Session-Inr
ssnInr = Platform.lnkGetSwitch( "SSNINR" );
if( Platform.errorCode() == 0 )
{
// If Session-Inr is passed use this Inr as Session Id
if( Platform.compareTo(Platform.mid( ssnInr, 1, 1 ) , "A")>=0 )
SSNDone:
while(true){
SSNNew:
while(true){
if( Platform.isEmpty( $\sysmod\ssn\inr ) )
{
// only on first Execution of rule try to load SPT-Inr
sptInr = Platform.lnkGetSwitch( "SPTINR" );
// only on first Execution of rule try to load a Session-Inr
ssnInr = Platform.lnkGetSwitch( "SSNINR" );
if( Platform.errorCode() == 0 )
{
// If Session-Inr is passed use this Inr as Session Id
if( Platform.compareTo(Platform.mid( ssnInr, 1, 1 ) , "A")>=0 )
{
// alphanumeric encoded SSNINR > 99999999
ssnInrNumeric = $syspth.valBase36( ssnInr );
if( ssnInrNumeric < 0 )
{
Platform.sysDump( Platform.formatText( "Invalid base 36 number '$1' passed following -SSNINR", ssnInr ) );
//return ; // #### goto SSNNew
break SSNNew;
}
Platform.setContext( tdContextSESSIONNUMBER, Platform.toString( ssnInrNumeric ) );
}
else
{
Platform.setContext( tdContextSESSIONNUMBER, ssnInr );
}
}
else
{
// If no Session-Inr is passed try to get the Session-Inr
ssn = Platform.DBGetSessionnumber();
if( Platform.errorCode() <= 0 )
{
ssnInr = Platform.toString( ssn, -8 );
if( Platform.errorCode() == tdStrBase36Encoding )
{
// alphanumeric encoding for SSNINR is ok
Platform.setErrorCode( 0, "" );
}
}
if( Platform.errorCode() > 0 )
{
$\sysmod\ssn\inr = "NO";
switch( Platform.errorCode() )
{
case 235:
canTxt = Platform.getText( #CT000176, Platform.errorCode(), Platform.getErrorText() );
break;
case 226:
canTxt = Platform.getText( #CT000178, Platform.errorCode(), Platform.getErrorText() );
break;
default:
canTxt = Platform.getText( #CT000177, Platform.errorCode(), Platform.getErrorText() );
}
if( Platform.compareTo( Platform.getContext( tdContextCLIENTSERVER ) , tdStringTRUE ) == 0 )
{
if( Platform.compareTo($\sysmod\ssn\bckgrd, "B" )== 0 )
{
Platform.setContext( "LOGFILEENTRY", canTxt );
Platform.exitSession();
}
}
can = Platform.prompt( #CT000181, canTxt );
if( can != Platform.intConvertBoolean(tdPromptCancel) )
{
Platform.exitSession();
}
//return ; // #### goto SSNNew
break SSNNew;
}
}
// After having fixed the Session-Inr lock the Session record
$\sysmod\ssn\inr = ssnInr;
Platform.dbLock( $\sysmod\ssn );
if( Platform.errorCode() > 0 )
{
$\sysmod\ssn\inr = "NO";
Platform.sysDump( Platform.formatText( "Unable to lock session ID upon start of transaction.\n(Error=$1 $2)", Platform.errorCode(), Platform.getErrorText() ) );
//return ; // #### goto SSNNew
break SSNNew;
}
// Load the Session record
Platform.dbRead( $\sysmod\ssn, $\sysmod\ssn\inr.getValue(), "INR" );
if( Platform.errorCode() == tdOdbcNotFound )
{
//return ; // #### goto SSNNew
break SSNNew;
}
else
{
if( Platform.errorCode() > 0 )
{
Platform.sysDump( Platform.formatText( "Unable to read session ID upon start of transaction.\n(Error=$1 $2)", Platform.errorCode(), Platform.getErrorText() ) );
$\sysmod\ssn\inr = "NO";
//return ; // #### goto SSNNew
break SSNNew;
}
}
}
// Check the validity of the existing SSN entry
if( ! Platform.isEmpty( $\sysmod\ssn\appsrv ) )
{
// The stored Applications server id has to fit
if( Platform.compareTo($\sysmod\ssn\appsrv.getValue(), Platform.mid( Platform.getContext( tdContextSERVERID ), 1, Platform.getAttribute( $\sysmod\ssn\appsrv.getValue(), tdAttrLength ) )) != 0 )
{
Platform.sysDump( Platform.formatText( "Inconsistent session data upon start of transaction.\nThe session record identifies the application server as $1, but it is $2.\nSession not registered.\n(Session INR used: $3)", $\sysmod\ssn\appsrv.getValue(), Platform.getContext( tdContextSERVERID ),$\sysmod\ssn\inr.getValue() ) );
$\sysmod\ssn\inr = "NO";
//return ; // #### goto SSNNew
break SSNNew;
}
}
else
{
$\sysmod\ssn\appsrv = Platform.getContext( tdContextSERVERID );
$\sysmod\ssn\eng = Platform.fileBaseName( Platform.getContext( "ExeName" ) );
}
if( ! Platform.isEmpty( $\sysmod\ssn\apppid ) )
{
// The stored Applications server pid has to fit
if( Platform.compareTo($\sysmod\ssn\apppid.getValue(), Platform.getContext( tdContextSERVERPID )) != 0 )
{
Platform.sysDump( Platform.formatText( "Inconsistent session data upon start of transaction.\nThe session record identifies the application pid as $1, but it is $2.\nSession not registered.\n(Session INR used: $3)", $\sysmod\ssn\apppid.getValue(), Platform.getContext( tdContextSERVERPID ),$\sysmod\ssn\inr.getValue() ) );
$\sysmod\ssn\inr = "NO";
//return ; // #### goto SSNNew
break SSNNew;
}
}
else
{
$\sysmod\ssn\apppid = Platform.getContext( tdContextSERVERPID );
}
if( ! Platform.isEmpty( $\sysmod\ssn\usr ) )
{
// The stored Userid has to fit
if( Platform.compareTo(Platform.toUpper( $\sysmod\ssn\usr.getValue() ), Platform.toUpper( Platform.getLoginUser() )) != 0 )
{
Platform.sysDump( Platform.formatText( "Inconsistent session data upon start of transaction.\nThe session record identifies the user as $1, but it is $2.\nSession not registered.\n(Session INR used: $3)", $\sysmod\ssn\usr.getValue(), Platform.getLoginUser(), $\sysmod\ssn\inr.getValue() ) );
$\sysmod\ssn\inr = "NO";
//return ; // #### goto SSNNew
break SSNNew;
}
// to set an potential foldover user-id
$\sysmod\ssn\usr = Platform.getLoginUser();
}
else
{
$\sysmod\ssn\usr = Platform.getLoginUser();
}
// store information about the last start of a transaction
$\sysmod\ssn\lstdattim = Platform.toDay();
$\sysmod\ssn\lstfrm = Platform.fileBaseName( Platform.getTransName() );
// set status to application (database updates have been executed in this session)
// or to executing (active session with no database updates up to now)
if( !( Platform.compareTo($\sysmod\ssn\sta, "A" )== 0) )
{
$\sysmod\ssn\sta = "X";
}
// if an SSN record is reused (`inherit` or reinit/reload during debugging), set additionally
if( ! Platform.isEmpty( ssnInr ) )
{
$\sysmod\ssn\dissrv = Platform.getContext( tdContextCLIENTID ) + "-" + Platform.getClientType();
$\sysmod\ssn\dispid = Platform.getContext( tdContextCLIENTPID );
$\sysmod\ssn\eng = Platform.fileBaseName( Platform.getContext( "ExeName" ) );
if( Platform.compareTo( Platform.getContext( tdContextBATCHMODE ) , tdStringTRUE ) == 0 )
{
$\sysmod\ssn\bckgrd.setValue ( "B" );
}
else
{
$\sysmod\ssn\bckgrd.setValue ( "F" );
}
}
// update an existing SSN entry
if( Platform.compareTo($\sysmod\ssn\inr.getValue(), "NO") != 0 )
{
Platform.sdbUpdate( $\sysmod\ssn );
if( Platform.errorCode() > 0 )
{
Platform.sysDump( Platform.formatText( "Unable to update session record upon start of a transaction.\n(Session INR used: $3)\n(Error=$1 $2)", Platform.errorCode(), Platform.getErrorText(), $\sysmod\ssn\inr.getValue() ) );
}
}
//return ; // #### goto SSNDone
break SSNDone;
}
//------------------------
// #### label SSNNew
// Initial settings of a new session record
$\sysmod\ssn\begdattim = Platform.toDay();
$\sysmod\ssn\dissrv = Platform.getContext( tdContextCLIENTID ) + "-" + Platform.getClientType();
$\sysmod\ssn\dispid = Platform.getContext( tdContextCLIENTPID );
$\sysmod\ssn\eng = Platform.fileBaseName( Platform.getContext( "ExeName" ) );
$\sysmod\ssn\appsrv = Platform.getContext( tdContextSERVERID );
$\sysmod\ssn\apppid = Platform.getContext( tdContextSERVERPID );
// store information about the last start of a transaction
$\sysmod\ssn\lstdattim = $\sysmod\ssn\begdattim;
$\sysmod\ssn\lstfrm = Platform.fileBaseName( Platform.getTransName() );
$\sysmod\ssn\usr = Platform.getLoginUser();
$\sysmod\ssn\sta = "X";
Platform.clear( $\sysmod\ssn\enddattim );
int err = 0;
String errTxt = NULLSTR;
if( Platform.compareTo($\sysmod\ssn\inr.getValue(), "NO") != 0 )
{
// alphanumeric encoded SSNINR > 99999999
ssnInrNumeric = $syspth.valBase36( ssnInr );
if( ssnInrNumeric < 0 )
Platform.dbInsert( $\sysmod\ssn );
if( Platform.errorCode() > 0 )
{
Platform.sysDump( Platform.formatText( "Invalid base 36 number '$1' passed following -SSNINR", ssnInr ) );
return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
$\sysmod\ssn\inr = "NO";
if( Platform.errorCode() == 271 )
{
Platform.sysDump( Platform.formatText( "Licensed user count of $1 sessions exceeded", Platform.getContext( "MAXUSERCOUNT" ) ) );
}
else
{
err = Platform.errorCode();
errTxt = Platform.getErrorText();
msg = Platform.formatText( "Unable to create session record upon start of session.\n(Error=$1 $2)", err, errTxt );
if( ! IsAdministrator || Platform.compareTo(Platform.getInitialTransaction(), Platform.toUpper( Platform.getTransName() )) != 0 )
{
Platform.sysDump( msg );
}
}
}
Platform.setContext( tdContextSESSIONNUMBER, Platform.toString( ssnInrNumeric ) );
}
else
if( Platform.compareTo( $\sysmod\ssn\inr , "NO" ) == 0 && IsAdministrator && Platform.compareTo( Platform.getInitialTransaction() , Platform.toUpper( Platform.getTransName() ) ) == 0 )
{
Platform.setContext( tdContextSESSIONNUMBER, ssnInr );
}
}
else
{
// If no Session-Inr is passed try to get the Session-Inr
ssn = Platform.DBGetSessionnumber();
if( Platform.errorCode() <= 0 )
{
ssnInr = Platform.toString( ssn, -8 );
if( Platform.errorCode() == tdStrBase36Encoding )
if( ! Platform.isEmpty( msg ) )
{
// alphanumeric encoding for SSNINR is ok
Platform.setErrorCode( 0, "" );
msg = msg + "\r\n";
}
Platform.dbCommit();
msg = msg + "Administration transaction SYSADM will be launched now.";
Platform.message( "$1", msg );
Platform.chain( "SYSADM" );
}
if( Platform.errorCode() > 0 )
// Only when in foreground and only on first start check the remaining time of the security key
String endStr = NULLSTR;
String endDatStr = NULLSTR;
Date endDat = null;
int remDay = 0;
if( Platform.compareTo($\sysmod\ssn\bckgrd, "F" )== 0 )
{
$\sysmod\ssn\inr = "NO";
switch( Platform.errorCode() )
endStr = Platform.getIniStr( "SECKEY.INI", "TRACO", "EndDate" );
endDatStr = Platform.mid( endStr, 7, 2 ) + "/" + Platform.mid( endStr, 5, 2 ) + "/" + Platform.mid( endStr, 1, 4 );
endDat = Platform.parseDate( endDatStr );
// If the content is no valid date just do not warn and ignor the error
if( Platform.errorCode() == 0 )
{
case 235:
canTxt = Platform.getText( #CT000176, Platform.errorCode(), Platform.getErrorText() );
break;
case 226:
canTxt = Platform.getText( #CT000178, Platform.errorCode(), Platform.getErrorText() );
break;
default:
canTxt = Platform.getText( #CT000177, Platform.errorCode(), Platform.getErrorText() );
}
if( Platform.compareTo( Platform.getContext( tdContextCLIENTSERVER ) , tdStringTRUE ) == 0 )
{
if( Platform.compareTo($\sysmod\ssn\bckgrd, "B" )== 0 )
remDay = Platform.diff( endDat, Platform.today() ) + 1;
if( remDay <= 10 && remDay > 0 )
{
Platform.setContext( "LOGFILEENTRY", canTxt );
Platform.exitSession();
Platform.message( #CT000180, remDay );
}
}
can = Platform.prompt( #CT000181, canTxt );
if( can != Platform.intConvertBoolean(tdPromptCancel) )
{
Platform.exitSession();
}
return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
}
}
// After having fixed the Session-Inr lock the Session record
$\sysmod\ssn\inr = ssnInr;
Platform.dbLock( $\sysmod\ssn );
if( Platform.errorCode() > 0 )
{
$\sysmod\ssn\inr = "NO";
Platform.sysDump( Platform.formatText( "Unable to lock session ID upon start of transaction.\n(Error=$1 $2)", Platform.errorCode(), Platform.getErrorText() ) );
return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
}
// Load the Session record
Platform.dbRead( $\sysmod\ssn, $\sysmod\ssn\inr.getValue(), "INR" );
if( Platform.errorCode() == tdOdbcNotFound )
{
return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
}
else
{
if( Platform.errorCode() > 0 )
{
Platform.sysDump( Platform.formatText( "Unable to read session ID upon start of transaction.\n(Error=$1 $2)", Platform.errorCode(), Platform.getErrorText() ) );
$\sysmod\ssn\inr = "NO";
return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
}
}
}
// Check the validity of the existing SSN entry
if( ! Platform.isEmpty( $\sysmod\ssn\appsrv ) )
{
// The stored Applications server id has to fit
if( Platform.compareTo($\sysmod\ssn\appsrv.getValue(), Platform.mid( Platform.getContext( tdContextSERVERID ), 1, Platform.getAttribute( $\sysmod\ssn\appsrv.getValue(), tdAttrLength ) )) != 0 )
{
Platform.sysDump( Platform.formatText( "Inconsistent session data upon start of transaction.\nThe session record identifies the application server as $1, but it is $2.\nSession not registered.\n(Session INR used: $3)", $\sysmod\ssn\appsrv.getValue(), Platform.getContext( tdContextSERVERID ),$\sysmod\ssn\inr.getValue() ) );
$\sysmod\ssn\inr = "NO";
return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
}
}
else
{
$\sysmod\ssn\appsrv = Platform.getContext( tdContextSERVERID );
$\sysmod\ssn\eng = Platform.fileBaseName( Platform.getContext( "ExeName" ) );
}
if( ! Platform.isEmpty( $\sysmod\ssn\apppid ) )
{
// The stored Applications server pid has to fit
if( Platform.compareTo($\sysmod\ssn\apppid.getValue(), Platform.getContext( tdContextSERVERPID )) != 0 )
{
Platform.sysDump( Platform.formatText( "Inconsistent session data upon start of transaction.\nThe session record identifies the application pid as $1, but it is $2.\nSession not registered.\n(Session INR used: $3)", $\sysmod\ssn\apppid.getValue(), Platform.getContext( tdContextSERVERPID ),$\sysmod\ssn\inr.getValue() ) );
$\sysmod\ssn\inr = "NO";
return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
}
}
else
{
$\sysmod\ssn\apppid = Platform.getContext( tdContextSERVERPID );
}
if( ! Platform.isEmpty( $\sysmod\ssn\usr ) )
{
// The stored Userid has to fit
if( Platform.compareTo(Platform.toUpper( $\sysmod\ssn\usr.getValue() ), Platform.toUpper( Platform.getLoginUser() )) != 0 )
{
Platform.sysDump( Platform.formatText( "Inconsistent session data upon start of transaction.\nThe session record identifies the user as $1, but it is $2.\nSession not registered.\n(Session INR used: $3)", $\sysmod\ssn\usr.getValue(), Platform.getLoginUser(), $\sysmod\ssn\inr.getValue() ) );
$\sysmod\ssn\inr = "NO";
return ; // #######TODO 改写 LABEL与GOTO #### goto SSNNew
}
// to set an potential foldover user-id
$\sysmod\ssn\usr = Platform.getLoginUser();
}
else
{
$\sysmod\ssn\usr = Platform.getLoginUser();
}
// store information about the last start of a transaction
$\sysmod\ssn\lstdattim = Platform.toDay();
$\sysmod\ssn\lstfrm = Platform.fileBaseName( Platform.getTransName() );
// set status to application (database updates have been executed in this session)
// or to executing (active session with no database updates up to now)
if( !( Platform.compareTo($\sysmod\ssn\sta, "A" )== 0) )
{
$\sysmod\ssn\sta = "X";
}
// if an SSN record is reused (`inherit` or reinit/reload during debugging), set additionally
if( ! Platform.isEmpty( ssnInr ) )
{
$\sysmod\ssn\dissrv = Platform.getContext( tdContextCLIENTID ) + "-" + Platform.getClientType();
$\sysmod\ssn\dispid = Platform.getContext( tdContextCLIENTPID );
$\sysmod\ssn\eng = Platform.fileBaseName( Platform.getContext( "ExeName" ) );
if( Platform.compareTo( Platform.getContext( tdContextBATCHMODE ) , tdStringTRUE ) == 0 )
{
$\sysmod\ssn\bckgrd.setValue ( "B" );
}
else
{
$\sysmod\ssn\bckgrd.setValue ( "F" );
}
}
// update an existing SSN entry
if( Platform.compareTo($\sysmod\ssn\inr.getValue(), "NO") != 0 )
{
Platform.sdbUpdate( $\sysmod\ssn );
if( Platform.errorCode() > 0 )
{
Platform.sysDump( Platform.formatText( "Unable to update session record upon start of a transaction.\n(Session INR used: $3)\n(Error=$1 $2)", Platform.errorCode(), Platform.getErrorText(), $\sysmod\ssn\inr.getValue() ) );
}
}
//return ; // #######TODO 改写 LABEL与GOTO #### goto SSNDone
//------------------------
// #######TODO 改写 LABEL与GOTO #### label SSNNew
// Initial settings of a new session record
$\sysmod\ssn\begdattim = Platform.toDay();
$\sysmod\ssn\dissrv = Platform.getContext( tdContextCLIENTID ) + "-" + Platform.getClientType();
$\sysmod\ssn\dispid = Platform.getContext( tdContextCLIENTPID );
$\sysmod\ssn\eng = Platform.fileBaseName( Platform.getContext( "ExeName" ) );
$\sysmod\ssn\appsrv = Platform.getContext( tdContextSERVERID );
$\sysmod\ssn\apppid = Platform.getContext( tdContextSERVERPID );
// store information about the last start of a transaction
$\sysmod\ssn\lstdattim = $\sysmod\ssn\begdattim;
$\sysmod\ssn\lstfrm = Platform.fileBaseName( Platform.getTransName() );
$\sysmod\ssn\usr = Platform.getLoginUser();
$\sysmod\ssn\sta = "X";
Platform.clear( $\sysmod\ssn\enddattim );
int err = 0;
String errTxt = NULLSTR;
if( Platform.compareTo($\sysmod\ssn\inr.getValue(), "NO") != 0 )
{
Platform.dbInsert( $\sysmod\ssn );
if( Platform.errorCode() > 0 )
{
$\sysmod\ssn\inr = "NO";
if( Platform.errorCode() == 271 )
{
Platform.sysDump( Platform.formatText( "Licensed user count of $1 sessions exceeded", Platform.getContext( "MAXUSERCOUNT" ) ) );
}
else
{
err = Platform.errorCode();
errTxt = Platform.getErrorText();
msg = Platform.formatText( "Unable to create session record upon start of session.\n(Error=$1 $2)", err, errTxt );
if( ! IsAdministrator || Platform.compareTo(Platform.getInitialTransaction(), Platform.toUpper( Platform.getTransName() )) != 0 )
{
Platform.sysDump( msg );
}
}
}
}
if( Platform.compareTo( $\sysmod\ssn\inr , "NO" ) == 0 && IsAdministrator && Platform.compareTo( Platform.getInitialTransaction() , Platform.toUpper( Platform.getTransName() ) ) == 0 )
{
if( ! Platform.isEmpty( msg ) )
{
msg = msg + "\r\n";
}
Platform.dbCommit();
msg = msg + "Administration transaction SYSADM will be launched now.";
Platform.message( "$1", msg );
Platform.chain( "SYSADM" );
}
// Only when in foreground and only on first start check the remaining time of the security key
String endStr = NULLSTR;
String endDatStr = NULLSTR;
Date endDat = null;
int remDay = 0;
if( Platform.compareTo($\sysmod\ssn\bckgrd, "F" )== 0 )
{
endStr = Platform.getIniStr( "SECKEY.INI", "TRACO", "EndDate" );
endDatStr = Platform.mid( endStr, 7, 2 ) + "/" + Platform.mid( endStr, 5, 2 ) + "/" + Platform.mid( endStr, 1, 4 );
endDat = Platform.parseDate( endDatStr );
// If the content is no valid date just do not warn and ignor the error
if( Platform.errorCode() == 0 )
{
remDay = Platform.diff( endDat, Platform.today() ) + 1;
if( remDay <= 10 && remDay > 0 )
{
Platform.message( #CT000180, remDay );
}
}
internalSetupSSN();
break SSNDone;
}
internalSetupSSN();
// #######TODO 改写 LABEL与GOTO #### label SSNDone
// #### label SSNDone
// Finally commit the database transaction handling the SSN-entry
// initialy -> creation of SSN
// all others -> update SSN with current transaction
......
......@@ -45,20 +45,24 @@ init $$\ order 9000500
Platform.setContext( tdContextBATCHMODE, true );
}
}
// #######TODO 改写 LABEL与GOTO #### label ChkStk
// #### label ChkStk
// Check the stack and remove the own entry if found
String lin = Platform.getLine( $\sysmod\frmstk\stk.getValue(), 1 );
String frm = Platform.getTransName();
int pos = 0;
if( Platform.compareTo( frm , Platform.mid( lin, 1, Platform.len( frm ) ) ) == 0 )
{
pos = Platform.pos( lin, "\t" );
if( pos > 0 )
{
$\sysmod\frmstk\curctx = Platform.mid( lin, pos + 1 );
}
Platform.streamDelete( $\sysmod\frmstk\stk.getValue(), 1 );
return ; // #######TODO 改写 LABEL与GOTO #### goto ChkStk
ChkStk:
while(true){
String lin = Platform.getLine( $\sysmod\frmstk\stk.getValue(), 1 );
String frm = Platform.getTransName();
int pos = 0;
if( Platform.compareTo( frm , Platform.mid( lin, 1, Platform.len( frm ) ) ) == 0 )
{
pos = Platform.pos( lin, "\t" );
if( pos > 0 )
{
$\sysmod\frmstk\curctx = Platform.mid( lin, pos + 1 );
}
Platform.streamDelete( $\sysmod\frmstk\stk.getValue(), 1 );
//return ; // #### goto ChkStk
continue ChkStk;
}
break;
}
}
\ No newline at end of file
......@@ -20,7 +20,7 @@ String getOSAccessibleName(String argfilename)
nonDel = "/";
}
// Loop to replace the wrong delimiter by the correct ones
// #######TODO 改写 LABEL与GOTO #### label NextDel
// #### label NextDel
int pos;
NextDelLabel:
while(true){
......@@ -28,7 +28,7 @@ String getOSAccessibleName(String argfilename)
if( pos > 0 )
{
fil = Platform.mid( fil, 1, pos - 1 ) + del + Platform.mid( fil, pos + 1 );
//return ; // #######TODO 改写 LABEL与GOTO #### goto NextDel
//return ; // #### goto NextDel
continue NextDelLabel;
}
break;
......@@ -44,7 +44,7 @@ String getOSAccessibleName(String argfilename)
}
// Look for included illegal character and remove them
// single quote, double quote, execute quote
// #######TODO 改写 LABEL与GOTO #### label quoloop
// #### label quoloop
quoloopLabel:
while(true){
pos = Platform.pos( fil, "'" );
......@@ -59,7 +59,7 @@ String getOSAccessibleName(String argfilename)
if( pos > 0 )
{
fil = Platform.mid( fil, 1, pos - 1 ) + Platform.mid( fil, pos + 1 );
//return ; // #######TODO 改写 LABEL与GOTO #### goto quoloop
//return ; // #### goto quoloop
continue quoloopLabel;
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment