Ubill
PDF Invoice generator.
Installation
Install the gem and add to the application's Gemfile by executing:
$ bundle add ubill
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install ubill
Configuration
Configuration must to be executed only once! Put it into a rails initializer if possible.
Ubill.configure do
page_size "A4"
footer.configure do
add_line do
append "rechnung GmbH", styles: [:bold]
append "Mattermoststraße 23"
append "12345 Demoburg"
append "info@example.org"
append "www.example.org"
end
add_line do
append "Geschäftsführer Fried Hof, Holger Manen, Manfred Erike"
end
add_line do
append "HRB 4711"
append "Amtsgericht Jurahausen"
append "Steuernummer 123/456/78900"
end
end
header.configure do
left "rechnung GmbH"
right do
append "Mattermoststraße 23"
append "12345 Demoburg"
append "info@example.org"
end
end
account.configure do
recipient "rechnung GmbH"
iban "DE081547114200"
bic "ACCOUNTXXX"
end
end
Usage
doc = Ubill::Invoice.new do
subject("Rechnung R1234567890", "Rechnungsdatum 01.01.2100")
recipient(
organisation: "Spielvereinigung Demoburg e.V.",
name: "Tobi Ornottobi",
department: "Dept. Purchase",
street_1: "Highwaytohell 2",
street_2: "Room 3.12",
zip: "12345",
city: "Coruscant",
country: "Galactic Empire"
)
4.times do |idx|
position(
name: "Standard Abonnement",
description: "SpVgg Demoburg -- Platz #{idx+1}\nStandard Abonnement für ein Jahr",
price_per_unit: "7,50 € / Monat",
units: "12",
price: "90,00 €"
)
end
total "180,00 €"
due "24.12.2100"
end
doc.save_as("invoice.pdf")
License
The gem is available as open source under the terms of the MIT License.