Example #1
0
$kassacls = new Kassa();
include_once "barguestclass.inc.php";
$barguest = new Barguest();
if ($request->GetVar('frm_selectedcat', 'post') !== $request->undefined) {
    $cats = $request->GetVar('frm_selectedcat', 'post');
} else {
    $cats = array();
}
if ($request->GetVar('payid', 'post') !== $request->undefined) {
    $items = $request->GetVar('payid', 'post');
} else {
    $items = array();
}
if ($request->GetVar('frm_guestid', 'post') !== $request->undefined) {
    $theguestid = $request->GetVar('frm_guestid', 'post');
    $guestarticles = $kassacls->getBon($theguestid, $cats, $items);
}
$sum = 0.0;
$tax = array();
for ($i = 0; $i < count($guestarticles) - 1; $i++) {
    $sum += $guestarticles[$i]['total'];
    $tax[$guestarticles[$i]['tax']]['brutto'] += $guestarticles[$i]['total'];
}
ksort($tax);
$tpl_tax = array();
$i = 0;
foreach ($tax as $key => $val) {
    $tpl_tax[$i]['tax'] = $key;
    $brutto = $val['brutto'];
    $netto = round($val['brutto'] * 100 / ($key + 100), 2);
    $tax_value = $brutto - $netto;