Skip to content

Commit

Permalink
Support for multiple invoice items
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Tsoganov authored and Sergei Tsoganov committed Sep 29, 2023
1 parent a8d9cc4 commit c138053
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/e_invoice/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ def build_invoice_payment_details(invoice)
end

def build_invoice_items(items)
items.each do |item|
builder.InvoiceItem do
builder.InvoiceItem do
items.each do |item|
builder.InvoiceItemGroup do
builder.ItemEntry do
builder.Description item.description
Expand All @@ -154,13 +154,13 @@ def build_invoice_items(items)
builder.ItemTotal format_decimal(item.total, scale: 4)
end
end
end

builder.InvoiceItemTotalGroup do
builder.InvoiceItemTotalAmount format_decimal(item.total, scale: 4)
builder.InvoiceItemTotalSum format_decimal(item.subtotal, scale: 4)
builder.InvoiceItemTotalGroup do
builder.InvoiceItemTotalAmount format_decimal(item.total, scale: 4)
builder.InvoiceItemTotalSum format_decimal(item.subtotal, scale: 4)

builder.InvoiceItemTotal format_decimal(item.total, scale: 4)
end
builder.InvoiceItemTotal format_decimal(item.total, scale: 4)
end
end
end
Expand Down

0 comments on commit c138053

Please sign in to comment.