X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/5202b3e71b817c6a78845cd4c27773760ff408b6..a3263b669347ae6cb6555bc01023c1bff3a1b9d4:/SL/DB/ShopOrder.pm diff --git a/SL/DB/ShopOrder.pm b/SL/DB/ShopOrder.pm index 2752de627..00399029b 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; @@ -47,7 +48,8 @@ sub convert_to_sales_order { }else{ my $current_order_item = SL::DB::OrderItem->new( parts_id => $part->id, - description => $part->description, + description => $_->description, # description from the shop + longdescription => $part->notes, # longdescription from parts. TODO locales qty => $_->quantity, sellprice => $_->price, unit => $part->unit, @@ -95,7 +97,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, @@ -187,6 +189,8 @@ sub get_customer{ my $customer_proposals = $self->check_for_existing_customers; my $name = $self->billing_firstname . " " . $self->billing_lastname; my $customer = 0; + 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, @@ -205,7 +209,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);