Platform.dbExecuteSQL( "select INIFRM || ':'|| OWNREF REF from trn where inr in (select prvinr from tro where TRNINR= ? ) and relflg <> 'R' and relflg <> 'F' ", $$argtrn\inr.getValue() );
Platform.dbExecuteSQL( "select INIFRM || ':'|| OWNREF REF from trn where inr in (select prvinr from tro where TRNINR= ? ) and relflg <> 'R' and relflg <> 'F' ", $$argtrn\inr.getValue() );
Platform.dbFetchFields( "", ref );
Argument<String> refBox = new Argument<String>("","");
String sql = "select ownref from clr where smhinr in ( select inr from (select inr from smh where f21 = ? and msgtyp in ('202','910') order by inr desc ) where rownum=1)";
String sql = "select ownref from clr where smhinr in ( select inr from (select inr from smh where f21 = ? and msgtyp in ('202','910') order by inr desc ) where rownum=1)";
Platform.dbExecuteSQL( sql, ownref );
Platform.dbExecuteSQL( sql, ownref );
Platform.dbFetchFields( "", clrref );
Argument<String> clrrefBox = new Argument<String>("","");
Platform.dbFetchFields( "", clrrefBox );
clrref=clrrefBox.value;
int err = Platform.errorCode();
int err = Platform.errorCode();
Platform.dbCloseCursor();
Platform.dbCloseCursor();
if( ! Platform.isEmpty( clrref ) )
if( ! Platform.isEmpty( clrref ) )
{
{
sql = " select relflg from trn where ownref= ? ";
sql = " select relflg from trn where ownref= ? ";
Platform.dbExecuteSQL( sql, clrref );
Platform.dbExecuteSQL( sql, clrref );
Platform.dbFetchFields( "", relflg );
Argument<String> relflgBox = new Argument<String>("","");
String sql = "select dkd.jjh from dkd dkd,trn trn where dkd.ownref='" + ref + "' and trn.objtyp='DKD' and trn.objinr=dkd.inr and trn.relflg in ('R','F') ";
String sql = "select dkd.jjh from dkd dkd,trn trn where dkd.ownref='" + ref + "' and trn.objtyp='DKD' and trn.objinr=dkd.inr and trn.relflg in ('R','F') ";
Platform.dbExecuteSql( sql );
Platform.dbExecuteSql( sql );
Platform.dbFetchFields( "", vjjh );
Argument<String> vjjhBox = new Argument<String>("","");
sql = "select sum(case when syscur='CNY' then sysAMT else amt end) from gle where DBTDFT='FX' and (sysCUR='CNY' or CUR='CNY') and WHMTYP='3' and TRNinr='" + trninr + "'";
sql = "select sum(case when syscur='CNY' then sysAMT else amt end) from gle where DBTDFT='FX' and (sysCUR='CNY' or CUR='CNY') and WHMTYP='3' and TRNinr='" + trninr + "'";
sumamt = 0;
sumamt = 0;
Platform.dbExecuteSql( sql );
Platform.dbExecuteSql( sql );
Platform.dbFetchFields( "", sumamt );
Argument<Integer> sumamtBox = new Argument<Integer>("",0);
Platform.dbFetchFields( "", sumamtBox );
sumamt=sumamtBox.value;
err = Platform.errorCode();
err = Platform.errorCode();
Platform.dbCloseCursor();
Platform.dbCloseCursor();
sql1 = "select sum(case when syscur='CNY' then sysAMT else amt end) from gle where DBTDFT='FX' and (sysCUR='CNY' or CUR='CNY') and WHMTYP='5' and TRNinr='" + trninr + "'";
sql1 = "select sum(case when syscur='CNY' then sysAMT else amt end) from gle where DBTDFT='FX' and (sysCUR='CNY' or CUR='CNY') and WHMTYP='5' and TRNinr='" + trninr + "'";
sumamt1 = 0;
sumamt1 = 0;
Platform.dbExecuteSql( sql1 );
Platform.dbExecuteSql( sql1 );
Platform.dbFetchFields( "", sumamt1 );
Argument<Integer> sumamt1Box = new Argument<Integer>("",0);
Platform.dbFetchFields( "", sumamt1Box );
sumamt1=sumamt1Box.value;
err = Platform.errorCode();
err = Platform.errorCode();
Platform.dbCloseCursor();
Platform.dbCloseCursor();
sql2 = "select SUM(SYSAMT*excrat) from gle where DBTDFT='FX' and WHMTYP not in ('3','5') and TRNinr='" + trninr + "'";
sql2 = "select SUM(SYSAMT*excrat) from gle where DBTDFT='FX' and WHMTYP not in ('3','5') and TRNinr='" + trninr + "'";
sumamt2 = 0;
sumamt2 = 0;
Platform.dbExecuteSql( sql2 );
Platform.dbExecuteSql( sql2 );
Platform.dbFetchFields( "", sumamt2 );
Argument<Integer> sumamt2Box = new Argument<Integer>("",0);
Platform.dbFetchFields( "", sumamt2Box );
sumamt2=sumamt2Box.value;
err = Platform.errorCode();
err = Platform.errorCode();
Platform.dbCloseCursor();
Platform.dbCloseCursor();
time = Platform.DateTimeGetTime( Platform.toDay() );
time = Platform.DateTimeGetTime( Platform.toDay() );
String strsql = "select adr.pobzip,adr.nam1,adr.nam2,adr.nam3,adr.str1,adr.str2,adr.loccty,adr.tel1,adr.tel2,adr.fax1,adr.fax2 from adr,bch where adr.bic=bch.swfcod and bch.lev='" + lev + "' and bchkey='" + bchkey + "'";
String strsql = "select adr.pobzip,adr.nam1,adr.nam2,adr.nam3,adr.str1,adr.str2,adr.loccty,adr.tel1,adr.tel2,adr.fax1,adr.fax2 from adr,bch where adr.bic=bch.swfcod and bch.lev='" + lev + "' and bchkey='" + bchkey + "'";
sqltext = "select rptno from dba where buscode=(select ownref from trn where inr='" + $trn\inr.getValue() + "')";
sqltext = "select rptno from dba where buscode=(select ownref from trn where inr='" + $trn\inr.getValue() + "')";
Platform.dbExecuteSql( sqltext );
Platform.dbExecuteSql( sqltext );
Platform.dbFetchFields( "", text );
Argument<String> textBox = new Argument<String>("","");
Platform.dbFetchFields( "", textBox );
text=textBox.value;
if( Platform.errorCode() <= 0 )
if( Platform.errorCode() <= 0 )
{
{
}
}
...
@@ -104,7 +106,9 @@ void defaultTRNP()
...
@@ -104,7 +106,9 @@ void defaultTRNP()
strsql = "select refnos from dbm where rptno in(select rptno from dba where buscode=(select ownref from trn where inr='" + $trn\inr.getValue() + "'))";
strsql = "select refnos from dbm where rptno in(select rptno from dba where buscode=(select ownref from trn where inr='" + $trn\inr.getValue() + "'))";
}
}
Platform.dbExecuteSql( strsql );
Platform.dbExecuteSql( strsql );
Platform.dbFetchFields( "", refnos );
Argument<String> refnosBox = new Argument<String>("","");
sql = "select inr from SMH where TRNinr=? and DIR = '>' and cortyp='SWT' and msgtyp in ('202','103','910','199','299') and sndstatus='0' AND NAM NOT LIKE '%GPI%'";
sql = "select inr from SMH where TRNinr=? and DIR = '>' and cortyp='SWT' and msgtyp in ('202','103','910','199','299') and sndstatus='0' AND NAM NOT LIKE '%GPI%'";
@@ -64,7 +64,9 @@ event $trncorco\trnstm order 1501
...
@@ -64,7 +64,9 @@ event $trncorco\trnstm order 1501
inr = "";
inr = "";
sql = "select inr from SMH where TRNinr=? and DIR = '>' and cortyp='SWT' and msgtyp in ('202','103','910','199','299') and sndstatus='0' AND NAM NOT LIKE '%GPI%'";
sql = "select inr from SMH where TRNinr=? and DIR = '>' and cortyp='SWT' and msgtyp in ('202','103','910','199','299') and sndstatus='0' AND NAM NOT LIKE '%GPI%'";
@@ -27,7 +27,15 @@ event $recpan\smssnd order 1000
...
@@ -27,7 +27,15 @@ event $recpan\smssnd order 1000
sql = "select adr.tel3 , adr.adr1 , adr.fax3 , led.amenbr from adr , pts , led where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='LED' aND pts.OBJINR='" + $trn\objinr.getValue() + "' and pts.rol='BEN' and led.inr=pts.OBJINR ";
sql = "select adr.tel3 , adr.adr1 , adr.fax3 , led.amenbr from adr , pts , led where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='LED' aND pts.OBJINR='" + $trn\objinr.getValue() + "' and pts.rol='BEN' and led.inr=pts.OBJINR ";
sql = "select to_char(credattim,'YYYY-MM-DD') credattim from smh where trninr='" + $trn\inr.getValue() + "' and msgtyp='199' and f79sta='ACSC' ";
sql = "select to_char(credattim,'YYYY-MM-DD') credattim from smh where trninr='" + $trn\inr.getValue() + "' and msgtyp='199' and f79sta='ACSC' ";
Platform.sqlSetDirtyRead();
Platform.sqlSetDirtyRead();
Platform.dbExecuteSql( sql );
Platform.dbExecuteSql( sql );
Platform.dbFetchFields( "", credattim );
Argument<String> credattimBox = new Argument<String>("","");
Platform.dbFetchFields( "", credattimBox );
credattim=credattimBox.value;
error = Platform.errorCode();
error = Platform.errorCode();
Platform.dbCloseCursor();
Platform.dbCloseCursor();
Platform.sqlSetCommittedRead();
Platform.sqlSetCommittedRead();
...
@@ -104,7 +132,9 @@ event $recpan\smssnd order 1000
...
@@ -104,7 +132,9 @@ event $recpan\smssnd order 1000
sqltrd = "select count(*) from TRD where pnttyp='BED' and pntinr='" + objinr + "'";
sqltrd = "select count(*) from TRD where pnttyp='BED' and pntinr='" + objinr + "'";
Platform.sqlSetDirtyRead();
Platform.sqlSetDirtyRead();
Platform.dbExecuteSql( sqltrd );
Platform.dbExecuteSql( sqltrd );
Platform.dbFetchFields( "", count );
Argument<Integer> countBox = new Argument<Integer>("",0);
Platform.dbFetchFields( "",countBox );
count=countBox.value;
error = Platform.errorCode();
error = Platform.errorCode();
Platform.dbCloseCursor();
Platform.dbCloseCursor();
Platform.sqlSetCommittedRead();
Platform.sqlSetCommittedRead();
...
@@ -113,7 +143,15 @@ event $recpan\smssnd order 1000
...
@@ -113,7 +143,15 @@ event $recpan\smssnd order 1000
sql = "select adr.tel4 , adr.adr1 , adr.fax4 ,PTS.REF from adr , pts , BED where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BED' aND pts.OBJINR='" + objinr + "' and pts.rol='BEN' and BED.inr=pts.OBJINR ";
sql = "select adr.tel4 , adr.adr1 , adr.fax4 ,PTS.REF from adr , pts , BED where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BED' aND pts.OBJINR='" + objinr + "' and pts.rol='BEN' and BED.inr=pts.OBJINR ";
@@ -127,7 +165,9 @@ event $recpan\smssnd order 1000
...
@@ -127,7 +165,9 @@ event $recpan\smssnd order 1000
sqltrd = "select count(*) from TRD where PNTtyp='BTD' and pntinr='" + objinr + "'";
sqltrd = "select count(*) from TRD where PNTtyp='BTD' and pntinr='" + objinr + "'";
Platform.sqlSetDirtyRead();
Platform.sqlSetDirtyRead();
Platform.dbExecuteSql( sqltrd );
Platform.dbExecuteSql( sqltrd );
Platform.dbFetchFields( "", count );
Argument<Integer> countBox = new Argument<Integer>("",0);
Platform.dbFetchFields( "",countBox );
count=countBox.value;
error = Platform.errorCode();
error = Platform.errorCode();
Platform.dbCloseCursor();
Platform.dbCloseCursor();
Platform.sqlSetCommittedRead();
Platform.sqlSetCommittedRead();
...
@@ -136,14 +176,24 @@ event $recpan\smssnd order 1000
...
@@ -136,14 +176,24 @@ event $recpan\smssnd order 1000
sql = "select adr.tel4 , adr.adr1 , adr.fax4 ,PTS.REF from adr , pts , BTD where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BTD' aND pts.OBJINR='" + objinr + "' and pts.rol='BE1' and BTD.inr=pts.OBJINR ";
sql = "select adr.tel4 , adr.adr1 , adr.fax4 ,PTS.REF from adr , pts , BTD where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BTD' aND pts.OBJINR='" + objinr + "' and pts.rol='BE1' and BTD.inr=pts.OBJINR ";
@@ -156,7 +206,10 @@ event $recpan\smssnd order 1000
...
@@ -156,7 +206,10 @@ event $recpan\smssnd order 1000
sqltrd = "select count(*) from TRD where PNTtyp='BOD' and pntinr='" + objinr + "'";
sqltrd = "select count(*) from TRD where PNTtyp='BOD' and pntinr='" + objinr + "'";
Platform.sqlSetDirtyRead();
Platform.sqlSetDirtyRead();
Platform.dbExecuteSql( sqltrd );
Platform.dbExecuteSql( sqltrd );
Platform.dbFetchFields( "", count );
//Platform.dbFetchFields( "", count );
Argument<Integer> countBox = new Argument<Integer>("",0);
Platform.dbFetchFields( "",countBox );
count=countBox.value;
error = Platform.errorCode();
error = Platform.errorCode();
Platform.dbCloseCursor();
Platform.dbCloseCursor();
Platform.sqlSetCommittedRead();
Platform.sqlSetCommittedRead();
...
@@ -165,7 +218,15 @@ event $recpan\smssnd order 1000
...
@@ -165,7 +218,15 @@ event $recpan\smssnd order 1000
sql = "select adr.tel5 , adr.adr1 , adr.fax5 ,PTS.REF from adr , pts , BOD where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BOD' aND pts.OBJINR='" + objinr + "' and pts.rol='DRR' and BOD.inr=pts.OBJINR";
sql = "select adr.tel5 , adr.adr1 , adr.fax5 ,PTS.REF from adr , pts , BOD where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BOD' aND pts.OBJINR='" + objinr + "' and pts.rol='DRR' and BOD.inr=pts.OBJINR";
@@ -179,7 +240,18 @@ event $recpan\smssnd order 1000
...
@@ -179,7 +240,18 @@ event $recpan\smssnd order 1000
sql = "select adr.tel6 , adr.adr1 , adr.fax6 ,LID.ownref,BRD.ORDPAYDAT from adr , pts , LID,BRD where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BRD' aND pts.OBJINR=BRD.inr and pts.rol='APL' and BRD.inr=pts.OBJINR and BRD.inr='" + objinr + "'" + " and LID.inr=BRD.PNTINR and BRD.PNTTYP='LID'";
sql = "select adr.tel6 , adr.adr1 , adr.fax6 ,LID.ownref,BRD.ORDPAYDAT from adr , pts , LID,BRD where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BRD' aND pts.OBJINR=BRD.inr and pts.rol='APL' and BRD.inr=pts.OBJINR and BRD.inr='" + objinr + "'" + " and LID.inr=BRD.PNTINR and BRD.PNTTYP='LID'";
sql = "select adr.tel7 , adr.adr1 , adr.fax7 ,LID.ownref,PTe.BEGDAT from adr , pts , LID,BRD ,PTEwhere adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BRD' aND pts.OBJINR=BRD.inr and pts.rol='APL' and BRD.inr=pts.OBJINR and BRD.inr='" + $trn\objinr.getValue() + "'" + "and LID.inr=BRD.PNTINR and BRD.PNTTYP='LID' and PTE.objtyp='PTS' and PTE.objinr=PTS.inr and PTE.CBTPFX='AKZ' and PTE.EXTID='AKZ/BR'";
sql = "select adr.tel7 , adr.adr1 , adr.fax7 ,LID.ownref,PTe.BEGDAT from adr , pts , LID,BRD ,PTEwhere adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BRD' aND pts.OBJINR=BRD.inr and pts.rol='APL' and BRD.inr=pts.OBJINR and BRD.inr='" + $trn\objinr.getValue() + "'" + "and LID.inr=BRD.PNTINR and BRD.PNTTYP='LID' and PTE.objtyp='PTS' and PTE.objinr=PTS.inr and PTE.CBTPFX='AKZ' and PTE.EXTID='AKZ/BR'";
sql = "select adr.tel7 , adr.adr1 , adr.fax7 ,BCD.ownref,PTe.BEGDAT from adr , pts ,BCD ,PTE where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BCD' aND pts.OBJINR=BCD.inr and pts.rol='DRE' and BCD.inr='" + $trn\objinr.getValue() + "'" + " and PTE.objtyp='PTS' and PTE.objinr=PTS.inr and PTE.CBTPFX='AKZ' and PTE.EXTID='AKZ/BC'";
sql = "select adr.tel7 , adr.adr1 , adr.fax7 ,BCD.ownref,PTe.BEGDAT from adr , pts ,BCD ,PTE where adr.extkey=pts.extkey and adr.extkey=pts.extkey and pts.objtyp='BCD' aND pts.OBJINR=BCD.inr and pts.rol='DRE' and BCD.inr='" + $trn\objinr.getValue() + "'" + " and PTE.objtyp='PTS' and PTE.objinr=PTS.inr and PTE.CBTPFX='AKZ' and PTE.EXTID='AKZ/BC'";
String sqlcount = "select count(*) from trn t,smh s where t.inr =s.trninr and s.trntyp = 'TRN' and s.cortyp = 'SWT' and msgtyp in ('103','202','910') and s.dir = '>' and t.inr = '" + trninrr + "'";
String sqlcount = "select count(*) from trn t,smh s where t.inr =s.trninr and s.trntyp = 'TRN' and s.cortyp = 'SWT' and msgtyp in ('103','202','910') and s.dir = '>' and t.inr = '" + trninrr + "'";
Platform.dbExecuteSql( sqlcount );
Platform.dbExecuteSql( sqlcount );
Platform.dbFetchFields( "", countFlg );
Argument<String> countFlgBox = new Argument<String>("","");