From: Werner Hahn Date: Thu, 24 Jun 2021 12:24:23 +0000 (+0200) Subject: WooCommerce Shopware: paymentid im Shoporder setzen X-Git-Tag: kivitendo-mebil_0.1-0~9^2~140 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=841762994976f7cdbdf1ab5c4bdcbf9daf8230e1;p=kivitendo-erp.git WooCommerce Shopware: paymentid im Shoporder setzen --- diff --git a/SL/ShopConnector/Shopware.pm b/SL/ShopConnector/Shopware.pm index 79f7cd632..97571609f 100644 --- a/SL/ShopConnector/Shopware.pm +++ b/SL/ShopConnector/Shopware.pm @@ -11,6 +11,7 @@ use LWP::Authen::Digest; use SL::DB::ShopOrder; use SL::DB::ShopOrderItem; use SL::DB::History; +use SL::DB::PaymentTerm; use DateTime::Format::Strptime; use SL::DB::File; use Data::Dumper; @@ -185,6 +186,11 @@ sub map_data_to_shoporder { my $shop_id = $self->config->id; my $tax_included = $self->config->pricetype; + # Mapping Zahlungsmethoden muss an Firmenkonfiguration angepasst werden + my %payment_ids_methods = ( + # shopware_paymentId => kivitendo_payment_id + ); + my $default_payment_id = SL::DB::Manager::PaymentTerm->get_first()->id || undef; # Mapping to table shoporders. See http://community.shopware.com/_detail_1690.html#GET_.28Liste.29 my %columns = ( amount => $import->{data}->{invoiceAmount}, @@ -232,7 +238,7 @@ sub map_data_to_shoporder { netamount => $import->{data}->{invoiceAmountNet}, order_date => $orderdate, payment_description => $import->{data}->{payment}->{description}, - payment_id => $import->{data}->{paymentId}, + payment_id => $payment_ids_methods{$import->{data}->{paymentId}} || $default_payment_id, remote_ip => $import->{data}->{remoteAddress}, sepa_account_holder => $import->{data}->{paymentIntances}->{accountHolder}, sepa_bic => $import->{data}->{paymentIntances}->{bic}, diff --git a/SL/ShopConnector/WooCommerce.pm b/SL/ShopConnector/WooCommerce.pm index 06a4b39d8..1be37d00b 100644 --- a/SL/ShopConnector/WooCommerce.pm +++ b/SL/ShopConnector/WooCommerce.pm @@ -9,6 +9,7 @@ use LWP::UserAgent; use LWP::Authen::Digest; use SL::DB::ShopOrder; use SL::DB::ShopOrderItem; +use SL::DB::PaymentTerm; use SL::DB::History; use SL::DB::File; use Data::Dumper; @@ -205,9 +206,9 @@ sub map_data_to_shoporder { } # Mapping Zahlungsmethoden muss an Firmenkonfiguration angepasst werden my %payment_ids_methods = ( - 'paypal' => 2489, - 'german_market_purchase_on_account' => 2487, - ); + # woocommerce_payment_method_title => kivitendo_payment_id + ); + my $default_payment_id = SL::DB::Manager::PaymentTerm->get_first()->id || undef; my %columns = ( #billing Shop can have different billing addresses, and may have 1 customer_address billing_firstname => $import->{billing}->{first_name}, @@ -297,7 +298,7 @@ sub map_data_to_shoporder { #prices_include_tax tax_included => $tax_included, #payment_method - payment_id => $payment_ids_methods{$import->{payment_method}} || 2487, + payment_id => $payment_ids_methods{$import->{payment_method}} || $default_payment_id, #payment_method_title payment_description => $import->{payment_method_title}, #transaction_id