Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pik
ambre
Commits
481c801f
Commit
481c801f
authored
Jan 19, 2020
by
gwendal
Browse files
add deposit and subscription boolean to ledger_item#to_invoicing_export
(related #188)
parent
9b86cc32
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/models/invoice.rb
View file @
481c801f
...
@@ -465,7 +465,6 @@ class Invoice < InvoicingLedgerItem
...
@@ -465,7 +465,6 @@ class Invoice < InvoicingLedgerItem
def
to_invoicing_export
def
to_invoicing_export
return
super
.
merge
({
return
super
.
merge
({
# recipient: handled in subclasses
# recipient: handled in subclasses
deposit:
self
.
deposit?
,
payment_method:
payment_method
payment_method:
payment_method
})
})
end
end
...
...
app/models/invoicing_ledger_item.rb
View file @
481c801f
...
@@ -55,6 +55,8 @@ class InvoicingLedgerItem < ActiveRecord::Base
...
@@ -55,6 +55,8 @@ class InvoicingLedgerItem < ActiveRecord::Base
tax_amount:
self
.
tax_amount
.
to_f
,
tax_amount:
self
.
tax_amount
.
to_f
,
line_items:
self
.
line_items
.
order
(
:id
).
each
.
map
(
&
:to_invoicing_export
),
line_items:
self
.
line_items
.
order
(
:id
).
each
.
map
(
&
:to_invoicing_export
),
description:
self
.
description
,
description:
self
.
description
,
deposit:
self
.
deposit
,
subscription:
self
.
subscription
,
}
}
# sender and recipient should be defined in subclass
# sender and recipient should be defined in subclass
return
result
return
result
...
...
spec/models/member_credit_note_spec.rb
View file @
481c801f
...
@@ -86,6 +86,7 @@ describe MemberInvoice do
...
@@ -86,6 +86,7 @@ describe MemberInvoice do
net_amount:
0.0
,
net_amount:
0.0
,
line_items:
[],
line_items:
[],
deposit:
false
,
deposit:
false
,
subscription:
false
,
payment_method:
"direct_debit"
payment_method:
"direct_debit"
})
})
end
end
...
...
spec/models/member_invoice_spec.rb
View file @
481c801f
...
@@ -140,6 +140,7 @@ describe MemberInvoice do
...
@@ -140,6 +140,7 @@ describe MemberInvoice do
net_amount:
0.0
,
net_amount:
0.0
,
line_items:
[],
line_items:
[],
deposit:
false
,
deposit:
false
,
subscription:
false
,
payment_method:
"direct_debit"
payment_method:
"direct_debit"
})
})
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment