X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FDB%2FShopOrder.pm;fp=SL%2FDB%2FShopOrder.pm;h=6a53387b52de4df62441a347c604b157f83bc0c5;hb=b293ff8ad52fc76ba0c44783e3982418114d6b08;hp=ae5d8568f72a730b955f02a72c4c8c34aa726ee3;hpb=d4925a8b60f04674885e30d9316dc0263f8b9a84;p=kivitendo-erp.git diff --git a/SL/DB/ShopOrder.pm b/SL/DB/ShopOrder.pm index ae5d8568f..6a53387b5 100644 --- a/SL/DB/ShopOrder.pm +++ b/SL/DB/ShopOrder.pm @@ -48,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, @@ -137,11 +138,11 @@ WHERE ( OR ( street % ? AND zipcode ILIKE ?) OR - email ILIKE ? + ( email ILIKE ? OR invoice_mail ILIKE ? ) ) AND obsolete = 'F' SQL - my @values = ($lastname, $company, $self->billing_zipcode, $street, $self->billing_zipcode, $self->billing_email); + my @values = ($lastname, $company, $self->billing_zipcode, $street, $self->billing_zipcode, $self->billing_email, $self->billing_email); $customers = SL::DB::Manager::Customer->get_objects_from_sql( sql => $fs_query, @@ -151,20 +152,24 @@ SQL # If trgm extension is not installed $customers = SL::DB::Manager::Customer->get_all( where => [ - or => [ - and => [ - or => [ 'name' => { ilike => $lastname }, - 'name' => { ilike => $company }, - ], - 'zipcode' => { ilike => $zipcode }, + or => [ + and => [ + or => [ 'name' => { ilike => $lastname }, + 'name' => { ilike => $company }, + ], + 'zipcode' => { ilike => $zipcode }, ], - and => [ - and => [ 'street' => { ilike => $street_not_fuzzy }, - 'zipcode' => { ilike => $zipcode }, + and => [ + and => [ 'street' => { ilike => $street_not_fuzzy }, + 'zipcode' => { ilike => $zipcode }, ], ], - or => [ 'email' => { ilike => $email } ], - ], + or => [ + 'email' => { ilike => $email }, + 'invoice_mail' => { ilike => $email }, + ], + ], + and => [ obsolete => 'F' ] ], ); } @@ -198,6 +203,7 @@ sub get_customer{ 'zipcode' => $self->billing_zipcode, 'city' => $self->billing_city, 'email' => $self->billing_email, + 'invoice_mail' => $self->billing_email, 'country' => $self->billing_country, 'greeting' => $self->billing_greeting, 'fax' => $self->billing_fax, @@ -233,6 +239,7 @@ sub get_customer{ obsolete => 'F', ); } + $customer->update_attributes(invoice_mail => $self->billing_email) if $customer->invoice_mail ne $self->billing_email; return $customer; }