ok
This commit is contained in:
@@ -173,7 +173,7 @@ const App = ({ forCafe = true, cafeId = -1,
|
||||
const cafeTotal = (cafe.report?.itemSales || []).reduce((sum, item) => sum + item.sold, 0);
|
||||
return total + cafeTotal;
|
||||
}, 0);
|
||||
|
||||
console.log(totalSoldAcrossAllCafes)
|
||||
const totalSpendAcrossAllCafes = filteredItems.reduce((total, cafe) => {
|
||||
const cafeTotal = (cafe.report?.materialSpend || []).reduce((sum, item) => sum + item.spend, 0);
|
||||
return total + cafeTotal;
|
||||
@@ -484,11 +484,13 @@ const App = ({ forCafe = true, cafeId = -1,
|
||||
invert={false}
|
||||
loading={loading}
|
||||
/>
|
||||
{analytics?.itemSales &&
|
||||
analytics?.itemSales.length > 0 && (
|
||||
<h1>{segments[0]?.itemName}</h1>
|
||||
{((analytics?.itemSales &&
|
||||
analytics?.itemSales.length > 0) || (!analytics?.itemSales && segments.length > 0)) && (
|
||||
<RoundedRectangle
|
||||
title={"Item favorit"}
|
||||
value={analytics?.itemSales[0]?.itemName}
|
||||
value={analytics?.itemSales[0] != undefined ? analytics?.itemSales[0]?.itemName
|
||||
: segments[0].itemName}
|
||||
loading={loading}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user