Package de.willuhn.jameica.hbci.rmi

Examples of de.willuhn.jameica.hbci.rmi.AuslandsUeberweisung


  void importObject(Object o, int idx, Map ctx) throws Exception
  {
    DBService service = de.willuhn.jameica.hbci.Settings.getDBService();

    Properties prop = (Properties) o;
    AuslandsUeberweisung u = (AuslandsUeberweisung) service.createObject(AuslandsUeberweisung.class,null);
    u.setKonto(this.findKonto(prop.getProperty(ISEPAParser.Names.SRC_IBAN.getValue())));
    u.setGegenkontoName(prop.getProperty(ISEPAParser.Names.DST_NAME.getValue()));
    u.setGegenkontoNummer(prop.getProperty(ISEPAParser.Names.DST_IBAN.getValue()));
    u.setGegenkontoBLZ(prop.getProperty(ISEPAParser.Names.DST_BIC.getValue()));
    u.setZweck(prop.getProperty(ISEPAParser.Names.USAGE.getValue()));
   
    u.setBetrag(Double.valueOf(prop.getProperty(ISEPAParser.Names.VALUE.getValue())));

    String date = StringUtils.trimToNull(prop.getProperty(ISEPAParser.Names.DATE.getValue()));
   
    if (date != null && !SepaUtil.DATE_UNDEFINED.equals(date))
      u.setTermin(ISO_DATE.parse(date));

    u.setEndtoEndId(StringUtils.trimToNull(prop.getProperty(ISEPAParser.Names.ENDTOENDID.getValue())));
    u.setPmtInfId(StringUtils.trimToNull(prop.getProperty(ISEPAParser.Names.PMTINFID.getValue())));

    u.store();
    Application.getMessagingFactory().sendMessage(new ImportMessage(u));
  }
View Full Code Here


  /**
   * @see de.willuhn.jameica.hbci.rmi.Duplicatable#duplicate()
   */
  public Duplicatable duplicate() throws RemoteException {
    AuslandsUeberweisung u = (AuslandsUeberweisung) getService().createObject(AuslandsUeberweisung.class,null);
    u.setBetrag(getBetrag());
    u.setGegenkontoNummer(getGegenkontoNummer());
    u.setGegenkontoName(getGegenkontoName());
    u.setGegenkontoBLZ(getGegenkontoBLZ());
    u.setKonto(getKonto());
    u.setZweck(getZweck());
    u.setEndtoEndId(getEndtoEndId());
    u.setPmtInfId(getPmtInfId());
    u.setTerminUeberweisung(isTerminUeberweisung());
    u.setTermin(isTerminUeberweisung() ? getTermin() : new Date());
    u.setUmbuchung(isUmbuchung());
   
    return u;
  }
View Full Code Here

    if (context == null || !(context instanceof AuslandsUeberweisung))
      throw new ApplicationException(i18n.tr("Kein Auftrag angegeben"));

    try
    {
      final AuslandsUeberweisung u = (AuslandsUeberweisung) context;
     
      if (u.ausgefuehrt())
        throw new ApplicationException(i18n.tr("�berweisung wurde bereits ausgef�hrt"));

      if (u.isNewObject())
        u.store(); // wir speichern bei Bedarf selbst.

      Date termin = DateUtil.startOfDay(u.getTermin());
      Date now    = DateUtil.startOfDay(new Date());
      if (!u.isTerminUeberweisung() && (termin.getTime() - now.getTime()) >= (24 * 60 * 60 * 1000))
      {
        String q = i18n.tr("Der Termin liegt mindestens 1 Tag in Zukunft.\n" +
                           "Soll der Auftrag stattdessen als bankseitige SEPA-Termin�berweisung " +
                           "ausgef�hrt werden?");
        if (Application.getCallback().askUser(q))
        {
          u.setTerminUeberweisung(true);
          u.store();
        }
      }

      AuslandsUeberweisungDialog d = new AuslandsUeberweisungDialog(u,AuslandsUeberweisungDialog.POSITION_CENTER);
      try
      {
        if (!((Boolean)d.open()).booleanValue())
          return;
      }
      catch (OperationCanceledException oce)
      {
        Logger.info(oce.getMessage());
        return;
      }
      catch (Exception e)
      {
        Logger.error("error while showing confirm dialog",e);
        Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Fehler beim Ausf�hren der �berweisung"),StatusBarMessage.TYPE_ERROR));
        return;
      }

      Konto konto = u.getKonto();
      Class<SynchronizeJobSepaUeberweisung> type = SynchronizeJobSepaUeberweisung.class;

      BeanService bs = Application.getBootLoader().getBootable(BeanService.class);
      SynchronizeEngine engine   = bs.get(SynchronizeEngine.class);
      SynchronizeBackend backend = engine.getBackend(type,konto);
View Full Code Here

   */
  public String getName() throws ApplicationException
  {
    try
    {
      AuslandsUeberweisung ueb = (AuslandsUeberweisung) this.getContext(CTX_ENTITY);
      Konto k = ueb.getKonto();
     
      if (ueb.isTerminUeberweisung())
        return i18n.tr("{0}: ({1}) {2} {3} per {4} an {5} �berweisen",k.getLongName(),ueb.getZweck(),HBCI.DECIMALFORMAT.format(ueb.getBetrag()),k.getWaehrung(),HBCI.DATEFORMAT.format(ueb.getTermin()),ueb.getGegenkontoName());
     
      return i18n.tr("{0}: ({1}) {2} {3} an {4} �berweisen",k.getLongName(),ueb.getZweck(),HBCI.DECIMALFORMAT.format(ueb.getBetrag()),k.getWaehrung(),ueb.getGegenkontoName());
    }
    catch (RemoteException re)
    {
      Logger.error("unable to determine job name",re);
      throw new ApplicationException(i18n.tr("Auftragsbezeichnung nicht ermittelbar: {0}",re.getMessage()));
View Full Code Here

      buttons.addButton(i18n.tr("...oder �berweisung"),new Action() {
        public void handleAction(Object context) throws ApplicationException
        {
          try
          {
            AuslandsUeberweisung u = (AuslandsUeberweisung) Settings.getDBService().createObject(AuslandsUeberweisung.class,null);
            u.setGegenkontoBLZ(new String(bic));
            u.setGegenkontoNummer(new String(iban));
            u.setGegenkontoName(name);
            u.setZweck("Spende Hibiscus");
            new de.willuhn.jameica.hbci.gui.action.AuslandsUeberweisungNew().handleAction(u);
          }
          catch (Exception e)
          {
            Logger.error("unable to create sepa ueberweisung",e);
View Full Code Here

   */
  public SelectInput getTyp() throws RemoteException
  {
    if (this.typ != null)
      return this.typ;
    final AuslandsUeberweisung u = getTransfer();
   
    List<Typ> list = new ArrayList<Typ>();
    list.add(new Typ(false,false));
    list.add(new Typ(true,false));
    list.add(new Typ(false,true));
    this.typ = new SelectInput(list,new Typ(u.isTerminUeberweisung(),u.isUmbuchung()));
    this.typ.setName(i18n.tr("Auftragstyp"));
    this.typ.setAttribute("name");
    this.typ.setEnabled(!u.ausgefuehrt());
    this.typ.addListener(new Listener() {
      public void handleEvent(Event event)
      {
        // Wir muessen die Entscheidung, ob es eine Termin-Ueberweisung ist,
        // sofort im Objekt speichern, denn die Information wird von
        // "getTermin()" gebraucht, um zu erkennen, ob der Auftrag faellig ist
        try
        {
          Typ t = (Typ) getTyp().getValue();
          u.setTerminUeberweisung(t.termin);

          // Kommentar vom Termin-Eingabefeld aktualisieren.
          getTermin().updateComment();
        }
        catch (Exception e)
View Full Code Here

   * Speichert den Geld-Transfer.
   * @return true, wenn das Speichern erfolgreich war, sonst false.
   */
  public synchronized boolean handleStore()
  {
    AuslandsUeberweisung t = null;
   
    try
    {
      t = this.getTransfer();
      if (t.ausgefuehrt()) // BUGZILLA 1197
        return true;
     
      t.transactionBegin();

      Double d = (Double) getBetrag().getValue();
      t.setBetrag(d == null ? Double.NaN : d.doubleValue());
     
      t.setKonto((Konto)getKontoAuswahl().getValue());
      t.setZweck((String)getZweck().getValue());
      t.setTermin((Date) getTermin().getValue());
      t.setEndtoEndId((String) getEndToEndId().getValue());
      t.setPmtInfId((String) getPmtInfId().getValue());

      Typ typ = (Typ) getTyp().getValue();
      t.setTerminUeberweisung(typ.termin);
      t.setUmbuchung(typ.umb);

      String kto  = (String)getEmpfaengerKonto().getValue();
      String name = getEmpfaengerName().getText();
      String bic  = (String) getEmpfaengerBic().getValue();

      t.setGegenkontoNummer(kto);
      t.setGegenkontoName(name);
      t.setGegenkontoBLZ(bic);
     
      t.store();

      // Reminder-Intervall speichern
      ReminderIntervalInput input = this.getReminderInterval();
      if (input.containsInterval())
        ReminderUtil.apply(t,(ReminderInterval) input.getValue(), input.getEnd());

      Boolean store = (Boolean) getStoreEmpfaenger().getValue();
      if (store.booleanValue())
      {
        HibiscusAddress e = (HibiscusAddress) Settings.getDBService().createObject(HibiscusAddress.class,null);
        e.setIban(kto);
        e.setName(name);
        e.setBic(bic);
       
        // Zu schauen, ob die Adresse bereits existiert, ueberlassen wir der Action
        new EmpfaengerAdd().handleAction(e);
      }
      GUI.getStatusBar().setSuccessText(i18n.tr("Auftrag gespeichert"));
      t.transactionCommit();

      if (t.getBetrag() > Settings.getUeberweisungLimit())
        GUI.getView().setErrorText(i18n.tr("Warnung: Auftragslimit �berschritten: {0} ", HBCI.DECIMALFORMAT.format(Settings.getUeberweisungLimit()) + " " + getTransfer().getKonto().getWaehrung()));
     
      return true;
    }
    catch (Exception e)
    {
      if (t != null) {
        try {
          t.transactionRollback();
        }
        catch (Exception xe) {
          Logger.error("rollback failed",xe);
        }
      }
View Full Code Here

  /**
   * @see de.willuhn.jameica.gui.Action#handleAction(java.lang.Object)
   */
  public void handleAction(Object context) throws ApplicationException
  {
    AuslandsUeberweisung u = null;

    try
    {
      if (context instanceof AuslandsUeberweisung)
      {
        u = (AuslandsUeberweisung) context;
      }
      else if (context instanceof Konto)
      {
        Konto k = (Konto) context;
        u = (AuslandsUeberweisung) Settings.getDBService().createObject(AuslandsUeberweisung.class,null);
        if (!k.hasFlag(Konto.FLAG_DISABLED) && !k.hasFlag(Konto.FLAG_OFFLINE) && StringUtils.trimToNull(k.getIban()) != null)
          u.setKonto(k);
      }
      else if (context instanceof Address)
      {
        Address e = (Address) context;
        u = (AuslandsUeberweisung) Settings.getDBService().createObject(AuslandsUeberweisung.class,null);
        u.setGegenkonto(e);
      }
      else if (context instanceof Umsatz)
      {
        Umsatz umsatz = (Umsatz) context;
        u = (AuslandsUeberweisung) Settings.getDBService().createObject(AuslandsUeberweisung.class,null);
        u.setBetrag(Math.abs(umsatz.getBetrag())); // negative Betraege automatisch in positive umwandeln
        u.setGegenkontoName(umsatz.getGegenkontoName());
        u.setKonto(umsatz.getKonto());
        u.setTermin(new Date());

        // BUGZILLA 1437
        // Wenn wir ein Gegenkonto haben, dann pruefen wir, ob es wie eine IBAN aussieht.
        // Falls ja, uebernehmen wir sie. Falls nicht, schauen wir im Adressbuch, ob
        // wir die Adresse kennen und dort vielleicht BIC und IBAN haben
        String kto = StringUtils.trimToEmpty(umsatz.getGegenkontoNummer());
        String blz = StringUtils.trimToEmpty(umsatz.getGegenkontoBLZ());
        if (kto.length() <= 10 && kto.length() > 0 && blz.length() > 0) // aber nur, wenn wir auch was zum Suchen im Adressbuch haben
        {
          // kann keine IBAN sein. Die ist per Definition laenger
         
          // Also im Adressbuch schauen
          HibiscusAddress address = (HibiscusAddress) Settings.getDBService().createObject(HibiscusAddress.class,null);
          address.setBlz(blz);
          address.setKontonummer(kto);
          AddressbookService book = (AddressbookService) Application.getServiceFactory().lookup(HBCI.class,"addressbook");
          Address a = book.contains(address);
          kto = a != null ? a.getIban() : null;
          blz = a != null ? a.getBic() : null;
        }
       
       
        u.setGegenkontoBLZ(blz);
        u.setGegenkontoNummer(kto);

       
        // die weiteren Verwendungszweck-Zeilen gibts bei SEPA-Ueberweisungen nicht.
        // Daher landen die alle in einer Zeile
        u.setZweck(VerwendungszweckUtil.toString(umsatz));
      }
      else if (context instanceof SepaSammelUeberweisungBuchung)
      {
        try
        {
          SepaSammelUeberweisungBuchung b = (SepaSammelUeberweisungBuchung) context;
          SepaSammelUeberweisung st = (SepaSammelUeberweisung) b.getSammelTransfer();
          u = (AuslandsUeberweisung) Settings.getDBService().createObject(AuslandsUeberweisung.class,null);
          u.setBetrag(b.getBetrag());
          u.setGegenkontoBLZ(b.getGegenkontoBLZ());
          u.setGegenkontoName(b.getGegenkontoName());
          u.setGegenkontoNummer(b.getGegenkontoNummer());
          u.setZweck(b.getZweck());
          u.setEndtoEndId(b.getEndtoEndId());
         
          if (st != null)
          {
            u.setKonto(st.getKonto());
            u.setTermin(st.getTermin());
          }
        }
        catch (RemoteException re)
        {
          Logger.error("error while creating transfer",re);
View Full Code Here

      try
      {
        if (o instanceof AuslandsUeberweisung[])
          return false;
        AuslandsUeberweisung u = (AuslandsUeberweisung) o;
        return !u.ausgefuehrt();
      }
      catch (Exception e)
      {
        Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Fehler beim Pr�fen, ob Auftrag bereits ausgef�hrt wurde"),StatusBarMessage.TYPE_ERROR));
        Logger.error("error while enable check in menu item",e);
View Full Code Here

          continue;

        values.put(line.substring(0,sep).trim(),line.substring(sep+1).trim());
      }

      AuslandsUeberweisung u = (AuslandsUeberweisung) Settings.getDBService().createObject(AuslandsUeberweisung.class,null);

      Iterator i = values.keySet().iterator();
      while (i.hasNext())
      {
        String s = (String) i.next();
        String value = (String) values.get(s);
        if (value == null || s == null)
          continue;
        if (PT_BLZ.matcher(s).matches())
          u.setGegenkontoBLZ(value.replaceAll(" ",""));
        else if (PT_KONTO.matcher(s).matches())
          u.setGegenkontoNummer(value.replaceAll(" ",""));
        else if (PT_NAME.matcher(s).matches())
          u.setGegenkontoName(value);
        else if (PT_ZWECK.matcher(s).matches())
          u.setZweck(value);
      }
      return u;
    }
    catch (Throwable t)
    {
View Full Code Here

TOP

Related Classes of de.willuhn.jameica.hbci.rmi.AuslandsUeberweisung

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.