Skip to main content

Crate core_invoice

Crate core_invoice 

Source
Expand description

Semantic model for the core electronic invoice: EN 16931 and Peppol PINT.

Tax is VAT, GST, SST, or consumption — not VAT only. No I/O, no tax-authority APIs, no accounting UI.

Re-exports§

pub use amount::Amount;
pub use amount::InvoiceAmount;
pub use amount::UnitPriceAmount;
pub use attachment::Attachment;
pub use bt::BtId;
pub use bt::Group;
pub use bt::Path;
pub use category::CategoryProfile;
pub use category::VatCategory;
pub use category::pint_gst_category;
pub use code::Code;
pub use codes::ARTEFACT_VERSION;
pub use codes::EN16931_GIT;
pub use codes::PEPPOL_BIS_VERSION;
pub use codes::PINT_MY_VERSION;
pub use codes::PINT_VERSION;
pub use codes::currency as is_currency;
pub use date::Date;
pub use error::AmountError;
pub use error::AttachmentError;
pub use error::DateError;
pub use identifier::DocumentReference;
pub use identifier::Identifier;
pub use invoice::AllowanceCharge;
pub use invoice::Contact;
pub use invoice::Delivery;
pub use invoice::DocumentTotals;
pub use invoice::Invoice;
pub use invoice::InvoiceNote;
pub use invoice::ItemAttribute;
pub use invoice::Line;
pub use invoice::LineAllowanceCharge;
pub use invoice::Party;
pub use invoice::PartyTax;
pub use invoice::Payee;
pub use invoice::PaymentInstructions;
pub use invoice::Period;
pub use invoice::PostalAddress;
pub use invoice::PrecedingInvoice;
pub use invoice::Price;
pub use invoice::SupportingDocument;
pub use invoice::TaxBreakdown;
pub use invoice::TaxRepresentative;
pub use kind::DocumentKind;
pub use numeric::Percentage;
pub use numeric::Quantity;
pub use payment::CreditTransfer;
pub use payment::DirectDebit;
pub use payment::PaymentCard;
pub use payment::PaymentMeans;
pub use profile::Edition;
pub use profile::Profile;
pub use profile::ProfileLookup;
pub use proof::Check;
pub use proof::En16931 as En16931Marker;
pub use proof::PeppolBis3 as PeppolBis3Marker;
pub use proof::Pint as PintMarker;
pub use proof::PintMy as PintMyMarker;
pub use proof::ProfileMarker;
pub use proof::ProveError;
pub use proof::Underlies;
pub use proof::Validated;
pub use reconcile::ReconcileError;
pub use reconcile::Reconciled;
pub use reconcile::Reconciler;
pub use reconcile::reconcile;
pub use report::Finding;
pub use report::Report;
pub use report::Severity;
pub use report::Source;
pub use rules::catalogue;
pub use rules::conformance_matrix;
pub use rules::core_rules;
pub use rules::explain;
pub use tax::TaxCategory;
pub use tax::TaxSystem;
pub use tax::pint_my_category;
pub use tax::wire_scheme;
pub use validate::validate;

Modules§

amount
InvoiceAmount (≤2 fraction digits, refuse excess) and UnitPriceAmount (uncapped).
arith
Rounding and slack used by VAT/GST/SST derivation.
attachment
Binary Attachment: bytes, MIME, and filename (BT-125).
bt
Finding locations: BtId, Group, Path. Repeating-group index is 0-based.
category
Nine UNCL 5305 VAT category families plus PINT-MY aligned tables.
code
Verbatim Code. List membership is a rule (BR-CL-*), not a constructor.
codes
Code lists generated from refers/ genericode (code points only; EUPL XML stays out of git).
date
Calendar Date: YYYY-MM-DD, no time, no timezone. Invalid input fails closed.
error
Construction errors for amounts, dates, and attachments.
identifier
Identifier (value + optional scheme) and DocumentReference (content only).
invoice
Semantic invoice: parties, lines, totals, and Table 2 groups.
kind
Syntax root DocumentKind. Not derived from BT-3.
numeric
Quantity (signed, not money) and Percentage (per cent, not a fraction).
payment
Exclusive payment means: BG-17 credit transfer, BG-18 card, or BG-19 direct debit.
peppol
Peppol BIS Billing 3.0 extra_rules. Not CORE, not inherited by PINT.
profile
Usage specification (BT-24). Profiles are siblings, not a ladder.
proof
Proof that an invoice passed a named profile. Formats stamp BT-24 from this.
reconcile
Derive BG-23 and BG-22 from lines, document allowances and charges.
report
Validation findings. Severity::Fatal fails Report::ok; Severity::Warning does not.
rules
Rule registry. crate::validate() and explain share one table.
tax
Tax system and category. SST is in-memory; wire_scheme never emits TaxScheme SST.
validate
Semantic checks on the in-memory invoice.