Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / SL / PriceSource / Customer.pm
index c0cfbc0..fe67d91 100644 (file)
@@ -43,7 +43,7 @@ sub discount_from_source {
     )
   }
 
-  if (!$self->record->customer) {
+  if (!$self->record->can('customer') || !$self->record->customer) {
     return SL::PriceSource::Discount->new(
       discount     => $customer->discount,
       spec         => $customer->id,
@@ -59,7 +59,7 @@ sub discount_from_source {
       spec         => $customer->id,
       description  => t8('Customer Discount'),
       price_source => $self,
-      invalid      => t8('This discount is only valid for customer #1', $customer->full_description),
+      invalid      => t8('This discount is only valid for customer #1', $customer->displayable_name),
     )
   }