@fayz-ai/plugin-crm 0.18.1 → 0.19.0
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.
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect, useMemo, useCallback, useRef } from 'react';
|
|
2
2
|
import { tl, useTranslation, getSupabaseClientOptional, registerTranslations, registerMessageDefaults, createSafeDataProvider, getActiveTenantId, countByTenant, usePluginRuntimeOptional, useActiveTenantId, exportCSV, loadMessageOverrides, resolveMessages, useActiveUnitId } from '@fayz-ai/core';
|
|
3
3
|
import { createPluginContext, useUnitBootstrap, useUnitStore, createCrudPage, PluginSettingsPanel, registerTimelineSource, dedup, useModuleNavigation, createViewRouter, ModuleActionBar, usePermissionOptional, PageActions, useTenantPluginSettings, SettingsGroup, ToggleRow, adminNavigateTo, useLimitGuard, OrderFormSkeleton, OrderFormBlock, OrderFormView, OrderFormItemsCard, OrderFormItemRow, OrderFormAddItemStep, formatCurrency, OrderDetailSkeleton, OrderDetailBlock, OrderDetailView, PersonLink, RightRailPage, KanbanBoard, invalidateLimit, useAccessOptional, useOrganizationStore, getRailPage, ContactPicker } from '@fayz-ai/admin';
|
|
4
|
-
import { Archive, FileX2, FileCheck2, Send, FilePlus2, XCircle, Trophy, PhoneCall, MoveRight, Target, ArrowRightLeft, UserPlus, MapPin, MessageCircle, CheckSquare, FileText, Users, Mail, Phone, ArrowUp, ArrowDown, X, Plus, Filter, Lock, Pencil, Trash2, Globe, Check, ChevronRight, Settings, Tag, User, Building2, Download, Inbox, Play, Clock, Sparkles, Calendar, ArrowRight, ChevronDown, Printer, CircleCheckBig, Ban, Receipt, Package, CalendarClock, Loader2, Network, Link2, Star, MessageSquareQuote, Search, SignalHigh, CalendarRange, ChevronLeft, TrendingDown, ThumbsDown, UserCheck, AlertTriangle, Settings2, Repeat, Zap, Snowflake, Sun, Flame, Merge,
|
|
4
|
+
import { Archive, FileX2, FileCheck2, Send, FilePlus2, XCircle, Trophy, PhoneCall, MoveRight, Target, ArrowRightLeft, UserPlus, MapPin, MessageCircle, CheckSquare, FileText, Users, Mail, Phone, ArrowUp, ArrowDown, X, Plus, Filter, Lock, Pencil, Trash2, Globe, Check, ChevronRight, Settings, Tag, User, Building2, Download, Inbox, Play, Clock, Sparkles, Calendar, ArrowRight, ChevronDown, Printer, CircleCheckBig, Ban, Receipt, Package, CalendarClock, Loader2, Network, Fingerprint, Link2, Star, MessageSquareQuote, Search, SignalHigh, CalendarRange, ChevronLeft, TrendingDown, ThumbsDown, UserCheck, AlertTriangle, Settings2, Repeat, Zap, Snowflake, Sun, Flame, Merge, Paperclip, ImageOff, CircleAlert, CircleDashed, CheckCircle2, Clipboard, DollarSign, ThumbsUp } from 'lucide-react';
|
|
5
5
|
import { Badge, Checkbox, toast, defineKpiWidget, defineChartWidget, defineCustomWidget, defineTableWidget, PageTransition, ModulePage, SubpageHeader, Button, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, Switch, ConfirmDialog, useIsWide, SegmentedControl, PageHeaderActions, FilterChip, MultiSelect, ListView, Modal, ModalContent, ModalHeader, ModalTitle, ModalBody, Input, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, ModalFooter, useSaveBar, SearchSelect, DatePicker, DataTable, Breadcrumb, PhoneLink, SheetBody, SheetFooter, DashboardCanvas, ModalDescription, Card, CurrencyInput, HeaderTabs, Dropdown, DropdownTrigger, DropdownContent, DropdownLabel, DropdownSeparator, DropdownItem, PageToolbar, ToolbarButton, RangeControl, Popover, PopoverTrigger, PopoverContent, getLucideIcon, DictateButton, normalizePhone, KpiCard, ChartWidget, CardHeader, CardTitle, CardContent, TableWidget } from '@fayz-ai/ui';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
@@ -6269,6 +6269,7 @@ function CompanyDetailView({
|
|
|
6269
6269
|
const archiveCompany = useCrmStore((s) => s.archiveCompany);
|
|
6270
6270
|
const unlinkCompanyPerson = useCrmStore((s) => s.unlinkCompanyPerson);
|
|
6271
6271
|
const [company, setCompany] = useState(null);
|
|
6272
|
+
const [receita, setReceita] = useState(null);
|
|
6272
6273
|
const [people, setPeople] = useState([]);
|
|
6273
6274
|
const [deals, setDeals] = useState([]);
|
|
6274
6275
|
const [loading, setLoading] = useState(true);
|
|
@@ -6295,6 +6296,17 @@ function CompanyDetailView({
|
|
|
6295
6296
|
useEffect(() => {
|
|
6296
6297
|
void load();
|
|
6297
6298
|
}, [load]);
|
|
6299
|
+
useEffect(() => {
|
|
6300
|
+
let vivo = true;
|
|
6301
|
+
provider.getCompanyReceita(companyId).then((r) => {
|
|
6302
|
+
if (vivo) setReceita(r);
|
|
6303
|
+
}).catch(() => {
|
|
6304
|
+
if (vivo) setReceita(null);
|
|
6305
|
+
});
|
|
6306
|
+
return () => {
|
|
6307
|
+
vivo = false;
|
|
6308
|
+
};
|
|
6309
|
+
}, [provider, companyId]);
|
|
6298
6310
|
if (loading) return /* @__PURE__ */ jsx("div", { className: "p-6 text-sm text-muted-foreground", children: t2("common.loading") });
|
|
6299
6311
|
if (!company) return /* @__PURE__ */ jsx("div", { className: "p-6 text-sm text-muted-foreground", children: t2("crm.companyDetail.notFound") });
|
|
6300
6312
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
@@ -6363,6 +6375,52 @@ function CompanyDetailView({
|
|
|
6363
6375
|
) })
|
|
6364
6376
|
] }) })
|
|
6365
6377
|
] }),
|
|
6378
|
+
receita && /* @__PURE__ */ jsxs("div", { children: [
|
|
6379
|
+
/* @__PURE__ */ jsxs("h3", { className: "mb-1 flex items-center gap-1.5 text-sm font-semibold text-foreground", children: [
|
|
6380
|
+
/* @__PURE__ */ jsx(Fingerprint, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
6381
|
+
t2("crm.companyDetail.receita"),
|
|
6382
|
+
receita.consultadoEm && /* @__PURE__ */ jsxs("span", { className: "text-xs font-normal text-muted-foreground", children: [
|
|
6383
|
+
"\xB7 ",
|
|
6384
|
+
t2("crm.companyDetail.receitaCheckedOn"),
|
|
6385
|
+
" ",
|
|
6386
|
+
receita.consultadoEm
|
|
6387
|
+
] })
|
|
6388
|
+
] }),
|
|
6389
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-card border bg-card shadow-sm", children: /* @__PURE__ */ jsxs("dl", { className: "grid divide-y md:grid-cols-2 md:divide-y-0", children: [
|
|
6390
|
+
/* @__PURE__ */ jsx("div", { className: "px-5 md:border-b", children: /* @__PURE__ */ jsx(FieldRow2, { label: t2("crm.companyDetail.receitaSituacao"), value: receita.situacao ? (
|
|
6391
|
+
// "BAIXADA" não é um detalhe: é a empresa não existir mais.
|
|
6392
|
+
// Em cinzento ao lado de porte e capital, passa despercebida.
|
|
6393
|
+
/* @__PURE__ */ jsx("span", { className: receita.situacao === "ATIVA" ? void 0 : "font-medium text-destructive", children: receita.situacao })
|
|
6394
|
+
) : null }) }),
|
|
6395
|
+
/* @__PURE__ */ jsx("div", { className: "px-5 md:border-b", children: /* @__PURE__ */ jsx(FieldRow2, { label: t2("crm.companyDetail.receitaLegalName"), value: receita.razaoSocial ?? null }) }),
|
|
6396
|
+
/* @__PURE__ */ jsx("div", { className: "px-5 md:border-b", children: /* @__PURE__ */ jsx(FieldRow2, { label: t2("crm.companyDetail.receitaPorte"), value: receita.porte ?? null }) }),
|
|
6397
|
+
/* @__PURE__ */ jsx("div", { className: "px-5 md:border-b", children: /* @__PURE__ */ jsx(
|
|
6398
|
+
FieldRow2,
|
|
6399
|
+
{
|
|
6400
|
+
label: t2("crm.companyDetail.receitaCapital"),
|
|
6401
|
+
value: receita.capitalSocial != null ? formatCurrency(receita.capitalSocial, currency) : null
|
|
6402
|
+
}
|
|
6403
|
+
) }),
|
|
6404
|
+
/* @__PURE__ */ jsx("div", { className: "px-5 md:border-b", children: /* @__PURE__ */ jsx(FieldRow2, { label: t2("crm.companyDetail.receitaOpened"), value: receita.abertura ?? null }) }),
|
|
6405
|
+
/* @__PURE__ */ jsx("div", { className: "px-5 md:border-b", children: /* @__PURE__ */ jsx(
|
|
6406
|
+
FieldRow2,
|
|
6407
|
+
{
|
|
6408
|
+
label: t2("crm.companyDetail.receitaPartners"),
|
|
6409
|
+
value: receita.socios != null ? String(receita.socios) : null
|
|
6410
|
+
}
|
|
6411
|
+
) }),
|
|
6412
|
+
/* @__PURE__ */ jsx("div", { className: "px-5 md:col-span-2 md:border-t", children: /* @__PURE__ */ jsx(
|
|
6413
|
+
FieldRow2,
|
|
6414
|
+
{
|
|
6415
|
+
label: t2("crm.companyDetail.receitaCnae"),
|
|
6416
|
+
value: receita.cnaeDescricao ? /* @__PURE__ */ jsxs("span", { children: [
|
|
6417
|
+
receita.cnaeDescricao,
|
|
6418
|
+
receita.cnae && /* @__PURE__ */ jsx("span", { className: "ml-1.5 tabular-nums text-muted-foreground", children: receita.cnae })
|
|
6419
|
+
] }) : receita.cnae ?? null
|
|
6420
|
+
}
|
|
6421
|
+
) })
|
|
6422
|
+
] }) })
|
|
6423
|
+
] }),
|
|
6366
6424
|
(company.groupSiblings ?? 0) > 0 && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
6367
6425
|
/* @__PURE__ */ jsx(Link2, { className: "inline h-3 w-3 mr-1" }),
|
|
6368
6426
|
t2("crm.companyDetail.groupHint", { count: String(company.groupSiblings) })
|
|
@@ -25617,6 +25675,15 @@ var en = {
|
|
|
25617
25675
|
"crm.companyDetail.linkAlreadyAt": "already at",
|
|
25618
25676
|
"crm.companyDetail.linkRole": "Role here",
|
|
25619
25677
|
"crm.companyDetail.linkRolePlaceholder": "Owner / partner, manager\u2026",
|
|
25678
|
+
"crm.companyDetail.receita": "Federal tax registry",
|
|
25679
|
+
"crm.companyDetail.receitaCheckedOn": "checked on",
|
|
25680
|
+
"crm.companyDetail.receitaSituacao": "Registration status",
|
|
25681
|
+
"crm.companyDetail.receitaLegalName": "Legal name",
|
|
25682
|
+
"crm.companyDetail.receitaPorte": "Size",
|
|
25683
|
+
"crm.companyDetail.receitaCapital": "Share capital",
|
|
25684
|
+
"crm.companyDetail.receitaOpened": "Opened",
|
|
25685
|
+
"crm.companyDetail.receitaPartners": "Partners",
|
|
25686
|
+
"crm.companyDetail.receitaCnae": "Activity (CNAE)",
|
|
25620
25687
|
"crm.companyDetail.identity": "Identification",
|
|
25621
25688
|
"crm.companyDetail.email": "Email",
|
|
25622
25689
|
"crm.companyDetail.phone": "Phone",
|
|
@@ -26397,6 +26464,15 @@ var ptBR = {
|
|
|
26397
26464
|
"crm.companyDetail.linkAlreadyAt": "j\xE1 est\xE1 em",
|
|
26398
26465
|
"crm.companyDetail.linkRole": "Cargo aqui",
|
|
26399
26466
|
"crm.companyDetail.linkRolePlaceholder": "Propriet\xE1rio / s\xF3cio, ger\xEAncia\u2026",
|
|
26467
|
+
"crm.companyDetail.receita": "Receita Federal",
|
|
26468
|
+
"crm.companyDetail.receitaCheckedOn": "consultado em",
|
|
26469
|
+
"crm.companyDetail.receitaSituacao": "Situa\xE7\xE3o cadastral",
|
|
26470
|
+
"crm.companyDetail.receitaLegalName": "Raz\xE3o social",
|
|
26471
|
+
"crm.companyDetail.receitaPorte": "Porte",
|
|
26472
|
+
"crm.companyDetail.receitaCapital": "Capital social",
|
|
26473
|
+
"crm.companyDetail.receitaOpened": "Abertura",
|
|
26474
|
+
"crm.companyDetail.receitaPartners": "S\xF3cios",
|
|
26475
|
+
"crm.companyDetail.receitaCnae": "Atividade (CNAE)",
|
|
26400
26476
|
"crm.companyDetail.identity": "Identifica\xE7\xE3o",
|
|
26401
26477
|
"crm.companyDetail.email": "E-mail",
|
|
26402
26478
|
"crm.companyDetail.phone": "Telefone",
|