diff --git a/app/models/p_customer_sheet.rb b/app/models/p_customer_sheet.rb index 974391f..e43e428 100644 --- a/app/models/p_customer_sheet.rb +++ b/app/models/p_customer_sheet.rb @@ -103,7 +103,9 @@ class PCustomerSheet < ApplicationRecord end def ca_particular_infos - self.price_line_block.particular_bill.organisation + self.price_line_block.particular_bill.firstname + self.price_line_block.particular_bill.name + if self.price_line_block.particular_bill + self.price_line_block.particular_bill.organisation + self.price_line_block.particular_bill.firstname + self.price_line_block.particular_bill.name + end end diff --git a/app/views/admin/p_customers/show.html.haml b/app/views/admin/p_customers/show.html.haml index a877a99..406520a 100644 --- a/app/views/admin/p_customers/show.html.haml +++ b/app/views/admin/p_customers/show.html.haml @@ -160,7 +160,7 @@ #customer_adresses - =render(:partial => "admin/particulars/customer_preview", :locals => {:p_customer => @p_customer}) if !@p_customer.p_customer_cat.name == "Plateforme" + =render(:partial => "admin/particulars/customer_preview", :locals => {:p_customer => @p_customer}) if !@p_customer.p_customer_cat&.name == "Plateforme" @@ -179,7 +179,7 @@ %li.nav-item=link_to "Factures & Avoirs", "?tab=bills#tabs", :class => "nav-link"+(" active" if params[:tab] == "bills").to_s -if current_admin.has_permission?("payments") %li.nav-item=link_to "Paiements", "?tab=payments#tabs", :class => "nav-link"+(" active" if params[:tab] == "payments").to_s - -if current_admin.has_permission?("payments") and @p_customer.p_customer_cat.name == "Plateforme" + -if current_admin.has_permission?("payments") and @p_customer.p_customer_cat&.name == "Plateforme" %li.nav-item=link_to "Adresses", "?tab=adresses#tabs", :class => "nav-link"+(" active" if params[:tab] == "adresses").to_s