fix: include Fee Type in export when Start Date not in fields

Append membership_fee_type to column list when it is visible but
membership_fee_start_date was not in the selection (MemberExport,
export_column_order, build_export_member_fields_list).
This commit is contained in:
Moritz 2026-02-24 09:15:08 +01:00
parent 94bcb5dc8c
commit 1c8c5ae83b
Signed by: moritz
GPG key ID: 1020A035E5DD0824

View file

@ -433,6 +433,14 @@ defmodule Mv.Membership.MemberExport do
expand_field_with_computed(f, member_fields, computed_fields)
end)
# If fee type is visible but start_date was not in the list, it won't be in db_with_insert
db_with_insert =
if "membership_fee_type" in member_fields and "membership_fee_type" not in db_with_insert do
db_with_insert ++ ["membership_fee_type"]
else
db_with_insert
end
remaining = Enum.reject(computed_fields, &(&1 in db_with_insert))
db_with_insert ++ remaining
end