mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 14:10:28 +01:00
mahnwesen changed tab behaviour, tabs always visible with counter
This commit is contained in:
parent
bf242623c4
commit
943bac22a3
@ -362,18 +362,40 @@ class Mahnwesen {
|
|||||||
";
|
";
|
||||||
$offene_rechnungen = $this->app->DB->SelectArr($sql);
|
$offene_rechnungen = $this->app->DB->SelectArr($sql);
|
||||||
|
|
||||||
$menus = array();
|
|
||||||
|
|
||||||
foreach ($offene_rechnungen as $offene_rechnung) {
|
foreach ($offene_rechnungen as $offene_rechnung) {
|
||||||
if ($offene_rechnung['mahnwesen'] != $offene_rechnung['mahnwesen_neu']) {
|
if ($offene_rechnung['mahnwesen'] != $offene_rechnung['mahnwesen_neu']) {
|
||||||
$sql = "UPDATE rechnung set mahnwesen = ".$offene_rechnung['mahnwesen_neu'].", versendet_mahnwesen = 0 WHERE id = ".$offene_rechnung['id'];
|
$sql = "UPDATE rechnung set mahnwesen = ".$offene_rechnung['mahnwesen_neu'].", versendet_mahnwesen = 0 WHERE id = ".$offene_rechnung['id'];
|
||||||
$this->app->DB->Update($sql);
|
$this->app->DB->Update($sql);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!in_array($offene_rechnung['mahnwesen_neu'],$menus) && ($offene_rechnung['versendet_mahnwesen']) && count($menus) < 5) {
|
$menus = $this->app->DB->SelectArr("
|
||||||
$menus[] = $offene_rechnung['mahnwesen_neu'];
|
SELECT
|
||||||
$this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=stufe_list&stufe=".$offene_rechnung['mahnwesen_neu'], $this->app->DB->real_escape_string($offene_rechnung['name']));
|
m.id mahnung,
|
||||||
|
m.name,
|
||||||
|
SUM(if(r.versendet_mahnwesen = 1,1,0)) anzahl
|
||||||
|
FROM
|
||||||
|
mahnwesen m
|
||||||
|
LEFT JOIN rechnung r ON
|
||||||
|
m.id = r.mahnwesen
|
||||||
|
WHERE
|
||||||
|
r.id IS NULL OR
|
||||||
|
(
|
||||||
|
r.zahlungsstatus <> 'bezahlt' AND
|
||||||
|
r.mahnwesen_gesperrt <> 1
|
||||||
|
)
|
||||||
|
GROUP BY
|
||||||
|
m.id
|
||||||
|
ORDER BY
|
||||||
|
m.tage ASC
|
||||||
|
");
|
||||||
|
|
||||||
|
foreach ($menus as $menu) {
|
||||||
|
$suffix = "";
|
||||||
|
if ($menu['anzahl']) {
|
||||||
|
$suffix = " (".$menu['anzahl'].")";
|
||||||
}
|
}
|
||||||
|
$this->app->erp->MenuEintrag("index.php?module=mahnwesen&action=stufe_list&stufe=".$menu['mahnung'], $this->app->DB->real_escape_string($menu['name']).$suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($msg)) {
|
if (!empty($msg)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user