mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-18 07:52:23 +01:00
hide organization custom field if value is empty in invoice
This commit is contained in:
parent
78076b7fba
commit
d0f7be41a0
@ -61,7 +61,11 @@ class PDF::Invoice < Prawn::Document
|
||||
if invoice&.invoicing_profile&.organization
|
||||
name = invoice.invoicing_profile.organization.name
|
||||
full_name = "#{name} (#{invoice.invoicing_profile.full_name})"
|
||||
others = invoice&.invoicing_profile&.user_profile_custom_fields&.includes(:profile_custom_field)&.map do |f|
|
||||
others = invoice&.invoicing_profile&.user_profile_custom_fields&.joins(:profile_custom_field)
|
||||
&.where('profile_custom_fields.actived' => true)
|
||||
&.order('profile_custom_fields.id ASC')
|
||||
&.select { |f| f.value.present? }
|
||||
&.map do |f|
|
||||
"#{f.profile_custom_field.label}: #{f.value}"
|
||||
end
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user