Revision e66c12b7
Von Werner Hahn vor mehr als 6 Jahren hinzugefügt
SL/Controller/ShopOrder.pm | ||
---|---|---|
32 | 32 |
foreach my $shop_config ( @{ $active_shops } ) { |
33 | 33 |
my $shop = SL::Shop->new( config => $shop_config ); |
34 | 34 |
my $new_orders = $shop->connector->get_new_orders; |
35 |
push @{ $orders_fetched },@{ $new_orders }; |
|
35 |
# push @{ $orders_fetched },@{ $new_orders };
|
|
36 | 36 |
}; |
37 |
flash_later('info', t8('#1 shoporders has been fetched', scalar(@{$orders_fetched})-1)); |
|
37 |
$main::lxdebug->dump(0, 'WH:OF ',$orders_fetched); |
|
38 |
|
|
39 |
# flash('info', t8('#1 shoporders has been fetched', scalar(@{$orders_fetched})-1)); |
|
38 | 40 |
$self->action_list; |
39 | 41 |
} |
40 | 42 |
|
... | ... | |
68 | 70 |
sub action_show { |
69 | 71 |
my ( $self ) = @_; |
70 | 72 |
my $id = $::form->{id} || {}; |
71 |
my $shop_order = SL::DB::Manager::ShopOrder->find_by( id => $id , with_objects => ['kivi_customer'] );
|
|
73 |
my $shop_order = SL::DB::ShopOrder->new( id => $id )->load( with => ['kivi_customer'] );
|
|
72 | 74 |
die "can't find shoporder with id $id" unless $shop_order; |
73 | 75 |
|
74 |
# Only Customers which are not found will be applied |
|
75 |
my $name = $shop_order->billing_lastname ne '' ? "%" . $shop_order->billing_firstname . "%" . $shop_order->billing_lastname . "%" : ''; |
|
76 |
my $lastname = $shop_order->billing_lastname ne '' ? "%" . $shop_order->billing_lastname . "%" : ''; |
|
77 |
my $company = $shop_order->billing_company ne '' ? "%" . $shop_order->billing_company . "%" : ''; |
|
78 |
my $street = $shop_order->billing_street ne '' ? $shop_order->billing_street : ''; |
|
79 |
# Fuzzysearch for street to find e.g. "Dorfstrasse - Dorfstr. - Dorfstraße" |
|
80 |
my $dbh = $::form->get_standard_dbh(); |
|
81 |
my $fs_query = "SELECT id FROM customer WHERE ( ( ( name ILIKE ? |
|
82 |
OR name ILIKE ? |
|
83 |
) |
|
84 |
AND zipcode ILIKE ? |
|
85 |
) |
|
86 |
OR ( street % ? |
|
87 |
AND zipcode ILIKE ? |
|
88 |
) |
|
89 |
OR email ILIKE ? |
|
90 |
)"; |
|
91 |
my @values = ($lastname, $company, $shop_order->billing_zipcode, $street, $shop_order->billing_zipcode, $shop_order->billing_email); |
|
92 |
my @c_ids = selectall_array_query($::form, $dbh, $fs_query, @values); |
|
93 |
|
|
94 |
my $proposals = SL::DB::Manager::Customer->get_all( |
|
95 |
query => [ id => [ @c_ids ], ], |
|
96 |
); |
|
76 |
my $proposals = $shop_order->check_for_existing_customers; |
|
97 | 77 |
|
98 | 78 |
$self->render('shop_order/show', |
99 | 79 |
title => t8('Shoporder'), |
... | ... | |
128 | 108 |
die "Can't load shop_order form form->import_id" unless $self->shop_order; |
129 | 109 |
|
130 | 110 |
my $order = $self->shop_order->convert_to_sales_order(customer => $customer, employee => $employee); |
131 |
|
|
111 |
## price_tax_calculator |
|
132 | 112 |
if ($order->{error}){ |
133 | 113 |
flash_later('error',@{$order->{errors}}); |
134 | 114 |
$self->redirect_to(controller => "ShopOrder", action => 'show', id => $self->shop_order->id); |
Auch abrufbar als: Unified diff
Shopmodul: Bilder hochladen geht jetzt
Bestellungen überarbeitet, Teile aus dem ShowareConnector ausgelagert, da diese allgemeingültig auch für andere Connectoren sind
Typo