ok
This commit is contained in:
@@ -165,10 +165,10 @@ const DailyCharts = ({ incomeGraph, transactionGraph, materialGraph, colors, typ
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
yaxis: {
|
yaxis: {
|
||||||
show: false,
|
|
||||||
max: globalMax,
|
max: globalMax,
|
||||||
min: 0,
|
min: 0,
|
||||||
labels: {
|
labels: {
|
||||||
|
maxWidth: 20,
|
||||||
style: {
|
style: {
|
||||||
colors: "transparent",
|
colors: "transparent",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -105,7 +105,8 @@ if (aggregatedCurrentReports || aggregatedPreviousReports) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
yaxis: { show: false, max: globalMax, min: 0, labels: { style: { colors: "transparent" } } },
|
yaxis: { max: globalMax, min: 0, labels: {
|
||||||
|
maxWidth: 20, style: { colors: "transparent" } } },
|
||||||
grid: { show: false },
|
grid: { show: false },
|
||||||
fill: { opacity: 0.5 },
|
fill: { opacity: 0.5 },
|
||||||
colors: [colors[0]],
|
colors: [colors[0]],
|
||||||
@@ -166,7 +167,7 @@ if (aggregatedCurrentReports || aggregatedPreviousReports) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
yaxis: { show: false, max: globalMax, min: 0, labels: { style: { colors: "transparent" } } },
|
yaxis: { max: globalMax, min: 0, labels: { maxWidth: 20, style: { colors: "transparent" } } },
|
||||||
grid: { show: false },
|
grid: { show: false },
|
||||||
fill: { opacity: 0.5 },
|
fill: { opacity: 0.5 },
|
||||||
colors: [colors[1]],
|
colors: [colors[1]],
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ const App = ({ forCafe = true, cafeId = -1,
|
|||||||
const cafeTotal = (cafe.report?.itemSales || []).reduce((sum, item) => sum + item.sold, 0);
|
const cafeTotal = (cafe.report?.itemSales || []).reduce((sum, item) => sum + item.sold, 0);
|
||||||
return total + cafeTotal;
|
return total + cafeTotal;
|
||||||
}, 0);
|
}, 0);
|
||||||
|
console.log(totalSoldAcrossAllCafes)
|
||||||
const totalSpendAcrossAllCafes = filteredItems.reduce((total, cafe) => {
|
const totalSpendAcrossAllCafes = filteredItems.reduce((total, cafe) => {
|
||||||
const cafeTotal = (cafe.report?.materialSpend || []).reduce((sum, item) => sum + item.spend, 0);
|
const cafeTotal = (cafe.report?.materialSpend || []).reduce((sum, item) => sum + item.spend, 0);
|
||||||
return total + cafeTotal;
|
return total + cafeTotal;
|
||||||
@@ -484,11 +484,13 @@ const App = ({ forCafe = true, cafeId = -1,
|
|||||||
invert={false}
|
invert={false}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
/>
|
/>
|
||||||
{analytics?.itemSales &&
|
<h1>{segments[0]?.itemName}</h1>
|
||||||
analytics?.itemSales.length > 0 && (
|
{((analytics?.itemSales &&
|
||||||
|
analytics?.itemSales.length > 0) || (!analytics?.itemSales && segments.length > 0)) && (
|
||||||
<RoundedRectangle
|
<RoundedRectangle
|
||||||
title={"Item favorit"}
|
title={"Item favorit"}
|
||||||
value={analytics?.itemSales[0]?.itemName}
|
value={analytics?.itemSales[0] != undefined ? analytics?.itemSales[0]?.itemName
|
||||||
|
: segments[0].itemName}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user