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