@fayz-ai/plugin-financial 0.33.10 → 0.33.11

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.
@@ -1,4 +1,4 @@
1
- import { InvoiceFormView, InvoiceDetailView, marcarItemParaAbrir, FINANCIAL_FISCAL_ZONES, AccountIcon, createFinancialCounterpartyLookup, InvoiceAttachmentsModal, CancelInvoicesDialog, FinancialCounterpartySearchSelect, useWritableUnits, useStockedItemTypes, UnitField, BankLogo, findBrBank, BankPicker } from './chunk-F7UW7VZI.js';
1
+ import { InvoiceFormView, InvoiceDetailView, marcarItemParaAbrir, FINANCIAL_FISCAL_ZONES, AccountIcon, createFinancialCounterpartyLookup, InvoiceAttachmentsModal, CancelInvoicesDialog, FinancialCounterpartySearchSelect, useWritableUnits, useStockedItemTypes, UnitField, BankLogo, findBrBank, BankPicker } from './chunk-KD46ZOEH.js';
2
2
  import { chartTreeProps, chartAccountWithDescendants, chartRowsFor } from './chunk-XGBGRXZ3.js';
3
3
  import { startReceiptCapture, RECEIVABLE_RECEIPT_INSTRUCTIONS, RECEIPT_INSTRUCTIONS, createReceiptTools } from './chunk-7VKJLBYY.js';
4
4
  import { FINANCIAL_MODULE_DEFAULTS, FinancialGeneralSettings } from './chunk-POYZFEAN.js';
@@ -1050,7 +1050,7 @@ function useInvoiceColumns(currency, paymentMethods, paymentMethodTypes, bankAcc
1050
1050
  }
1051
1051
  ) });
1052
1052
  }
1053
- const n = row.original.paidAmount > 0 ? row.original.attachmentCount ?? 0 : 0;
1053
+ const n = row.original.attachmentCount ?? 0;
1054
1054
  const label = n === 1 ? "1 anexo" : `${n} anexos`;
1055
1055
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-0.5", children: [
1056
1056
  n > 0 && /* @__PURE__ */ jsxs(
@@ -1063,7 +1063,7 @@ function useInvoiceColumns(currency, paymentMethods, paymentMethodTypes, bankAcc
1063
1063
  "aria-label": label,
1064
1064
  onClick: (e) => {
1065
1065
  e.stopPropagation();
1066
- openAttachments(row.original.invoiceId ?? row.original.id);
1066
+ openAttachments(row.original);
1067
1067
  },
1068
1068
  children: [
1069
1069
  /* @__PURE__ */ jsx(Paperclip, { className: "h-4 w-4", "aria-hidden": true }),
@@ -1073,7 +1073,7 @@ function useInvoiceColumns(currency, paymentMethods, paymentMethodTypes, bankAcc
1073
1073
  ),
1074
1074
  /* @__PURE__ */ jsx(RowActions, { actions: [
1075
1075
  { id: "open", label: t("financial.invoice.rowOpen"), icon: Pencil, hidden: !rowMenu.open, onSelect: () => rowMenu.open?.(row.original) },
1076
- { id: "attachments", label: t("financial.invoice.rowAttachments"), icon: Paperclip, hidden: !n, onSelect: () => openAttachments(row.original.invoiceId ?? row.original.id) },
1076
+ { id: "attachments", label: t("financial.invoice.rowAttachments"), icon: Paperclip, hidden: !n, onSelect: () => openAttachments(row.original) },
1077
1077
  { id: "cancel", label: t("financial.invoice.bulkCancel"), icon: Ban, intent: "danger", hidden: !rowMenu.cancel || row.original.status === "cancelled", onSelect: () => rowMenu.cancel?.(row.original) }
1078
1078
  ] })
1079
1079
  ] });
@@ -1251,7 +1251,7 @@ function InvoiceListView({ direction, onNew, onNewReceipt, onEdit }) {
1251
1251
  }, [provider, t, fetchInvoices, query, onEdit]);
1252
1252
  const filtered = invoices.filter((inv) => inv.direction === direction);
1253
1253
  const [attachmentsOf, setAttachmentsOf] = useState(null);
1254
- const openAttachments = useCallback((invoiceId) => setAttachmentsOf(invoiceId), []);
1254
+ const openAttachments = useCallback((row) => setAttachmentsOf(row), []);
1255
1255
  const contactLookup = useMemo(() => createFinancialCounterpartyLookup(direction), [direction]);
1256
1256
  const tags = useMemo(
1257
1257
  // `provisioned` fora da barra: ele não é um recorte do que existe, é o
@@ -1693,7 +1693,9 @@ function InvoiceListView({ direction, onNew, onNewReceipt, onEdit }) {
1693
1693
  attachmentsOf && /* @__PURE__ */ jsx(
1694
1694
  InvoiceAttachmentsModal,
1695
1695
  {
1696
- invoiceId: attachmentsOf,
1696
+ invoiceId: attachmentsOf.invoiceId ?? attachmentsOf.id,
1697
+ installmentNumber: attachmentsOf.installmentNumber ?? 1,
1698
+ totalInstallments: attachmentsOf.totalInstallments ?? 1,
1697
1699
  onClose: () => setAttachmentsOf(null),
1698
1700
  onChanged: () => {
1699
1701
  void fetchInvoices(query);
@@ -6757,5 +6759,5 @@ function FinancialPage({ config: appConfig, provider, store, registries }) {
6757
6759
  }
6758
6760
 
6759
6761
  export { FinancialPage };
6760
- //# sourceMappingURL=FinancialPage-2FIMXWCQ.js.map
6761
- //# sourceMappingURL=FinancialPage-2FIMXWCQ.js.map
6762
+ //# sourceMappingURL=FinancialPage-LJCVGEM3.js.map
6763
+ //# sourceMappingURL=FinancialPage-LJCVGEM3.js.map