projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fd75174
)
DeliveryOrder: new_from - fix für Quellobjekte die keine Kunden/Lieferanten haben
author
Sven Schöling
<s.schoeling@googlemail.com>
Fri, 8 Oct 2021 16:02:49 +0000
(18:02 +0200)
committer
Jan Büren
<jan@kivitendo.de>
Mon, 14 Feb 2022 13:58:19 +0000
(14:58 +0100)
SL/DB/DeliveryOrder.pm
patch
|
blob
|
history
diff --git
a/SL/DB/DeliveryOrder.pm
b/SL/DB/DeliveryOrder.pm
index
a7c20cb
..
068d6c4
100644
(file)
--- a/
SL/DB/DeliveryOrder.pm
+++ b/
SL/DB/DeliveryOrder.pm
@@
-155,7
+155,8
@@
sub new_from {
# infer type from legacy fields if not given
$params{order_type} //= $source->customer_id ? 'sales_delivery_order'
: $source->vendor_id ? 'purchase_delivery_order'
- : undef;
+ : $source->is_sales ? 'sales_delivery_order'
+ : croak "need some way to set delivery order type from source";
# overwrite legacy is_sales from type_data
$args{is_sales} = SL::Controller::DeliveryOrder::TypeData::get3($params{order_type}, "properties", "is_customer");