Revision f3227c04
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
| SL/DB/Part.pm | ||
|---|---|---|
| );
 | ||
| use SL::DB::Helper::DisplayableNamePreferences (
 | ||
|   title   => t8('Article'),
 | ||
|   options => [ {name => 'partnumber',  title => t8('Part Number')     },
 | ||
|                {name => 'description', title => t8('Description')    },
 | ||
|                {name => 'notes',       title => t8('Notes')},
 | ||
|                {name => 'ean',         title => t8('EAN')            }, ],
 | ||
|   options => [
 | ||
|     {name => 'partnumber',     title => t8('Part Number')},
 | ||
|     {name => 'description',    title => t8('Description')},
 | ||
|     {name => 'variant_values', title => t8('Varaint Values')},
 | ||
|     {name => 'notes',          title => t8('Notes')},
 | ||
|     {name => 'ean',            title => t8('EAN')},
 | ||
|   ],
 | ||
| );
 | ||
|  | ||
|  | ||
| ... | ... | |
|   return 1;
 | ||
| }
 | ||
|  | ||
| sub init_onhandqty{
 | ||
| sub variant_values {
 | ||
|   my ($self) = @_;
 | ||
|   return unless $self->is_variant;
 | ||
|   return join(" ",
 | ||
|     map {"[" . $_->variant_property->abbreviation . ":" . $_->abbreviation . "]"}
 | ||
|     $self->variant_property_values);
 | ||
| }
 | ||
|  | ||
| sub init_onhandqty {
 | ||
|   my ($self) = @_;
 | ||
|   my $qty = SL::Helper::Inventory::get_onhand(part => $self->id) || 0;
 | ||
|   return $qty;
 | ||
| }
 | ||
|  | ||
| sub init_stockqty{
 | ||
| sub init_stockqty {
 | ||
|   my ($self) = @_;
 | ||
|   my $qty = SL::Helper::Inventory::get_stock(part => $self->id) || 0;
 | ||
|   return $qty;
 | ||
| SL/Presenter/Part.pm | ||
|---|---|---|
| sub type_abbreviation {
 | ||
|   my ($part_type) = @_;
 | ||
|  | ||
|   return ''                                               if !$part_type;
 | ||
|   return $::locale->text('Assembly (typeabbreviation)')   if $part_type eq 'assembly';
 | ||
|   return $::locale->text('Part (typeabbreviation)')       if $part_type eq 'part';
 | ||
|   return $::locale->text('Assortment (typeabbreviation)') if $part_type eq 'assortment';
 | ||
|   return $::locale->text('Service (typeabbreviation)');
 | ||
|   my %part_type_abbr = (
 | ||
|     part           => t8('Part (typeabbreviation)'),
 | ||
|     assembly       => t8('Assembly (typeabbreviation)'),
 | ||
|     assortment     => t8('Assortment (typeabbreviation)'),
 | ||
|     service        => t8('Service (typeabbreviation)'),
 | ||
|     parent_variant => t8('Parent Variant (typeabbreviation)'),
 | ||
|     variant        => t8('Variant (typeabbreviation)'),
 | ||
|   );
 | ||
|  | ||
|   return $part_type_abbr{$part_type} || '';
 | ||
| }
 | ||
|  | ||
| #
 | ||
| templates/design40_webpages/part/_variant.html | ||
|---|---|---|
|       [% LxERP.t8("Variant Property Values") %]
 | ||
|     </caption>
 | ||
|     <thead>
 | ||
|       <th>[% "Transled Value" | $T8 %]</th>
 | ||
|       <th>[% "Value" | $T8 %]</th>
 | ||
|       <th>[% "Name" | $T8 %]([% "Abbreviation" | $T8 %])</th>
 | ||
|       <th>[% "Abbreviation" | $T8 %]</th>
 | ||
|       <th>[% "Value" | $T8 %]</th>
 | ||
|     </thead>
 | ||
|     <tbody class="row_entry listrow">
 | ||
|     [% FOREACH variant_property_value = SELF.part.variant_property_values %]
 | ||
|     [% FOREACH value = SELF.part.variant_property_values %]
 | ||
|       <tr>
 | ||
|       [% # L.dump(variant_property_value) %]
 | ||
|         <td>[% variant_property_value.value_translated | html %]</td>
 | ||
|         <td>[% variant_property_value.value | html %]</td>
 | ||
|         <td>[% variant_property_value.abbreviation | html %]</td>
 | ||
|         <td>[% value.variant_property.name | html %]([% value.variant_property.abbreviation | html %])</td>
 | ||
|         <td>[% value.abbreviation | html %]</td>
 | ||
|         <td>[% value.value | html %]</td>
 | ||
|       </tr>
 | ||
|     [% END %]
 | ||
|     </tbody>
 | ||
Auch abrufbar als: Unified diff
Varianten: Varianten Eigenschaften im Namen anzeigen