|
1 | | -\documentclass{bon} |
| 1 | +<?php |
2 | 2 |
|
3 | | -\usepackage[paperwidth=72mm,paperheight=108mm,top=0mm, bottom=0mm, left=0mm, right=0mm]{geometry} |
| 3 | +echo '\documentclass{bon}'."\n"; |
4 | 4 |
|
5 | | -\begin{document} |
6 | | -\code{<?php echo str_pad($order['number'], 4, "0", STR_PAD_LEFT); ?>} |
7 | | -\head |
8 | | -\startorder |
9 | | -<?php |
10 | | - $total = 0; |
11 | | - foreach($order['items'] as $item){ |
12 | | - echo "\addorder{".$item['amount']."}{".$item['name'].'}{'.helper::formatPriceLaTeX($item['amount']*$item['price']).'}'."\n"; |
13 | | - $total += ($item['amount']*$item['price']); |
14 | | - } |
15 | | - echo '\total{'.helper::formatPriceLaTeX($total).'}'."\n"; |
16 | | -?> |
17 | | -\finishorder |
18 | | -<?php |
19 | | - if(count($order['items']) <= 10){ |
20 | | - echo '\vspace{'.(120-(count($order['items'])*12)).'pt}'; |
21 | | - } |
22 | | -?> |
23 | | -\beginfooter |
24 | | -\addfooter{HTTP://PIZZAPROXY.ORG} |
25 | | -\addfooter{<?php echo date(); ?>} |
26 | | -\finishfooter |
27 | | -\end{document} |
| 5 | +echo '\usepackage[paperwidth=72mm,paperheight=108mm,top=0mm, bottom=0mm, left=0mm, right=0mm]{geometry}'."\n"; |
| 6 | + |
| 7 | +echo '\begin{document}'."\n"; |
| 8 | +echo '\code{'.str_pad($order['number'], 4, "0", STR_PAD_LEFT).'}'."\n"; |
| 9 | +echo '\head'."\n"; |
| 10 | +echo '\startorder'.'\n'; |
| 11 | + |
| 12 | +$total = 0; |
| 13 | +foreach($order['items'] as $item){ |
| 14 | + echo '\addorder{'.$item['amount'].'}{'.$item['name'].'}{'.helper::formatPriceLaTeX($item['amount']*$item['price']).'}'."\n"; |
| 15 | + $total += ($item['amount']*$item['price']); |
| 16 | +} |
| 17 | +echo '\total{'.helper::formatPriceLaTeX($total).'}'."\n"; |
| 18 | +echo '\finishorder'."\n"; |
| 19 | + |
| 20 | +if(count($order['items']) <= 10){ |
| 21 | + echo '\vspace{'.(100-(count($order['items'])*10)).'pt}'; |
| 22 | +} |
| 23 | +echo '\beginfooter'."\n"; |
| 24 | +echo '\addfooter{HTTP://PIZZAPROXY.ORG}'."\n"; |
| 25 | +echo '\addfooter{'.date("d.m.j G:i:s").'}'."\n"; |
| 26 | +echo '\finishfooter'."\n"; |
| 27 | +echo '\end{document}'."\n"; |
28 | 28 |
|
0 commit comments