From: Werner Hahn Date: Thu, 24 Jun 2021 09:31:03 +0000 (+0200) Subject: WebshopApi: Zahlungsbedingung beim Kundenanlegen ... X-Git-Tag: kivitendo-mebil_0.1-0~9^2~143 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=14fd87107e86d96894c3f731245172ec04554dd1;p=kivitendo-erp.git WebshopApi: Zahlungsbedingung beim Kundenanlegen ... für den Kunden die die 1. Zahlungsbedingung übernehmen --- diff --git a/SL/DB/ShopOrder.pm b/SL/DB/ShopOrder.pm index 2752de627..8ee8d0ec3 100644 --- a/SL/DB/ShopOrder.pm +++ b/SL/DB/ShopOrder.pm @@ -9,6 +9,7 @@ use SL::DBUtils; use SL::DB::Shop; use SL::DB::MetaSetup::ShopOrder; use SL::DB::Manager::ShopOrder; +use SL::DB::PaymentTerm; use SL::DB::Helper::LinkedRecords; use SL::Locale::String qw(t8); use Carp; @@ -187,6 +188,7 @@ 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; if(!scalar(@{$customer_proposals})){ my %address = ( 'name' => $name, 'department_1' => $self->billing_company, @@ -205,7 +207,7 @@ sub get_customer{ 'pricegroup_id' => (split '\/',$shop->price_source)[0] eq "pricegroup" ? (split '\/',$shop->price_source)[1] : undef, 'taxzone_id' => $shop->taxzone_id, 'currency' => $::instance_conf->get_currency_id, - #'payment_id' => 7345,# TODO hardcoded + 'payment_id' => $payment_id, ); $customer = SL::DB::Customer->new(%address);