Widget: Mahnstufe-Badge verlinkt auf Mahnung, Strich bei keiner Mahnung [deploy]
All checks were successful
Deploy mahnung / deploy (push) Successful in 13s
All checks were successful
Deploy mahnung / deploy (push) Successful in 13s
- Rechnungen ohne Mahnung: "—" als Zeichen - Rechnungen mit Mahnung: farbiger Badge verlinkt auf card.php der Mahnung - Mahnung-ID per Subquery geholt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b68ef498ee
commit
d1cec1b46a
1 changed files with 13 additions and 5 deletions
|
|
@ -80,7 +80,10 @@ class box_mahnung_offen extends ModeleBoxes
|
||||||
$sql .= " ORDER BY m2.stufe DESC LIMIT 1) as mahnstufe,";
|
$sql .= " ORDER BY m2.stufe DESC LIMIT 1) as mahnstufe,";
|
||||||
$sql .= " (SELECT m3.date_mahnung FROM ".MAIN_DB_PREFIX."mahnung_mahnung as m3";
|
$sql .= " (SELECT m3.date_mahnung FROM ".MAIN_DB_PREFIX."mahnung_mahnung as m3";
|
||||||
$sql .= " WHERE m3.fk_facture = f.rowid AND m3.status != ".((int) Mahnung::STATUS_STORNIERT);
|
$sql .= " WHERE m3.fk_facture = f.rowid AND m3.status != ".((int) Mahnung::STATUS_STORNIERT);
|
||||||
$sql .= " ORDER BY m3.stufe DESC LIMIT 1) as mahndatum";
|
$sql .= " ORDER BY m3.stufe DESC LIMIT 1) as mahndatum,";
|
||||||
|
$sql .= " (SELECT m4.rowid FROM ".MAIN_DB_PREFIX."mahnung_mahnung as m4";
|
||||||
|
$sql .= " WHERE m4.fk_facture = f.rowid AND m4.status != ".((int) Mahnung::STATUS_STORNIERT);
|
||||||
|
$sql .= " ORDER BY m4.stufe DESC LIMIT 1) as mahnid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture";
|
||||||
|
|
@ -145,8 +148,8 @@ class box_mahnung_offen extends ModeleBoxes
|
||||||
$late = img_warning(sprintf($l_due_date, dol_print_date($datelimit, 'day', 'tzuserrel')));
|
$late = img_warning(sprintf($l_due_date, dol_print_date($datelimit, 'day', 'tzuserrel')));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mahnstufe-Badge
|
// Mahnstufe-Badge (mit Link zur Mahnung) oder Strich fuer keine Mahnung
|
||||||
$mahnBadge = '';
|
$mahnCell = '<span class="opacitymedium">—</span>';
|
||||||
if (!empty($objp->mahnstufe)) {
|
if (!empty($objp->mahnstufe)) {
|
||||||
$stufe = (int) $objp->mahnstufe;
|
$stufe = (int) $objp->mahnstufe;
|
||||||
$colors = array(1 => '#4a90d9', 2 => '#e68a00', 3 => '#cc3333');
|
$colors = array(1 => '#4a90d9', 2 => '#e68a00', 3 => '#cc3333');
|
||||||
|
|
@ -155,7 +158,12 @@ class box_mahnung_offen extends ModeleBoxes
|
||||||
$label = $labels[$stufe] ?? 'Stufe '.$stufe;
|
$label = $labels[$stufe] ?? 'Stufe '.$stufe;
|
||||||
$mahnDatum = $objp->mahndatum ? dol_print_date($this->db->jdate($objp->mahndatum), 'day') : '';
|
$mahnDatum = $objp->mahndatum ? dol_print_date($this->db->jdate($objp->mahndatum), 'day') : '';
|
||||||
$tooltip = $label.($mahnDatum ? ' vom '.$mahnDatum : '');
|
$tooltip = $label.($mahnDatum ? ' vom '.$mahnDatum : '');
|
||||||
$mahnBadge = '<span class="badge" style="background-color:'.$color.';color:#fff;font-size:0.75em;" title="'.dol_escape_htmltag($tooltip).'">'.$label.'</span>';
|
$badge = '<span class="badge" style="background-color:'.$color.';color:#fff;font-size:0.75em;" title="'.dol_escape_htmltag($tooltip).'">'.$label.'</span>';
|
||||||
|
if (!empty($objp->mahnid)) {
|
||||||
|
$mahnCell = '<a href="'.DOL_URL_ROOT.'/custom/mahnung/card.php?id='.((int) $objp->mahnid).'">'.$badge.'</a>';
|
||||||
|
} else {
|
||||||
|
$mahnCell = $badge;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spalte 1: Rechnung + Warnung
|
// Spalte 1: Rechnung + Warnung
|
||||||
|
|
@ -188,7 +196,7 @@ class box_mahnung_offen extends ModeleBoxes
|
||||||
// Spalte 5: Mahnstufe
|
// Spalte 5: Mahnstufe
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="center nowraponall"',
|
'td' => 'class="center nowraponall"',
|
||||||
'text' => !empty($mahnBadge) ? $mahnBadge : '',
|
'text' => $mahnCell,
|
||||||
'asis' => 1,
|
'asis' => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue