mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 01:11:43 +02:00
Added product_id to monthly invoice items
This commit is contained in:
parent
5d92442a48
commit
34f5347c1f
2 changed files with 4 additions and 4 deletions
|
@ -91,13 +91,13 @@ class Invoice
|
|||
def generate_monthly_invoice_item(invoice, item)
|
||||
EInvoice::InvoiceItem.new.tap do |i|
|
||||
i.description = item.description
|
||||
i.description = "[#{item.product_id}] #{item.description}" if item.product_id
|
||||
i.product_id = item.product_id
|
||||
i.unit = item.unit
|
||||
i.price = item.price
|
||||
i.quantity = item.quantity
|
||||
i.vat_rate = invoice.vat_rate
|
||||
if item.price && item.quantity
|
||||
i.subtotal = (item.price * item.quantity).round(3)
|
||||
i.vat_rate = invoice.vat_rate
|
||||
i.vat_amount = i.subtotal * (i.vat_rate / 100)
|
||||
i.total = i.subtotal + i.vat_amount
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue