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
Call the paperwork beside a label shipping documents
Damian Legawiecb23ca80454ec
diff --git a/.gitignore b/.gitignoreindex 885d65f263..78d85cc18b 100644--- a/.gitignore+++ b/.gitignore@@ -55,6 +55,12 @@ brakeman-*.**/app/assets/builds.claude/worktreesserver/+.server/+# Never commit environment files: a leading-dot copy of server/ once slipped+# past the line above carrying a live API key.+.env+.env.*+!.env.example# Per-worktree clone of spree/storefront (branch 6-0-dev), provisioned by# scripts/worktree/setup.sh. Keeps its own .git — commit and push from inside it.storefront/diff --git a/packages/dashboard/src/components/spree/orders/shipping-documents.tsx b/packages/dashboard/src/components/spree/orders/shipping-documents.tsxindex 8c5cb27476..33c7358f81 100644--- a/packages/dashboard/src/components/spree/orders/shipping-documents.tsx+++ b/packages/dashboard/src/components/spree/orders/shipping-documents.tsx@@ -3,8 +3,9 @@ import { FileTextIcon } from 'lucide-react'import { useTranslation } from 'react-i18next'/**- * Customs paperwork the carrier produced beside the label — a commercial- * invoice, a declaration — for parcels that cross a border.+ * Paperwork the carrier produced beside the label. Customs forms are the+ * common case — a commercial invoice, a declaration, for anything crossing a+ * border — but what a provider files here is its own to decide.** Owner-agnostic like the label row beside it: an export and a cross-border* return are declared the same way. The files are hosted by the carrier@@ -21,7 +22,7 @@ export function ShippingDocuments({if (!documents?.length) return nullreturn (- <CardContent className="flex flex-col gap-1.5 border-t pt-3">+ <CardContent className="flex flex-col gap-1.5 border-b border-border-subtle pt-3"><p className="text-sm font-medium">{t('admin.orders.detail.fulfillments.documents_title')}</p>{documents.map((document) => (<adiff --git a/packages/dashboard/src/locales/ar.json b/packages/dashboard/src/locales/ar.jsonindex 19083830ed..c93a6d3b99 100644--- a/packages/dashboard/src/locales/ar.json+++ b/packages/dashboard/src/locales/ar.json@@ -2759,7 +2759,7 @@"customs_form": "نموذج جمركي","form": "مستند"},- "documents_title": "المستندات الجمركية",+ "documents_title": "مستندات الشحن","edit_description": "غيّر مكان شحن هذه الشحنة وطريقة التوصيل التي تنقلها.","edit_title": "تعديل الشحنة","edit_tracking_title": "تعديل التتبع",diff --git a/packages/dashboard/src/locales/de.json b/packages/dashboard/src/locales/de.jsonindex 7ec18cca32..10c7cabe81 100644--- a/packages/dashboard/src/locales/de.json+++ b/packages/dashboard/src/locales/de.json@@ -2741,7 +2741,7 @@"customs_form": "Zollformular","form": "Dokument"},- "documents_title": "Zolldokumente",+ "documents_title": "Versanddokumente","edit_description": "Ändern Sie, von wo diese Sendung versandt wird und welche Versandart sie befördert.","edit_title": "Sendung bearbeiten","edit_tracking_title": "Sendungsverfolgung bearbeiten",diff --git a/packages/dashboard/src/locales/en.json b/packages/dashboard/src/locales/en.jsonindex 843badb16f..aa58e2edd2 100644--- a/packages/dashboard/src/locales/en.json+++ b/packages/dashboard/src/locales/en.json@@ -2741,7 +2741,7 @@"customs_form": "Customs form","form": "Document"},- "documents_title": "Customs documents",+ "documents_title": "Shipping documents","edit_description": "Change where this fulfillment ships from and which delivery method carries it.","edit_title": "Edit fulfillment","edit_tracking_title": "Edit tracking",diff --git a/packages/dashboard/src/locales/fr.json b/packages/dashboard/src/locales/fr.jsonindex 798ea52d86..b5c3c7eaef 100644--- a/packages/dashboard/src/locales/fr.json+++ b/packages/dashboard/src/locales/fr.json@@ -2741,7 +2741,7 @@"customs_form": "Formulaire douanier","form": "Document"},- "documents_title": "Documents douaniers",+ "documents_title": "Documents d'expédition","edit_description": "Modifiez le lieu d'expédition et le mode de livraison de cette expédition.","edit_title": "Modifier l'expédition","edit_tracking_title": "Modifier le suivi",diff --git a/packages/dashboard/src/locales/pl.json b/packages/dashboard/src/locales/pl.jsonindex 85cc77ebef..b5b8670548 100644--- a/packages/dashboard/src/locales/pl.json+++ b/packages/dashboard/src/locales/pl.json@@ -2761,7 +2761,7 @@"customs_form": "Formularz celny","form": "Dokument"},- "documents_title": "Dokumenty celne",+ "documents_title": "Dokumenty przewozowe","edit_description": "Zmień miejsce wysyłki tej przesyłki oraz sposób dostawy, którym jest realizowana.","edit_title": "Edytuj przesyłkę","edit_tracking_title": "Edytuj śledzenie",diff --git a/packages/dashboard/src/locales/zh-CN.json b/packages/dashboard/src/locales/zh-CN.jsonindex 0e0e42b4f4..9822da97b4 100644--- a/packages/dashboard/src/locales/zh-CN.json+++ b/packages/dashboard/src/locales/zh-CN.json@@ -2734,7 +2734,7 @@"customs_form": "报关单","form": "文件"},- "documents_title": "报关文件",+ "documents_title": "运输文件","edit_description": "修改此发货单的发货地以及承运的配送方式。","edit_title": "编辑发货单","edit_tracking_title": "编辑物流跟踪",diff --git a/spree/api/app/serializers/spree/api/v3/admin/return_serializer.rb b/spree/api/app/serializers/spree/api/v3/admin/return_serializer.rbindex 54087f6e5e..ed7b437d3d 100644--- a/spree/api/app/serializers/spree/api/v3/admin/return_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/admin/return_serializer.rb@@ -40,8 +40,8 @@ module Spreeone :stock_location, resource: proc { Spree.api.admin_stock_location_serializer }, if: proc { expand?('stock_location') }many :refunds, resource: proc { Spree.api.admin_refund_serializer }, if: proc { expand?('refunds') }- # Customs paperwork the provider produced beside the label: a- # cross-border return is declared like any other export.+ # Paperwork the provider produced beside the label: a cross-border+ # return is declared like any other export.attribute :documents do |return_record|return_record.provider.documents(return_record).map(&:as_json)enddiff --git a/spree/api/spec/serializers/spree/api/v3/admin/documents_spec.rb b/spree/api/spec/serializers/spree/api/v3/admin/documents_spec.rbindex 83618f7824..f066f3ba85 100644--- a/spree/api/spec/serializers/spree/api/v3/admin/documents_spec.rb+++ b/spree/api/spec/serializers/spree/api/v3/admin/documents_spec.rb@@ -1,7 +1,7 @@require 'spec_helper'require 'spree/testing_support/label_provider'-# Customs paperwork reaches the merchant through the provider, not a column,+# Paperwork reaches the merchant through the provider, not a column,# so what matters is that both owners of a label actually ask for it: an# international return is declared like any other export, and for a long# while only fulfillments exposed it.diff --git a/spree/core/app/models/spree/shipping_document.rb b/spree/core/app/models/spree/shipping_document.rbindex df541612be..68b5bdbddf 100644--- a/spree/core/app/models/spree/shipping_document.rb+++ b/spree/core/app/models/spree/shipping_document.rb@@ -9,9 +9,9 @@ module Spree# change to this class rather than to every provider and serializer.## +kind+ is the carrier's own word for the document and is deliberately not- # validated against a list: what paperwork a border wants is not Spree's- # vocabulary to fix, and an unknown kind renders humanised rather than- # being dropped.+ # validated against a list: which papers a shipment needs is the carrier's+ # and the border's business, not Spree's vocabulary to fix, and an unknown+ # kind renders humanised rather than being dropped.class ShippingDocumentinclude ActiveModel::Modelinclude ActiveModel::Attributes