Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8666d075

Von Werner Hahn vor etwa 7 Jahren hinzugefügt

  • ID 8666d0751946db936255ca088a38b8e8fab98a75
  • Vorgänger f2992e54
  • Nachfolger 9ebcbe54

Shopmodul: Shopartikel erfassen funktioniert mit dem PartController

Conflicts:
SL/Controller/Part.pm

Unterschiede anzeigen:

SL/Controller/Part.pm
6 6
use Clone qw(clone);
7 7
use SL::DB::Part;
8 8
use SL::DB::PartsGroup;
9
use SL::DB::Shop;
9 10
use SL::Controller::Helper::GetModels;
10 11
use SL::Locale::String qw(t8);
11 12
use SL::JSON;
......
21 22

  
22 23
use Rose::Object::MakeMethods::Generic (
23 24
  'scalar --get_set_init' => [ qw(parts models part p warehouses multi_items_models
24
                                  makemodels
25
                                  makemodels shops_not_assigned
25 26
                                  orphaned
26 27
                                  assortment assortment_items assembly assembly_items
27 28
                                  all_pricegroups all_translations all_partsgroups all_units
......
924 925
  }
925 926
}
926 927

  
928
sub init_shops_not_assigned {
929
  my ($self) = @_;
930

  
931
  my @used_shop_ids = map { $_->shop->id } @{ $self->part->shop_parts };
932
  if ( @used_shop_ids ) {
933
    return SL::DB::Manager::Shop->get_all( query => [ obsolete => 0, '!id' => \@used_shop_ids ], sort_by => 'sortkey' );
934
  }
935
  else {
936
    return SL::DB::Manager::Shop->get_all( query => [ obsolete => 0 ], sort_by => 'sortkey' );
937
  }
938
}
939

  
927 940
sub init_all_units {
928 941
  my ($self) = @_;
929 942
  if ( $self->part->orphaned ) {
SL/Controller/ShopPart.pm
411 411
  if ($::form->{shop_part_id}) {
412 412
    SL::DB::Manager::ShopPart->find_by(id => $::form->{shop_part_id});
413 413
  } else {
414
    SL::DB::ShopPart->new(shop_id => $::form->{shop_id}, part_id => $::form->{part_id})->load(with => ['shop']);
414
    SL::DB::ShopPart->new(shop_id => $::form->{shop_id}, part_id => $::form->{part_id});
415
    #SL::DB::ShopPart->new;
415 416
  };
416 417
}
417 418

  
templates/webpages/part/_shop.html
41 41
  </script>
42 42
  [% END %]
43 43
  [%- END %]
44
  [%- FOREACH shop = SHOPS_NOT_ASSIGNED %]
44
  [%- FOREACH shop = SELF.shops_not_assigned %]
45 45
  <tr>
46 46
   <td>[% HTML.escape( shop.description ) %]</td>
47 47
   <td></td>
......
49 49
   <td></td>
50 50
   <td></td>
51 51
   <td></td>
52
   <td></td>
52
   <td>[% L.button_tag("kivi.shop_part.create_shop_part(" _ id _ ", " _ shop.id _ ")", LxERP.t8("Add"))  %]</td>
53 53
  </tr>
54 54
  </thead>
55 55
  [%- END %]

Auch abrufbar als: Unified diff