Revision 12194786
Von Werner Hahn vor mehr als 7 Jahren hinzugefügt
SL/BackgroundJob/ShopOrderMassTransfer.pm | ||
---|---|---|
60 | 60 |
$job_obj->update_attributes(data_as_hash => $data); |
61 | 61 |
}else{ |
62 | 62 |
$order->save; |
63 |
$order->calculate_prices_and_taxes; |
|
63 | 64 |
my $snumbers = "ordernumber_" . $order->ordnumber; |
64 | 65 |
SL::DB::History->new( |
65 | 66 |
trans_id => $order->id, |
SL/Controller/ShopOrder.pm | ||
---|---|---|
111 | 111 |
|
112 | 112 |
die "Can't load shop_order form form->import_id" unless $self->shop_order; |
113 | 113 |
my $order = $self->shop_order->convert_to_sales_order(customer => $customer, employee => $employee); |
114 |
$order->calculate_prices_and_taxes; |
|
115 | 114 |
|
116 | 115 |
if ($order->{error}){ |
117 | 116 |
flash_later('error',@{$order->{errors}}); |
118 | 117 |
$self->redirect_to(controller => "ShopOrder", action => 'show', id => $self->shop_order->id); |
119 | 118 |
}else{ |
120 | 119 |
$order->db->with_transaction( sub { |
120 |
$order->calculate_prices_and_taxes; |
|
121 | 121 |
$order->save; |
122 | 122 |
|
123 | 123 |
my $snumbers = "ordernumber_" . $order->ordnumber; |
SL/DB/ShopOrder.pm | ||
---|---|---|
5 | 5 |
|
6 | 6 |
use strict; |
7 | 7 |
|
8 |
use SL::DBUtils; |
|
8 | 9 |
use SL::DB::Shop; |
9 | 10 |
use SL::DB::MetaSetup::ShopOrder; |
10 | 11 |
use SL::DB::Manager::ShopOrder; |
... | ... | |
131 | 132 |
email ILIKE ? |
132 | 133 |
) AND obsolete = 'F' |
133 | 134 |
SQL |
135 |
|
|
136 |
# Fuzzysearch for street to find e.g. "Dorfstrasse - Dorfstr. - Dorfstraße" |
|
137 |
my $fs_subquery = <<SQL; |
|
138 |
SELECT id |
|
139 |
FROM customer |
|
140 |
WHERE ( |
|
141 |
( |
|
142 |
( name ILIKE ? OR name ILIKE ? ) |
|
143 |
AND |
|
144 |
zipcode ILIKE ? |
|
145 |
) |
|
146 |
OR |
|
147 |
( street % ? AND zipcode ILIKE ?) |
|
148 |
OR |
|
149 |
email ILIKE ? |
|
150 |
) AND obsolete = 'F' |
|
151 |
SQL |
|
152 |
|
|
134 | 153 |
my @values = ($lastname, $company, $self->billing_zipcode, $street, $self->billing_zipcode, $self->billing_email); |
135 |
my $customers = SL::DB::Manager::Customer->get_objects_from_sql( |
|
136 |
sql => $fs_query, |
|
137 |
args => \@values, |
|
138 |
); |
|
154 |
|
|
155 |
my $dbh = $::form->get_standard_dbh(); |
|
156 |
my @c_ids = ( 0 ); |
|
157 |
@c_ids = selectall_array_query($::form, $dbh, $fs_subquery, @values); |
|
158 |
@c_ids = ( 0 ) if( !scalar(@c_ids) ); |
|
159 |
my $customers = SL::DB::Manager::Customer->get_all( query => [ id => [ @c_ids ] ] ); |
|
160 |
|
|
161 |
# my $customers = SL::DB::Manager::Customer->get_objects_from_sql( |
|
162 |
# sql => $fs_query, |
|
163 |
# args => \@values, |
|
164 |
#); |
|
165 |
|
|
139 | 166 |
return $customers; |
140 | 167 |
} |
141 | 168 |
|
SL/ShopConnector/Shopware.pm | ||
---|---|---|
85 | 85 |
$shop_order->{positions} = $position-1; |
86 | 86 |
|
87 | 87 |
my $customer = $shop_order->get_customer; |
88 |
|
|
88 | 89 |
if(ref($customer)){ |
89 | 90 |
$shop_order->kivi_customer_id($customer->id); |
90 | 91 |
$shop_order->save; |
sql/Pg-upgrade2/trigram_indices.sql | ||
---|---|---|
1 | 1 |
-- @tag: trigram_indices |
2 | 2 |
-- @description: Trigram Indizes für häufig durchsuchte Spalten |
3 |
-- @depends: release_3_4_1 |
|
3 |
-- @depends: release_3_4_1 shops
|
|
4 | 4 |
-- @encoding: utf-8 |
5 | 5 |
-- @ignore: 1 |
6 | 6 |
|
Auch abrufbar als: Unified diff
Shopmodul: check_existing_customer umgeschrieben.