From: Jan Büren Date: Mon, 5 Jan 2015 12:23:36 +0000 (+0100) Subject: Lieferscheine benötigen auch Preisquellen X-Git-Tag: release-3.2.0beta~105 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=44310118d55217b2456a2ceab51b14c0bfb77bbc;p=kivitendo-erp.git Lieferscheine benötigen auch Preisquellen -> customervendor Funktion auch für Lieferscheine -> Typ Kunde oder Lieferant (is_customer) entsprechend analog --- diff --git a/SL/Controller/PriceSource.pm b/SL/Controller/PriceSource.pm index ab74da015..555b03e35 100644 --- a/SL/Controller/PriceSource.pm +++ b/SL/Controller/PriceSource.pm @@ -161,6 +161,7 @@ sub _make_record { $obj->items(@items) if @items; } + $obj->is_sales(!!$obj->customer_id) if $class eq 'SL::DB::DeliveryOrder'; return $obj; } diff --git a/SL/DB/DeliveryOrder.pm b/SL/DB/DeliveryOrder.pm index 68997416c..9c405f52a 100644 --- a/SL/DB/DeliveryOrder.pm +++ b/SL/DB/DeliveryOrder.pm @@ -171,6 +171,10 @@ sub new_from { return ($delivery_order, $custom_shipto); } +sub customervendor { + $_[0]->is_sales ? $_[0]->customer : $_[0]->vendor; +} + 1; __END__ diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index c4f656714..849e8df5a 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -2015,6 +2015,7 @@ sub _make_record { } $obj->items(@items) if @items; + $obj->is_sales(!!$obj->customer_id) if $class eq 'SL::DB::DeliveryOrder'; return $obj; }