1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! Core types, tax computation, and XML generation for Brazilian fiscal documents.
//!
//! `fiscal-core` is the foundation crate of the `fiscal-rs` workspace. It contains:
//!
//! - **Data types** ([`types`], [`newtypes`]) — strongly-typed structs and newtypes for
//! NF-e / NFC-e document data, validated at construction time.
//! - **Tax computation** ([`tax_icms`], [`tax_pis_cofins_ipi`], [`tax_issqn`], [`tax_is`]) —
//! build XML fragments for each Brazilian tax group and accumulate invoice totals.
//! - **XML builder** ([`xml_builder`]) — typestate builder for assembling a complete,
//! schema-compliant NF-e / NFC-e XML document.
//! - **Protocol helpers** ([`complement`], [`contingency`], [`qrcode`]) — attach SEFAZ
//! authorization protocols, manage contingency mode, and build NFC-e QR codes.
//! - **Utilities** ([`format_utils`], [`xml_utils`], [`gtin`], [`state_codes`],
//! [`status_codes`], [`constants`]) — formatting, XML escaping, GTIN validation,
//! IBGE state code lookups, and SEFAZ status-code constants.
//! - **Conversion** ([`convert`], [`standardize`]) — TXT-to-XML converter and
//! XML type identification / JSON conversion.
//! - **Traits** ([`traits`]) — sealed `TaxCalculation` and `XmlSerializable` traits.
pub use FiscalError;
/// Functions for attaching SEFAZ authorization protocols to signed XML documents.
/// Compile-time constants: namespaces, algorithm URIs, and payment type codes.
/// Contingency mode manager for NF-e fallback emission.
/// SPED TXT-to-XML converter for NF-e documents.
/// Formatting helpers for monetary amounts, rates, and decimal numbers.
/// GTIN (barcode) validation and check-digit calculation.
/// Parse-don't-validate newtypes for monetary amounts, tax rates, access keys, and state codes.
/// NFC-e QR code URL builder and XML injection.
/// ASCII sanitization for XML text content (replaces accented characters).
/// NF-e XML document type identification and XML-to-JSON conversion.
/// Brazilian state IBGE code lookup tables and helpers.
/// SEFAZ status code constants and valid-status sets.
/// Internal tax element types used by tax computation modules.
/// IBS/CBS (Imposto sobre Bens e Servicos / Contribuicao sobre Bens e Servicos) XML generation.
/// ICMS tax computation and XML generation (CST and CSOSN variants).
/// IS (Imposto Seletivo) XML generation.
/// ISSQN (municipal service tax) XML generation.
/// PIS, COFINS, IPI, and II tax computation and XML generation.
/// Timezone lookup by Brazilian state (UF).
/// Public data structures for NF-e / NFC-e documents.
/// Typestate XML builder for NF-e / NFC-e documents.
/// XML building primitives: `tag`, `escape_xml`, and `extract_xml_tag_value`.
/// Sealed trait infrastructure for preventing external implementations.
/// Sealed public traits: [`TaxCalculation`](traits::TaxCalculation) and [`XmlSerializable`](traits::XmlSerializable).