X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/b3ba396b54121922f650c16d07ce8509efaa0e45..854500401fb91ccb0dfc4ff4115adc90f1cefcdc:/SL/Controller/Order.pm diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 79ff2934f..83938509f 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -151,6 +151,11 @@ sub action_add_item { $new_attr{sellprice} = $part->sellprice if ! $item->sellprice; $new_attr{discount} = $cv_discount if ! $item->discount; + # add_custom_variables adds cvars to an orderitem with no cvars for saving, but + # they cannot be retrieved via custom_variables until the order/orderitem is + # saved. Adding empty custom_variables to new orderitem here solves this problem. + $new_attr{custom_variables} = []; + $item->assign_attributes(%new_attr); $self->order->add_items($item);