1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

[bug] newly generated refund is displayed as broken

This commit is contained in:
Sylvain 2019-07-29 12:25:46 +02:00
parent 5e8697de18
commit 3d3be70e29
3 changed files with 8 additions and 5 deletions

View File

@ -2,6 +2,7 @@
- Fix a bug: no user can be created after the last member was deleted
- Fix a bug: unable to generate a refund (Avoir)
- Fix a bug: a newly generated refund is displayed as broken (unchained record) even if it is correctly chained
- Fix a security issue: updated lodash to 4.17.14 to fix [CVE-2019-10744](https://github.com/lodash/lodash/pull/4336)
- Fix a security issue: updated mini_magick to 4.9.4 to fix [CVE-2019-13574](https://nvd.nist.gov/vuln/detail/CVE-2019-13574)
- Fix some security issues: updated bootstrap to 3.4.1 to fix [CVE-2019-8331](https://nvd.nist.gov/vuln/detail/CVE-2019-8331), [CVE-2019-14041](https://nvd.nist.gov/vuln/detail/CVE-2018-14041), and 3 other low severity CVE

View File

@ -1,14 +1,15 @@
json.extract! @avoir, :id, :created_at, :reference, :invoiced_type, :avoir_date, :avoir_mode, :invoice_id
json.user_id @avoir.invoicing_profile.user_id
json.total (@avoir.total / 100.00)
json.total @avoir.total / 100.00
json.name @avoir.user.profile.full_name
json.has_avoir false
json.is_avoir true
json.date @avoir.avoir_date
json.chained_footprint @avoir.check_footprint
json.items @avoir.invoice_items do |item|
json.id item.id
json.stp_invoice_item_id item.stp_invoice_item_id
json.amount (item.amount / 100.0)
json.amount item.amount / 100.0
json.description item.description
json.invoice_item_id item.invoice_item_id
end
end

View File

@ -2,17 +2,18 @@
json.extract! @invoice, :id, :created_at, :reference, :invoiced_type, :avoir_date, :description
json.user_id @invoice.invoicing_profile&.user_id
json.total (@invoice.total / 100.00)
json.total @invoice.total / 100.00
json.name @invoice.user.profile.full_name
json.has_avoir @invoice.refunded?
json.is_avoir @invoice.is_a?(Avoir)
json.is_subscription_invoice @invoice.subscription_invoice?
json.stripe @invoice.stp_invoice_id?
json.date @invoice.is_a?(Avoir) ? @invoice.avoir_date : @invoice.created_at
json.chained_footprint @invoice.check_footprint
json.items @invoice.invoice_items do |item|
json.id item.id
json.stp_invoice_item_id item.stp_invoice_item_id
json.amount (item.amount / 100.0)
json.amount item.amount / 100.0
json.description item.description
json.avoir_item_id item.invoice_item.id if item.invoice_item
end