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) 
16) require_once('invoice.php');
17) 
18) require_role(ROLE_CUSTOMER);
19) 
bernd Rechnungen unterhalb von "Ü...

bernd authored 14 years ago

20) $section = 'invoice_current';
21) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

22) title("Offene Posten");
23) output('<p>Hier sehen Sie einen Überblick über alle aktuell offenen und zukünftigen Posten.</p>');
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

24) 
25) 
Bernd Wurst Neues Layout der Rechnungs-...

Bernd Wurst authored 9 years ago

26) output('<p style="margin: 1em; padding: 1em; border: 2px solid red; background: white;"><strong>Hinweis:</strong> Die hier aufgeführten Posten dienen nur Ihrer Information und erheben keinen Anspruch auf Vollständigkeit. Aus technischen Gründen sind manche Posten hier nicht aufgeführt, die dennoch berechnet werden. Zudem können, bedingt durch Rundungsfehler, die Beträge auf dieser Seite falsch dargestellt sein. Wiederkehrende Beträge werden grundsätzlich nur für den nächsten Abrechnungszeitraum angezeigt.</p>');
bernd Kunden können Ihre Rechnung...

bernd authored 16 years ago

27) 
28) $items = upcoming_items();
29) $summe = 0;
30) 
31) $flip = true;
32) $today = date('Y-m-d');
33) 
34) output('<table><tr><th>Anzahl</th><th>Beschreibung</th><th>Zeitraum</th><th>Einzelpreis</th><th>Gesamtbetrag</th></tr>');
35) 
Bernd Wurst Zukünftige Rechnungsposten:...

Bernd Wurst authored 11 years ago

36) $counter = 0;
37) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

38) foreach ($items as $item) {
39)     if ($flip && $item['startdatum'] > $today) {
40)         if ($counter == 0) {
41)             output("<tr><td colspan=\"5\"><em>Aktuell keine fälligen Posten</em></td></tr>");
42)         }
43)         $flip = false;
44)         output("<tr><td colspan=\"4\" style=\"text-align: right; font-weight: bold; border: none;\">Summe bisher fällige Posten:</td>");
45)         output("<td style=\"font-weight: bold;\">{$summe} €</td></tr>\n");
46)         output("<tr><td colspan=\"5\" style=\"border: none;\"> </td></tr>\n");
Bernd Wurst Zukünftige Rechnungsposten:...

Bernd Wurst authored 11 years ago

47)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

48)     $counter++;
49)     $desc = $item['startdatum'];
50)     if ($item['enddatum'] != null) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

51)         $desc = $item['startdatum'] . ' - ' . $item['enddatum'];
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

52)     }
53)     $epreis = $item['betrag'];
54)     if ($item['brutto'] == 0) {
55)         $epreis = $epreis * (1 + ($item['mwst'] / 100));
56)     }
57)     $gesamt = round($epreis * $item['anzahl'], 2);
58)     $epreis = round($epreis, 2);
59)     $summe += $gesamt;
60)     $einheit = ($item['einheit'] ? $item['einheit'] : '');
61)     output("<tr><td>{$item['anzahl']} {$einheit}</td>");
62)     output("<td>{$item['beschreibung']}</td><td>{$desc}</td>");
63)     output("<td>{$epreis} €</td><td>{$gesamt} €</td></tr>\n");