da2eaa6d6f8367bf912f8f72272dedd012cbf3e2
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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 Added license tags for CC0,...

Bernd Wurst authored 12 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 Added license tags for CC0,...

Bernd Wurst authored 12 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) */
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

16) 
17) require_once('session/start.php');
18) require_once('invoice.php');
19) require_once('inc/security.php');
20) 
21) require_role(ROLE_CUSTOMER);
22) $section = 'invoice_current';
23) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

24) title('Rechnung');
25) output('<p>Detailansicht Ihrer Rechnung. Beachten Sie bitte, dass diese Informationsseite sowie auch ein Ausdruck dieser Seite keine Rechnung darstellt. Ein gültiges Rechnungsdokument stellt lediglich die signierte PDF-Version bzw. eine Papierrechnung dar, die Sie von uns erhalten haben.</p>');
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

26) 
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

27) $invoice_id = (int) $_GET['id'];
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

28) 
Hanno Böck pdflogo und doppelten html-...

Hanno Böck authored 11 years ago

29) output("<p>Für eine druckbare Version benutzen Sie bitte die Ausgabe ".internal_link("pdf", "als PDF-Datei <img src=\"{$prefix}images/pdf.png\" width=\"22\" height=\"22\" alt=\"PDF\"/>", "id={$invoice_id}").".</p>
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

30) <p>&#160;</p>");
31) 
32) 
33) $items = invoice_items($invoice_id);
34) $summe = 0;
35) 
36) $invoice = invoice_details($invoice_id);
37) 
38) output('<p style="border: 1px solid black; margin: 1em; padding: 0.5em;">Rechnungsnummer: '.$invoice_id.'<br />
39) Kundennummer: '.$invoice['kunde'].'<br />
40) Rechnungsdatum: '.$invoice['datum'].'
41) </p>
42) 
43) ');
44) 
45) 
46) output('<table><tr><th>Anzahl</th><th>Beschreibung</th><th>Einzelpreis</th><th>Gesamtbetrag</th></tr>');
47) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

48) foreach ($items as $item) {
49)     $anzahl = $item['anzahl'];
50)     if (round($anzahl, 0) == $anzahl) {
51)         $anzahl = round($anzahl, 0);
52)     }
53)     $desc = $item['beschreibung'];
54)     if ($item['enddatum'] == null) {
55)         $desc .= '<br />(Leistungsdatum: '.$item['datum'].')';
56)     } else {
57)         $desc .= '<br />(Leistungszeitraum: '.$item['datum'].' - '.$item['enddatum'].')';
58)     }
59)     $epreis = $item['betrag'];
60)     if ($item['brutto'] == 0) {
61)         $epreis = $epreis * (1 + ($item['mwst'] / 100));
62)     }
63)     $einheit = ($item['einheit'] ? $item['einheit'] : '');
64)     $gesamt = round($epreis * $item['anzahl'], 2);
65)     $epreis = round($epreis, 2);
66)     $summe += $gesamt;
67)     output("<tr><td>{$anzahl} {$einheit}</td>");
68)     output("<td>{$desc}</td>");
69)     output("<td>{$epreis} €</td><td>{$gesamt} €</td></tr>\n");
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

70) }
71) 
72) output("<tr><td colspan=\"3\" style=\"text-align: right; font-weight: bold; border: none;\">Summe aller Posten:</td>");
73) output("<td style=\"font-weight: bold;\">{$summe} €</td></tr>\n");
74) output('</table><br />');
75) 
Bernd Wurst Vorgemerkte Lastschriften a...

Bernd Wurst authored 10 years ago

76) $l = get_lastschrift($invoice_id);
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

77) 
Bernd Wurst Vorgemerkte Lastschriften a...

Bernd Wurst authored 10 years ago

78) if ($invoice['bezahlt'] == 1) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

79)     output('<p>Diese Rechnung ist bereits bezahlt.</p>');
Bernd Wurst Zeige Rechnungen zu rückgeb...

Bernd Wurst authored 9 years ago

80) } elseif ($l && $l['status'] == 'pending') {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

81)     output('<p>Diese Rechnung wird am '.$l['buchungsdatum'].' per Lastschrift eingezogen.</p>');
Bernd Wurst Zeige Rechnungen zu rückgeb...

Bernd Wurst authored 9 years ago

82) } elseif ($l && $l['status'] == 'done') {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

83)     output('<p>Diese Rechnung wurde am '.$l['buchungsdatum'].' per Lastschrift eingezogen.</p>');
Bernd Wurst Vorgemerkte Lastschriften a...

Bernd Wurst authored 10 years ago

84) } else {
Hanno rename generate_qrcode_imag...

Hanno authored 5 years ago

85)     $qrcode_image = generate_qrcode_image_invoice($invoice_id);
Bernd Wurst QR-Codes für Überweisung be...

Bernd Wurst authored 10 years ago

86) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

87)     output('<h4>GiroCode für Mobile Banking (SEPA Credit Transfer)</h4><p><img src="data:image/png;base64,'.base64_encode($qrcode_image).'" /></p>');