c25a34819a86fcb8b3b69309243e089eb86b3292
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) 
5) Written 2008-2012 by schokokeks.org Hosting, namely
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) 
bernd eliminate .php extensions f...

bernd authored 15 years ago

29) output("<p>Für eine druckbare Version benutzen Sie bitte die Ausgabe ".internal_link("pdf", "als PDF-Datei", "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 11 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 11 years ago

65) 	output("<tr><td>{$anzahl} {$einheit}</td>");