fix: Minor fixes to the inventory pages (#7921)
This commit is contained in:
+5
-3
@@ -59,7 +59,9 @@ export const InventoryItemGeneralSection = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getQuantityFormat = (quantity: number, locations?: number) => {
|
const getQuantityFormat = (quantity: number, locations?: number) => {
|
||||||
return `${quantity ?? "-"} ${
|
if (quantity !== undefined && !isNaN(quantity)) {
|
||||||
quantity ? `across ${locations ?? "-"} locations` : ""
|
return `${quantity} across ${locations ?? "-"} locations`
|
||||||
}`
|
}
|
||||||
|
|
||||||
|
return "-"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-5
@@ -2,10 +2,7 @@ import * as zod from "zod"
|
|||||||
|
|
||||||
import { InventoryTypes, StockLocationDTO } from "@medusajs/types"
|
import { InventoryTypes, StockLocationDTO } from "@medusajs/types"
|
||||||
import { Button, Input, Select, Text, Textarea, toast } from "@medusajs/ui"
|
import { Button, Input, Select, Text, Textarea, toast } from "@medusajs/ui"
|
||||||
import {
|
import { RouteDrawer, useRouteModal } from "../../../../../../components/modals"
|
||||||
RouteDrawer,
|
|
||||||
useRouteModal,
|
|
||||||
} from "../../../../../../components/modals"
|
|
||||||
|
|
||||||
import { zodResolver } from "@hookform/resolvers/zod"
|
import { zodResolver } from "@hookform/resolvers/zod"
|
||||||
import { useForm } from "react-hook-form"
|
import { useForm } from "react-hook-form"
|
||||||
@@ -140,7 +137,11 @@ export const EditReservationForm = ({
|
|||||||
/>
|
/>
|
||||||
<AttributeGridRow
|
<AttributeGridRow
|
||||||
title={t("inventory.available")}
|
title={t("inventory.available")}
|
||||||
value={level!.stocked_quantity - reservedQuantity}
|
value={
|
||||||
|
level!.stocked_quantity -
|
||||||
|
(level.reserved_quantity - reservation.quantity) -
|
||||||
|
reservedQuantity
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Form.Field
|
<Form.Field
|
||||||
|
|||||||
+1
-1
@@ -82,7 +82,7 @@ export const ReservationGeneralSection = ({
|
|||||||
/>
|
/>
|
||||||
<SectionRow
|
<SectionRow
|
||||||
title={t("inventory.reservation.reservedAtLocation")}
|
title={t("inventory.reservation.reservedAtLocation")}
|
||||||
value={reservation.quantity}
|
value={locationLevel?.reserved_quantity}
|
||||||
/>
|
/>
|
||||||
</Container>
|
</Container>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user