X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/457e1237959ddf06c2198e2fba1768adc8053840..6ff27683f4db6c02be0b39bd643572fda7db59fd:/SL/ShopConnector/WooCommerce.pm diff --git a/SL/ShopConnector/WooCommerce.pm b/SL/ShopConnector/WooCommerce.pm index 210170781..77aea400b 100644 --- a/SL/ShopConnector/WooCommerce.pm +++ b/SL/ShopConnector/WooCommerce.pm @@ -32,6 +32,7 @@ sub get_one_order { if($answer->{success}) { my $shoporder = $answer->{data}; + $main::lxdebug->dump(0, 'WH: ANSWER ', $answer); $dbh->with_transaction( sub{ #update status on server $shoporder->{status} = "processing"; @@ -161,7 +162,7 @@ sub import_data_to_shop_order { $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_part = SL::DB::Manager::Part->find_by( id => $self->config->shipping_costs_parts_id); my %shipping_pos = ( description => $import->{data}->{dispatch}->{name}, partnumber => $shipping_part->partnumber, @@ -206,7 +207,8 @@ sub map_data_to_shoporder { my %payment_ids_methods = ( # woocommerce_payment_method_title => kivitendo_payment_id ); - my $default_payment_id = SL::DB::Manager::PaymentTerm->get_first()->id || undef; + my $default_payment = SL::DB::Manager::PaymentTerm->get_first(); + my $default_payment_id = $default_payment ? $default_payment->id : undef; my %columns = ( #billing Shop can have different billing addresses, and may have 1 customer_address billing_firstname => $import->{billing}->{first_name},