Skip to content

cloudacy/eb-interface-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eb-interface-rs

status

ebInterface generator

⚠️ This crate is in alpha stage ⚠️

Notes

rounding

  • eb-interface-rs rounds after all calculations are done
  • eb-interface-rs uses the MidpointAwayFromZero rounding strategy

Feature set

  • minimal invoice

Example

Invoice::new(
    "test",
    "EUR",
    "993433000298",
    "2020-01-01",
    Biller::new("ATU51507409"),
    InvoiceRecipient::new("ATU18708634"),
)
.with_item(
    DetailsItem::new(
        dec!(100),
        "STK",
        dec!(10.20),
        TaxItem::new(dec!(20), TaxCategory::S),
    )
    .with_description("Schraubenzieher")
)
.with_document_title("An invoice")
.with_language("de")
.with_payment_method(
    PaymentMethod::payment_card(
        PaymentMethodPaymentCard::new("123456*4321").with_card_holder_name("Name"),
    )
    .with_comment("Comment"),
)
.to_xml_string()
.unwrap(); // returns "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Invoice>...</Invoice>"

Development

Reference: https://www.wko.at/service/netzwerke/ebinterface-aktuelle-version-xml-rechnungsstandard.html

Validate: https://labs.ebinterface.at/labs

cargo watch -x test