mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-07 01:54:16 +01:00
(bug) no main item on some invoices
This commit is contained in:
parent
5dae938078
commit
8863ac7047
@ -1,5 +1,6 @@
|
|||||||
# Changelog Fab-manager
|
# Changelog Fab-manager
|
||||||
|
|
||||||
|
- Fix a bug: no main item on some invoices
|
||||||
- Fix a bug: unable to build accounting lines if no invoices
|
- Fix a bug: unable to build accounting lines if no invoices
|
||||||
- Fix a bug: unable to apply rounding correction on accounting lines
|
- Fix a bug: unable to apply rounding correction on accounting lines
|
||||||
- Fix a bug: empty object for some invoice item
|
- Fix a bug: empty object for some invoice item
|
||||||
|
@ -132,7 +132,12 @@ class Invoice < PaymentDocument
|
|||||||
end
|
end
|
||||||
|
|
||||||
def main_item
|
def main_item
|
||||||
invoice_items.where(main: true).first
|
main = invoice_items.where(main: true).first
|
||||||
|
if main.nil?
|
||||||
|
main = invoice_items.order(id: :asc).first
|
||||||
|
main&.update(main: true)
|
||||||
|
end
|
||||||
|
main
|
||||||
end
|
end
|
||||||
|
|
||||||
def other_items
|
def other_items
|
||||||
|
Loading…
x
Reference in New Issue
Block a user