mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-30 19:52:20 +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
|
if invoice&.invoicing_profile&.organization
|
||||||
name = invoice.invoicing_profile.organization.name
|
name = invoice.invoicing_profile.organization.name
|
||||||
full_name = "#{name} (#{invoice.invoicing_profile.full_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}"
|
"#{f.profile_custom_field.label}: #{f.value}"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user