pub enum InvoiceField {
Show 14 variants
InvoiceNumber(String),
InvoiceDate(String),
DueDate(String),
TotalAmount(f64),
TaxAmount(f64),
NetAmount(f64),
VatNumber(String),
SupplierName(String),
CustomerName(String),
Currency(String),
ArticleNumber(String),
LineItemDescription(String),
LineItemQuantity(f64),
LineItemUnitPrice(f64),
}Expand description
Extracted invoice field with strongly-typed data
Each variant represents a different type of information that can be extracted from an invoice. Fields are matched using language-specific patterns and converted to appropriate types (String for text, f64 for amounts).
§Type Conversion
- String fields: Invoice numbers, dates, names (preserved as-is)
- Amount fields: Parsed with language-aware decimal handling
- European format:
1.234,56→1234.56 - US/UK format:
1,234.56→1234.56
- European format:
- Quantity fields: Parsed as floating-point numbers
§Examples
use oxidize_pdf::text::invoice::InvoiceField;
let invoice_number = InvoiceField::InvoiceNumber("INV-2025-001".to_string());
let total = InvoiceField::TotalAmount(1234.56);
assert_eq!(invoice_number.name(), "Invoice Number");
assert_eq!(total.name(), "Total Amount");Variants§
InvoiceNumber(String)
Invoice number (e.g., “INV-2025-001”, “Factura Nº: 2025-001”)
Typically appears near the top of the invoice. Format varies by country and company, but usually includes alphanumeric identifiers.
InvoiceDate(String)
Invoice date as extracted from document
Format varies by language:
- Spanish/Italian: DD/MM/YYYY
- German: DD.MM.YYYY
- English: DD/MM/YYYY or MM/DD/YYYY
Note: Stored as string, not parsed to Date type (MVP)
DueDate(String)
Due date for payment
Same format considerations as InvoiceDate.
TotalAmount(f64)
Total amount including all taxes (in currency units)
Also known as: “Total”, “Grand Total”, “Gesamtbetrag”, “Totale”
TaxAmount(f64)
Tax amount (VAT/IVA/MwSt/IVA in currency units)
Represents the total tax charged. May include breakdown of different tax rates (e.g., 21% VAT, 10% reduced rate).
NetAmount(f64)
Net amount before tax (in currency units)
Also known as: “Subtotal”, “Net Amount”, “Base Imponible”, “Nettobetrag”, “Imponibile”
VatNumber(String)
VAT/Tax identification number
Format varies by country:
- Spain: CIF (A12345678)
- UK: VAT Number (GB123456789)
- Germany: USt-IdNr. (DE123456789)
- Italy: Partita IVA (IT12345678901)
SupplierName(String)
Supplier/Vendor name (company issuing the invoice)
CustomerName(String)
Customer/Client name (company receiving the invoice)
Currency(String)
Currency code (ISO 4217)
Examples: “EUR”, “GBP”, “USD”, “CHF”
ArticleNumber(String)
Article/Product number for line items
SKU, part number, or product code.
LineItemDescription(String)
Line item description/name
Textual description of product or service.
LineItemQuantity(f64)
Line item quantity (units ordered/delivered)
LineItemUnitPrice(f64)
Line item unit price (price per unit, before tax)
Implementations§
Trait Implementations§
Source§impl Clone for InvoiceField
impl Clone for InvoiceField
Source§fn clone(&self) -> InvoiceField
fn clone(&self) -> InvoiceField
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InvoiceField
impl Debug for InvoiceField
Source§impl PartialEq for InvoiceField
impl PartialEq for InvoiceField
impl StructuralPartialEq for InvoiceField
Auto Trait Implementations§
impl Freeze for InvoiceField
impl RefUnwindSafe for InvoiceField
impl Send for InvoiceField
impl Sync for InvoiceField
impl Unpin for InvoiceField
impl UnwindSafe for InvoiceField
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more