commit be4b49e576514e1731c736ab35f96b3d68bf2a66
Author: Werner Hahn <wh@futureworldsearch.net>
Date:   Wed Oct 19 17:12:47 2016 +0200

    Shopmodul: Anpassungen nach mergen für master
    Bis hier noch mit individuellen Kundenanpassungen

diff --git a/SL/BackgroundJob/ShopOrderMassTransfer.pm b/SL/BackgroundJob/ShopOrderMassTransfer.pm
index 4bd0d9e0f..0142b0ef8 100644
--- a/SL/BackgroundJob/ShopOrderMassTransfer.pm
+++ b/SL/BackgroundJob/ShopOrderMassTransfer.pm
@@ -1,5 +1,5 @@
 package SL::BackgroundJob::ShopOrderMassTransfer;
-#BackgroundJob::ShopOrderMassTransfer
+
 use strict;
 use warnings;
 
@@ -27,7 +27,7 @@ use constant DONE                         => 2;
 # my $data                  = {
 #     shop_order_record_ids       => [ 603, 604, 605],
 #     num_order_created           => 0,
-#     num_delivery_order_created  => 0,
+#     orders_ids                  => [1,2,3]
 #     conversation_errors         => [ { id => 603 , item => 2, message => "Out of stock"}, ],
 # };
 #
@@ -45,7 +45,7 @@ sub create_order {
     # die "can't find shoporder with id $shop_order_id" unless $shop_order;
     #TODO Kundenabfrage so ändern, dass es nicht abricht
     unless($shop_order){
-      push @{ $error_report{$shop_order_id}} }, 'Shoporder not found';
+      push @{ $error_report{$shop_order_id} }, 'Shoporder not found';
     }
     my $customer = SL::DB::Manager::Customer->find_by(id => $shop_order->{kivi_customer_id});
     die "Can't find customer" unless $customer;
@@ -80,10 +80,11 @@ sub create_order {
       $shop_order->oe_transid($order->id);
       $shop_order->save;
       $shop_order->link_to_record($order);
-      $data->{num_created}++;
+      $data->{num_order_created} ++;
       push @{ $data->{orders_ids} }, $order->id;
       push @{ $data->{shop_orders_ids} }, $shop_order->id;
 
+      $job_obj->update_attributes(data_as_hash => $data);
       my $delivery_order = $order->convert_to_delivery_order(customer => $customer, employee => $employee);
       $delivery_order->save;
       my $snumbers = "deliveryordernumber_" . $delivery_order->donumber;
diff --git a/SL/Controller/FileUploader.pm b/SL/Controller/FileUploader.pm
index 35e563762..50c6772ac 100644
--- a/SL/Controller/FileUploader.pm
+++ b/SL/Controller/FileUploader.pm
@@ -21,21 +21,6 @@ sub action_test_page{
   $self->render('fileuploader/test_page');
 }
 
-sub action_upload_form{
-  my ($self) = @_;
-  $self->file(SL::DB::File->new);
-  $self->render('common/file_upload', {header => 0});
-}
-
-sub action_show_files {
-  my ($self) = @_;
-$main::lxdebug->dump(0, 'WH: Show_Files',\$::form);
-  my $images = SL::DB::Manager::File->get_all( query => [ trans_id => $::form->{id}, modul => $::form->{modul} ] );
-  $main::lxdebug->dump(0, 'WH: ',\$images);
-
-
-}
-
 sub action_ajax_add_file{
   my ($self) = @_;
   $self->file( $::form->{id} ? SL::DB::File->new(id => $::form->{id})->load : SL::DB::File->new );
@@ -60,45 +45,6 @@ sub validate_filetype {
   return @errors
 }
 
-sub action_upload_form{
-  my ($self) = @_;
-  $self->file(SL::DB::File->new);
-  $self->render('common/file_upload', {header => 0});
-}
-
-sub action_show_files {
-  my ($self) = @_;
-
-
-sub action_ajax_add_file{
-  my ($self) = @_;
-  $self->file(SL::DB::File->new);
-  $self->render('common/file_upload', { layout => 0}, DATA => $::form);
-}
-
-sub action_ajax_upload_file{
-  my ($self, %params) = @_;
-  my $attributes                  = $::form->{ $::form->{form_prefix} } || die "Missing FormPrefix";
-  $attributes->{trans_id}         = $::form->{id} || die "Missing ID";
-  $attributes->{modul}            = $::form->{modul} || die "Missing Modul";
-  $attributes->{filename}         = $::form->{FILENAME} || die "Missing Filename";
-  $attributes->{title}            = $::form->{ $::form->{form_prefix} }->{title};
-  $attributes->{description}      = $::form->{ $::form->{form_prefix} }->{description};
-  my @image_types = ("jpg","tif","png");
-
-  my @errors = $self->file(SL::DB::File->new(%{ $attributes }))->validate;
-  return $self->js->error(@errors)->render($self) if @errors;
-
-  $self->file->save;
-
-  # TODO js call
-  $self->render('fileuploader/test_page');
-}
-
-#
-# helpers
-#
-
 sub init_file {
   return SL::DB::File->new(id => $::form->{id})->load;
 }
@@ -122,7 +68,16 @@ SL::Controller::FileUploader - Controller to manage fileuploads
 
 =head1 DESCRIPTION
 
-# longer description...
+ just the action ajax_add_file is needed and its automaticly called by. The other ones are for the testpage templates/webpages/testpage.html
+ kivi.add.file(id[shop_part_id,part_id, cv_id, project_id,...],modul[part,shop_part,project,IC,...],controller_action[ShopPart/do_something_file],allowed_filestypes) in your template.
+ [% L.button_tag("kivi.add_file(this.form.id.value,'shop_part', 'Part/do_something_with_file','jpg,png,gif,pdf')", 'Fileupload') %]
+
+ The called Controller/Action deals with the uploaded file in wich you can do whatever you want with the file.
+ like
+ - Store it in the Database SL::DB::File
+ - Store it in Webdav
+ - Store it in Webdav and DB (be careful: files wich deleted in the filesystem will not be deleted in the database automaticly)
+ - do something very fancy with the file
 
 
 =head1 INTERFACE
diff --git a/SL/Controller/ShopOrder.pm b/SL/Controller/ShopOrder.pm
index 8609a7e2c..005283950 100644
--- a/SL/Controller/ShopOrder.pm
+++ b/SL/Controller/ShopOrder.pm
@@ -1,6 +1,4 @@
 package SL::Controller::ShopOrder;
-#package SL::Controller::ShopOrder;
-# Controller::ShopOrder
 
 use strict;
 
@@ -43,8 +41,6 @@ sub action_list {
   my ( $self ) = @_;
   my %filter = ($::form->{filter} ? parse_filter($::form->{filter}) : query => [ transferred => 0, obsolete => 0 ]);
   my $transferred = $::form->{filter}->{transferred_eq_ignore_empty} ne '' ? $::form->{filter}->{transferred_eq_ignore_empty} : '';
-  #$::lxdebug->dump(0, "WH: FILTER ",  $::form->{filter}->{_eq_ignore_empty}." - ".$transferred);
-  #$::lxdebug->dump(0, "WH: FILTER2 ",  \%filter);
   my $sort_by = $::form->{sort_by} ? $::form->{sort_by} : 'order_date';
   $sort_by .=$::form->{sort_dir} ? ' DESC' : ' ASC';
   my $shop_orders = SL::DB::Manager::ShopOrder->get_all( %filter, sort_by => $sort_by,
@@ -61,8 +57,6 @@ sub action_list {
     );
     $shop_order->{open_invoices} = $open_invoices;
   }
-  $main::lxdebug->dump(0, 'WH:SHOPORDER ',\$shop_orders);
-
 
   $self->render('shop_order/list',
                 title       => t8('ShopOrders'),
@@ -116,12 +110,12 @@ sub action_show {
                             and => [ # check for street and zipcode
                                      and => [ 'street'  => { ilike => "%".$shop_order->customer_street."%" },
                                               'zipcode' => { ilike => $shop_order->customer_zipcode },
+                                            ],
+                                   ],
                             or  => [ 'email' => { ilike => $shop_order->customer_email } ],
                          ],
                 ],
   );
-  $main::lxdebug->dump(0, 'WH:PROP ',\$proposals);
-
 
   $self->render('shop_order/show',
                 title       => t8('Shoporder'),
@@ -287,7 +281,6 @@ sub check_address {
                                            'zipcode'=> { ilike => $address{'zipcode'} },
                                            'city'   => { ilike => $address{'city'} },
                                          ]);
-  $::lxdebug->dump(0, "WH: CUSTOMER ", \$addressdata);
   return @{$addressdata}[0];
 }
 
diff --git a/SL/Controller/ShopPart.pm b/SL/Controller/ShopPart.pm
index 2d43cd84d..0410a3392 100644
--- a/SL/Controller/ShopPart.pm
+++ b/SL/Controller/ShopPart.pm
@@ -1,5 +1,4 @@
 package SL::Controller::ShopPart;
-#package SL::Controller::ShopPart;
 
 use strict;
 
@@ -181,7 +180,7 @@ sub action_show_stock {
     my $shop_article = $shop->connector->get_article($self->shop_part->part->partnumber);
     $stock_onlineshop = $shop_article->{data}->{mainDetail}->{inStock};
     $active_online = $shop_article->{data}->{active};
-    #}
+  }
 
   $stock_local = $self->shop_part->part->onhand;
 
@@ -234,7 +233,6 @@ sub create_or_update {
 
   #TODO Price must be formatted. $price_src_str must be translated
   flash('info', $is_new ? t8('The shop part has been created.') : t8('The shop part has been saved.'));
-  # $self->js->val('#partnumber', 'ladida');
   $self->js->html('#shop_part_description_' . $self->shop_part->id, $self->shop_part->shop_description)
            ->html('#shop_part_active_' . $self->shop_part->id, $self->shop_part->active)
            ->html('#price_' . $self->shop_part->id, $::form->format_amount(\%::myconfig,$price,2))
@@ -307,7 +305,6 @@ sub action_list_articles {
   my $transferred = $::form->{filter}->{transferred_eq_ignore_empty} ne '' ? $::form->{filter}->{transferred_eq_ignore_empty} : '';
   my $sort_by = $::form->{sort_by} ? $::form->{sort_by} : 'part.partnumber';
   $sort_by .=$::form->{sort_dir} ? ' DESC' : ' ASC';
-$main::lxdebug->message(0, "WH:LA ");
 
   my $articles = SL::DB::Manager::ShopPart->get_all(where => [ 'shop.obsolete' => 0 ],with_objects => [ 'part','shop' ], sort_by => $sort_by );
 
@@ -315,7 +312,6 @@ $main::lxdebug->message(0, "WH:LA ");
     my $images = SL::DB::Manager::File->get_all_count( where => [ trans_id => $article->part->id, modul => 'shop_part', file_content_type => { like => 'image/%' } ], sort_by => 'position' );
     $article->{images} = $images;
   }
-  $main::lxdebug->dump(0, 'WH:ARTIKEL ',\$articles);
 
   $self->render('shop_part/_list_articles', title => t8('Webshops articles'), SHOP_PARTS => $articles);
 }
@@ -332,7 +328,6 @@ sub action_upload_status {
 
 sub action_mass_upload {
   my ($self) = @_;
-$main::lxdebug->message(0, "WH:MA ");
 
   my @shop_parts =  @{ $::form->{shop_parts_ids} || [] };
 
@@ -346,10 +341,8 @@ $main::lxdebug->message(0, "WH:MA ");
      status                       => SL::BackgroundJob::ShopPartMassUpload->WAITING_FOR_EXECUTION(),
      conversation_errors          => [ ],
    )->update_next_run_at;
-$main::lxdebug->dump(0, 'WH:MA JOB ',\$job);
 
    SL::System::TaskServer->new->wake_up;
-$main::lxdebug->dump(0, 'WH:MA JOB 2',\$job);
 
    my $html = $self->render('shop_part/_transfer_status', { output => 0 }, job => $job);
 
@@ -363,7 +356,6 @@ $main::lxdebug->dump(0, 'WH:MA JOB 2',\$job);
 # internal stuff
 #
 sub add_javascripts  {
-  # is this needed?
   $::request->{layout}->add_javascripts(qw(kivi.shop_part.js));
 }
 
@@ -422,32 +414,24 @@ sub init_shop_part {
 }
 
 sub init_file {
-  $main::lxdebug->message(0, "WH:INIT_FILES ");
   my $file = $::form->{id} ? SL::DB::File->new(id => $::form->{id})->load : SL::DB::File->new;
-  $main::lxdebug->dump(0, 'WH: INITFILE: ',\file);
-
   return $file;
 }
 
 sub init_shops {
   # data for drop down filter options
-  $main::lxdebug->message(0, "WH:INIT_SHOPS ");
-
   require SL::DB::Shop;
   my @shops_dd = [ { title => t8("all") ,   value =>'' } ];
   my $shops = SL::DB::Mangager::Shop->get_all( where => [ obsolete => 0 ] );
-   my @tmp = map { { title => $_->{description}, value => $_->{id} } } @{ $shops } ;
- $main::lxdebug->dump(0, 'WH:SHOPS ',\@tmp);
- return @shops_dd;
+  my @tmp = map { { title => $_->{description}, value => $_->{id} } } @{ $shops } ;
+  return @shops_dd;
 
 }
 
 sub init_producers {
   # data for drop down filter options
-  $main::lxdebug->message(0, "WH:INIT_PRODUCERS ");
-
   my @producers_dd = [ { title => t8("all") ,   value =>'' } ];
- return @producers_dd;
+  return @producers_dd;
 
 }
 
diff --git a/SL/DB/File.pm b/SL/DB/File.pm
index bb6def2f7..d44f07225 100644
--- a/SL/DB/File.pm
+++ b/SL/DB/File.pm
@@ -2,7 +2,6 @@
 # Feel free to modify it at will; it will not be overwritten automatically.
 
 package SL::DB::File;
-#package SL::DB::File;
 
 use strict;
 
diff --git a/SL/DB/Helper/ThumbnailCreator.pm b/SL/DB/Helper/ThumbnailCreator.pm
index f1a18458c..c653e165d 100644
--- a/SL/DB/Helper/ThumbnailCreator.pm
+++ b/SL/DB/Helper/ThumbnailCreator.pm
@@ -2,6 +2,9 @@ package SL::DB::Helper::ThumbnailCreator;
 
 use strict;
 
+use parent qw(SL::Controller::Base);
+
+use SL::Locale::String qw(t8);
 use Carp;
 use GD;
 use Image::Info;
@@ -79,7 +82,7 @@ sub file_update_type_and_dimensions {
   my ($self) = @_;
 
   return () if !$self->file_content;
-  return () if $self->file_content_type && $self->file_img_width && $self->file_img_height && !Rose::DB::Object::Util::get_column_value_modified($self, 'file_content');
+  return () if $self->file_content_type && $self->files_img_width && $self->files_img_height && !Rose::DB::Object::Util::get_column_value_modified($self, 'file_content');
 
   my @errors = $self->file_probe_type;
   return @errors if @errors;
@@ -102,7 +105,7 @@ __END__
 
 =head1 NAME
 
-SL::DB::Helper::ThumbnailCreator - DatabaseClass Helper for Fileuploads
+  SL::DB::Helper::ThumbnailCreator - DatabaseClass Helper for Fileuploads
 
 =head1 SYNOPSIS
 
@@ -112,10 +115,11 @@ SL::DB::Helper::ThumbnailCreator - DatabaseClass Helper for Fileuploads
 
 =head1 DESCRIPTION
 
-# longer description..
+  # longer description..
+
 =head1 AUTHOR
 
-Werner Hahn E<lt>wh@futureworldsearch.netE<gt>
+  Werner Hahn E<lt>wh@futureworldsearch.netE<gt>
 
 =cut
 
diff --git a/SL/DB/MetaSetup/Shop.pm b/SL/DB/MetaSetup/Shop.pm
index 362e96926..463e6cebe 100644
--- a/SL/DB/MetaSetup/Shop.pm
+++ b/SL/DB/MetaSetup/Shop.pm
@@ -1,11 +1,10 @@
 # This file has been auto-generated. Do not modify it; it will be overwritten
 # by rose_auto_create_model.pl automatically.
 package SL::DB::Shop;
-#package SL::DB::Shop;
 
 use strict;
 
-use base qw(SL::DB::Object);
+use parent qw(SL::DB::Object);
 
 __PACKAGE__->meta->table('shops');
 
diff --git a/SL/DB/MetaSetup/ShopOrder.pm b/SL/DB/MetaSetup/ShopOrder.pm
index 08c75d8bd..30276554d 100644
--- a/SL/DB/MetaSetup/ShopOrder.pm
+++ b/SL/DB/MetaSetup/ShopOrder.pm
@@ -1,7 +1,6 @@
 # This file has been auto-generated. Do not modify it; it will be overwritten
 # by rose_auto_create_model.pl automatically.
 package SL::DB::ShopOrder;
-#package SL::DB::ShopOrder;
 
 use strict;
 
diff --git a/SL/DB/MetaSetup/ShopOrderItem.pm b/SL/DB/MetaSetup/ShopOrderItem.pm
index 6b2be9ed1..835baf126 100644
--- a/SL/DB/MetaSetup/ShopOrderItem.pm
+++ b/SL/DB/MetaSetup/ShopOrderItem.pm
@@ -1,7 +1,6 @@
 # This file has been auto-generated. Do not modify it; it will be overwritten
 # by rose_auto_create_model.pl automatically.
 package SL::DB::ShopOrderItem;
-#package SL::DB::ShopOrderItem;
 
 use strict;
 
diff --git a/SL/DB/MetaSetup/ShopPart.pm b/SL/DB/MetaSetup/ShopPart.pm
index 9047da86e..4dcf15983 100644
--- a/SL/DB/MetaSetup/ShopPart.pm
+++ b/SL/DB/MetaSetup/ShopPart.pm
@@ -1,15 +1,10 @@
 # This file has been auto-generated. Do not modify it; it will be overwritten
 # by rose_auto_create_model.pl automatically.
 package SL::DB::ShopPart;
-#package SL::DB::ShopPart;
 
 use strict;
 
-<<<<<<< HEAD
 use parent qw(SL::DB::Object);
-=======
-use base qw(SL::DB::Object);
->>>>>>> Shop - Einführung von ShopParts
 
 __PACKAGE__->meta->table('shop_parts');
 
diff --git a/SL/DB/Part.pm b/SL/DB/Part.pm
index 7bc24c163..8e63235f8 100644
--- a/SL/DB/Part.pm
+++ b/SL/DB/Part.pm
@@ -1,5 +1,4 @@
 package SL::DB::Part;
-#package SL::DB::Part;
 
 use strict;
 
@@ -134,17 +133,16 @@ sub is_service    { $_[0]->part_type eq 'service'    }
 sub is_assortment { $_[0]->part_type eq 'assortment' }
 
 sub type {
-  return $_[0]->part_type;
-  # my ($self, $type) = @_;
-  # if (@_ > 1) {
-  #   die 'invalid type' unless $type =~ /^(?:part|service|assembly)$/;
-  #   $self->assembly(          $type eq 'assembly' ? 1 : 0);
-  #   $self->inventory_accno_id($type ne 'service'  ? 1 : undef);
-  # }
-
-  # return 'assembly' if $self->assembly;
-  # return 'part'     if $self->inventory_accno_id;
-  # return 'service';
+  my ($self, $type) = @_;
+  if (@_ > 1) {
+    die 'invalid type' unless $type =~ /^(?:part|service|assembly)$/;
+    $self->assembly(          $type eq 'assembly' ? 1 : 0);
+    $self->inventory_accno_id($type ne 'service'  ? 1 : undef);
+  }
+
+  return 'assembly' if $self->assembly;
+  return 'part'     if $self->inventory_accno_id;
+  return 'service';
 }
 
 sub new_part {
diff --git a/SL/DB/ShopOrder.pm b/SL/DB/ShopOrder.pm
index 97fb9cddf..0dfe4ad65 100644
--- a/SL/DB/ShopOrder.pm
+++ b/SL/DB/ShopOrder.pm
@@ -2,7 +2,6 @@
 # Feel free to modify it at will; it will not be overwritten automatically.
 
 package SL::DB::ShopOrder;
-# DB::ShopOrder
 
 use strict;
 
diff --git a/SL/DB/ShopPart.pm b/SL/DB/ShopPart.pm
index f7f9f93e1..5294c5fec 100644
--- a/SL/DB/ShopPart.pm
+++ b/SL/DB/ShopPart.pm
@@ -13,4 +13,5 @@ use SL::DB::Helper::AttrHTML;
 __PACKAGE__->meta->initialize;
 __PACKAGE__->attr_html('shop_description');
 
+
 1;
diff --git a/SL/Shop.pm b/SL/Shop.pm
index eb7f2e695..b3130f3a7 100644
--- a/SL/Shop.pm
+++ b/SL/Shop.pm
@@ -1,9 +1,10 @@
 package SL::Shop;
-#package SL::Shop;
 
 use strict;
 
 use parent qw(Rose::Object);
+use SL::ShopConnector::ALL;
+use SL::DB::Part;
 
 # __PACKAGE__->run_before('check_auth');
 
@@ -12,10 +13,39 @@ use Rose::Object::MakeMethods::Generic (
   'scalar --get_set_init' => [ qw(connector) ],
 );
 
+sub updatable_parts {
+  my ($self, $last_update) = @_;
+  $last_update ||= DateTime->now(); # need exact timestamp, with minutes
+
+  my $parts;
+  my $active_shops = SL::DB::Manager::Shop->get_all(query => [ obsolete => 0 ]);
+  foreach my $shop ( @{ $active_shops } ) {
+    # maybe run as an iterator? does that make sense with with_objects?
+    my $update_parts = SL::DB::Manager::ShopPart->get_all(query => [
+             and => [
+                'active' => 1,
+                'shop_id' => $shop->id,
+                # shop => '1',
+                or => [ 'part.mtime' => { ge => $last_update },
+                        'part.itime' => { ge => $last_update },
+                        'itime'      => { ge => $last_update },
+                        'mtime'      => { ge => $last_update },
+                      ],
+                    ]
+             ],
+             with_objects => ['shop', 'part'],
+             # multi_many_ok   => 1,
+          );
+    push( @{ $parts }, @{ $update_parts });
+  };
+  return $parts;
+
+};
+
 sub init_connector {
   my ($self) = @_;
   # determine the connector from the connector type in the webshop config
-  return SL::ShopConnector::ALL->shop_connector_class_by_name($self->config->connector)->new( config => $self->config); 
+  return SL::ShopConnector::ALL->shop_connector_class_by_name($self->config->connector)->new( config => $self->config);
 
 };
 
@@ -27,15 +57,15 @@ __END__
 
 =head1 NAME
 
-SL::WebShop - Do stuff with WebShop instances
+  SL::Shop - Do stuff with WebShop instances
 
 =head1 SYNOPSIS
 
-  my $config = SL::DB::Manager::WebShop->get_first();
+  my $config = SL::DB::Manager::Shop->get_first();
   my $shop = SL::WebShop->new( config => $config );
 
-From the config we know which Connector class to load, save in $shop->connector
-and do stuff from there:
+  From the config we know which Connector class to load, save in $shop->connector
+  and do stuff from there:
 
   $shop->connector->get_new_orders;
 
@@ -43,11 +73,10 @@ and do stuff from there:
 
 =head1 BUGS
 
-Nothing here yet.
+  Nothing here yet.
 
 =head1 AUTHOR
 
-G. Richardson <lt>information@kivitendo-premium.deE<gt>
+  G. Richardson <lt>information@kivitendo-premium.deE<gt>
 
 =cut
-
diff --git a/SL/ShopConnector/Shopware.pm b/SL/ShopConnector/Shopware.pm
index f6793a99e..135dce7bb 100644
--- a/SL/ShopConnector/Shopware.pm
+++ b/SL/ShopConnector/Shopware.pm
@@ -1,6 +1,4 @@
 package SL::ShopConnector::Shopware;
-#package SL::ShopConnector::Shopware;
-#package SL::ShopConnector::Shopware;
 
 use strict;
 
@@ -249,6 +247,12 @@ sub get_categories {
   return \@daten;
 }
 
+sub get_articles {
+  my ($self, $json_data) = @_;
+
+}
+
+
 sub update_part {
   my ($self, $shop_part, $json, $todo) = @_;
 
@@ -316,7 +320,6 @@ sub update_part {
 
   # mapping to shopware still missing attributes,metatags
   my %shop_data;
-  $main::lxdebug->dump(0, 'WH:TODO ',\$todo);
 
   if($todo eq "price"){
     %shop_data = ( mainDetail => { number   => $part->{partnumber},
@@ -375,16 +378,12 @@ sub update_part {
   }else{
     my %shop_data =  ( mainDetail => { number   => $part->{partnumber}, });
   }
-  $main::lxdebug->dump(0, 'WH:SHOPDATA ',\%shop_data);
 
   my $dataString = SL::JSON::to_json(\%shop_data);
   $dataString = encode_utf8($dataString);
 
   my $upload_content;
   if($import->{success}){
-  my %del_img =  ( images        => [ {} ], ) ;
-  my $del_imgString = SL::JSON::to_json(\%del_img);
-  #my $delImg = $self->connector->put("http://$url/api/articles/$part->{partnumber}?useNumberAsId=true",Content => $del_imgString);
     #update
     my $partnumber = $::form->escape($part->{partnumber});#shopware don't accept / in articlenumber
     my $upload = $self->connector->put("http://$url/api/articles/$partnumber?useNumberAsId=true",Content => $dataString);
@@ -408,7 +407,7 @@ sub get_article {
   my ($self,$partnumber) = @_;
 
   my $url = $self->url;
-  my $partnumber = $::form->escape($partnumber);#shopware don't accept / in articlenumber
+  $partnumber = $::form->escape($partnumber);#shopware don't accept / in articlenumber
   my $data = $self->connector->get("http://$url/api/articles/$partnumber?useNumberAsId=true");
   my $data_json = $data->content;
   return SL::JSON::decode_json($data_json);
diff --git a/css/webshop.css b/css/webshop.css
index 84445161d..78c78a719 100644
--- a/css/webshop.css
+++ b/css/webshop.css
@@ -1,4 +1,3 @@
-/* Shop */
 div.shop_table {
   display: table;
   background-color: #ebebeb;
diff --git a/js/kivi.FileUploader.js b/js/kivi.FileUploader.js
index 559d4de7c..ce83b32d2 100644
--- a/js/kivi.FileUploader.js
+++ b/js/kivi.FileUploader.js
@@ -1,4 +1,3 @@
-//TMP
 namespace('kivi.FileUploader', function(ns) {
   //opens a popupdialog for fileupload
 
diff --git a/js/kivi.ShopOrder.js b/js/kivi.ShopOrder.js
index 3d83f5be9..2fdf8ea68 100644
--- a/js/kivi.ShopOrder.js
+++ b/js/kivi.ShopOrder.js
@@ -1,13 +1,12 @@
-//TMP
 namespace('kivi.ShopOrder', function(ns) {
   ns.massTransferInitialize = function() {
     kivi.popup_dialog({
       id: 'status_mass_transfer',
       dialog: {
-        title: kivi.t8('Status Shoptransfer')
+        title: kivi.t8('Status Shoptransfer'),
+        close: function(event, ui) { alert('CLOSE'); },
       }
     });
-    alert('Hallo');
   };
 
   ns.massTransferStarted = function() {
@@ -24,10 +23,14 @@ namespace('kivi.ShopOrder', function(ns) {
     $('.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', '')
   };
 
+  ns.processClose = function() {
+    $('#status_mass_transfer').dialog('close');
+    window.location.href = 'controller.pl?filter.obsolete=0&filter.transferred=0&action=ShopOrder%2flist&db=shop_orders&sort_by=shop_ordernumber';
+  };
+
   ns.setup = function() {
     kivi.ShopOrder.massTransferInitialize();
     kivi.submit_ajax_form('controller.pl?action=ShopOrder/mass_transfer','[name=shop_orders_list]');
   };
 
 });
-//$(kivi.ShopOrder.setup);
diff --git a/js/kivi.shop_part.js b/js/kivi.shop_part.js
index fc65520a5..bf2cb3b14 100644
--- a/js/kivi.shop_part.js
+++ b/js/kivi.shop_part.js
@@ -1,4 +1,3 @@
-//TMP
 namespace('kivi.shop_part', function(ns) {
   var $dialog;
 
@@ -30,28 +29,27 @@ namespace('kivi.shop_part', function(ns) {
   }
 
 
-    // save existing shop_part_id with new params from form, calls create_or_update and saves to db
-    ns.save_shop_part = function(shop_part_id) {
-      var form = $('form').serializeArray();
-      form.push( { name: 'action', value: 'ShopPart/update' }
-               , { name: 'shop_part_id',  value: shop_part_id }
-      );
-
-      $.post('controller.pl', form, function(data) {
-        kivi.eval_json_result(data);
-      });
-    }
+  // save existing shop_part_id with new params from form, calls create_or_update and saves to db
+  ns.save_shop_part = function(shop_part_id) {
+    var form = $('form').serializeArray();
+    form.push( { name: 'action', value: 'ShopPart/update' }
+             , { name: 'shop_part_id',  value: shop_part_id }
+    );
 
-    // add part to a shop
-    ns.add_shop_part = function(part_id,shop_id) {
-      var form = $('form').serializeArray();
-      form.push( { name: 'action', value: 'ShopPart/update' }
-      );
+    $.post('controller.pl', form, function(data) {
+      kivi.eval_json_result(data);
+    });
+  }
 
-      $.post('controller.pl', form, function(data) {
-        kivi.eval_json_result(data);
-      });
-    }
+  // add part to a shop
+  ns.add_shop_part = function(part_id,shop_id) {
+    var form = $('form').serializeArray();
+    form.push( { name: 'action', value: 'ShopPart/update' }
+    );
+    $.post('controller.pl', form, function(data) {
+      kivi.eval_json_result(data);
+    });
+  }
 
   // this is called from tabs/_shop.html, opens edit_window (render)
   ns.edit_shop_part = function(shop_part_id) {
@@ -121,4 +119,32 @@ namespace('kivi.shop_part', function(ns) {
     });
   }
 
+  ns.massUploadInitialize = function() {
+    kivi.popup_dialog({
+      id: 'status_mass_upload',
+      dialog: {
+        title: kivi.t8('Status Shopupload')
+      }
+    });
+  };
+
+  ns.massUploadStarted = function() {
+    $('#status_mass_upload').data('timerId', setInterval(function() {
+      $.get("controller.pl", {
+        action: 'ShopPart/upload_status',
+        job_id: $('#smu_job_id').val()
+      }, kivi.eval_json_result);
+    }, 5000));
+  };
+
+  ns.massUploadFinished = function() {
+    clearInterval($('#status_mass_upload').data('timerId'));
+    $('.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', '')
+  };
+
+  ns.setup = function() {
+    kivi.shop_part.massUploadInitialize();
+    kivi.submit_ajax_form('controller.pl?action=ShopPart/mass_upload','[name=shop_parts]');
+  };
+
 });
diff --git a/menus/user/10-shopimport.yaml b/menus/user/10-shopimport.yaml
index dc9fe7b3d..d774641bc 100644
--- a/menus/user/10-shopimport.yaml
+++ b/menus/user/10-shopimport.yaml
@@ -18,4 +18,3 @@
     action: ShopPart/list_articles
     db: shop_parts
     sort_by: part.onhand
-#ShopPart
diff --git a/sql/Pg-upgrade2/shop_orders_2.sql b/sql/Pg-upgrade2/shop_orders_2.sql
index 8ee9bb27c..37a7622a5 100644
--- a/sql/Pg-upgrade2/shop_orders_2.sql
+++ b/sql/Pg-upgrade2/shop_orders_2.sql
@@ -1,5 +1,4 @@
 -- @tag: shop_orders_2
 -- @description: Hinzufügen der Spalte Position in der Tabelle shop_order_items
 -- @depends: release_3_3_0
--- tmp
 ALTER TABLE shop_order_items ADD COLUMN position integer;
diff --git a/sql/Pg-upgrade2/shop_parts.sql b/sql/Pg-upgrade2/shop_parts.sql
index 7e9e5a4ca..273d32629 100644
--- a/sql/Pg-upgrade2/shop_parts.sql
+++ b/sql/Pg-upgrade2/shop_parts.sql
@@ -1,4 +1,3 @@
--- TMP
 -- @tag: shop_parts
 -- @description: Add tables for part information for shop
 -- @charset: UTF-8
diff --git a/templates/webpages/common/file_upload.html b/templates/webpages/common/file_upload.html
index 7b04b55e9..d103e628e 100644
--- a/templates/webpages/common/file_upload.html
+++ b/templates/webpages/common/file_upload.html
@@ -1,26 +1,30 @@
-<!-- TMP -->
 [%- USE LxERP -%][%- USE L -%][%- USE HTML -%][%- USE JavaScript -%][% USE Base64 %]
 [% SET style="width: 500px" %]
-[% SET id_base = "fileupload" %]
-[% L.dump(DATA) %]
+[% SET id_base_bak  = "fileupload" %]
+[% SET id_base      = 'fileupload_' _ (SELF.file.id ? SELF.file.id : 'new') %]
+[% SET trans_id     = SELF.file.id ? SELF.file.trans_id : data.trans_id %]
+[% SET modul        = SELF.file.id ? SELF.file.modul : data.modul %]
+
 <form method="post" id="fileupload_form" method="POST" enctype="multipart/form-data">
- [% L.hidden_tag('form_prefix',                    id_base,         id=id_base _ '_form_prefix') %]
- [% L.hidden_tag('id',                             DATA.id, no_id=1) %]
- [% L.hidden_tag('modul',                          DATA.modul) %]
+ [% L.hidden_tag('form_prefix',                    id_base,      id=id_base _ '_form_prefix') %]
+ [% L.hidden_tag(id_base _ '.id',                  SELF.file.id, no_id=1) %]
+ [% L.hidden_tag(id_base _ '.trans_id',            trans_id) %]
+ [% L.hidden_tag(id_base _ '.modul',               modul) %]
+ [% L.hidden_tag('aft',                            data.aft) %]
 
  <h2>
   [%- IF SELF.file.id %]
-   [%- LxERP.t8("Edit file properties ", SELF.file.number) %]
+   [%- LxERP.t8("Edit fileproperties", SELF.file.position) %]
   [%- ELSE %]
-   [%- LxERP.t8("Add file to webdav") %]
+   [%- LxERP.t8("Add file") %]
   [%- END %]
  </h2>
 
  <table>
-[% IF SELF.file.number %]
+[% IF SELF.file.id %]
   <tr>
-   <th align="right">[%- LxERP.t8("Number") %]:</th>
-   <td>[% HTML.escape(SELF.file.number) %]</td>
+   <th align="right">[%- LxERP.t8("Position") %]:</th>
+   <td>[% HTML.escape(SELF.file.position) %]</td>
   </tr>
 [% END %]
 
@@ -37,7 +41,7 @@
 [% IF SELF.file.file_content %]
   <tr>
    <th align="right">[%- LxERP.t8("File name") %]:</th>
-   <td>[% HTML.escape(SELF.file.file_file_name) %]</td>
+   <td>[% HTML.escape(SELF.file.filename) %][% L.hidden_tag(id_base _ '.filename', SELF.file.filename) %][% L.hidden_tag('id', SELF.file.id, no_id=1) %]</td>
   </tr>
 
   <tr>
@@ -47,12 +51,12 @@
 
   <tr>
    <th align="right">[%- LxERP.t8("Dimensions") %]:</th>
-   <td>[% HTML.escape(SELF.file.file_width) %]x[% HTML.escape(SELF.file.file_height) %]</td>
+   <td>[% HTML.escape(SELF.file.files_img_width) %]x[% HTML.escape(SELF.file.files_img_height) %]</td>
   </tr>
 
   <tr>
    <th align="right">[%- LxERP.t8("Uploaded at") %]:</th>
-   <td>[% HTML.escape(SELF.file.file_mtime.to_kivitendo(precision='second')) %]</td>
+   <td>[% HTML.escape(SELF.file.files_mtime.to_kivitendo(precision='second')) %]</td>
   </tr>
 [% END %]
 
@@ -63,7 +67,8 @@
  </table>
 
  <p>
-  [%- L.ajax_submit_tag('controller.pl?action=FileUploader/ajax_upload_file', '#fileupload_form', LxERP.t8('Save'), no_id=1) %]
+ <!-- TODO action ändern in übergebene Variable, sodass jede xbelibiege Controller/Action aufgerufen werden kann -->
+  [%- L.ajax_submit_tag('controller.pl?action=' _ data.ca, '#fileupload_form', LxERP.t8('Save'), no_id=1) %]
   <a href="#" onclick="$('#jqueryui_popup_dialog').dialog('close');">[%- LxERP.t8("Cancel") %]</a>
  </p>
 
diff --git a/templates/webpages/shop_order/_transfer_status.html b/templates/webpages/shop_order/_transfer_status.html
index eb28a7704..2e6f12719 100644
--- a/templates/webpages/shop_order/_transfer_status.html
+++ b/templates/webpages/shop_order/_transfer_status.html
@@ -2,7 +2,7 @@
 [%- USE Dumper -%]
 [% SET data = job.data_as_hash %]
 
-<!-- ShopOrder -->
+
 <h2>[% LxERP.t8("Watch status") %]</h2>
 
 [% L.hidden_tag('', job.id, id="smt_job_id") %]
@@ -14,6 +14,7 @@ JOBID: [% job.id %] <p>
 [% # Dumper.dump_html(data) %]
 </p>
 <p>
+ [% L.link("#", LxERP.t8("Close window"), onclick="kivi.ShopOrder.processClose();") %]
  <table>
   <tr>
    <th valign="top" align="left">[% LxERP.t8("Current status:") %]</th>
@@ -28,14 +29,10 @@ JOBID: [% job.id %] <p>
    </td>
   </tr>
   <tr>
-   <th valign="top" align="left">[% LxERP.t8("Number of invoices created:") %]</th>
-   <td valign="top">[% IF data.status > 0 %][% HTML.escape(data.num_created) %] / [% HTML.escape(data.record_ids.size) %][% ELSE %]–[% END %]</td>
+   <th valign="top" align="left">[% LxERP.t8("Number of orders created:") %]</th>
+   <td valign="top">[% IF data.status > 0 %][% HTML.escape(data.num_order_created) %] / [% HTML.escape(data.shop_order_record_ids.size) %][% ELSE %]–[% END %]</td>
   </tr>
 
-  <tr>
-   <th valign="top" align="left">[% LxERP.t8("Number of invoices printed:") %]</th>
-   <td valign="top">[% IF data.status > 1 %][% HTML.escape(data.num_printed) %] / [% HTML.escape(data.invoice_ids.size) %][% ELSE %]–[% END %]</td>
-  </tr>
 
   <tr>
    <th valign="top" align="left">[% LxERP.t8("Errors during conversion:") %]</th>
@@ -61,31 +58,5 @@ JOBID: [% job.id %] <p>
 [% END %]
    </td>
   </tr>
-
-  <tr>
-   <th valign="top" align="left">[% LxERP.t8("Errors during printing:") %]</th>
-   <td valign="top">
-[% IF data.status < 2 %]
- –
-[% ELSIF !data.print_errors.size %]
- [% LxERP.t8("No errors have occurred.") %]
-[% ELSE %]
-    <table>
-     <tr class="listheader">
-      <th>[% LxERP.t8("Invoice") %]</th>
-      <th>[% LxERP.t8("Error") %]</th>
-     </tr>
-
- [% FOREACH error = data.print_errors %]
-     <tr>
-      <td valign="top">[% IF error.id %][% L.link(SELF.url_for(controller='is.pl', action='edit', type='sales_invoice',id=error.id), HTML.escape(error.number), target="_blank") %][% ELSE %]–[% END %]</td>
-      <td valign="top">[% HTML.escape(error.message) %]</td>
-     </tr>
- [% END %]
-    </table>
-[% END %]
-   </td>
-  </tr>
-
  </table>
 </p>
diff --git a/templates/webpages/shop_order/list.html b/templates/webpages/shop_order/list.html
index 0be5118ee..cde984b55 100644
--- a/templates/webpages/shop_order/list.html
+++ b/templates/webpages/shop_order/list.html
@@ -1,6 +1,5 @@
 [%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]
 [% USE Dumper %]
-<!-- TMP -->
 
 <h1>[% title %]</h1>
 [%- PROCESS 'shop_order/_filter.html' filter=SELF.models.filtered.laundered %]
@@ -149,7 +148,7 @@
       <br>[% HTML.escape(shop_order.customer_street) %]
       <br>[% HTML.escape(shop_order.customer_zipcode) %]&nbsp;[% HTML.escape(shop_order.customer_city) %]
       <br>[% HTML.escape(shop_order.customer_country) %] </td>
-    <td>[% IF shop_order.customer_company %]<b>[% HTML.escape(shop_order.customer_company) %]</b><br>[% END %]
+    <td [% transferable_class %]>[% IF shop_order.customer_company %]<b>[% HTML.escape(shop_order.customer_company) %]</b><br>[% END %]
       <b>[% HTML.escape(shop_order.billing_lastname) %],&nbsp;[% HTML.escape(shop_order.billing_firstname) %]</b>
       <br>[% HTML.escape(shop_order.billing_street) %]
       <br>[% HTML.escape(shop_order.billing_zipcode) %]&nbsp;[% HTML.escape(shop_order.billing_city) %]
@@ -181,9 +180,11 @@
  </table>
  <hr>
   <p>
-   [% L.hidden_tag("action", "ShopOrder/mass_transfer") %]
-   [% L.submit_tag("", LxERP.t8("Transfer all marked")) %]
+  [% L.button_tag("kivi.ShopOrder.setup();", LxERP.t8("Transfer all marked"), id="mass_transfer") %]
   </p>
+  <div id="status_mass_transfer" style="display: none;">
+    [%- INCLUDE 'shop_order/_transfer_status.html' %]
+  </div>
  </form>
 <script type="text/javascript">
 <!--
diff --git a/templates/webpages/shop_order/show.html b/templates/webpages/shop_order/show.html
index e89a6a7a8..4ce312f3b 100644
--- a/templates/webpages/shop_order/show.html
+++ b/templates/webpages/shop_order/show.html
@@ -1,4 +1,3 @@
-<!-- TMP -->
 [%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]
 [% L.stylesheet_tag('webshop') %]
 
@@ -208,4 +207,4 @@ $("input[type=radio]").change(function(){
       $('#transfer').css("display", 'block');
 });
 </script>
-[% L.dump(IMPORT) %]
+[% # L.dump(IMPORT) %]
diff --git a/templates/webpages/shop_part/_filter.html b/templates/webpages/shop_part/_filter.html
index 4cc337093..caa65fa6f 100644
--- a/templates/webpages/shop_part/_filter.html
+++ b/templates/webpages/shop_part/_filter.html
@@ -2,7 +2,6 @@
 [%- USE L %]
 [%- USE LxERP %]
 [%- USE HTML %]
-<!-- ShopOrder -->
 <form action='controller.pl' method='post' id="shop_part_filter">
  <table id='filter_table'>
 
diff --git a/templates/webpages/shop_part/_list_articles.html b/templates/webpages/shop_part/_list_articles.html
index 6a6b6d7f8..c975947e2 100644
--- a/templates/webpages/shop_part/_list_articles.html
+++ b/templates/webpages/shop_part/_list_articles.html
@@ -1,8 +1,7 @@
 [%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]
 [% USE Dumper %]
-<!-- ShopPart -->
-<!-- ShopPart -->
-<!-- ShopPart -->
+
+
 <h1>[% title %]</h1>
 [%- PROCESS 'shop_part/_filter.html' filter=SELF.models.filtered.laundered %]
 <hr>
diff --git a/templates/webpages/shop_part/_list_images.html b/templates/webpages/shop_part/_list_images.html
index c9a621c98..8ee7711b5 100644
--- a/templates/webpages/shop_part/_list_images.html
+++ b/templates/webpages/shop_part/_list_images.html
@@ -1,4 +1,3 @@
-<!-- TMP -->
 [%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%]
 [%- USE T8 %][% USE Base64 %]
 [%- USE Dumper %]
@@ -11,6 +10,7 @@
       <th>[% 'Description' | $T8 %]</th>
       <th>[% 'Filename' | $T8 %]</th>
       <th>[% 'Orig. Size w/h' | $T8 %]</th>
+      <th>[% 'Action' | $T8 %]</th>
     </tr>
   </thead>
   <tbody>
@@ -18,10 +18,11 @@
     <tr class="listrow" id="image_id_[%  img.id %]">
       <td><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]" class="dragdrop"></td>
       <td width="70px"><img src="data:[%  img.thumbnail_img_content_type %];base64,[%  img.thumbnail_img_content.encode_base64 %]" alt="[%  img.title %]"></td>
-      <td>[%  HTML.escape(img.title) %]</td>
-      <td>[%  HTML.escape(img.description) %]</td>
-      <td>[%  HTML.escape(img.filename) %]</td>
-      <td>[%  HTML.escape(img.thumbnail_img_width) _  ' x ' _ HTML.escape(img.thumbnail_img_height) %]</td>
+      <td>[% HTML.escape(img.title) %]</td>
+      <td>[% HTML.escape(img.description) %]</td>
+      <td>[% HTML.escape(img.filename) %]</td>
+      <td>[% HTML.escape(img.files_img_width) _  ' x ' _ HTML.escape(img.files_img_height) %]</td>
+      <td>[% L.button_tag("kivi.FileUploader.delete_file(" _ img.id _ ", 'ShopPart/ajax_delete_file')", LxERP.t8('Delete'), confirm=LxERP.t8("Are you sure?")) %] [% L.button_tag("kivi.FileUploader.add_file(" _ img.id _ "," _ FORM.id _ ",'shop_part','ShopPart/ajax_update_file','jpg|png|tif|gif')", LxERP.t8('Edit')) %] </td>
     </tr>
    [%  END %]
   </tbody>
@@ -29,25 +30,5 @@
 
 [% L.sortable_element('#images_list tbody', url=SELF.url_for(action='reorder'), with='image_id') %]
 <p>
-[% L.button_tag("add_file(this.form.id.value,'shop_part')", 'Fileupload') %]
+[% L.button_tag("kivi.FileUploader.add_file(''," _ FORM.id _ ",'shop_part','ShopPart/ajax_upload_file','jpg|png|tif|gif')", LxERP.t8('Fileupload')) %]
 </p>
-
-
-
-
-<script type='text/javascript'>
-<!--
-function add_file(id,modul) {
-  //var id = this.$('#part').val();
-  kivi.popup_dialog({
-        url :           'controller.pl?action=FileUploader/ajax_add_file',
-        data:           'id=' + id + '&modul=' + modul,
-        dialog:         { title: kivi.t8('File upload') }
-  } );
-   // var url = 'controller.pl?action=ShopPart/show_files?modul=shop_part&id=' + $('#id').val();
-   // $('#images_list').load(url);
-    //$('#jqueryui_popup_dialog').dialog('close');
-  return true;
-}
--->
-</script>
diff --git a/templates/webpages/shop_part/_transfer_status.html b/templates/webpages/shop_part/_transfer_status.html
index 9c76eae80..9d4978d4e 100644
--- a/templates/webpages/shop_part/_transfer_status.html
+++ b/templates/webpages/shop_part/_transfer_status.html
@@ -2,7 +2,6 @@
 [%- USE Dumper -%]
 [% SET data = job.data_as_hash %]
 
-<!-- ShopOrder BGJ -->
 <h2>[% LxERP.t8("Watch status") %]</h2>
 
 [% L.hidden_tag('', job.id, id="smu_job_id") %]
diff --git a/templates/webpages/shop_part/_upload_status.html b/templates/webpages/shop_part/_upload_status.html
index 8efca5681..7e11b4c7f 100644
--- a/templates/webpages/shop_part/_upload_status.html
+++ b/templates/webpages/shop_part/_upload_status.html
@@ -3,7 +3,6 @@
 [% SET data = job.data_as_hash %]
 
 
-<!-- ShopPart BGJ -->
 <h2>[% LxERP.t8("Watch status") %]</h2>
 
 [% L.hidden_tag('', job.id, id="smu_job_id") %]
diff --git a/templates/webpages/shop_part/categories.html b/templates/webpages/shop_part/categories.html
index 0fca312a6..fcf680386 100644
--- a/templates/webpages/shop_part/categories.html
+++ b/templates/webpages/shop_part/categories.html
@@ -4,7 +4,7 @@
 [%- USE P -%]
 [%- USE LxERP -%]
 [%- USE Dumper -%]
-<!-- ShopPart -->
+
 [%  LxERP.t8("Part") %]: [% HTML.escape(SELF.shop_part.part.displayable_name) %]<br>
 [%  LxERP.t8("Shop") %]: [% HTML.escape(SELF.shop_part.shop.description) %]
 <br>
@@ -14,14 +14,14 @@
 
 <form action="controller.pl" method="post">
   [% BLOCK recurse %]
-  [% # path = '' %]<!-- TODO: Pfad wg neuer Kategorie im Shop anlegen -->
+    [% # path = '' %]<!-- TODO: Pfad wg neuer Kategorie im Shop anlegen -->
     [% FOREACH obj = data %]
       <ul>
         <li>
         [% checked = '' %]
         [% # path = path _ obj.name %]
         [% # test = path.split('\|') %]
-        [% # Dumper.dump_html(SELF.shop_part.shop_category.size) %]
+        [% # Dumper.dump_html(SELF.shop_part.shop_category) %]
         [% IF SELF.shop_part.shop_category.1.grep(obj.name).size %]
           [% checked = 'checked' %]
         [% ELSE %]
@@ -31,7 +31,7 @@
             [% END %]
           [% END %]
         [% END %]
-          [% L.checkbox_tag('categories[]',value=obj.id _"," _ obj.name _ ",PFAD", checked=checked) %][% HTML.escape(obj.name) %]</li>
+          [% L.checkbox_tag('categories[]',value=obj.id, checked=checked) %][% HTML.escape(obj.name) %][% L.hidden_tag("cat_id_" _ obj.id, obj.name) %]</li>
         [% IF obj.childrenCount >= 1 %]
           [% # path = path _ '|' %]
           [% INCLUDE recurse data=obj.children %]
@@ -41,6 +41,7 @@
   [% END %]
   <div><h2>[% LxERP.t8("Shopcategories") %]</h2>
       [% FOREACH row = CATEGORIES %]
+<!-- TODO: Is still hardcoded 'Root' is shopware specified -->
         [% IF row.name == 'Root' %]
           [% IF row.childrenCount >= 1 %]
             [% path = '' %]
diff --git a/templates/webpages/shop_part/edit.html b/templates/webpages/shop_part/edit.html
index 67a482222..089bfc6aa 100644
--- a/templates/webpages/shop_part/edit.html
+++ b/templates/webpages/shop_part/edit.html
@@ -5,11 +5,9 @@
 [%- USE LxERP -%]
 [%- USE Dumper -%]
 
-<!-- ShopPart -->
-<!-- ShopPart -->
 [% LxERP.t8("Part") %]: [% HTML.escape(SELF.shop_part.part.displayable_name) %]<br>
 [% LxERP.t8("Shop") %]: [% HTML.escape(SELF.shop_part.shop.description) %]
-[% Dumper.dump_html(SELF) %]
+[% # Dumper.dump_html(SELF) %]
 <form action="controller.pl" method="post">
   <div>
     [% IF SELF.shop_part.id %]
@@ -27,7 +25,7 @@
     </tr>
     <tr>
      <td>[% LxERP.t8("Active") %]</td>
-     <td>[% L.yes_no_tag("shop_part.active", SELF.shop_part.active) %]</td>
+     <td>[% L.yes_no_tag("shop_part.active", SELF.shop_part.active, default = "yes") %]</td>
     </tr>
     <tr>
       <th align="right">[% 'Price Source' | $T8 %]</th>
diff --git a/templates/webpages/shops/form.html b/templates/webpages/shops/form.html
index 78a3c8be0..f82812b19 100644
--- a/templates/webpages/shops/form.html
+++ b/templates/webpages/shops/form.html
@@ -72,6 +72,21 @@
  </p>
 
  <hr>
+ <table>
+  <tr>
+    <th align="right">[% 'Description' | $T8 %]</th>
+    <th>Last update</th>
+    <th>[% 'Available qty' | $T8 %]</th>
+  </tr>
+ [%- FOREACH shop_part = SELF.shop.updatable_parts %]
+  <tr>
+   <td>[% P.part(shop_part.part) %]</td>
+   <td>[% shop_part.last_update.to_kivitendo %]</td>
+   <td>[% shop_part.part.get_stock %]</td>
+  </tr>
+ [%- END %]
+ </table>
+
 
 <script type="text/javascript">
 <!--
