Wechsel eines Kunden-/Lieferanten mit Typ zu einem ohne …
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Sun, 26 Apr 2015 15:59:11 +0000 (17:59 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Sun, 26 Apr 2015 15:59:11 +0000 (17:59 +0200)
… beim Bestimmen des Rabatts abfangen.

SL/PriceSource/Business.pm

index ca66c5d..fc7b298 100644 (file)
@@ -50,13 +50,14 @@ sub price_from_source {
     )
   }
 
-  if ($business->id != $self->customer_vendor->business->id) {
+  if (!$self->customer_vendor->business ||
+      $business->id != $self->customer_vendor->business->id) {
     return SL::PriceSource::Discount->new(
       discount     => $business->discount,
       spec         => $business->id,
       description  => t8('Business Discount'),
       price_source => $self,
-      invalid      => t8('This discount is only valid for business #1', $business->full_description),
+      invalid      => t8('This discount is only valid for business #1', $business->displayable_name),
     )
   }