da2eaa6d6f8367bf912f8f72272dedd012cbf3e2
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

1) <?php
2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15) */
16) 
Bernd Wurst Zeige gleich an, ob eine (d...

Bernd Wurst authored 10 years ago

17) require_once('inc/icons.php');
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

18) require_once('invoice.php');
19) 
Bernd Wurst Nutze zentrales JQuery

Bernd Wurst authored 10 years ago

20) require_once('inc/jquery.php');
Bernd Wurst JS-Code in separate Datei a...

Bernd Wurst authored 6 years ago

21) javascript();
Bernd Wurst Nutze zentrales JQuery

Bernd Wurst authored 10 years ago

22) 
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

23) require_role(ROLE_CUSTOMER);
24) $section = 'invoice_current';
25) 
26) title('Erteilung eines Mandats zur SEPA-Basis-Lastschrift');
27) 
28) output('<p>Ich ermächtige die Firma schokokeks.org GbR, Zahlungen von meinem Konto mittels Lastschrift
29) einzuziehen. Zugleich weise ich mein Kreditinstitut an, die von der Firma schokokeks.org GbR auf mein
30) Konto gezogenen Lastschriften einzulösen.</p>
31) <p>Hinweis: Ich kann innerhalb von acht Wochen, beginnend mit dem Belastungsdatum, die Erstattung des
Bernd Wurst Typo / Schönheitskorrektur

Bernd Wurst authored 10 years ago

32) belasteten Betrages verlangen. Es gelten dabei die mit meinem Kreditinstitut vereinbarten Bedingungen.
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

33) Insbesondere fallen bei Zurückweisung einer gerechtfertigten Abbuchung i.d.R. Gebühren an.</p>');
34) 
35) $name = $_SESSION['customerinfo']['name'];
36) if ($_SESSION['customerinfo']['company']) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

37)     if ($_SESSION['customerinfo']['name']) {
38)         $name = $_SESSION['customerinfo']['company'] .' / '. $_SESSION['customerinfo']['name'];
39)     } else {
40)         $name = $_SESSION['customerinfo']['company'];
41)     }
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

42) }
Bernd Wurst Kleine Korrekturen Ausführu...

Bernd Wurst authored 10 years ago

43) output('<p>Dieses Mandat gilt für Forderungen bzgl. der Kundennummer <strong>'.$_SESSION['customerinfo']['customerno'].'</strong> ('.$name.'). Sämtliche Forderungen werden mindestens 2 Tage vor Fälligkeit angekündigt. Diese Ankündigung erfolgt in der Regel im Rahmen der Zusendung einer Rechnung per E-Mail.</p>');
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

44) 
45) 
46) 
47) $first_date = date('Y-m-d');
48) $invoices = my_invoices();
49) foreach ($invoices as $i) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

50)     if ($i['bezahlt'] == 0 && $i['sepamandat'] == null && $i['datum'] < $first_date) {
51)         $first_date = $i['datum'];
52)     }
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

53) }
54) 
Bernd Wurst Ermögliche das Berechnen de...

Bernd Wurst authored 10 years ago

55) $html = '<h4>Gültigkeit des Mandats</h4>
56) <p>Ein eventuell zuvor erteiltes Mandat wird zu diesem Datum automatisch ungültig.</p>';
57) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

58) $checked = false;
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

59) if ($first_date != date('Y-m-d')) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

60)     $checked = true;
61)     $html .= '<p><input type="radio" id="gueltig_ab_'.$first_date.'" name="gueltig_ab" value="'.$first_date.'" checked="checked" /><label for="gueltig_ab_'.$first_date.'">Dieses Mandat gilt <strong>ab '.$first_date.'</strong> (Alle bisher offenen Forderungen werden ebenfalls abgebucht)</label></p>';
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

62) }
63) $html .= '<p><input type="radio" id="gueltig_ab_heute" name="gueltig_ab" value="'.date('Y-m-d').'" '.($checked ? '' : 'checked="checked"').' /><label for="gueltig_ab_heute">Dieses Mandat gilt <strong>ab heute</strong> ('.date('Y-m-d').')</label></p>';
Bernd Wurst Ermögliche das Berechnen de...

Bernd Wurst authored 10 years ago

64) $html .= '<p><input type="radio" id="gueltig_ab_datum" name="gueltig_ab" value="datum" /><label for="gueltig_ab_datum">Dieses Mandat gilt <strong>erst ab</strong></label> '.html_datepicker("gueltig_ab_datum", time()).'</p>';
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

65) 
66) $html .= '<h4>Ihre Bankverbindung</h4>';
67) $html .= '<table>
Bernd Wurst Funktion um Name und Adress...

Bernd Wurst authored 10 years ago

68) <tr><td><label for="kontoinhaber">Name des Kontoinhabers:</label></td><td><input type="text" name="kontoinhaber" id="kontoinhaber" /> <button id="copydata">Von Kundendaten kopieren</button></td></tr>
Bernd Wurst Erste Version des SEPA-Mand...

Bernd Wurst authored 10 years ago

69) <tr><td><label for="adresse">Adresse des Kontoinhabers:</label></td><td><textarea cols="50" lines="2" name="adresse" id="adresse"></textarea></td></tr>
Bernd Wurst Ermögliche das Berechnen de...

Bernd Wurst authored 10 years ago

70) <tr id="ktoblz_input" style="display: none;"><td>Kontodaten:</td><td><label for="kto">Konto:</label> <input type="text" id="kto" /> <label for="blz">BLZ:</label> <input type="text" id="blz" /><br /><button id="ktoblz">IBAN berechnen...</button></td></tr>
71) <tr><td><label for="iban">IBAN:</label></td><td><input type="text" name="iban" id="iban" size="30" /><span id="iban_feedback"></span><br />
72) <span id="ktoblz_button"><button id="showktoblz">IBAN aus Kontonummer / BLZ berechnen...</button></span>
73) </td></tr>
Bernd Wurst IBAN-Feld breiter darstellen

Bernd Wurst authored 10 years ago

74) <tr><td><label for="bankname">Name der Bank:</label></td><td><input type="text" name="bankname" id="bankname" size="30" /></td></tr>