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