Skip to content

Commit cd4ad60

Browse files
committed
Merge branch 'dev-rebase-test' of https://github.com/FOSSASystems/InvenTree into dev-rebase-test
2 parents c7cf727 + 4c082cb commit cd4ad60

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/frontend/src/components/dashboard/DashboardMenu.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,14 @@ export default function DashboardMenu({
4545
}>) {
4646
const user = useUserState();
4747
const instanceName = useInstanceName();
48-
const [total_Value, total_Consumed, total_bills, total_quantity, total_count] = UseTotalValue();
48+
const [total_Value, total_Consumed, total_bills, total_quantity, total_count, total_Extracted] = UseTotalValue();
4949

5050
const title = useMemo(() => {
5151
const username = user.username();
5252

5353
return (
5454
<div>
5555
<StylishText size='lg'>{`FOSSA Inventory (Spain) - ${username}`}</StylishText>
56-
<div style={{ marginTop: '10px', display: 'flex', flexDirection: 'column' }}>
57-
<Text size='md' fw={500}>Total Stock: {total_quantity}</Text>
58-
</div>
5956
<div style={{ marginTop: '10px', display: 'flex', flexDirection: 'column' }}>
6057
<Text size='md' fw={500}>Item Count: {total_count}</Text>
6158
</div>
@@ -68,9 +65,12 @@ export default function DashboardMenu({
6865
<div style={{ marginTop: '10px', display: 'flex', flexDirection: 'column' }}>
6966
<Text size='md' fw={500}>Total Bills Value: {total_bills}</Text>
7067
</div>
68+
<div style={{ marginTop: '10px', display: 'flex', flexDirection: 'column' }}>
69+
<Text size='md' fw={500}>Total Extracted Value: {total_Extracted}</Text>
70+
</div>
7171
</div>
7272
);
73-
}, [user, instanceName, total_Value, total_Consumed]);
73+
}, [user, instanceName, total_Value, total_Consumed, total_Extracted]);
7474
return (
7575
<Paper p='sm' pr={0}>
7676
<Group justify='space-between' wrap='nowrap'>

src/frontend/src/hooks/UseTotalValue.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default function UseTotalValue() {
66
const [totalBills, setTotalBills] = useState<number>(0);
77
const [totalQuantity, setTotalQuantity] = useState<number>(0);
88
const [totalCount, setTotalCount] = useState<number>(0);
9+
const [totalExtracted, setTotalExtracted] = useState<number>(0);
910

1011
useEffect(() => {
1112
fetch("/api/stock/value/")
@@ -16,8 +17,9 @@ export default function UseTotalValue() {
1617
setTotalBills(data.total_from_bills);
1718
setTotalQuantity(data.total_quantity)
1819
setTotalCount(data.item_count)
20+
setTotalExtracted(data.total_extracted)
1921
});
2022
}, []);
2123

22-
return [totalValue.toFixed(2), totalConsumed.toFixed(2), totalBills.toFixed(2), totalQuantity, totalCount];
24+
return [totalValue.toFixed(2), totalConsumed.toFixed(2), totalBills.toFixed(2), totalQuantity, totalCount, totalExtracted.toFixed(2)];
2325
}

0 commit comments

Comments
 (0)