Skip to main content

Fiscal Document

This section describes the reusable components available under charges/pages/fiscal-document, used to build the fiscal document (Gestão de Notas Fiscais) experience.

Composition​

The fiscal document feature is composed of the following reusable components:

All components are standalone and exported from @celerofinancas/ui-charges.

Module activation status​

Which part of the experience is rendered depends on whether the fiscal document module (digital certificate) is already activated for the active company. This rule is not handled by the components themselves — it is exposed by the FinancialManagementService and the consumer decides what to render:

FinancialManagementService​

MemberTypeDescription
nfModuleActivatedWritableSignal<boolean | null>Activation status signal. null = not loaded yet, true = active, false = not active.
loadNFModuleStatus()voidLoads the activation status for the active company. Idempotent: skips the request if the status is already known or another call is in flight.
refreshNFModuleStatus()voidClears the cached status and re-fetches it. Call after the activation flow completes so the UI reflects the new state without a page reload.
fiscal-document.component.ts
import { Component, OnInit, inject } from '@angular/core';
import {
FinancialManagementService,
TypeFinancialManagement,
} from '@celerofinancas/ui-charges';

@Component({ /* ... */ })
export class FiscalDocumentComponent implements OnInit {
private readonly financialManagementService = inject(FinancialManagementService);

// Drives whether the certificate setup banner or the dashboard/list is rendered.
public readonly nfModuleActivated = this.financialManagementService.nfModuleActivated;

public readonly TypeFinancialManagement = TypeFinancialManagement;

public ngOnInit(): void {
this.financialManagementService.loadNFModuleStatus();
}
}
fiscal-document.component.html
@if (nfModuleActivated() === false) {
<bfm-certificate-setup-banner />
}

@if (nfModuleActivated() === true) {
<bfm-financial-dashboard [topEntitiesType]="TypeFinancialManagement.PAYABLES" />
<!-- NFe / NFSe tables -->
}

Shared models​

Some components rely on the following enums, also exported from @celerofinancas/ui-charges:

TypeFinancialManagement​

ValueDescription
TypeFinancialManagement.PAYABLES ('payables')Invoices to be paid (entrada).
TypeFinancialManagement.RECEIVABLES ('receivables')Invoices to be received (saída).

CategoryFinancialManagement​

ValueDescription
CategoryFinancialManagement.PAYABLES_NFE ('payables-nfe')Payable product invoices.
CategoryFinancialManagement.PAYABLES_NFSE ('payables-nfse')Payable service invoices.
CategoryFinancialManagement.RECEIVABLES_NFSE ('receivables-nfse')Receivable service invoices.