forked from jverein/jverein
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Buchung geprüft Markieren. Buchungsliste teilweise aktualisieren
- Loading branch information
Showing
28 changed files
with
582 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
98 changes: 98 additions & 0 deletions
98
src/de/jost_net/JVerein/Messaging/HibscusUmsatzMessageConsumer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/********************************************************************** | ||
* | ||
* Copyright (c) 2004 Olaf Willuhn | ||
* All right/********************************************************************** | ||
* Copyright (c) by Heiner Jostkleigrewe | ||
* This program is free software: you can redistribute it and/or modify it under the terms of the | ||
* GNU General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | ||
* the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this program. If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
* [email protected] | ||
* www.jverein.de | ||
**********************************************************************/ | ||
|
||
package de.jost_net.JVerein.Messaging; | ||
|
||
import de.jost_net.JVerein.Einstellungen; | ||
import de.jost_net.JVerein.rmi.Buchung; | ||
import de.willuhn.datasource.GenericObject; | ||
import de.willuhn.datasource.rmi.DBIterator; | ||
import de.willuhn.jameica.messaging.Message; | ||
import de.willuhn.jameica.messaging.MessageConsumer; | ||
import de.willuhn.jameica.messaging.QueryMessage; | ||
|
||
/** | ||
* Wird benachrichtigt, wenn eine Buchung aus Hibiscus als geprueft/ungeprueft | ||
* markiert wurde. Insofern wir eine Buchung haben, die aus diesem Umsatz | ||
* erzeugt wurde, uebernehmen wir den Status dann auch gleich in JVerein. | ||
*/ | ||
public class HibscusUmsatzMessageConsumer implements MessageConsumer | ||
{ | ||
/** | ||
* @see de.willuhn.jameica.messaging.MessageConsumer#getExpectedMessageTypes() | ||
*/ | ||
@SuppressWarnings("rawtypes") | ||
@Override | ||
public Class[] getExpectedMessageTypes() | ||
{ | ||
return new Class[] { QueryMessage.class }; | ||
} | ||
|
||
/** | ||
* @see de.willuhn.jameica.messaging.MessageConsumer#handleMessage(de.willuhn.jameica.messaging.Message) | ||
*/ | ||
@Override | ||
public void handleMessage(Message message) throws Exception | ||
{ | ||
if (!Einstellungen.getEinstellung().getGeprueftSynchronisieren()) | ||
return; | ||
|
||
final QueryMessage m = (QueryMessage) message; | ||
final String name = m.getName(); | ||
final Object data = m.getData(); | ||
|
||
if (name == null || data == null) | ||
return; | ||
|
||
final boolean state = Boolean.valueOf(name); | ||
|
||
// Wir muessen hier nichtmal auf Umsatz casten - uns genuegt die ID des | ||
// Datensatzes | ||
if (!(data instanceof GenericObject)) | ||
return; | ||
|
||
final GenericObject o = (GenericObject) data; | ||
final String id = o.getID(); | ||
if (id == null || id.length() == 0) | ||
return; | ||
|
||
DBIterator<Buchung> list = Einstellungen.getDBService() | ||
.createList(Buchung.class); | ||
list.addFilter("umsatzid = ?", id); | ||
if (!list.hasNext()) | ||
return; | ||
|
||
Buchung b = list.next(); | ||
b.setGeprueft(state); | ||
b.store(); | ||
} | ||
|
||
/** | ||
* @see de.willuhn.jameica.messaging.MessageConsumer#autoRegister() | ||
*/ | ||
@Override | ||
public boolean autoRegister() | ||
{ | ||
// Per plugin.xml registriert. | ||
return false; | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.