Skip to content

Commit

Permalink
Add support for EPC payment QR Code (#205)
Browse files Browse the repository at this point in the history
* Add support for EPC payment QR Code

- added some settings to configure the QR code's contents
- QR code is available as form element and can be placed on the invoice
  just like any other form field

* Anzeige externe Mitgliedsnummer automatisch

Abhängig davon, ob in den Einstellungen die Verwendung einer externen
Mitgliedsnummer konfiguriert wurde, wird im QR-Code die jeweils richtige
Mitgliedsnummer angezeigt (externe oder interne).

* Add additional QR code option, minor changes

Changes:
- Infotext an den Überweiser abgeändert
  ("Vielen Dank für Ihre Spende" -> "Vielen Dank!")
- Introtext für Girocode wird auch in der Formular-Voransicht angezeigt
- Zusätzlicher QR-Code verfügbar (ein QR-Code, der den offenen Betrag im
  Mitgliedskonto beinhaltet und ein weiterer, der nur die Rechnungssumme beinhaltet.)

* Verwendung der Rechnungssumme im QR-Code statt offener Betrag im Konto

* renamed Update0434.java to Update0435.java

* fix check variable type

* Verwenden eines Punkts als Dezimaltrennzeichen im QR-Code
  • Loading branch information
SchachtnerTh committed Apr 22, 2024
1 parent 2e227c1 commit 8b86ff6
Show file tree
Hide file tree
Showing 9 changed files with 628 additions and 19 deletions.
2 changes: 2 additions & 0 deletions src/de/jost_net/JVerein/Variable/MitgliedskontoMap.java
Expand Up @@ -110,6 +110,8 @@ public Map<String, Object> getMap(ArrayList<Mitgliedskonto> mk,
map.put(MitgliedskontoVar.DIFFERENZ.getName(), differenz.toArray());
map.put(MitgliedskontoVar.STAND.getName(), Double.valueOf(-1 * saldo));
map.put(MitgliedskontoVar.SUMME_OFFEN.getName(), Double.valueOf(saldo));
map.put(MitgliedskontoVar.QRCODE_INTRO.getName(),
Einstellungen.getEinstellung().getQRCodeIntro());
return map;
}

Expand Down
4 changes: 3 additions & 1 deletion src/de/jost_net/JVerein/Variable/MitgliedskontoVar.java
Expand Up @@ -29,7 +29,9 @@ public enum MitgliedskontoVar
IST("mitgliedskonto_ist"), //
DIFFERENZ("mitgliedskonto_differenz"), //
STAND("mitgliedskonto_stand"), //
SUMME_OFFEN("mitgliedskonto_summe_offen");
SUMME_OFFEN("mitgliedskonto_summe_offen"), //
QRCODE_SUMME("qrcode_summe"), //
QRCODE_INTRO("qrcode_intro");

private String name;

Expand Down
2 changes: 2 additions & 0 deletions src/de/jost_net/JVerein/gui/action/FormularAnzeigeAction.java
Expand Up @@ -319,6 +319,8 @@ public void handleAction(Object context) throws ApplicationException
map.put(MitgliedskontoVar.IST.getName(), ist.toArray());
map.put(MitgliedskontoVar.DIFFERENZ.getName(), differenz.toArray());
map.put(MitgliedskontoVar.SUMME_OFFEN.getName(), 700);
map.put(MitgliedskontoVar.QRCODE_INTRO.getName(),
Einstellungen.getEinstellung().getQRCodeIntro());
FormularAufbereitung fab = new FormularAufbereitung(file);
fab.writeForm(formular, map);
fab.showFormular();
Expand Down
130 changes: 130 additions & 0 deletions src/de/jost_net/JVerein/gui/control/EinstellungControl.java
Expand Up @@ -302,6 +302,26 @@ public class EinstellungControl extends AbstractControl
private ImageInput unterschrift;


private IntegerInput qrcodesize;

private CheckboxInput qrcodeptext;

private CheckboxInput qrcodepdate;

private CheckboxInput qrcodeprenum;

private CheckboxInput qrcodepmnum;

private TextInput qrcodetext;

private CheckboxInput qrcodesngl;

private TextInput qrcodeinfom;

private TextInput qrcodeintro;

private CheckboxInput qrcodekuerzen;

/**
* Verschlüsselte Datei für besonders sensible Daten (Passwörter)
*/
Expand Down Expand Up @@ -1626,6 +1646,106 @@ public SelectInput getBuchungsartSort() throws RemoteException
return buchungsartsort;
}

public IntegerInput getQRCodeSizeInMm() throws RemoteException
{
if (null == qrcodesize)
{
qrcodesize = new IntegerInput(
Einstellungen.getEinstellung().getQRCodeSizeInMm());
}
return qrcodesize;
}

public TextInput getQRCodeVerwendungszweck() throws RemoteException
{
if (null == qrcodetext)
{
qrcodetext = new TextInput(
Einstellungen.getEinstellung().getQRCodeText());
}
return qrcodetext;
}

public CheckboxInput getQRCodePrintVerwendungszweck() throws RemoteException
{
if (null == qrcodeptext)
{
qrcodeptext = new CheckboxInput(
Einstellungen.getEinstellung().getQRCodeFesterText());
}
return qrcodeptext;
}

public CheckboxInput getQRCodeSingle() throws RemoteException
{
if (null == qrcodesngl)
{
qrcodesngl = new CheckboxInput(
Einstellungen.getEinstellung().getQRCodeSnglLine());
}
return qrcodesngl;
}

public CheckboxInput getQRCodeReDa() throws RemoteException
{
if (null == qrcodepdate)
{
qrcodepdate = new CheckboxInput(
Einstellungen.getEinstellung().getQRCodeDatum());
}
return qrcodepdate;
}

public CheckboxInput getQRCodeReNr() throws RemoteException
{
if (null == qrcodeprenum)
{
qrcodeprenum = new CheckboxInput(
Einstellungen.getEinstellung().getQRCodeReNu());
}
return qrcodeprenum;
}

public CheckboxInput getQRCodeMemberNr() throws RemoteException
{
if (null == qrcodepmnum)
{
qrcodepmnum = new CheckboxInput(
Einstellungen.getEinstellung().getQRCodeMember());
}
return qrcodepmnum;
}

public TextInput getQRCodeInfoToMember() throws RemoteException
{
if (null == qrcodeinfom)
{
qrcodeinfom = new TextInput(
Einstellungen.getEinstellung().getQRCodeInfoM());
}
return qrcodeinfom;
}

public CheckboxInput getQRCodeKuerzen() throws RemoteException
{
if (null == qrcodekuerzen)
{
qrcodekuerzen = new CheckboxInput(
Einstellungen.getEinstellung().getQRCodeKuerzen());
}
return qrcodekuerzen;
}

public TextInput getQRCodeIntro() throws RemoteException
{
if (null == qrcodeintro)
{
qrcodeintro = new TextInput(
Einstellungen.getEinstellung().getQRCodeIntro());
}
return qrcodeintro;
}

// // public void handleStore()
// {
// try
Expand Down Expand Up @@ -2060,6 +2180,16 @@ public void handleStoreRechnungen()
e.setRechnungTextBar((String) rechnungtextbar.getValue());
Integer length = (Integer) zaehlerlaenge.getValue();
e.setZaehlerLaenge(length);
e.setQRCodeSizeInMm((Integer) qrcodesize.getValue());
e.setQRCodeDatum((Boolean) qrcodepdate.getValue());
e.setQRCodeFesterText((Boolean) qrcodeptext.getValue());
e.setQRCodeInfoM((String) qrcodeinfom.getValue());
e.setQRCodeMember((Boolean) qrcodepmnum.getValue());
e.setQRCodeReNu((Boolean) qrcodeprenum.getValue());
e.setQRCodeSnglLine((Boolean) qrcodesngl.getValue());
e.setQRCodeText((String) qrcodetext.getValue());
e.setQRCodeIntro((String) qrcodeintro.getValue());
e.setQRCodeKuerzen((Boolean) qrcodekuerzen.getValue());

e.store();
Einstellungen.setEinstellung(e);
Expand Down
15 changes: 15 additions & 0 deletions src/de/jost_net/JVerein/gui/view/EinstellungenRechnungenView.java
Expand Up @@ -41,6 +41,21 @@ public void bind() throws Exception
control.getRechnungTextUeberweisung());
cont.addLabelPair("Text Bar", control.getRechnungTextBar());
cont.addLabelPair("Zählerlänge", control.getZaehlerLaenge());
cont.addLabelPair("Kantenlänge QR-Code", control.getQRCodeSizeInMm());
cont.addLabelPair("Verwendungszweck", control.getQRCodeVerwendungszweck());
cont.addLabelPair("Verwendungszweck hinzufügen",
control.getQRCodePrintVerwendungszweck());
cont.addLabelPair("Bei einzelner Position Verwendungszweck ersetzen",
control.getQRCodeSingle());
cont.addLabelPair("Rechnungsdatum in QR-Code", control.getQRCodeReDa());
cont.addLabelPair("Rechnungsnummer in QR-Code", control.getQRCodeReNr());
cont.addLabelPair("Mitgliedsnummer in QR-Code",
control.getQRCodeMemberNr());
cont.addLabelPair("Information an Mitglied in QR-Code",
control.getQRCodeInfoToMember());
cont.addLabelPair("Texte in QR-Code kürzen", control.getQRCodeKuerzen());
cont.addLabelPair("Beschreibungstext für QR-Code",
control.getQRCodeIntro());

ButtonArea buttons = new ButtonArea();
buttons.addButton("Hilfe", new DokumentationAction(),
Expand Down

0 comments on commit 8b86ff6

Please sign in to comment.