56f1d250c7c1ab9b32db00f5c9c246cf0220066b
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 Updated copyright notice (2...

Bernd Wurst authored 11 years ago

5) Written 2008-2013 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) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
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) 
27) $invoice_id = (int) filter_input_general($_GET['id']);
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) 
48) foreach($items AS $item)
49) {
50) 	$anzahl = $item['anzahl'];
51) 	if (round($anzahl, 0) == $anzahl)
52) 		$anzahl = round($anzahl, 0);
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) 	$epreis = $item['betrag'];
59) 	if ($item['brutto'] == 0)
60) 		$epreis = $epreis * (1 + ($item['mwst'] / 100));
Bernd Wurst Einheit bei Rechnungsposten...

Bernd Wurst authored 12 years ago

61)   $einheit = ($item['einheit'] ? $item['einheit'] : '');
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

62) 	$gesamt = round($epreis * $item['anzahl'], 2);
63) 	$epreis = round($epreis, 2);
64) 	$summe += $gesamt;
Bernd Wurst Einheit bei Rechnungsposten...

Bernd Wurst authored 12 years ago

65) 	output("<tr><td>{$anzahl} {$einheit}</td>");
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

66) 	output("<td>{$desc}</td>");
67) 	output("<td>{$epreis} €</td><td>{$gesamt} €</td></tr>\n");
68) }
69) 
70) output("<tr><td colspan=\"3\" style=\"text-align: right; font-weight: bold; border: none;\">Summe aller Posten:</td>");
71) output("<td style=\"font-weight: bold;\">{$summe} €</td></tr>\n");
72) output('</table><br />');
73) 
74) 
Bernd Wurst QR-Codes für Überweisung be...

Bernd Wurst authored 10 years ago

75) if ($invoice['bezahlt'] == 0 && $invoice['abbuchung'] == 0) {
76)   $qrcode_image = generate_qrcode_image($invoice_id);
77) 
78)   output('<h4>QR-Code für Mobile Banking (STUZZA-Verfahren, Österreichische und viele deutschen Banken)</h4><p><img src="data:image/png;base64,'.base64_encode($qrcode_image).'" /></p>');
79) 
80)   $qrcode_image = generate_bezahlcode_image($invoice_id);
81) 
82)   output('<h4>BezahlCode für Mobile Banking (BezahlCode, für iPhone-Anwendungen von Drittanbietern)</h4><p><img src="data:image/png;base64,'.base64_encode($qrcode_image).'" /></p>');
83) }
84)