Examples of SepaSammelLastschrift


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

        sl.delete();
      }

      // SEPA-Sammellastschriften
      list = getSepaSammelLastschriften();
      SepaSammelLastschrift ssl = null;
      while (list.hasNext())
      {
        ssl = (SepaSammelLastschrift) list.next();
        ssl.delete();
      }

      // SEPA-Sammelueberweisungen
      list = getSepaSammelUeberweisungen();
      SepaSammelUeberweisung ssu = null;
View Full Code Here

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

      u = (SepaSammelLastBuchung) context;
    }
    else
    {
      try {
        SepaSammelLastschrift s = (SepaSammelLastschrift) context;
        u = (SepaSammelLastBuchung) s.createBuchung();
      }
      catch (RemoteException e)
      {
        // Dann halt nicht
      }
View Full Code Here

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

   */
  public String getName() throws ApplicationException
  {
    try
    {
      SepaSammelLastschrift last = (SepaSammelLastschrift) this.getContext(CTX_ENTITY);
      Konto k = last.getKonto();
      return i18n.tr("{0}: ({1}) {2} {3} als SEPA-Sammellastschrift einziehen",k.getLongName(),last.getBezeichnung(),HBCI.DECIMALFORMAT.format(last.getSumme()),k.getWaehrung());
    }
    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

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

  /**
   * @see de.willuhn.jameica.hbci.rmi.Duplicatable#duplicate()
   */
  public Duplicatable duplicate() throws RemoteException
  {
    SepaSammelLastschrift l = null;
    try
    {
      l = (SepaSammelLastschrift) getService().createObject(SepaSammelLastschrift.class,null);
     
      l.transactionBegin();
      l.setBezeichnung(this.getBezeichnung());
      l.setKonto(this.getKonto());
      l.setTermin(new Date());
      l.setSequenceType(getSequenceType());
      l.setTargetDate(getTargetDate());
      l.setType(getType());
      l.setOrderId(getOrderId());
      l.setPmtInfId(getPmtInfId());
      l.store();
     
      List<SepaSammelLastBuchung> list = this.getBuchungen();
      for (SepaSammelLastBuchung t:list)
      {
        SepaSammelLastBuchung copy = (SepaSammelLastBuchung) t.duplicate();
        copy.setSammelTransfer(l);
        copy.store();
      }
      l.transactionCommit();
      return (Duplicatable) l;
    }
    catch (Exception e)
    {
      if (l != null)
        l.transactionRollback();
      Logger.error("unable to duplicate sepa sammeltransfer",e);
      throw new RemoteException(i18n.tr("Fehler beim Duplizieren des SEPA-Sammelauftrages"),e);
    }
  }
View Full Code Here

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

  {
    if (lastschriften == null || lastschriften.size() == 0)
      throw new ApplicationException(i18n.tr("Bitte w�hlen Sie einen oder mehrere Auftr�ge aus"));
   
    List<SepaSammelLastschrift> result = new ArrayList<SepaSammelLastschrift>();
    SepaSammelLastschrift tx = null;
   
    try
    {
      HBCIDBService service = Settings.getDBService();
      Map<String,SepaSammelLastschrift> map = new HashMap<String,SepaSammelLastschrift>();
      boolean inDb = false;
      ////////////////////////////////////////
      // 1. Iterieren ueber die Auftraege, um herauszufinden, wieviele Sammel-Auftraege es werden
      for (SepaLastschrift l:lastschriften)
      {
        inDb |= !l.isNewObject();
        String key = this.createKey(l);
        SepaSammelLastschrift s = map.get(key);
        if (s == null)
        {
          s = (SepaSammelLastschrift) service.createObject(SepaSammelLastschrift.class,null);
          s.setKonto(l.getKonto());
          s.setBezeichnung(i18n.tr("{0} {1} vom {2}",l.getSequenceType().getDescription(),l.getType().getDescription(), HBCI.LONGDATEFORMAT.format(new Date())));
          s.setSequenceType(l.getSequenceType());
          s.setType(l.getType());
          s.setTargetDate(l.getTargetDate());
          map.put(key,s);
        }
      }
     
      // Abfrage anzeigen, ob die Einzelauftraege geloescht werden sollen
      // a) wenn mindestens einer in der DB existierte
      // b) oder mehr als ein Sammelauftrag entsteht.
      boolean delete = false;
      int count = map.size();
      if (count > 1 || inDb)
      {
        SepaLastschriftMergeDialog dialog = new SepaLastschriftMergeDialog(SepaLastschriftMergeDialog.POSITION_CENTER,count,inDb);
        Object o = dialog.open();
        if (o != null)
          delete = ((Boolean)o).booleanValue();
      }
     
      // OK, wir duerfen weiter machen. Erstmal die Sammelauftraege anlegen
      Iterator<SepaSammelLastschrift> list = map.values().iterator();
      while (list.hasNext())
      {
        SepaSammelLastschrift s = list.next();
       
        if (tx == null)
        {
          tx = s;
          tx.transactionBegin();
        }
       
        s.store();
        Application.getMessagingFactory().sendMessage(new ImportMessage(s));
        result.add(s);
      }
     
      // jetzt iterieren wir nochmal ueber die Einzelauftraege und ordnen sie den
      // Sammelauftraegen zu
      for (SepaLastschrift l:lastschriften)
      {
        String key = this.createKey(l);
        SepaSammelLastschrift s = map.get(key);
       
       
        if (s == null) // WTF?
        {
          Logger.error("unable to find sepa transfer for key " + key);
          continue;
        }
       
        SepaSammelLastBuchung b = s.createBuchung();
        b.setBetrag(l.getBetrag());
        b.setCreditorId(l.getCreditorId());
        b.setEndtoEndId(l.getEndtoEndId());
        b.setGegenkontoBLZ(l.getGegenkontoBLZ());
        b.setGegenkontoName(l.getGegenkontoName());
View Full Code Here

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

   * Wenn nichts angegeben ist, wird eine leere Sammel-Lastschrift erstellt und angezeigt.
   * @see de.willuhn.jameica.gui.Action#handleAction(java.lang.Object)
   */
  public void handleAction(Object context) throws ApplicationException
  {
    SepaSammelLastschrift u = null;

    if (context instanceof SepaSammelLastschrift)
    {
      u = (SepaSammelLastschrift) context;
    }
    else if (context instanceof Konto)
    {
      try {
        Konto k = (Konto) context;
        u = (SepaSammelLastschrift) Settings.getDBService().createObject(SepaSammelLastschrift.class,null);
        if (!k.hasFlag(Konto.FLAG_DISABLED) && !k.hasFlag(Konto.FLAG_OFFLINE) && StringUtils.trimToNull(k.getIban()) != null)
          u.setKonto(k);
      }
      catch (RemoteException e)
      {
        // Dann halt nicht
      }
View Full Code Here

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

      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.SepaSammelLastschrift

   */
  public synchronized boolean handleStore()
  {
    try
    {
      SepaSammelLastschrift t = this.getTransfer();
      if (t.ausgefuehrt())
        return true;
     
      t.setSequenceType((SepaLastSequenceType)getSequenceType().getValue());
      t.setType((SepaLastType)getType().getValue());
      t.setTargetDate((Date) getTargetDate().getValue());
     
      this.store();
     
      return true;
    }
View Full Code Here

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

   * @see de.willuhn.jameica.hbci.gui.controller.AbstractSepaSammelTransferBuchungControl#handleStore()
   */
  public synchronized boolean handleStore()
  {
    SepaSammelLastBuchung s = null;
    SepaSammelLastschrift t = null;
   
    try
    {
      s = this.getBuchung();
      t = s.getSammelTransfer();
     
      if (t.ausgefuehrt())
        return true;
     
      s.transactionBegin();
     
      s.setCreditorId((String) getCreditorId().getValue());
      s.setMandateId((String) getMandateId().getValue());
      s.setSignatureDate((Date) getSignatureDate().getValue());
     
      this.store();
     
      Konto k = t.getKonto();
     
      // Glaeubiger-ID im Konto speichern, damit wir sie beim naechsten Mal parat haben
      MetaKey.SEPA_CREDITOR_ID.set(k,s.getCreditorId());
     
      // Wenn wir eine fest assoziierte Adresse haben, ordnen wir die Mandats-Daten dieser zu
      String id = MetaKey.ADDRESS_ID.get(s); // Die ID kann sich u.U. geaendert haben
      if (id != null)
      {
        this.address = (HibiscusAddress) Settings.getDBService().createObject(HibiscusAddress.class,id);
      }

      // Daten des Mandats als Meta-Daten an der Adresse speichern
      if (this.address != null)
      {
        MetaKey.SEPA_MANDATE_ID.set(this.address,s.getMandateId());
        MetaKey.SEPA_MANDATE_SIGDATE.set(this.address,DateUtil.DEFAULT_FORMAT.format(s.getSignatureDate()));
      }
     
      s.transactionCommit();
      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.SepaSammelLastschrift

  @Override
  protected void exportObject(Object o, int idx, JobContext ctx) throws Exception
  {
    Properties props = ctx.props;
   
    SepaSammelLastschrift u = (SepaSammelLastschrift) o;
    Konto k = u.getKonto();
  
    // Wir nehmen die globalen Properties von der ersten Lastschrift
    if (idx == 0)
    {
      SepaLastType type = u.getType();
      if (type == null)
        type = SepaLastType.DEFAULT;

      props.setProperty("pmtinfid",     StringUtils.trimToEmpty(u.getPmtInfId()));
      props.setProperty("sequencetype", u.getSequenceType().name());
      props.setProperty("targetdate",   u.getTargetDate() != null ? ISO_DATE.format(u.getTargetDate()) : SepaUtil.DATE_UNDEFINED);
      props.setProperty("type",         type.name());
     
      String batchbook = MetaKey.SEPA_BATCHBOOK.get(u);
      if (batchbook != null)
        props.setProperty("batchbook", batchbook);
    }
   
    Integer count = (Integer) ctx.meta.get("count");
    if (count == null)
      count = 0;

    List<SepaSammelLastBuchung> buchungen = u.getBuchungen();
    for (int i=0;i<buchungen.size();++i)
    {
      SepaSammelLastBuchung b = buchungen.get(i);
      props.setProperty(SepaUtil.insertIndex("dst.bic",count),      StringUtils.trimToEmpty(b.getGegenkontoBLZ()));
      props.setProperty(SepaUtil.insertIndex("dst.iban",count),     StringUtils.trimToEmpty(b.getGegenkontoNummer()));
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.