Revision 3b239c98
Von Werner Hahn vor mehr als 6 Jahren hinzugefügt
SL/Controller/ShopOrder.pm | ||
---|---|---|
45 | 45 |
my $sort_by = $::form->{sort_by} ? $::form->{sort_by} : 'order_date'; |
46 | 46 |
$sort_by .=$::form->{sort_dir} ? ' DESC' : ' ASC'; |
47 | 47 |
my $shop_orders = SL::DB::Manager::ShopOrder->get_all( %filter, sort_by => $sort_by, |
48 |
with_objects => ['shop_order_items'], |
|
49 |
with_objects => ['customer'], |
|
48 |
with_objects => ['shop_order_items', 'kivi_customer'], |
|
50 | 49 |
); |
51 | 50 |
|
52 | 51 |
foreach my $shop_order(@{ $shop_orders }){ |
... | ... | |
69 | 68 |
sub action_show { |
70 | 69 |
my ( $self ) = @_; |
71 | 70 |
my $id = $::form->{id} || {}; |
72 |
my $shop_order = SL::DB::Manager::ShopOrder->get_all(query => [ id => $id ], |
|
73 |
with_objects => ['customer'], )->[0]; |
|
71 |
my $shop_order = SL::DB::Manager::ShopOrder->find_by( id => $id , with_objects => ['kivi_customer'] ); |
|
74 | 72 |
die "can't find shoporder with id $id" unless $shop_order; |
75 | 73 |
|
76 |
# the different importaddresscheck if there complete in the customer table to prevent duplicats inserts |
|
77 |
my %customer_address = ( 'name' => $shop_order->customer_lastname, |
|
78 |
'company' => $shop_order->customer_company, |
|
79 |
'street' => $shop_order->customer_street, |
|
80 |
'zipcode' => $shop_order->customer_zipcode, |
|
81 |
'city' => $shop_order->customer_city, |
|
82 |
); |
|
83 |
my %billing_address = ( 'name' => $shop_order->billing_lastname, |
|
84 |
'company' => $shop_order->billing_company, |
|
85 |
'street' => $shop_order->billing_street, |
|
86 |
'zipcode' => $shop_order->billing_zipcode, |
|
87 |
'city' => $shop_order->billing_city, |
|
88 |
); |
|
89 |
my %delivery_address = ( 'name' => $shop_order->delivery_lastname, |
|
90 |
'company' => $shop_order->delivery_company, |
|
91 |
'street' => $shop_order->delivery_street, |
|
92 |
'zipcode' => $shop_order->delivery_zipcode, |
|
93 |
'city' => $shop_order->delivery_city, |
|
94 |
); |
|
95 |
my $c_address = $self->check_address(%customer_address); |
|
96 |
my $b_address = $self->check_address(%billing_address); |
|
97 |
my $d_address = $self->check_address(%delivery_address); |
|
98 |
#### |
|
99 |
|
|
100 | 74 |
# Only Customers which are not found will be applied |
101 | 75 |
my $name = $shop_order->billing_lastname ne '' ? "%" . $shop_order->billing_firstname . "%" . $shop_order->billing_lastname . "%" : ''; |
102 | 76 |
my $lastname = $shop_order->billing_lastname ne '' ? "%" . $shop_order->billing_lastname . "%" : ''; |
Auch abrufbar als: Unified diff
Shopmodul: Shoporders Tbl geändert fkeys und unnötige spalten gelöscht
syntax im Shopoder Controller