<?php
if ($_SESSION['role'] & ROLE_CUSTOMER) {
$alert = null;
include_once('modules/invoice/include/invoice.php');
$unpayed_invoices = 0;
$my_invoices = my_invoices();
foreach ($my_invoices as $inv) {
if ($inv['bezahlt'] == 0) {
$l = get_lastschrift($inv['id']);
if (! $l || $l['status'] == 'rejected') {
$unpayed_invoices++;
}
}
}
if ($unpayed_invoices > 0) {
$alert = $unpayed_invoices.' unbezahlt';
}
$shortcuts[] = [ 'section' => 'administration',
'weight' => 50,
'file' => 'current',
'icon' => 'invoice.png',
'title' => 'Ihre Rechnungen',
'alert' => $alert, ];
}