@@ -1527,7 +1529,7 @@ if ($action === 'data') {
$('#profile').html(`
${esc(initials || '?')}
-
${esc(i.name)} ${LVL[lvl]}
+
${esc(i.name)} ${LVL[lvl]}
${esc(i.code)}${place ? ' · ' + esc(place) : ''}
${facts.join('')}
@@ -1549,22 +1551,22 @@ if ($action === 'data') {
month: 'short'
});
- const ytdCard = (title, icon, color, rows) => {
+ const ytdCard = (title, icon, color, rows, help) => {
const c = yearRow(rows, CUR_Y),
p = yearRow(rows, CUR_Y - 1);
const v = c ? +c.ytd : 0,
pv = p ? +p.ytd : 0;
return `
-
${title} ${CUR_Y}
+
${title} ${CUR_Y}
${fmtEurShort(v)}
al ${label} · ${CUR_Y - 1} stessa data: ${fmtEurShort(pv)} ${deltaSpan(pct(v, pv), '')}
${CUR_Y - 1} intero: ${fmtEurShort(p ? +p.full : 0)}
`;
};
- out.push(invOk ? ytdCard('Fatturato', 'fa-file-invoice-dollar', '#0f766e', d.inv.years) :
- `
Fatturato
—
serve la sincronizzazione delle fatture
`);
- out.push(ytdCard('Ordinato', 'fa-chart-line', '#6f42c1', d.ordYears));
+ out.push(invOk ? ytdCard('Fatturato', 'fa-file-invoice-dollar', '#0f766e', d.inv.years, 'sc.inv') :
+ `
Fatturato
—
serve la sincronizzazione delle fatture
`);
+ out.push(ytdCard('Ordinato', 'fa-chart-line', '#6f42c1', d.ordYears, 'sc.ord'));
const open = d.open || [];
const ov = open.reduce((a, r) => a + (+r.residual_value || 0), 0);
@@ -1572,7 +1574,7 @@ if ($action === 'data') {
const lv = late.reduce((a, r) => a + (+r.residual_value || 0), 0);
out.push(`
-
Da consegnare
+
Da consegnare
${fmtEurShort(ov)}
${fmtNum(open.length)} righe · ${fmtNum(new Set(open.map(r => r.sale_ord_id)).size)} ordini${late.length ? `
${fmtNum(late.length)} righe in ritardo · ${fmtEurShort(lv)}` : '
nessuna riga in ritardo'}
`);
@@ -1581,12 +1583,12 @@ if ($action === 'data') {
const p = d.inv.v12 > 0 ? d.inv.cn12 / d.inv.v12 * 100 : 0;
out.push(`
-
Note di credito · 12 mesi
+
Note di credito · 12 mesi
${fmtEurShort(d.inv.cn12)}
${fmtNum(d.inv.cn12_n)} note · ${p.toLocaleString('it-IT', {maximumFractionDigits: 1})}% del fatturato
fatturato 12 mesi: ${fmtEurShort(d.inv.v12)}
`);
} else {
- out.push(`
Note di credito
—
serve la sincronizzazione delle fatture
`);
+ out.push(`
Note di credito
—
serve la sincronizzazione delle fatture
`);
}
$('#kpis').html(out.join(''));
}
@@ -1923,6 +1925,7 @@ if ($action === 'data') {
});
})();
+