Mostra in admin anagrafica e dati fiscali delle società.

Così Ops può emettere fattura dalla scheda club senza cercare il profilo solo tra i pagamenti pending.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-10 16:17:20 +02:00
co-authored by Cursor
parent adfea01cdb
commit d7dd744c32
15 changed files with 293 additions and 8 deletions
@@ -59,18 +59,43 @@ module ClubBillingProfile
def billing_profile_invoice_lines
lines = []
lines << ["Tipo", self.class.billing_entity_types[billing_entity_type]] if billing_entity_type.present?
lines << ["Intestatario", billing_legal_name]
lines << ["Intestatario", billing_legal_name] if billing_legal_name.present?
lines << ["P.IVA", billing_vat_number] if billing_vat_number.present?
lines << ["Codice fiscale", billing_fiscal_code] if billing_fiscal_code.present?
lines << ["Email fatturazione", billing_email]
lines << ["Email fatturazione", billing_email] if billing_email.present?
lines << ["Telefono", billing_phone] if billing_phone.present?
addr = [billing_address_line, billing_postal_code, billing_city, billing_province, billing_country].compact.join(", ")
lines << ["Indirizzo", addr] if addr.present?
core_address = [billing_address_line, billing_postal_code, billing_city, billing_province].compact_blank
if core_address.any?
core_address << billing_country if billing_country.present?
lines << ["Indirizzo", core_address.join(", ")]
end
lines << ["SDI", billing_recipient_code] if billing_recipient_code.present?
lines << ["PEC", billing_pec] if billing_pec.present?
lines
end
# Stato profilo fiscale per badge admin: :complete | :incomplete | :absent
def billing_profile_admin_status
return :complete if billing_profile_complete?
return :absent unless billing_profile_started?
:incomplete
end
def billing_profile_started?
billing_legal_name.present? ||
billing_vat_number.present? ||
billing_fiscal_code.present? ||
billing_email.present? ||
billing_phone.present? ||
billing_address_line.present? ||
billing_city.present? ||
billing_postal_code.present? ||
billing_province.present? ||
billing_recipient_code.present? ||
billing_pec.present?
end
private
def billing_profile_for_invoicing