Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional (optional) company fields in invoice #37

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/receipts/base.rb
Expand Up @@ -68,6 +68,8 @@ def render_billing_details(company:, recipient:, margin_top: 16)
move_down margin_top

company_details = [
company[:company_code],
company[:iban],
company[:address],
company[:phone],
company[:email]
Expand Down
19 changes: 19 additions & 0 deletions test/test_receipts.rb
Expand Up @@ -49,6 +49,25 @@ def test_invoice_with_arguments
)
end

def test_invoice_with_additional_company_data
assert_instance_of Receipts::Invoice, Receipts::Invoice.new(
company: {
name: "Company",
address: "123 Street",
email: "company@example.org",
company_code: "000123",
iban: "LT241997677264666618"
},
recipient: [],
details: [
["Receipt", "123"]
],
line_items: [
["Product", "$10"]
]
)
end

def test_statement_with_arguments
assert_instance_of Receipts::Statement, Receipts::Statement.new(
company: {
Expand Down