]> wagnertech.de Git - kivitendo-erp.git/commitdiff
WebshopApi: Standardzahlungsbedingung korrigiert Syntax
authorWerner Hahn <wh@futureworldsearch.net>
Thu, 24 Jun 2021 14:40:40 +0000 (16:40 +0200)
committerWerner Hahn <wh@futureworldsearch.net>
Thu, 24 Jun 2021 14:45:39 +0000 (16:45 +0200)
SL/DB/ShopOrder.pm
SL/ShopConnector/Shopware.pm
SL/ShopConnector/WooCommerce.pm

index eef7b6ce52852231b010405de6b94c9a5c82a7ac..ae5d8568f72a730b955f02a72c4c8c34aa726ee3 100644 (file)
@@ -188,7 +188,8 @@ sub get_customer{
   my $customer_proposals = $self->check_for_existing_customers;
   my $name = $self->billing_firstname . " " . $self->billing_lastname;
   my $customer = 0;
-  my $payment_id = SL::DB::Manager::PaymentTerm->get_first()->id || undef;
+  my $default_payment    = SL::DB::Manager::PaymentTerm->get_first();
+  my $payment_id = $default_payment ? $default_payment->id : undef;
   if(!scalar(@{$customer_proposals})){
     my %address = ( 'name'                  => $name,
                     'department_1'          => $self->billing_company,
index 7e879bfefe7aa0292a2e02e219ad40e82e0e4b69..a777ddfb2e38ab8eae2b2d0fb324a79688d5c5b5 100644 (file)
@@ -190,7 +190,8 @@ sub map_data_to_shoporder {
   my %payment_ids_methods = (
     # shopware_paymentId => 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;
   # Mapping to table shoporders. See http://community.shopware.com/_detail_1690.html#GET_.28Liste.29
   my %columns = (
     amount                  => $import->{data}->{invoiceAmount},
index 21017078100d2e671d1c3a86998c1812b559b74f..c2e7c6fd42a68fd61d7bb8428987e48d26fda0b4 100644 (file)
@@ -206,7 +206,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},