Examples of UmsatzTyp


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

      umsaetze = (Umsatz[]) context;

    if (umsaetze.length == 0)
      throw new ApplicationException(i18n.tr("Bitte w�hlen Sie einen oder mehrere Ums�tze aus"));

    UmsatzTyp ut = null;
   
    try
    {
      int typ = UmsatzTyp.TYP_EGAL;
     
      if (umsaetze.length == 1)
      {
        // Mal schauen, ob der Umsatz schon einen Typ hat
        ut = umsaetze[0].getUmsatzTyp();

        // Dialog anzeigen, bei dem nur die zum Betrag passenden Kategorien angezeigt werden
        if (ut == null && umsaetze[0].getBetrag() != 0)
          typ = (umsaetze[0].getBetrag() > 0 ? UmsatzTyp.TYP_EINNAHME : UmsatzTyp.TYP_AUSGABE);
      }
      UmsatzTypListDialog d = new UmsatzTypListDialog(UmsatzTypListDialog.POSITION_CENTER,ut,typ);
      ut = (UmsatzTyp) d.open();
    }
    catch (OperationCanceledException oce)
    {
      Logger.info(oce.getMessage());
      return;
    }
    catch (ApplicationException ae)
    {
      throw ae;
    }
    catch (Exception e)
    {
      Logger.error("error while choosing umsatztyp",e);
      Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Fehler beim Ausw�hlen der Umsatz-Kategorie"), StatusBarMessage.TYPE_ERROR));
    }
     

    try
    {
      umsaetze[0].transactionBegin();
      for (int i=0;i<umsaetze.length;++i)
      {
        umsaetze[i].setUmsatzTyp(ut);
        umsaetze[i].store();
        Application.getMessagingFactory().sendMessage(new ObjectChangedMessage(umsaetze[i]));
      }
      umsaetze[0].transactionCommit();
     
      if (ut == null)
        Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Zuordnung der Kategorie entfernt"), StatusBarMessage.TYPE_SUCCESS));
      else
        Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Umsatz-Kategorie {0} zugeordnet", ut.getName()), StatusBarMessage.TYPE_SUCCESS));
    }
    catch (ApplicationException ae)
    {
      rollback(umsaetze[0]);
      throw ae;
View Full Code Here

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

  public synchronized boolean handleStore()
  {
    try {
      UmsatzTypObject t = (UmsatzTypObject) getArt().getValue();
     
      UmsatzTyp ut = getUmsatzTyp();
      ut.setTyp(t == null ? UmsatzTyp.TYP_EGAL : t.typ);
      ut.setName((String)getName().getValue());
      ut.setNummer((String)getNummer().getValue());
      ut.setPattern((String)getPattern().getValue());
      ut.setRegex(((Boolean)getRegex().getValue()).booleanValue());
      ut.setParent((UmsatzTyp)getParent().getValue());
     
      boolean b = ((Boolean)getCustomColor().getValue()).booleanValue();
      ut.setCustomColor(b);
      if (b)
      {
        Color c = (Color) getColor().getValue();
        if (c == null)
        {
          ut.setColor(null);
        }
        else
        {
          RGB rgb = c.getRGB();
          ut.setColor(new int[]{rgb.red,rgb.green,rgb.blue});
        }
      }
     
     
      ut.store();
      Application.getMessagingFactory().sendMessage(new StatusBarMessage(i18n.tr("Umsatz-Kategorie gespeichert"), StatusBarMessage.TYPE_SUCCESS));
      return true;
    }
    catch (ApplicationException e2)
    {
View Full Code Here

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

          {
            getCheck().setValue(i18n.tr("Bitte geben Sie eine Bezeichnung ein."));
            return;
          }

          UmsatzTyp typ = control.getUmsatzTyp();
          typ.setName(s);
          UmsatzTypControl.UmsatzTypObject uto = (UmsatzTypControl.UmsatzTypObject) control.getArt().getValue();
          typ.setTyp(uto.getTyp());
          close();
        }
        catch (RemoteException e)
        {
          Logger.error("unable to apply data",e);
View Full Code Here

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

                  return;
               
                // Mal schauen, obs den Typ schon gibt
                DBIterator existing = Settings.getDBService().createList(UmsatzTyp.class);
                existing.addFilter("pattern = ?", new Object[]{text});
                UmsatzTyp typ = null;
                if (existing.size() > 0)
                {
                  if (!Application.getCallback().askUser(i18n.tr("Eine Umsatz-Kategorie mit diesem Suchbegriff existiert bereits. �berschreiben?")))
                    return;
                 
                  // OK, ueberschreiben
                  typ = (UmsatzTyp) existing.next();
                }
                else
                {
                  UmsatzTypNewDialog d = new UmsatzTypNewDialog(UmsatzTypNewDialog.POSITION_MOUSE);
                  typ = (UmsatzTyp) d.open();
                }
                typ.setPattern(text);
                typ.setRegex(((Boolean)regex.getValue()).booleanValue());
                typ.store();
                GUI.getStatusBar().setSuccessText(i18n.tr("Umsatz-Kategorie gespeichert"));
              }
              catch (ApplicationException ae)
              {
                Application.getMessagingFactory().sendMessage(new StatusBarMessage(ae.getMessage(), StatusBarMessage.TYPE_ERROR));
              }
              catch (OperationCanceledException oce)
              {
                Logger.info("operation cancelled");
                return;
              }
              catch (Exception ex)
              {
                Logger.error("unable to store umsatz filter",ex);
                GUI.getStatusBar().setErrorText(i18n.tr("Fehler beim Speichern der Umsatz-Kategorie"));
              }
            }
          });
         
          new MenuItem(menu, SWT.SEPARATOR);
          try
          {
            DBIterator i = Settings.getDBService().createList(UmsatzTyp.class);
            i.addFilter("pattern is not null and pattern != ''"); // Wir wollen nur die mit Suchbegriff haben
            while (i.hasNext())
            {
              final UmsatzTyp ut = (UmsatzTyp) i.next();
              final String s    = ut.getName();
              final String p    = ut.getPattern();
              final boolean ir  = ut.isRegex();
              final MenuItem mi = new MenuItem(menu, SWT.PUSH);
              mi.setText(s);
              mi.addListener(SWT.Selection, new Listener()
              {
                public void handleEvent(Event event)
View Full Code Here

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

    // Nicht fest zugeordnet, dann schauen wir mal, ob's eine dynamische Zuordnung gibt
    Iterator typen = cache.values().iterator();
    while (typen.hasNext())
    {
      UmsatzTyp ut = (UmsatzTyp) typen.next();
      if (ut.matches(this))
        return ut;
    }
    return null;
  }
View Full Code Here

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

    String s = getContent(e);
    if (s == null)
      return null; // Keine Kategorie angegeben
   
    // Haben wir die Kategorie schon im Cache?
    UmsatzTyp typ = this.cache.get(s);
    if (typ != null) // jepp, haben wir schon
      return typ;
   
    try
    {
      String[] names = s.split(":");
     
      if (names.length > 1)
      {
        //////////////////////////////////////////////////////////////////////////
        // Kategorie-Baum

        // a) Suche in Datenbank
        UmsatzTyp parent = null;
        boolean found = true;
        for (String name:names)
        {
          typ = findTyp(name,parent);
          if (typ == null)
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.