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;
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},
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},
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;
}
# 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},
#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