354c05a4ddd678c49bcbba458bffa7d13482139a
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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

5) Written 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

9) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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

bernd authored 16 years ago

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

bernd authored 13 years ago

21) title('Rechnung');
22) 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

23) 
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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

bernd authored 16 years ago

25) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

26) 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

27) <p>&#160;</p>");
28) 
29) 
30) $items = invoice_items($invoice_id);
31) $summe = 0;
32) 
33) $invoice = invoice_details($invoice_id);
34) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

35) output('<p style="border: 1px solid black; margin: 1em; padding: 0.5em;">Rechnungsnummer: ' . $invoice_id . '<br />
36) Kundennummer: ' . $invoice['kunde'] . '<br />
37) Rechnungsdatum: ' . $invoice['datum'] . '
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

38) </p>
39) 
40) ');
41) 
42) 
43) output('<table><tr><th>Anzahl</th><th>Beschreibung</th><th>Einzelpreis</th><th>Gesamtbetrag</th></tr>');
44) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

45) foreach ($items as $item) {
46)     $anzahl = $item['anzahl'];
47)     if (round($anzahl, 0) == $anzahl) {
48)         $anzahl = round($anzahl, 0);
49)     }
50)     $desc = $item['beschreibung'];
51)     if ($item['enddatum'] == null) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

52)         $desc .= '<br />(Leistungsdatum: ' . $item['datum'] . ')';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

53)     } else {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

54)         $desc .= '<br />(Leistungszeitraum: ' . $item['datum'] . ' - ' . $item['enddatum'] . ')';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

55)     }
56)     $epreis = $item['betrag'];
57)     if ($item['brutto'] == 0) {
58)         $epreis = $epreis * (1 + ($item['mwst'] / 100));
59)     }
60)     $einheit = ($item['einheit'] ? $item['einheit'] : '');
61)     $gesamt = round($epreis * $item['anzahl'], 2);
62)     $epreis = round($epreis, 2);
63)     $summe += $gesamt;
64)     output("<tr><td>{$anzahl} {$einheit}</td>");
65)     output("<td>{$desc}</td>");
66)     output("<td>{$epreis} €</td><td>{$gesamt} €</td></tr>\n");
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

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

Bernd Wurst authored 10 years ago

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

bernd authored 16 years ago

74) 
Bernd Wurst Vorgemerkte Lastschriften a...

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 9 years ago

77) } elseif ($l && $l['status'] == 'pending') {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

78)     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

79) } elseif ($l && $l['status'] == 'done') {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

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

Bernd Wurst authored 10 years ago

81) } else {
Hanno rename generate_qrcode_imag...

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

83) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

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