Commit 481c801f authored by gwendal's avatar gwendal
Browse files

add deposit and subscription boolean to ledger_item#to_invoicing_export

(related #188)
parent 9b86cc32
......@@ -465,7 +465,6 @@ class Invoice < InvoicingLedgerItem
def to_invoicing_export
return super.merge({
# recipient: handled in subclasses
deposit: self.deposit?,
payment_method: payment_method
})
end
......
......@@ -55,6 +55,8 @@ class InvoicingLedgerItem < ActiveRecord::Base
tax_amount: self.tax_amount.to_f,
line_items: self.line_items.order(:id).each.map(&:to_invoicing_export),
description: self.description,
deposit: self.deposit,
subscription: self.subscription,
}
# sender and recipient should be defined in subclass
return result
......
......@@ -86,6 +86,7 @@ describe MemberInvoice do
net_amount: 0.0,
line_items: [],
deposit: false,
subscription: false,
payment_method: "direct_debit"
})
end
......
......@@ -140,6 +140,7 @@ describe MemberInvoice do
net_amount: 0.0,
line_items: [],
deposit: false,
subscription: false,
payment_method: "direct_debit"
})
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment