Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Edit a fulfillment's method and origin from a dialog

Damian Legawiecb3d48c6733e9
diff --git a/packages/dashboard/src/components/spree/orders/fulfillment-edit-dialog.tsx b/packages/dashboard/src/components/spree/orders/fulfillment-edit-dialog.tsx
new file mode 100644
index 0000000000..daebe91dc7
--- /dev/null
+++ b/packages/dashboard/src/components/spree/orders/fulfillment-edit-dialog.tsx
@@ -0,0 +1,266 @@
+import { zodResolver } from '@hookform/resolvers/zod'
+import type { Fulfillment, Order } from '@spree/admin-sdk'
+import { mapSpreeErrorsToForm } from '@spree/dashboard-core'
+import {
+ Button,
+ Dialog,
+ DialogBody,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+ Field,
+ FieldError,
+ FieldLabel,
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from '@spree/dashboard-ui'
+import { Controller, useForm } from 'react-hook-form'
+import { useTranslation } from 'react-i18next'
+import { z } from 'zod'
+import { useFulfillmentActions } from '../../../hooks/use-fulfillments'
+import { useOrder } from '../../../hooks/use-order'
+import { useStockCoverage } from '../../../hooks/use-stock-coverage'
+import { useStockLocations } from '../../../hooks/use-stock-locations'
+
+const fulfillmentEditSchema = z.object({
+ stock_location_id: z.string().min(1),
+ selected_delivery_rate_id: z.string(),
+})
+
+type FulfillmentEditFormValues = z.infer<typeof fulfillmentEditSchema>
+
+/**
+ * Where the fulfillment ships from and which priced service carries it.
+ *
+ * The two fields are coupled: rates are quoted against an origin, so moving
+ * the fulfillment invalidates the list the merchant is looking at. Rather than
+ * offering stale options, a save that changes the origin writes the location
+ * first, waits for the server to re-quote, and only then offers the fresh
+ * rates — see `handleSubmit`.
+ */
+export function FulfillmentEditDialog({
+ order,
+ fulfillment,
+ open,
+ onOpenChange,
+}: {
+ order: Order
+ fulfillment: Fulfillment
+ open: boolean
+ onOpenChange: (open: boolean) => void
+}) {
+ const { t } = useTranslation()
+ const { update } = useFulfillmentActions(order.id)
+ const { data: stockLocations } = useStockLocations()
+ const { refetch: refetchOrder } = useOrder(order.id)
+
+ const form = useForm<FulfillmentEditFormValues>({
+ resolver: zodResolver(fulfillmentEditSchema),
+ defaultValues: {
+ stock_location_id: fulfillment.stock_location_id ?? '',
+ selected_delivery_rate_id: fulfillment.selected_delivery_rate_id ?? '',
+ },
+ })
+
+ const demands = (fulfillment.fulfillment_items ?? []).flatMap((item) =>
+ item.variant_id ? [{ variantId: item.variant_id, quantity: item.quantity }] : [],
+ )
+ const { data: coverage } = useStockCoverage(demands, open)
+
+ const chosenLocationId = form.watch('stock_location_id')
+ // The rates on the record were quoted for the origin it currently has. Once
+ // the merchant picks a different one they describe a route that is no longer
+ // on offer, so the method field stands down until the server re-quotes.
+ const originMoved = chosenLocationId !== (fulfillment.stock_location_id ?? '')
+
+ const locationOptions = (stockLocations?.data ?? [])
+ .map((location) => {
+ const covered = coverage?.get(location.id) ?? false
+ return {
+ value: location.id,
+ // Uncovered locations stay selectable: moving a fulfillment to a
+ // warehouse awaiting a transfer is a real workflow, and backorderable
+ // stock ships from an empty shelf by design.
+ label: covered
+ ? location.name
+ : `${location.name} — ${t('admin.orders.detail.fulfillments.out_of_stock')}`,
+ covered,
+ }
+ })
+ .sort((left, right) => Number(right.covered) - Number(left.covered))
+
+ const rateOptions = (fulfillment.delivery_rates ?? []).map((rate) => ({
+ value: rate.id,
+ label: `${rate.name} — ${
+ Number.parseFloat(rate.cost) === 0
+ ? t('admin.orders.detail.fulfillments.free')
+ : rate.display_cost
+ }`,
+ }))
+
+ async function onSubmit(values: FulfillmentEditFormValues) {
+ const locationChanged = values.stock_location_id !== (fulfillment.stock_location_id ?? '')
+ const rateChanged =
+ values.selected_delivery_rate_id !== (fulfillment.selected_delivery_rate_id ?? '')
+
+ try {
+ if (locationChanged) {
+ await update.mutateAsync({
+ fulfillmentId: fulfillment.id,
+ stock_location_id: values.stock_location_id,
+ })
+
+ // The server re-quotes on the move and re-selects an equivalent method
+ // where the new origin offers one. Pull the fresh fulfillment back and
+ // show that pick, rather than writing a rate id quoted for the origin
+ // the fulfillment just left. The merchant confirms or changes it in a
+ // second save, against rates that actually apply.
+ const { data: refreshed } = await refetchOrder()
+ const requoted = refreshed?.fulfillments?.find(
+ (candidate) => candidate.id === fulfillment.id,
+ )
+
+ form.reset({
+ stock_location_id: values.stock_location_id,
+ selected_delivery_rate_id: requoted?.selected_delivery_rate_id ?? '',
+ })
+ return
+ }
+
+ if (rateChanged) {
+ await update.mutateAsync({
+ fulfillmentId: fulfillment.id,
+ selected_delivery_rate_id: values.selected_delivery_rate_id,
+ })
+ }
+
+ onOpenChange(false)
+ } catch (err) {
+ if (!mapSpreeErrorsToForm(err, form.setError)) throw err
+ }
+ }
+
+ const { errors, isSubmitting } = form.formState
+
+ return (
+ <Dialog open={open} onOpenChange={onOpenChange}>
+ <DialogContent>
+ <form
+ onSubmit={(event) => {
+ // The order page renders its cards inside their own forms — without
+ // stopping the bubble the browser submits the outer one.
+ form.handleSubmit(onSubmit)(event)
+ event.stopPropagation()
+ }}
+ >
+ <DialogHeader>
+ <DialogTitle>{t('admin.orders.detail.fulfillments.edit_title')}</DialogTitle>
+ <DialogDescription>
+ {t('admin.orders.detail.fulfillments.edit_description')}
+ </DialogDescription>
+ </DialogHeader>
+
+ <DialogBody className="flex flex-col gap-4">
+ {errors.root?.message && (
+ <p className="text-sm text-destructive" role="alert">
+ {errors.root.message}
+ </p>
+ )}
+
+ <Field>
+ <FieldLabel htmlFor="fulfillment-location">
+ {t('admin.orders.detail.fulfillments.ships_from')}
+ </FieldLabel>
+ <Controller
+ name="stock_location_id"
+ control={form.control}
+ render={({ field }) => (
+ <Select
+ items={locationOptions}
+ value={field.value}
+ onValueChange={(value) => field.onChange(value as string)}
+ >
+ <SelectTrigger id="fulfillment-location">
+ <SelectValue placeholder={t('admin.common.select_placeholder')} />
+ </SelectTrigger>
+ <SelectContent>
+ {locationOptions.map((option) => (
+ <SelectItem key={option.value} value={option.value}>
+ {option.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ )}
+ />
+ <FieldError errors={[errors.stock_location_id]} />
+ </Field>
+
+ <Field>
+ <FieldLabel htmlFor="fulfillment-rate">
+ {t('admin.orders.detail.fulfillments.delivery_method')}
+ </FieldLabel>
+ <Controller
+ name="selected_delivery_rate_id"
+ control={form.control}
+ render={({ field }) => (
+ <Select
+ items={rateOptions}
+ value={field.value}
+ disabled={originMoved || rateOptions.length === 0}
+ onValueChange={(value) => field.onChange(value as string)}
+ >
+ <SelectTrigger id="fulfillment-rate">
+ <SelectValue placeholder={t('admin.common.select_placeholder')} />
+ </SelectTrigger>
+ <SelectContent>
+ {rateOptions.map((option) => (
+ <SelectItem key={option.value} value={option.value}>
+ {option.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ )}
+ />
+ {originMoved && (
+ <span className="text-muted-foreground text-xs">
+ {t('admin.orders.detail.fulfillments.rates_pending_origin')}
+ </span>
+ )}
+ {!originMoved && rateOptions.length === 0 && (
+ <span className="text-muted-foreground text-xs">
+ {t('admin.orders.detail.fulfillments.no_rates')}
+ </span>
+ )}
+ </Field>
+ </DialogBody>
+
+ <DialogFooter>
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ onClick={() => onOpenChange(false)}
+ disabled={isSubmitting}
+ >
+ {t('admin.actions.cancel')}
+ </Button>
+ <Button type="submit" size="sm" disabled={isSubmitting}>
+ {isSubmitting
+ ? t('admin.actions.saving')
+ : originMoved
+ ? t('admin.orders.detail.fulfillments.move_and_requote')
+ : t('admin.actions.save')}
+ </Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
+ )
+}
diff --git a/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx b/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx
index 7c76df4fef..a60161fecf 100644
--- a/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx
+++ b/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx
@@ -40,6 +40,7 @@ import {
PlusIcon,
RotateCcwIcon,
SplitIcon,
+ TagIcon,
TruckIcon,
XCircleIcon,
} from 'lucide-react'
@@ -47,6 +48,7 @@ import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useFulfillmentActions } from '../../../hooks/use-fulfillments'
import { useStockLocations } from '../../../hooks/use-stock-locations'
+import { FulfillmentEditDialog } from './fulfillment-edit-dialog'
/**
* A unit sitting in one fulfillment. Splitting moves units per variant rather
@@ -84,113 +86,6 @@ function orderUnits(order: Order): Array<{ itemId: string; label: string; quanti
}))
}
-/**
- * The delivery options a fulfillment can be moved between. Each rate is a
- * priced service — with a carrier provider one method yields several, so the
- * rate rather than the method is what a merchant picks.
- */
-function RateSelect({
- fulfillment,
- orderId,
- disabled,
-}: {
- fulfillment: Fulfillment
- orderId: string
- disabled: boolean
-}) {
- const { t } = useTranslation()
- const { update } = useFulfillmentActions(orderId)
-
- const rates = fulfillment.delivery_rates ?? []
- if (rates.length === 0) return null
-
- const options = rates.map((rate) => ({
- value: rate.id,
- label: `${rate.name} — ${
- Number.parseFloat(rate.cost) === 0
- ? t('admin.orders.detail.fulfillments.free')
- : rate.display_cost
- }`,
- }))
-
- return (
- <Field>
- <FieldLabel htmlFor={`rate-${fulfillment.id}`}>
- {t('admin.orders.detail.fulfillments.delivery_method')}
- </FieldLabel>
- <Select
- items={options}
- value={fulfillment.selected_delivery_rate_id ?? ''}
- disabled={disabled || update.isPending}
- onValueChange={(value) =>
- update.mutate({
- fulfillmentId: fulfillment.id,
- selected_delivery_rate_id: value as string,
- })
- }
- >
- <SelectTrigger id={`rate-${fulfillment.id}`} size="sm">
- <SelectValue placeholder={t('admin.common.select_placeholder')} />
- </SelectTrigger>
- <SelectContent>
- {options.map((option) => (
- <SelectItem key={option.value} value={option.value}>
- {option.label}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </Field>
- )
-}
-
-/** Where the fulfillment ships from. Changing it re-prices against that origin. */
-function StockLocationSelect({
- fulfillment,
- orderId,
- disabled,
-}: {
- fulfillment: Fulfillment
- orderId: string
- disabled: boolean
-}) {
- const { t } = useTranslation()
- const { update } = useFulfillmentActions(orderId)
- const { data } = useStockLocations()
-
- const locations = data?.data ?? []
- if (locations.length === 0) return null
-
- const options = locations.map((location) => ({ value: location.id, label: location.name }))
-
- return (
- <Field>
- <FieldLabel htmlFor={`location-${fulfillment.id}`}>
- {t('admin.orders.detail.fulfillments.ships_from')}
- </FieldLabel>
- <Select
- items={options}
- value={fulfillment.stock_location_id ?? ''}
- disabled={disabled || update.isPending}
- onValueChange={(value) =>
- update.mutate({ fulfillmentId: fulfillment.id, stock_location_id: value as string })
- }
- >
- <SelectTrigger id={`location-${fulfillment.id}`} size="sm">
- <SelectValue placeholder={t('admin.common.select_placeholder')} />
- </SelectTrigger>
- <SelectContent>
- {options.map((option) => (
- <SelectItem key={option.value} value={option.value}>
- {option.label}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </Field>
- )
-}
-
function EditTrackingDialog({
orderId,
fulfillment,
@@ -546,6 +441,7 @@ function FulfillmentRow({ order, fulfillment }: { order: Order; fulfillment: Ful
const orderId = order.id
const { fulfill, cancel, resume } = useFulfillmentActions(orderId)
+ const [editOpen, setEditOpen] = useState(false)
const [trackingOpen, setTrackingOpen] = useState(false)
const [splitOpen, setSplitOpen] = useState(false)
@@ -566,8 +462,15 @@ function FulfillmentRow({ order, fulfillment }: { order: Order; fulfillment: Ful
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
+ {editable && (
+ <DropdownMenuItem onClick={() => setEditOpen(true)}>
+ <PencilIcon className="size-4" />
+ {t('admin.actions.edit')}
+ </DropdownMenuItem>
+ )}
+
<DropdownMenuItem onClick={() => setTrackingOpen(true)}>
- <PencilIcon className="size-4" />
+ <TagIcon className="size-4" />
{fulfillment.tracking
? t('admin.orders.detail.tracking.edit_title')
: t('admin.orders.detail.tracking.add_title')}
@@ -632,29 +535,20 @@ function FulfillmentRow({ order, fulfillment }: { order: Order; fulfillment: Ful
</DropdownMenu>
</div>
- {editable ? (
- <div className="grid gap-3 sm:grid-cols-2">
- <RateSelect fulfillment={fulfillment} orderId={orderId} disabled={!editable} />
- <StockLocationSelect fulfillment={fulfillment} orderId={orderId} disabled={!editable} />
+ {(fulfillment.delivery_method || Number.parseFloat(fulfillment.cost) > 0) && (
+ <div className="flex items-center justify-between text-sm">
+ <span className="text-muted-foreground">
+ {fulfillment.delivery_method?.name ?? t('admin.pages.orders.detail.no_delivery_method')}
+ </span>
+ <span>{fulfillment.display_cost}</span>
+ </div>
+ )}
+
+ {fulfillment.stock_location && (
+ <div className="flex items-center gap-1.5 text-xs text-muted-foreground">
+ <MapPinIcon className="size-3" />
+ {fulfillment.stock_location.name}
</div>
- ) : (
- <>
- {(fulfillment.delivery_method || Number.parseFloat(fulfillment.cost) > 0) && (
- <div className="flex items-center justify-between text-sm">
- <span className="text-muted-foreground">
- {fulfillment.delivery_method?.name ??
- t('admin.pages.orders.detail.no_delivery_method')}
- </span>
- <span>{fulfillment.display_cost}</span>
- </div>
- )}
- {fulfillment.stock_location && (
- <div className="flex items-center gap-1.5 text-xs text-muted-foreground">
- <MapPinIcon className="size-3" />
- {fulfillment.stock_location.name}
- </div>
- )}
- </>
)}
{fulfillment.tracking && (
@@ -687,6 +581,15 @@ function FulfillmentRow({ order, fulfillment }: { order: Order; fulfillment: Ful
</span>
)}
+ {editOpen && (
+ <FulfillmentEditDialog
+ order={order}
+ fulfillment={fulfillment}
+ open={editOpen}
+ onOpenChange={setEditOpen}
+ />
+ )}
+
{trackingOpen && (
<EditTrackingDialog
orderId={orderId}
diff --git a/packages/dashboard/src/hooks/use-stock-coverage.test.ts b/packages/dashboard/src/hooks/use-stock-coverage.test.ts
new file mode 100644
index 0000000000..7711d22966
--- /dev/null
+++ b/packages/dashboard/src/hooks/use-stock-coverage.test.ts
@@ -0,0 +1,80 @@
+import { describe, expect, it } from 'vitest'
+import { type CoverageStockItem, computeStockCoverage } from './use-stock-coverage'
+
+function stockItem(overrides: Partial<CoverageStockItem>): CoverageStockItem {
+ return {
+ stock_location_id: 'sloc_1',
+ variant_id: 'variant_1',
+ available_count: 0,
+ backorderable: false,
+ ...overrides,
+ }
+}
+
+describe('computeStockCoverage', () => {
+ it('covers a location holding enough of every demanded variant', () => {
+ const coverage = computeStockCoverage(
+ [
+ stockItem({ variant_id: 'variant_1', available_count: 5 }),
+ stockItem({ variant_id: 'variant_2', available_count: 2 }),
+ ],
+ [
+ { variantId: 'variant_1', quantity: 3 },
+ { variantId: 'variant_2', quantity: 2 },
+ ],
+ )
+
+ expect(coverage.get('sloc_1')).toBe(true)
+ })
+
+ it('does not cover a location short on one variant', () => {
+ const coverage = computeStockCoverage(
+ [
+ stockItem({ variant_id: 'variant_1', available_count: 5 }),
+ stockItem({ variant_id: 'variant_2', available_count: 1 }),
+ ],
+ [
+ { variantId: 'variant_1', quantity: 1 },
+ { variantId: 'variant_2', quantity: 2 },
+ ],
+ )
+
+ expect(coverage.get('sloc_1')).toBe(false)
+ })
+
+ // Backorderable is exactly how a merchant ships from a warehouse awaiting a
+ // transfer, so an empty shelf still counts as covered.
+ it('treats a backorderable row as unlimited', () => {
+ const coverage = computeStockCoverage(
+ [stockItem({ available_count: 0, backorderable: true })],
+ [{ variantId: 'variant_1', quantity: 99 }],
+ )
+
+ expect(coverage.get('sloc_1')).toBe(true)
+ })
+
+ it('does not cover a location missing a variant entirely', () => {
+ const coverage = computeStockCoverage(
+ [stockItem({ stock_location_id: 'sloc_1', variant_id: 'variant_1', available_count: 5 })],
+ [
+ { variantId: 'variant_1', quantity: 1 },
+ { variantId: 'variant_2', quantity: 1 },
+ ],
+ )
+
+ expect(coverage.get('sloc_1')).toBe(false)
+ })
+
+ it('keeps locations independent of one another', () => {
+ const coverage = computeStockCoverage(
+ [
+ stockItem({ stock_location_id: 'sloc_1', available_count: 10 }),
+ stockItem({ stock_location_id: 'sloc_2', available_count: 0 }),
+ ],
+ [{ variantId: 'variant_1', quantity: 4 }],
+ )
+
+ expect(coverage.get('sloc_1')).toBe(true)
+ expect(coverage.get('sloc_2')).toBe(false)
+ })
+})
diff --git a/packages/dashboard/src/hooks/use-stock-coverage.ts b/packages/dashboard/src/hooks/use-stock-coverage.ts
new file mode 100644
index 0000000000..9dae1d6f53
--- /dev/null
+++ b/packages/dashboard/src/hooks/use-stock-coverage.ts
@@ -0,0 +1,91 @@
+import { adminClient, useResourceKey } from '@spree/dashboard-core'
+import { useQuery } from '@tanstack/react-query'
+
+/** How many units of a variant a fulfillment needs. */
+export interface VariantDemand {
+ variantId: string
+ quantity: number
+}
+
+/**
+ * Which stock locations can cover a set of variants, keyed by location id.
+ * A location missing from the map holds no stock item for at least one of the
+ * variants at all, which counts as not covering it.
+ */
+export type StockCoverage = Map<string, boolean>
+
+/**
+ * Asks, for every stock location, whether it could source the given variants.
+ *
+ * One request covers the whole question: stock items are fetched for all the
+ * variants at once and grouped by location afterwards, so opening a dialog
+ * costs a single round trip rather than one per row. A backorderable item
+ * counts as covered — that is the point of the flag, and Spree will happily
+ * ship a fulfillment from a warehouse awaiting a transfer.
+ */
+export function useStockCoverage(demands: VariantDemand[], enabled = true) {
+ const variantIds = demands.map((demand) => demand.variantId).sort()
+
+ return useQuery({
+ queryKey: useResourceKey('stock-items', 'coverage', variantIds),
+ enabled: enabled && variantIds.length > 0,
+ queryFn: async (): Promise<StockCoverage> => {
+ const response = await adminClient.stockItems.list({
+ variant_id_in: variantIds,
+ // A variant can exist at every location, so the ceiling is
+ // variants × locations. The API caps `limit` at 100; merchants with
+ // more rows than that get the first page, and an unseen location
+ // simply reads as uncovered rather than wrongly reading as covered.
+ limit: 100,
+ })
+
+ return computeStockCoverage(response.data, demands)
+ },
+ })
+}
+
+/** The stock-item fields the coverage computation reads. */
+export interface CoverageStockItem {
+ stock_location_id?: string | null
+ variant_id?: string | null
+ available_count: number
+ backorderable: boolean
+}
+
+/**
+ * Groups stock rows by location and asks whether each location holds enough of
+ * every demanded variant. Backorderable rows count as unlimited: that flag
+ * exists so Spree can ship from an empty shelf.
+ *
+ * A location with no row for one of the variants cannot cover it — the caller
+ * labels those "Out of stock" rather than hiding them, so a warehouse awaiting
+ * a transfer stays selectable.
+ */
+export function computeStockCoverage(
+ stockItems: CoverageStockItem[],
+ demands: VariantDemand[],
+): StockCoverage {
+ const availabilityByLocation = new Map<string, Map<string, number>>()
+
+ for (const stockItem of stockItems) {
+ if (!stockItem.stock_location_id || !stockItem.variant_id) continue
+
+ const perVariant =
+ availabilityByLocation.get(stockItem.stock_location_id) ?? new Map<string, number>()
+ perVariant.set(
+ stockItem.variant_id,
+ stockItem.backorderable ? Number.POSITIVE_INFINITY : stockItem.available_count,
+ )
+ availabilityByLocation.set(stockItem.stock_location_id, perVariant)
+ }
+
+ const coverage: StockCoverage = new Map()
+ for (const [locationId, perVariant] of availabilityByLocation) {
+ coverage.set(
+ locationId,
+ demands.every((demand) => (perVariant.get(demand.variantId) ?? 0) >= demand.quantity),
+ )
+ }
+
+ return coverage
+}
diff --git a/packages/dashboard/src/locales/ar.json b/packages/dashboard/src/locales/ar.json
index e071bddf14..f42782fdad 100644
--- a/packages/dashboard/src/locales/ar.json
+++ b/packages/dashboard/src/locales/ar.json
@@ -1827,8 +1827,14 @@
"create_items": "العناصر",
"create_title": "إضافة شحنة",
"delivery_method": "طريقة التوصيل",
+ "edit_description": "غيّر مكان شحن هذه الشحنة وطريقة التوصيل التي تنقلها.",
+ "edit_title": "تعديل الشحنة",
"empty": "لا توجد شحنات لهذا الطلب بعد.",
"free": "مجاني",
+ "move_and_requote": "نقل وإعادة التسعير",
+ "no_rates": "لا توجد طرق توصيل متاحة لهذه الشحنة.",
+ "out_of_stock": "غير متوفر في المخزون",
+ "rates_pending_origin": "احفظ مصدر الشحن الجديد لعرض طرق التوصيل المتاحة منه.",
"ships_from": "الشحن من",
"split": "تقسيم",
"split_description": "انقل بعض الوحدات إلى شحنة جديدة. منتج واحد في كل مرة.",
diff --git a/packages/dashboard/src/locales/de.json b/packages/dashboard/src/locales/de.json
index f29501e2b6..d74f9ba609 100644
--- a/packages/dashboard/src/locales/de.json
+++ b/packages/dashboard/src/locales/de.json
@@ -1816,8 +1816,14 @@
"create_items": "Artikel",
"create_title": "Sendung hinzufügen",
"delivery_method": "Versandart",
+ "edit_description": "Ändern Sie, von wo diese Sendung versandt wird und welche Versandart sie befördert.",
+ "edit_title": "Sendung bearbeiten",
"empty": "Noch keine Sendungen für diese Bestellung.",
"free": "Kostenlos",
+ "move_and_requote": "Verschieben und neu berechnen",
+ "no_rates": "Für diese Sendung liegen keine Versandarten vor.",
+ "out_of_stock": "Nicht auf Lager",
+ "rates_pending_origin": "Speichern Sie den neuen Ursprung, um die dort verfügbaren Versandarten zu sehen.",
"ships_from": "Versand ab",
"split": "Aufteilen",
"split_description": "Verschieben Sie einzelne Einheiten in eine neue Sendung. Ein Produkt nach dem anderen.",
diff --git a/packages/dashboard/src/locales/en.json b/packages/dashboard/src/locales/en.json
index f9847684e6..1ae6d12e81 100644
--- a/packages/dashboard/src/locales/en.json
+++ b/packages/dashboard/src/locales/en.json
@@ -1816,8 +1816,14 @@
"create_items": "Items",
"create_title": "Add fulfillment",
"delivery_method": "Delivery method",
+ "edit_description": "Change where this fulfillment ships from and which delivery method carries it.",
+ "edit_title": "Edit fulfillment",
"empty": "No fulfillments on this order yet.",
"free": "Free",
+ "move_and_requote": "Move and re-quote",
+ "no_rates": "No delivery methods are quoted for this fulfillment.",
+ "out_of_stock": "Out of stock",
+ "rates_pending_origin": "Save the new origin to see the delivery methods it offers.",
"ships_from": "Ships from",
"split": "Split",
"split_description": "Move some units into a new fulfillment. One product at a time.",
diff --git a/packages/dashboard/src/locales/fr.json b/packages/dashboard/src/locales/fr.json
index aa03af430e..1e6933f1a1 100644
--- a/packages/dashboard/src/locales/fr.json
+++ b/packages/dashboard/src/locales/fr.json
@@ -1816,8 +1816,14 @@
"create_items": "Articles",
"create_title": "Ajouter une expédition",
"delivery_method": "Mode de livraison",
+ "edit_description": "Modifiez le lieu d'expédition et le mode de livraison de cette expédition.",
+ "edit_title": "Modifier l'expédition",
"empty": "Aucune expédition pour cette commande.",
"free": "Gratuit",
+ "move_and_requote": "Déplacer et recalculer",
+ "no_rates": "Aucun mode de livraison n'est proposé pour cette expédition.",
+ "out_of_stock": "En rupture de stock",
+ "rates_pending_origin": "Enregistrez la nouvelle origine pour voir les modes de livraison proposés.",
"ships_from": "Expédié depuis",
"split": "Diviser",
"split_description": "Déplacez certaines unités vers une nouvelle expédition. Un produit à la fois.",
diff --git a/packages/dashboard/src/locales/pl.json b/packages/dashboard/src/locales/pl.json
index 21b30d7e3e..1125d0a3ad 100644
--- a/packages/dashboard/src/locales/pl.json
+++ b/packages/dashboard/src/locales/pl.json
@@ -1832,8 +1832,14 @@
"create_items": "Pozycje",
"create_title": "Dodaj przesyłkę",
"delivery_method": "Sposób dostawy",
+ "edit_description": "Zmień miejsce wysyłki tej przesyłki oraz sposób dostawy, którym jest realizowana.",
+ "edit_title": "Edytuj przesyłkę",
"empty": "Brak przesyłek dla tego zamówienia.",
"free": "Za darmo",
+ "move_and_requote": "Przenieś i przelicz",
+ "no_rates": "Dla tej przesyłki nie ma dostępnych sposobów dostawy.",
+ "out_of_stock": "Brak w magazynie",
+ "rates_pending_origin": "Zapisz nowe miejsce wysyłki, aby zobaczyć dostępne dla niego sposoby dostawy.",
"ships_from": "Wysyłka z",
"split": "Podziel",
"split_description": "Przenieś część sztuk do nowej przesyłki. Po jednym produkcie naraz.",
diff --git a/packages/dashboard/src/locales/zh-CN.json b/packages/dashboard/src/locales/zh-CN.json
index c0293ddbbd..aae7af9355 100644
--- a/packages/dashboard/src/locales/zh-CN.json
+++ b/packages/dashboard/src/locales/zh-CN.json
@@ -1813,8 +1813,14 @@
"create_items": "商品项",
"create_title": "添加发货单",
"delivery_method": "配送方式",
+ "edit_description": "修改此发货单的发货地以及承运的配送方式。",
+ "edit_title": "编辑发货单",
"empty": "此订单暂无发货单。",
"free": "免费",
+ "move_and_requote": "移动并重新报价",
+ "no_rates": "此发货单暂无可用的配送方式。",
+ "out_of_stock": "无库存",
+ "rates_pending_origin": "保存新的发货地后即可查看该地可用的配送方式。",
"ships_from": "发货地",
"split": "拆分",
"split_description": "将部分数量移入新的发货单。每次操作一个商品。",