Skip to content

Commit

Permalink
fix: error regression
Browse files Browse the repository at this point in the history
  • Loading branch information
diegosteiner committed Jan 7, 2025
1 parent 3e0477c commit e91b2c7
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion app/models/concerns/booking_state_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def apply_transitions(transitions = transition_to, metadata: nil, infer_transiti
end

def update_booking_state_cache!
Rails.logger.info("Booking<#{id}>@#{booking_state&.to_s}")
return unless booking_state_cache != booking_state&.to_s

update_columns(booking_state_cache: booking_state.to_s, updated_at: Time.zone.now) # rubocop:disable Rails/SkipsModelValidations
Expand Down
5 changes: 5 additions & 0 deletions app/models/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class Invoice < ApplicationRecord
before_update :generate_pdf, if: :generate_pdf?
after_save :recalculate!
after_save :generate_journal_entries!, if: :generate_journal_entries?
after_save :update_payments
after_discard :generate_journal_entries!, if: :generate_journal_entries?

delegate :currency, to: :organisation
Expand All @@ -94,6 +95,10 @@ def supersede!
supersede_invoice.discard!
end

def update_payments
payments.each { _1.update!(booking_id:) }
end

def sequence_number
self[:sequence_number] ||= organisation.key_sequences.key(::Invoice.sti_name, year: sequence_year).lease!
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/manage/data_digest_templates/_form.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
= f.fields_for :prefilter_params, @data_digest_template.prefilter do |ff|
= render partial: @data_digest_template.filter_class.to_partial_path('filter_fields'), locals: { f: ff }

= render partial: @data_digest_template.to_partial_path('form_fields'), locals: { data_digest_template: @data_digest_template }
= render partial: 'renderables/data_digest_templates/tabular/form_fields', locals: { data_digest_template: @data_digest_template }

= f.submit

2 changes: 1 addition & 1 deletion app/views/manage/data_digests/show.html.slim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
h1.mt-0= @data_digest.label
p= @data_digest.localized_period

= render partial: @data_digest.data_digest_template.to_partial_path('show_data_digest'), locals: { data_digest: @data_digest }
= render partial: 'renderables/data_digest_templates/tabular/show_data_digest', locals: { data_digest: @data_digest }

br
.btn-group
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit e91b2c7

Please sign in to comment.