@fayz-ai/plugin-shop 0.35.3 → 0.35.5-canary.20261123144325
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,7 @@ import React7__default, { useState, useEffect, useRef, useCallback, useMemo } fr
|
|
|
8
8
|
import { Button, Modal, ModalContent, ModalHeader, ModalTitle, ModalDescription, Input, ModalFooter, formatPhone, toast, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Textarea, DataTable, ConfirmDialog, Skeleton, ModalPortal, ModalOverlay, ModalBody, SearchSelect } from '@fayz-ai/ui';
|
|
9
9
|
import { RotateCcw, QrCode, Pencil, Archive, Ban, CreditCard, XCircle, ShoppingBag, Package, Wallet, Plus, WandSparkles, ChefHat, Bike, Check, X, CheckCircle2, Printer, RefreshCw, ExternalLink, Truck, AlertTriangle, Loader2, Copy, Link2, HandCoins, Share2, MessageCircle, MapPin } from 'lucide-react';
|
|
10
10
|
import { formatDocument, getShopProvider, CHARGEABLE_PROVIDERS, supportsPaymentLink, resolveShippingLabelProvider, getShopTenantId, documentDigits, isValidDocument } from '@fayz-ai/shop';
|
|
11
|
-
import { useAdminPath, adminNavigateTo, useOrderReceivable, OrderDetailSkeleton, PageActions, WidgetSlot, ORDER_DETAIL_ZONES, OrderDetailBlock, OrderDetailRow, toOrderDetailReceivable, PersonLink, OrderDetailView as OrderDetailView$1, listPickablePriceTables, initialPriceTableId, OrderFormBlock, OrderCreateScreen, OrderListView, askAI, useConnectors, CrudRecordModal, AddressFormModal, useAgentSurface, customerPriceTableField, ClientOrdersTab, createClientOrdersProvider, duplicateWrite } from '@fayz-ai/admin';
|
|
11
|
+
import { useAdminPath, adminNavigateTo, useOrderReceivable, OrderDetailSkeleton, PageActions, receivableAdjustment, WidgetSlot, ORDER_DETAIL_ZONES, OrderDetailBlock, OrderDetailRow, toOrderDetailReceivable, adjustmentLabel, PersonLink, OrderDetailView as OrderDetailView$1, listPickablePriceTables, initialPriceTableId, OrderFormBlock, OrderCreateScreen, OrderListView, askAI, useConnectors, CrudRecordModal, AddressFormModal, useAgentSurface, customerPriceTableField, ClientOrdersTab, createClientOrdersProvider, duplicateWrite } from '@fayz-ai/admin';
|
|
12
12
|
import { FINANCIAL_ZONES } from '@fayz-ai/financial/views/zones';
|
|
13
13
|
import { usePluginRuntimeOptional, getWidgetsForZone, getSupabaseClientOptional, formatCurrency, tl, normalizeBrPhoneToE164, getActiveTenantId } from '@fayz-ai/core';
|
|
14
14
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -2149,6 +2149,7 @@ function OrderDetailView({ orderId, provider, onBack, fallback }) {
|
|
|
2149
2149
|
}
|
|
2150
2150
|
)
|
|
2151
2151
|
);
|
|
2152
|
+
const billAdjustment = receivableAdjustment(receivable, order.total);
|
|
2152
2153
|
const data = {
|
|
2153
2154
|
// No topo, onde o layout compartilhado já reserva lugar para uma recusa.
|
|
2154
2155
|
errorBanner: chargeError && !chargeOpen ? /* @__PURE__ */ jsx(
|
|
@@ -2163,7 +2164,12 @@ function OrderDetailView({ orderId, provider, onBack, fallback }) {
|
|
|
2163
2164
|
title: `Pedido #${order.orderNumber}`,
|
|
2164
2165
|
// A data saiu do topo para o rodapé de procedência, que é onde toda ficha
|
|
2165
2166
|
// do app guarda "criado em / atualizado em".
|
|
2166
|
-
meta:
|
|
2167
|
+
meta: {
|
|
2168
|
+
...order,
|
|
2169
|
+
createdVia: order.origin === "storefront" ? "site" : order.origin === "admin" ? "app" : void 0,
|
|
2170
|
+
// A guest checkout has no user behind it; the buyer is still who created it.
|
|
2171
|
+
createdByName: order.origin === "storefront" && !order.createdBy ? order.customerName ?? void 0 : void 0
|
|
2172
|
+
},
|
|
2167
2173
|
badges: [
|
|
2168
2174
|
{ label: ORDER_STATUS_LABEL[order.financialStatus] ?? order.financialStatus, tone: toneOf(order.financialStatus) },
|
|
2169
2175
|
{ label: ORDER_STATUS_LABEL[order.fulfillmentStatus] ?? order.fulfillmentStatus, tone: toneOf(order.fulfillmentStatus) }
|
|
@@ -2210,10 +2216,14 @@ function OrderDetailView({ orderId, provider, onBack, fallback }) {
|
|
|
2210
2216
|
})),
|
|
2211
2217
|
totals: [
|
|
2212
2218
|
{ label: "Subtotal", value: money3(order.subtotal, cur) },
|
|
2213
|
-
...order.discountTotal > 0 ? [{ label:
|
|
2219
|
+
...order.discountTotal > 0 ? [{ label: order.discountCode ? `Cupom ${order.discountCode}` : "Desconto", value: `\u2212 ${money3(order.discountTotal, cur)}` }] : [],
|
|
2214
2220
|
{ label: "Entrega", value: money3(order.shippingTotal, cur) },
|
|
2215
2221
|
{ label: "Impostos", value: money3(order.taxTotal, cur) },
|
|
2216
|
-
|
|
2222
|
+
...billAdjustment ? [
|
|
2223
|
+
{ label: "Total do pedido", value: money3(order.total, cur) },
|
|
2224
|
+
{ label: adjustmentLabel(billAdjustment), value: `${billAdjustment.amount < 0 ? "\u2212" : "+"} ${money3(Math.abs(billAdjustment.amount), cur)}` },
|
|
2225
|
+
{ label: "Total a pagar", value: money3(order.total + billAdjustment.amount, cur), strong: true }
|
|
2226
|
+
] : [{ label: "Total", value: money3(order.total, cur), strong: true }]
|
|
2217
2227
|
],
|
|
2218
2228
|
paymentMethod: order.paymentMethodKind ? PAYMENT_LABEL[order.paymentMethodKind] ?? order.paymentMethodKind : void 0,
|
|
2219
2229
|
paidAt: order.paidAt ? paidAtLabel(order.paidAt) : void 0,
|
|
@@ -2226,6 +2236,7 @@ function OrderDetailView({ orderId, provider, onBack, fallback }) {
|
|
|
2226
2236
|
(value) => money3(value, cur),
|
|
2227
2237
|
{
|
|
2228
2238
|
dateOnly: (value) => value ? dateOnly(value) : "",
|
|
2239
|
+
orderTotal: order.total,
|
|
2229
2240
|
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2230
2241
|
receiveMounted && receivable && receivable.balance.balance > 0 && receivable.balance.status !== "cancelled" && /* @__PURE__ */ jsx(
|
|
2231
2242
|
Button,
|
|
@@ -4503,5 +4514,5 @@ var ShopPage = ({ provider, section }) => {
|
|
|
4503
4514
|
ShopPage.displayName = "ShopPage";
|
|
4504
4515
|
|
|
4505
4516
|
export { ShopOrderDetailSlot, ShopPage };
|
|
4506
|
-
//# sourceMappingURL=ShopPage-
|
|
4507
|
-
//# sourceMappingURL=ShopPage-
|
|
4517
|
+
//# sourceMappingURL=ShopPage-ODGOF7WJ.js.map
|
|
4518
|
+
//# sourceMappingURL=ShopPage-ODGOF7WJ.js.map
|