Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Latest commit

 

History

History
28 lines (23 loc) · 1020 Bytes

File metadata and controls

28 lines (23 loc) · 1020 Bytes

Ruby Finvoice 2.01 XML generator

Code Climate Test Coverage Build Status

One way conversion from Ruby hash to Finvoice 2.01 XML file

Usage

# Invoice hash
invoice = {
    invoice: {
        number: "1234",
        date: "2016-02-25"
    },
    seller: {...},
    buyer: {...},
    rows: [...]
}

document = Finvoice201.build_from_hash(invoice)
document.valid? # => true or false
document.errors # => array of errors from XML schema validation
xml = document.to_xml # => xml contents
Finvoice201.validate(xml) # returns errors from XML schema validation