From: Bernd Bleßmann Date: Sun, 26 Apr 2015 15:59:11 +0000 (+0200) Subject: Wechsel eines Kunden-/Lieferanten mit Typ zu einem ohne … X-Git-Tag: release-3.3.0beta~128 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=dc83feb1ebefe50e443a351a7d158517bc23d526;p=kivitendo-erp.git Wechsel eines Kunden-/Lieferanten mit Typ zu einem ohne … … beim Bestimmen des Rabatts abfangen. --- diff --git a/SL/PriceSource/Business.pm b/SL/PriceSource/Business.pm index ca66c5dba..fc7b298fc 100644 --- a/SL/PriceSource/Business.pm +++ b/SL/PriceSource/Business.pm @@ -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), ) }