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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Stop unfulfilled items looking like a fulfillment
Damian Legawiec33c835068ed5
diff --git a/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx b/packages/dashboard/src/components/spree/orders/fulfillments-card.tsxindex f96d39abe6..1a001f08a6 100644--- a/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx+++ b/packages/dashboard/src/components/spree/orders/fulfillments-card.tsx@@ -743,25 +743,29 @@ function FulfillmentPanel({* so the eye can compare it against the real ones, minus the status and number* it does not have.*/-function UnfulfilledGroup({ rows }: { rows: FulfillmentItemRow[] }) {+function UnfulfilledItems({ rows, canCreate }: { rows: FulfillmentItemRow[]; canCreate: boolean }) {const { t } = useTranslation()const totalUnits = rows.reduce((sum, row) => sum + row.quantity, 0)+ // Deliberately not a FulfillmentPanel: these units have no fulfillment, and+ // borrowing the panel's status badge and location slot made them read as a+ // record that already exists. What the operator needs to see is that+ // something is owed and nothing is carrying it yet.return (- <FulfillmentPanel- status="unfulfilled"- // The badge names the state; the count says how much is in it, which a- // real fulfillment carries in its own rows instead.- meta={+ <div className="flex flex-col gap-2 rounded-lg border border-border-subtle border-dashed p-4">+ <div className="flex flex-wrap items-baseline justify-between gap-2">+ <span className="font-medium text-sm">+ {t('admin.orders.detail.fulfillments.awaiting_fulfillment', { count: totalUnits })}+ </span><span className="text-muted-foreground text-xs">- {t('admin.orders.detail.fulfillments.unfulfilled', { count: totalUnits })}+ {canCreate+ ? t('admin.orders.detail.fulfillments.awaiting_hint')+ : t('admin.orders.detail.fulfillments.awaiting_hint_draft')}</span>- }- >- <CardContent className="px-0 py-3">- <FulfillmentItemList rows={rows} />- </CardContent>- </FulfillmentPanel>+ </div>++ <FulfillmentItemList rows={rows} />+ </div>)}@@ -819,7 +823,9 @@ export function FulfillmentsCard({ order }: { order: Order }) {</CardContent>) : (<CardContent className="flex flex-col gap-4">- {unfulfilled.length > 0 && <UnfulfilledGroup rows={unfulfilled} />}+ {unfulfilled.length > 0 && (+ <UnfulfilledItems rows={unfulfilled} canCreate={canCreate} />+ )}{fulfillments.map((fulfillment) => (<FulfillmentRow key={fulfillment.id} order={order} fulfillment={fulfillment} />))}diff --git a/packages/dashboard/src/locales/ar.json b/packages/dashboard/src/locales/ar.jsonindex c4c92e2133..dc3fbed098 100644--- a/packages/dashboard/src/locales/ar.json+++ b/packages/dashboard/src/locales/ar.json@@ -2721,6 +2721,10 @@"add_delivery": "إضافة رقم تتبع","add_tracking": "إضافة تتبع","add_tracking_title": "إضافة تتبع",+ "awaiting_fulfillment_one": "ما زال هناك {{count}} عنصر للتنفيذ",+ "awaiting_fulfillment_other": "ما زال هناك {{count}} عناصر للتنفيذ",+ "awaiting_hint": "أضف تنفيذًا لشحنها.",+ "awaiting_hint_draft": "يمكن تنفيذها بمجرد تقديم الطلب.","buy_label": "شراء الملصق","buy_label_confirm": "شراء ملصق شحن لهذه الشحنة؟ سيتم الخصم من حساب شركة الشحن الخاص بك فور إصدار الملصق.","buy_label_confirm_rate": "شراء ملصق {{rate}} مقابل {{cost}}؟ سيتم الخصم من حساب شركة الشحن الخاص بك فور إصدار الملصق.",diff --git a/packages/dashboard/src/locales/de.json b/packages/dashboard/src/locales/de.jsonindex 87027ed221..bfd1033b9e 100644--- a/packages/dashboard/src/locales/de.json+++ b/packages/dashboard/src/locales/de.json@@ -2703,6 +2703,10 @@"add_delivery": "Sendungsnummer hinzufügen","add_tracking": "Sendungsverfolgung hinzufügen","add_tracking_title": "Sendungsverfolgung hinzufügen",+ "awaiting_fulfillment_one": "{{count}} Artikel noch zu erfüllen",+ "awaiting_fulfillment_other": "{{count}} Artikel noch zu erfüllen",+ "awaiting_hint": "Fügen Sie eine Erfüllung hinzu, um sie zu versenden.",+ "awaiting_hint_draft": "Sie können erfüllt werden, sobald die Bestellung aufgegeben ist.","buy_label": "Label kaufen","buy_label_confirm": "Versandlabel für diese Sendung kaufen? Ihr Versanddienstleister-Konto wird belastet, sobald das Label ausgestellt ist.","buy_label_confirm_rate": "Label {{rate}} für {{cost}} kaufen? Ihr Versanddienstleister-Konto wird belastet, sobald das Label ausgestellt ist.",diff --git a/packages/dashboard/src/locales/en.json b/packages/dashboard/src/locales/en.jsonindex f9b8056c34..7d8bed849b 100644--- a/packages/dashboard/src/locales/en.json+++ b/packages/dashboard/src/locales/en.json@@ -2703,6 +2703,10 @@"add_delivery": "Add tracking","add_tracking": "Add tracking","add_tracking_title": "Add tracking",+ "awaiting_fulfillment_one": "{{count}} item still to fulfill",+ "awaiting_fulfillment_other": "{{count}} items still to fulfill",+ "awaiting_hint": "Add a fulfillment to ship them.",+ "awaiting_hint_draft": "They can be fulfilled once the order is placed.","buy_label": "Buy label","buy_label_confirm": "Buy a shipping label for this fulfillment? Your carrier account is charged as soon as the label is issued.","buy_label_confirm_rate": "Buy a {{rate}} label for {{cost}}? Your carrier account is charged as soon as the label is issued.",diff --git a/packages/dashboard/src/locales/fr.json b/packages/dashboard/src/locales/fr.jsonindex 1bc21092fe..1ded87ce43 100644--- a/packages/dashboard/src/locales/fr.json+++ b/packages/dashboard/src/locales/fr.json@@ -2703,6 +2703,10 @@"add_delivery": "Ajouter un suivi","add_tracking": "Ajouter un suivi","add_tracking_title": "Ajouter un suivi",+ "awaiting_fulfillment_one": "{{count}} article encore à traiter",+ "awaiting_fulfillment_other": "{{count}} articles encore à traiter",+ "awaiting_hint": "Ajoutez un traitement pour les expédier.",+ "awaiting_hint_draft": "Ils pourront être traités une fois la commande passée.","buy_label": "Acheter l'étiquette","buy_label_confirm": "Acheter une étiquette d'expédition pour ce colis ? Votre compte transporteur est débité dès l'émission de l'étiquette.","buy_label_confirm_rate": "Acheter une étiquette {{rate}} pour {{cost}} ? Votre compte transporteur est débité dès l'émission de l'étiquette.",diff --git a/packages/dashboard/src/locales/pl.json b/packages/dashboard/src/locales/pl.jsonindex 5ef80291d1..27c324cc99 100644--- a/packages/dashboard/src/locales/pl.json+++ b/packages/dashboard/src/locales/pl.json@@ -2723,6 +2723,10 @@"add_delivery": "Dodaj numer przesyłki","add_tracking": "Dodaj śledzenie","add_tracking_title": "Dodaj śledzenie",+ "awaiting_fulfillment_one": "{{count}} pozycja do zrealizowania",+ "awaiting_fulfillment_other": "{{count}} pozycji do zrealizowania",+ "awaiting_hint": "Dodaj realizację, aby je wysłać.",+ "awaiting_hint_draft": "Będzie je można zrealizować po złożeniu zamówienia.","buy_label": "Kup etykietę","buy_label_confirm": "Kupić etykietę wysyłkową dla tej przesyłki? Twoje konto przewoźnika zostanie obciążone w momencie wystawienia etykiety.","buy_label_confirm_rate": "Kupić etykietę {{rate}} za {{cost}}? Twoje konto przewoźnika zostanie obciążone w momencie wystawienia etykiety.",diff --git a/packages/dashboard/src/locales/zh-CN.json b/packages/dashboard/src/locales/zh-CN.jsonindex aa6dd8a8cb..657838d669 100644--- a/packages/dashboard/src/locales/zh-CN.json+++ b/packages/dashboard/src/locales/zh-CN.json@@ -2696,6 +2696,10 @@"add_delivery": "添加运单号","add_tracking": "添加物流跟踪","add_tracking_title": "添加物流跟踪",+ "awaiting_fulfillment_one": "还有 {{count}} 件商品待履行",+ "awaiting_fulfillment_other": "还有 {{count}} 件商品待履行",+ "awaiting_hint": "添加履行项以发货。",+ "awaiting_hint_draft": "订单下单后即可履行。","buy_label": "购买面单","buy_label_confirm": "为此包裹购买运输面单?面单签发后将立即从您的承运商账户扣费。","buy_label_confirm_rate": "以 {{cost}} 购买 {{rate}} 面单?面单签发后将立即从您的承运商账户扣费。",