|
|
@ -133,14 +133,23 @@ class Organisation < ApplicationRecord |
|
|
|
:active |
|
|
|
:active |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def duplicate_lettings_logs_sets |
|
|
|
def editable_duplicate_lettings_logs_sets |
|
|
|
lettings_logs.duplicate_sets.map { |array_str| array_str ? array_str.map(&:to_i) : [] } |
|
|
|
all_sets = lettings_logs.duplicate_sets.map { |array_str| array_str ? array_str.map(&:to_i) : [] } |
|
|
|
|
|
|
|
editable_sets = [] |
|
|
|
|
|
|
|
all_sets.each do |set| |
|
|
|
|
|
|
|
editable_sets << set if LettingsLog.find(set.first).collection_period_open_for_editing? |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
editable_sets |
|
|
|
def duplicate_sales_logs_sets |
|
|
|
|
|
|
|
sales_logs.duplicate_sets.map { |array_str| array_str ? array_str.map(&:to_i) : [] } |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def editable_duplicate_sales_logs_sets |
|
|
|
|
|
|
|
all_sets = sales_logs.duplicate_sets.map { |array_str| array_str ? array_str.map(&:to_i) : [] } |
|
|
|
|
|
|
|
editable_sets = [] |
|
|
|
|
|
|
|
all_sets.each do |set| |
|
|
|
|
|
|
|
editable_sets << set if SalesLog.find(set.first).collection_period_open_for_editing? |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
editable_sets |
|
|
|
|
|
|
|
end |
|
|
|
def recently_absorbed_organisations_grouped_by_merge_date |
|
|
|
def recently_absorbed_organisations_grouped_by_merge_date |
|
|
|
return unless absorbed_organisations.present? && absorbed_organisations.merged_during_open_collection_period.present? |
|
|
|
return unless absorbed_organisations.present? && absorbed_organisations.merged_during_open_collection_period.present? |
|
|
|
|
|
|
|
|
|
|
|