}
$shop_order->positions($position-1);
+ if ( $self->config->shipping_costs_parts_id ) {
+ my $shipping_part = SL::DB::Part->find_by( id => $self->config->shipping_costs_parts_id);
+ my %shipping_pos = ( description => $import->{data}->{dispatch}->{name},
+ partnumber => $shipping_part->partnumber,
+ price => $import->{data}->{invoiceShipping},
+ quantity => 1,
+ position => $position,
+ shop_trans_id => 0,
+ shop_order_id => $id,
+ );
+ my $shipping_pos_insert = SL::DB::ShopOrderItem->new(%shipping_pos);
+ $shipping_pos_insert->save;
+ }
+
my $customer = $shop_order->get_customer;
if(ref($customer)){
</tr>
<tr>
<th align="right">[% 'Default part for shipping costs' | $T8 %]</th>
- <td>[%- P.part.picker('shop.shipping_costs_parts_id', 'SELF.shop.shipping_costs_parts_id', style="width: 300px") %]</td>
+ <td>[%- P.part.picker('shop.shipping_costs_parts_id', SELF.shop.shipping_costs_parts_id, style="width: 300px") %]</td>
</tr>
<tr>
<th align="right">[% 'Obsolete' | $T8 %]</th>