Package org.kapott.hbci.structures

Examples of org.kapott.hbci.structures.Konto


        entry.anlagebetrag=new Value(
            result.getProperty(header+".Anlagebetrag.value"),
            result.getProperty(header+".Anlagebetrag.curr"));
       
        if (result.getProperty(header+".Anlagekto.number")!=null) {
            entry.anlagekonto=new Konto();
            entry.anlagekonto.blz=result.getProperty(header+".Anlagekto.KIK.blz");
            entry.anlagekonto.country=result.getProperty(header+".Anlagekto.KIK.country");
            entry.anlagekonto.number=result.getProperty(header+".Anlagekto.number");
            entry.anlagekonto.subnumber=result.getProperty(header+".Anlagekto.subnumber");
            getMainPassport().fillAccountInfo(entry.anlagekonto);
        }
       
        if (result.getProperty(header+".Ausbuchungskto.number")!=null) {
            entry.ausbuchungskonto=new Konto();
            entry.ausbuchungskonto.blz=result.getProperty(header+".Ausbuchungskto.KIK.blz");
            entry.ausbuchungskonto.country=result.getProperty(header+".Ausbuchungskto.KIK.country");
            entry.ausbuchungskonto.number=result.getProperty(header+".Ausbuchungskto.number");
            entry.ausbuchungskonto.subnumber=result.getProperty(header+".Ausbuchungskto.subnumber");
            getMainPassport().fillAccountInfo(entry.ausbuchungskonto);
        }
       
        entry.belastungskonto=new Konto();
        entry.belastungskonto.blz=result.getProperty(header+".Belastungskto.KIK.blz");
        entry.belastungskonto.country=result.getProperty(header+".Belastungskto.KIK.country");
        entry.belastungskonto.number=result.getProperty(header+".Belastungskto.number");
        entry.belastungskonto.subnumber=result.getProperty(header+".Belastungskto.subnumber");
        getMainPassport().fillAccountInfo(entry.belastungskonto);
       
        if (result.getProperty(header+".Zinskto.number")!=null) {
            entry.zinskonto=new Konto();
            entry.zinskonto.blz=result.getProperty(header+".Zinskto.KIK.blz");
            entry.zinskonto.country=result.getProperty(header+".Zinskto.KIK.country");
            entry.zinskonto.number=result.getProperty(header+".Zinskto.number");
            entry.zinskonto.subnumber=result.getProperty(header+".Zinskto.subnumber");
            getMainPassport().fillAccountInfo(entry.zinskonto);
View Full Code Here


    protected void extractResults(HBCIMsgStatus msgstatus,String header,int idx)
    {
        Properties result=msgstatus.getData();
        GVRTermUebList.Entry entry=new GVRTermUebList.Entry();
       
        entry.my=new Konto();
        entry.my.blz=result.getProperty(header+".My.KIK.blz");
        entry.my.country=result.getProperty(header+".My.KIK.country");
        entry.my.number=result.getProperty(header+".My.number");
        entry.my.subnumber=result.getProperty(header+".My.subnumber");
        getMainPassport().fillAccountInfo(entry.my);

        entry.other=new Konto();
        entry.other.blz=result.getProperty(header+".Other.KIK.blz");
        entry.other.country=result.getProperty(header+".Other.KIK.country");
        entry.other.number=result.getProperty(header+".Other.number");
        entry.other.subnumber=result.getProperty(header+".Other.subnumber");
        entry.other.name=result.getProperty(header+".name");
View Full Code Here

                // participant
                Element participant=doc.createElement("participant");
                structured.appendChild(participant);

                Konto acc=transaction.other;
               
                Element name=doc.createElement("name");
                name.appendChild(doc.createTextNode(nullAsEmpty(acc!=null?acc.name:"")));
                participant.appendChild(name);
View Full Code Here

                }
               
                String st_depot=Swift.getTagValue(onerecord,"97A",0);
                int pos1=st_depot.indexOf("//");
                int pos2=st_depot.indexOf("/",pos1+2);
                entry.depot=new Konto();
                entry.depot.blz=st_depot.substring(pos1+2,pos2);
                entry.depot.number=st_depot.substring(pos2+1);
                getMainPassport().fillAccountInfo(entry.depot);
               
                String st;
View Full Code Here

    protected void extractResults(HBCIMsgStatus msgstatus,String header,int idx)
    {
        Properties result=msgstatus.getData();
        GVRTermUebList.Entry entry=new GVRTermUebList.Entry();

        entry.my=new Konto();
        entry.my.country=result.getProperty(header+".My.KIK.country");
        entry.my.blz=result.getProperty(header+".My.KIK.blz");
        entry.my.number=result.getProperty(header+".My.number");
        entry.my.subnumber=result.getProperty(header+".My.subnumber");
        entry.my.iban = result.getProperty(header+".My.iban");
        entry.my.bic = result.getProperty(header+".My.bic");
        getMainPassport().fillAccountInfo(entry.my);

        entry.other=new Konto();
       
        String sepadescr = result.getProperty(header+".sepadescr");
        PainVersion version = new PainVersion(sepadescr);
        ISEPAParser parser = SEPAParserFactory.get(version);
        ArrayList<Properties> sepaResults = new ArrayList<Properties>();
View Full Code Here

                    number="";
                    iban=konto_info;
                    curr="";
                }

                btag.my=new Konto();
                btag.my.blz=blz;
                btag.my.number=number;
                btag.my.iban=iban;
                btag.my.curr=curr;
                if (passport!=null) {
                    passport.fillAccountInfo(btag.my);
                }

                // extract "auszugsnummer"
                btag.counter=Swift.getTagValue(st_tag,"28C",0);

                // extract "anfangssaldo"
                String st_start=Swift.getTagValue(st_tag,"60F",0);
                char   starttype='F';
                if (st_start==null) {
                    st_start=Swift.getTagValue(st_tag,"60M",0);
                    starttype='M';
                }
                if (st_start!=null) {
                    // Tag 60 (Anfangssaldo) gibt es in MT942 nicht,
                    // darum wird btag.start nur in MT940 gef�llt

                    btag.start=new Saldo();
                    btag.starttype=starttype;

                    String cd=st_start.substring(0,1);

                    try {
                        btag.start.timestamp=dateFormat.parse(st_start.substring(1,7));
                    } catch (Exception e) {
                        btag.start.timestamp=null;
                    }

                    // hier aus dem CD-Indikator und dem absoluten Saldo-Betrag
                    // einen String f�r den Saldo-Betrag zusamennbauen
                    btag.start.value=new Value(
                        (cd.equals("D")?"-":"")+st_start.substring(10).replace(',','.'),
                        st_start.substring(7,10));
                }

                // looping to get all "umsaetze"

                // TODO: beim MT942 (btag.start==null) m�sste als Initialwert
                // fuer den Saldo hier eigentlich der Abschluss-Saldo aus den
                // gebuchten Ums�tzen verwendet werden (den habe ich an dieser
                // Stelle aber nicht so ohne weiteres)
                long saldo = (btag.start!=null)?btag.start.value.getLongValue():0;
                int  ums_counter=0;

                while (true) {
                    String st_ums=Swift.getTagValue(st_tag,"61",ums_counter);
                    if (st_ums==null)
                        break;

                    GVRKUms.UmsLine line=new GVRKUms.UmsLine();

                    // extract valuta
                    line.valuta=dateFormat.parse(st_ums.substring(0,6));

                    // extract bdate
                    int next=0;
                    if (st_ums.charAt(6)>'9') {
                        // [2012-01-27 - Patch von Frank/Pecunia]
                        // beim :61er Tag ist das Buchungsdatum optional. Wenn es nicht gesetzt ist, muss das Buchungsdatum des
                        // Umsatzes z.B. aus :60F kommen
                        if (btag.start !=  null && btag.start.timestamp != null) line.bdate = btag.start.timestamp;
                        else line.bdate=line.valuta;

                        next=6;

                    } else {
                        line.bdate=dateFormat.parse(st_ums.substring(0,2)+
                            st_ums.substring(6,10));

                        // wenn bdate und valuta um mehr als einen monat voneinander
                        // abweichen, dann ist das jahr des bdate falsch (1.1.2005 vs. 31.12.2004)
                        // korrektur des bdate-jahres in die richtige richtung notwendig
                        // FE: ein Monat reicht nicht, es sollte schon ein halbes Jahr sein - es gab verschiedene Probleme mit Umsaetzen im falschen Jahr!!
                        // http://www.onlinebanking-forum.de/phpBB2/viewtopic.php?p=75348
                        if (Math.abs(line.bdate.getTime()-line.valuta.getTime())>180L*24*3600*1000) {
                            int diff;

                            if (line.bdate.before(line.valuta)) {
                                diff=+1;
                            } else {
                                diff=-1;
                            }
                            Calendar cal=Calendar.getInstance();
                            cal.setTime(line.bdate);
                            cal.set(Calendar.YEAR,cal.get(Calendar.YEAR)+diff);
                            line.bdate=cal.getTime();
                        }

                        next=10;
                    }

                    // extract credit/debit
                    String cd;
                    if (st_ums.charAt(next)=='C' || st_ums.charAt(next)=='D') {
                        line.isStorno=false;
                        cd=st_ums.substring(next,next+1);
                        next++;
                    } else {
                        line.isStorno=true;
                        cd=st_ums.substring(next+1,next+2);
                        next+=2;
                    }

                    // skip part of currency
                    char currpart=st_ums.charAt(next);
                    if (currpart>'9')
                        next++;

                    line.value=new Value();

                    // TODO: bei einem MT942 wird die waehrung hier automatisch auf EUR
                    // gesetzt, weil die auto-erkennung (anhand des anfangssaldos) hier nicht
                    // funktioniert, weil es im MT942 keinen anfangssaldo gibt
                    line.value.setCurr((btag.start!=null)?btag.start.value.getCurr():"EUR");

                    // extract value and skip code
                    int    npos=st_ums.indexOf("N",next);
                    // welcher Code (C/D) zeigt einen negativen Buchungsbetrag
                    // an? Bei einer "normalen" Buchung ist das D(ebit). Bei
                    // einer Storno-Buchung ist der Betrag allerdings negativ,
                    // wenn eine ehemalige Gutschrift (Credit) storniert wird,
                    // in dem Fall w�re als "C" der Indikator f�r den negativen
                    // Buchungsbetrag
                    String negValueIndikator=line.isStorno?"C":"D";
                    line.value.setValue(
                        HBCIUtilsInternal.string2Long(
                            (cd.equals(negValueIndikator)?"-":"") + st_ums.substring(next,npos).replace(',','.'),
                            100));
                    next=npos+4;

                    // update saldo
                    saldo+=line.value.getLongValue();

                    line.saldo=new Saldo();
                    line.saldo.timestamp=line.bdate;
                    // TODO: bei einem MT942 wird die waehrung hier automatisch auf EUR
                    // gesetzt, weil die auto-erkennung (anhand des anfangssaldos) hier nicht
                    // funktioniert, weil es im MT942 keinen anfangssaldo gibt
                    line.saldo.value=new Value(saldo, (btag.start!=null)?btag.start.value.getCurr():"EUR");

                    // extract customerref
                    npos=st_ums.indexOf("//",next);
                    if (npos==-1)
                        npos=st_ums.indexOf("\r\n",next);
                    if (npos==-1)
                        npos=st_ums.length();
                    line.customerref=st_ums.substring(next,npos);
                    next=npos;

                    // check for instref
                    if (next<st_ums.length() && st_ums.substring(next,next+2).equals("//")) {
                        // extract instref
                        next+=2;
                        npos=st_ums.indexOf("\r\n",next);
                        if (npos==-1)
                            npos=st_ums.length();
                        line.instref=st_ums.substring(next,npos);
                        next=npos+2;
                    }
                    if (line.instref==null)
                        line.instref="";

                    // check for additional information
                    if (next<st_ums.length() && st_ums.charAt(next)=='\r') {
                        next+=2;

                        // extract orig Value
                        pos=st_ums.indexOf("/OCMT/",next);
                        if (pos!=-1) {
                            int slashpos=st_ums.indexOf("/",pos+9);
                            if (slashpos==-1)
                                slashpos=st_ums.length();

                            try
                            {
                              line.orig_value=new Value(
                                  st_ums.substring(pos+9,slashpos).replace(',','.'),
                                  st_ums.substring(pos+6,pos+9));
                            }
                            catch (NumberFormatException nfe)
                            {
                              // Der Betrag darf fehlen. Tolerieren wir
                            }
                        }

                        // extract charge Value
                        pos=st_ums.indexOf("/CHGS/",next);
                        if (pos!=-1) {
                            int slashpos=st_ums.indexOf("/",pos+9);
                            if (slashpos==-1)
                                slashpos=st_ums.length();

                            try
                            {
                              line.charge_value=new Value(
                                  st_ums.substring(pos+9,slashpos).replace(',','.'),
                                  st_ums.substring(pos+6,pos+9));
                            }
                            catch (NumberFormatException nfe)
                            {
                              // Der Betrag darf fehlen. Tolerieren wir
                            }
                        }
                    }

                    String st_multi=Swift.getTagValue(st_tag,"86",ums_counter);
                    if (st_multi!=null) {
                        line.gvcode=st_multi.substring(0,3);
                        st_multi=Swift.packMulti(st_multi.substring(3));

                        if (!line.gvcode.equals("999")) {
                            line.isSepa = line.gvcode.startsWith("1");
                            line.text=Swift.getMultiTagValue(st_multi,"00");
                            line.primanota=Swift.getMultiTagValue(st_multi,"10");
                            for (int i=0;i<10;i++) {
                                line.addUsage(Swift.getMultiTagValue(st_multi,Integer.toString(20+i)));
                            }

                            Konto acc=new Konto();
                            acc.blz=Swift.getMultiTagValue(st_multi,"30");
                            acc.number=Swift.getMultiTagValue(st_multi,"31");
                           
                            // fuer den Fall, dass in der BLZ sowas hier drin steht: "GENODEF1S06 SVWZ+ ja"
                            // Siehe http://www.onlinebanking-forum.de/phpBB2/viewtopic.php?t=16182
View Full Code Here

    {
        Properties result=msgstatus.getData();
        GVRAccInfo.AccInfo info=new GVRAccInfo.AccInfo();
        String st;
       
        info.account=new Konto();
        info.account.blz=result.getProperty(header+".My.KIK.blz");
        info.account.country=result.getProperty(header+".My.KIK.country");
        info.account.number=result.getProperty(header+".My.number");
        info.account.subnumber=result.getProperty(header+".My.subnumber");
        info.account.curr=result.getProperty(header+".curr");
        info.account.name=result.getProperty(header+".name");
        info.account.name2=result.getProperty(header+".name2");
        info.account.type=result.getProperty(header+".accbez");
       
        info.comment=result.getProperty(header+".info");
        if ((st=result.getProperty(header+".opendate"))!=null)
            info.created=HBCIUtils.string2DateISO(st);
       
        info.habenzins=((st=result.getProperty(header+".habenzins"))!=null)?HBCIUtilsInternal.string2Long(st,1000):-1;
        info.sollzins=((st=result.getProperty(header+".sollzins"))!=null)?HBCIUtilsInternal.string2Long(st,1000):-1;
        info.ueberzins=((st=result.getProperty(header+".overdrivezins"))!=null)?HBCIUtilsInternal.string2Long(st,1000):-1;
       
        if ((st=result.getProperty(header+".kredit.value"))!=null)
            info.kredit=new Value(st,result.getProperty(header+".kredit.curr"));
        if ((st=result.getProperty(header+".refkto.number"))!=null)
            info.refAccount=new Konto(result.getProperty(header+".refkto.KIK.country"),
                                      result.getProperty(header+".refkto.KIK.blz"),
                                      st,
                                      result.getProperty(header+".refkto.subnumber"));
        info.turnus=((st=result.getProperty(header+".turnus"))!=null)?Integer.parseInt(st):-1;
        info.versandart=((st=result.getProperty(header+".versandart"))!=null)?Integer.parseInt(st):-1;
View Full Code Here

    }

    private static void analyzeReportOfTransactions(HBCIPassport hbciPassport, HBCIHandler hbciHandle) {
        // auszuwertendes Konto automatisch ermitteln (das erste verf�gbare HBCI-Konto)
        Konto myaccount=hbciPassport.getAccounts()[0];
        // wenn der obige Aufruf nicht funktioniert, muss die abzufragende
        // Kontoverbindung manuell gesetzt werden:
        // Konto myaccount=new Konto("DE","86055592","1234567890");

        // Job zur Abholung der Kontoausz�ge erzeugen
View Full Code Here

    protected void extractResults(HBCIMsgStatus msgstatus,String header,int idx)
    {
        Properties result=msgstatus.getData();
        GVRDauerList.Dauer entry=new GVRDauerList.Dauer();

        entry.my=new Konto();
        entry.my.country=result.getProperty(header+".My.KIK.country");
        entry.my.blz=result.getProperty(header+".My.KIK.blz");
        entry.my.number=result.getProperty(header+".My.number");
        entry.my.subnumber=result.getProperty(header+".My.subnumber");
        entry.my.iban = result.getProperty(header+".My.iban");
        entry.my.bic = result.getProperty(header+".My.bic");
        getMainPassport().fillAccountInfo(entry.my);

        entry.other=new Konto();
       
        String sepadescr = result.getProperty(header+".sepadescr");
        PainVersion version = new PainVersion(sepadescr);
        ISEPAParser parser = SEPAParserFactory.get(version);
        ArrayList<Properties> sepaResults = new ArrayList<Properties>();
View Full Code Here

    @Test
    public void test() {
        System.out.println("---------Erstelle Job");
        HBCIJob job =  handler.newJob("DauerSEPAEdit");
       
        Konto acc = new Konto();
        acc.blz = params.getProperty("target_blz");
        acc.number = params.getProperty("target_number");
        acc.name = "Kurt Mustermann";
        acc.bic = params.getProperty("target_bic");
        acc.iban = params.getProperty("target_iban");
View Full Code Here

TOP

Related Classes of org.kapott.hbci.structures.Konto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.