X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FShopOrder.pm;h=ae5d8568f72a730b955f02a72c4c8c34aa726ee3;hb=670a6e6cb58ccaef212150406b66a955295fe074;hp=8ee8d0ec35b354ccd353de23bf2aee0f8c245fb9;hpb=14fd87107e86d96894c3f731245172ec04554dd1;p=kivitendo-erp.git diff --git a/SL/DB/ShopOrder.pm b/SL/DB/ShopOrder.pm index 8ee8d0ec3..ae5d8568f 100644 --- a/SL/DB/ShopOrder.pm +++ b/SL/DB/ShopOrder.pm @@ -96,7 +96,7 @@ sub convert_to_sales_order { intnotes => $customer->notes, salesman_id => $employee->id, taxincluded => $self->tax_included, - payment_id => $customer->payment_id, + payment_id => $self->payment_id, taxzone_id => $customer->taxzone_id, currency_id => $customer->currency_id, transaction_description => $shop->transaction_description, @@ -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,