Examples of SepaLastschrift


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

    // Wenn das der Fall ist, bearbeitet der User scheinbar gerade eine
    // existierende Lastschrift. Wir laden dann die Adresse, damit die
    // Mandats-Daten beim Speichern wieder dieser zugeordnet werden.
    try
    {
      SepaLastschrift s = this.getTransfer();
      if (!s.isNewObject())
      {
        String id = StringUtils.trimToNull(MetaKey.ADDRESS_ID.get(s));
        if (id != null)
          this.address = (HibiscusAddress) Settings.getDBService().createObject(HibiscusAddress.class,id);
      }
View Full Code Here

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

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

      Double d = (Double) getBetrag().getValue();
      t.setBetrag(d == null ? Double.NaN : d.doubleValue());
     
      Konto k = (Konto)getKontoAuswahl().getValue();
      t.setKonto(k);
      t.setZweck((String)getZweck().getValue());
      t.setTermin((Date) getTermin().getValue());
      t.setEndtoEndId((String) getEndToEndId().getValue());
      t.setPmtInfId((String) getPmtInfId().getValue());
      t.setCreditorId((String) getCreditorId().getValue());
      t.setMandateId((String) getMandateId().getValue());
      t.setSignatureDate((Date) getSignatureDate().getValue());
      t.setSequenceType((SepaLastSequenceType)getSequenceType().getValue());
      t.setType((SepaLastType)getType().getValue());
      t.setTargetDate((Date) getTargetDate().getValue());

      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);
       
        // wenn sie in der Action gespeichert wurde, sollte sie jetzt eine ID haben und wir koennen die Meta-Daten dran haengen
        if (e.getID() != null)
          this.address = e;
      }
     
      // Glaeubiger-ID im Konto speichern, damit wir sie beim naechsten Mal parat haben
      MetaKey.SEPA_CREDITOR_ID.set(k,t.getCreditorId());
     
      // Daten des Mandats als Meta-Daten an der Adresse speichern
      if (this.address != null)
      {
        MetaKey.SEPA_MANDATE_ID.set(this.address,t.getMandateId());
        MetaKey.SEPA_SEQUENCE_CODE.set(this.address,t.getSequenceType().name());
        MetaKey.SEPA_MANDATE_SIGDATE.set(this.address,DateUtil.DEFAULT_FORMAT.format(t.getSignatureDate()));
       
        // Adress-ID am Auftrag speichern, damit wir nach erfolgreicher Ausfuehrung des Auftrages den
        // Sequence-Typ von FRST auf RCUR setzen koennen
        MetaKey.ADDRESS_ID.set(t,this.address.getID());
      }
     
      t.transactionCommit();

      Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Auftrag gespeichert"),StatusBarMessage.TYPE_SUCCESS));
      MessageBus.send("hibiscus.transfer.check",t);
     
      return true;
    }
    catch (Exception e)
    {
      if (t != null) {
        try {
          t.transactionRollback();
        }
        catch (Exception xe) {
          Logger.error("rollback failed",xe);
        }
      }
View Full Code Here

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

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

    try
    {
      if (context instanceof SepaLastschrift)
      {
        u = (SepaLastschrift) context;
      }
      else if (context instanceof Konto)
      {
        Konto k = (Konto) context;
        u = (SepaLastschrift) Settings.getDBService().createObject(SepaLastschrift.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 = (SepaLastschrift) Settings.getDBService().createObject(SepaLastschrift.class,null);
        u.setGegenkonto(e);
      }
      else if (context instanceof Umsatz)
      {
        Umsatz umsatz = (Umsatz) context;
        u = (SepaLastschrift) Settings.getDBService().createObject(SepaLastschrift.class,null);
        u.setBetrag(Math.abs(umsatz.getBetrag())); // negative Betraege automatisch in positive umwandeln
        u.setGegenkontoBLZ(umsatz.getGegenkontoBLZ());
        u.setGegenkontoName(umsatz.getGegenkontoName());
        u.setGegenkontoNummer(umsatz.getGegenkontoNummer());
        u.setKonto(umsatz.getKonto());
        u.setTermin(new Date());
       
        // 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 SepaSammelLastBuchung)
      {
        try
        {
          SepaSammelLastBuchung b = (SepaSammelLastBuchung) context;
          SepaSammelLastschrift st = (SepaSammelLastschrift) b.getSammelTransfer();
          u = (SepaLastschrift) Settings.getDBService().createObject(SepaLastschrift.class,null);
          u.setBetrag(b.getBetrag());
          u.setGegenkontoBLZ(b.getGegenkontoBLZ());
          u.setGegenkontoName(b.getGegenkontoName());
          u.setGegenkontoNummer(b.getGegenkontoNummer());
          u.setZweck(b.getZweck());
          u.setCreditorId(b.getCreditorId());
          u.setEndtoEndId(b.getEndtoEndId());
          u.setMandateId(b.getMandateId());
          u.setSignatureDate(b.getSignatureDate());
         
          if (st != null)
          {
            u.setKonto(st.getKonto());
            u.setTermin(st.getTermin());
           
            u.setSequenceType(st.getSequenceType());
            u.setTargetDate(st.getTargetDate());
            u.setType(st.getType());
          }
        }
        catch (RemoteException re)
        {
          Logger.error("error while creating transfer",re);
View Full Code Here

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

      try
      {
        if (o instanceof SepaLastschrift[])
          return false;
        SepaLastschrift u = (SepaLastschrift) 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

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

        au.delete();
      }

      // SEPA-Lastschriften
      list = getSepaLastschriften();
      SepaLastschrift sl = null;
      while (list.hasNext())
      {
        sl = (SepaLastschrift) list.next();
        sl.delete();
      }

      // SEPA-Sammellastschriften
      list = getSepaSammelLastschriften();
      SepaSammelLastschrift ssl = null;
View Full Code Here

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

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

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

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

      SepaLastschriftDialog d = new SepaLastschriftDialog(u,SepaLastschriftDialog.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);
        GUI.getStatusBar().setErrorText(i18n.tr("Fehler beim Ausf�hren des Auftrages"));
        return;
      }

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

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

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

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

    Properties prop = (Properties) o;
    SepaLastschrift u = (SepaLastschrift) service.createObject(SepaLastschrift.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.TARGETDATE.getValue()));
   
    if (date != null && !SepaUtil.DATE_UNDEFINED.equals(date))
      u.setTargetDate(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.setCreditorId(prop.getProperty(ISEPAParser.Names.CREDITORID.getValue()));
    u.setMandateId(prop.getProperty(ISEPAParser.Names.MANDATEID.getValue()));
   
    String mandDate = StringUtils.trimToNull(prop.getProperty(ISEPAParser.Names.MANDDATEOFSIG.getValue()));
    if (mandDate != null && !SepaUtil.DATE_UNDEFINED.equals(mandDate))
      u.setSignatureDate(ISO_DATE.parse(mandDate));

    u.setSequenceType(SepaLastSequenceType.valueOf(prop.getProperty(ISEPAParser.Names.SEQUENCETYPE.getValue())));
    u.setType(SepaLastType.valueOf(prop.getProperty(ISEPAParser.Names.LAST_TYPE.getValue())));

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

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

  /**
   * @see de.willuhn.jameica.hbci.io.print.AbstractPrintSupportSepaTransfer#customize(net.sf.paperclips.GridPrint)
   */
  void customize(GridPrint table) throws RemoteException, ApplicationException
  {
    SepaLastschrift a = this.getTransfer();
   
    // Leerzeile
    table.add(new LineBreakPrint(fontTiny));
    table.add(new LineBreakPrint(fontTiny));

    // Wir fuegen noch ein paar SEPA-spezifische Sachen hinzu.
    table.add(new TextPrint(i18n.tr("Sequenz-Typ"),fontNormal));
    table.add(new TextPrint(a.getSequenceType().getDescription(),fontNormal));
    table.add(new TextPrint(i18n.tr("Lastschrift-Art"),fontNormal));
    table.add(new TextPrint(a.getType().getDescription(),fontNormal));
    Date faellig = a.getTargetDate();
    table.add(new TextPrint(i18n.tr("F�lligkeitsdatum"),fontNormal));
    table.add(new TextPrint(faellig == null ? "-" : HBCI.DATEFORMAT.format(faellig),fontNormal));
  }
View Full Code Here

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

        // Einzellastschriften
        DBIterator list = kt.getSepaLastschriften();
        list.addFilter("(ausgefuehrt is null or ausgefuehrt = 0)"); // Schnelleres Laden durch vorheriges Aussortieren
        while (list.hasNext())
        {
          SepaLastschrift u = (SepaLastschrift) list.next();
          if (!u.ueberfaellig() || u.ausgefuehrt()) // Doppelt haelt besser ;)
            continue; // Nur ueberfaellige Auftraege
         
          SynchronizeJobSepaLastschrift job = backend.create(SynchronizeJobSepaLastschrift.class,kt);
          job.setContext(SynchronizeJob.CTX_ENTITY,u);
          jobs.add(job);
View Full Code Here

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

   */
  public String getName() throws ApplicationException
  {
    try
    {
      SepaLastschrift last = (SepaLastschrift) this.getContext(CTX_ENTITY);
      Konto k = last.getKonto();
      return i18n.tr("{0}: ({1}) {2} {3} von {4} einziehen",k.getLongName(),last.getZweck(),HBCI.DECIMALFORMAT.format(last.getBetrag()),k.getWaehrung(),last.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
TOP
Copyright © 2018 www.massapi.com. 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.