From 44310118d55217b2456a2ceab51b14c0bfb77bbc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Mon, 5 Jan 2015 13:23:36 +0100 Subject: [PATCH] =?utf8?q?Lieferscheine=20ben=C3=B6tigen=20auch=20Preisque?= =?utf8?q?llen=20=20->=20customervendor=20Funktion=20auch=20f=C3=BCr=20Lie?= =?utf8?q?ferscheine=20=20->=20Typ=20Kunde=20oder=20Lieferant=20(is=5Fcust?= =?utf8?q?omer)=20entsprechend=20analog?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/PriceSource.pm | 1 + SL/DB/DeliveryOrder.pm | 4 ++++ bin/mozilla/io.pl | 1 + 3 files changed, 6 insertions(+) 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; } -- 2.20.1