Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f15f5e43

Von Jan Büren vor mehr als 2 Jahren hinzugefügt

  • ID f15f5e4321df31d2279edb480e9c7fc15c3af31c
  • Vorgänger 1b032ef4
  • Nachfolger b775c378

Lieferwertbericht um Filter nach Warengruppen erweitert

Unterschiede anzeigen:

SL/Controller/DeliveryValueReport.pm
17 17
use Data::Dumper;
18 18

  
19 19
use Rose::Object::MakeMethods::Generic (
20
  'scalar --get_set_init' => [ qw(models vc all_employees all_businesses) ],
20
  'scalar --get_set_init' => [ qw(models vc all_employees all_businesses all_partsgroups) ],
21 21
);
22 22

  
23 23
__PACKAGE__->run_before(sub { $::auth->assert('delivery_value_report'); });
......
141 141
sub make_filter_summary {
142 142
  my ($self) = @_;
143 143
  my $vc     = $self->vc;
144
  my ($business, $employee);
144
  my ($business, $employee, $partsgroup);
145 145

  
146 146
  my $filter = $::form->{filter} || {};
147 147
  my @filter_strings;
148 148

  
149
  $business = SL::DB::Business->new(id => $filter->{order}{customer}{"business_id"})->load->description if $filter->{order}{customer}{"business_id"};
150
  $employee = SL::DB::Employee->new(id => $filter->{order}{employee_id})->load->name if $filter->{order}{employee_id};
149
  $business   = SL::DB::Business->new(id => $filter->{order}{customer}{"business_id"})->load->description if $filter->{order}{customer}{"business_id"};
150
  $employee   = SL::DB::Employee->new(id => $filter->{order}{employee_id})->load->name                    if $filter->{order}{employee_id};
151
  $partsgroup = SL::DB::PartsGroup->new(id => $filter->{part}{partsgroup_id})->load->partsgroup           if $filter->{part}{partsgroup_id};
151 152

  
152 153
  my @filters = (
153 154
    [ $filter->{order}{"ordnumber:substr::ilike"},                    $::locale->text('Number')                                             ],
......
163 164
    [ $filter->{order}{customer}{"customernumber:substr::ilike"},     $::locale->text('Customer Number')                                    ],
164 165
    [ $business,                                                      $::locale->text('Customer type')                                      ],
165 166
    [ $employee,                                                      $::locale->text('Employee')                                           ],
167
    [ $partsgroup,                                                    $::locale->text('Partsgroup')                                         ],
166 168
  );
167 169

  
168 170
  # flags for with_object 'part'
......
217 219
sub init_all_businesses {
218 220
  return SL::DB::Manager::Business->get_all_sorted;
219 221
}
222
sub init_all_partsgroups {
223
  return SL::DB::Manager::PartsGroup->get_all_sorted;
224
}
220 225

  
221 226

  
222 227
sub link_to {
templates/webpages/delivery_value_report/_filter.html
78 78
                     style      => 'width: 200px') %]
79 79
   </td>
80 80
  </tr>
81
  [%- IF SELF.all_partsgroups.size %]
82
  <tr>
83
     <th align="right">[% 'Partsgroup' | $T8 %]</th>
84
     <td>[%- L.select_tag('filter.part.partsgroup_id', SELF.all_partsgroups, default=filter.part.partsgroup_id, title_key='partsgroup', value_key='id', with_empty=1 style='width: 200px') %]</td>
85
  </tr>
86
  [% END %]
81 87
  <tr>
82 88
   <th align="right">[% 'Type' | $T8 %]</th>
83 89
   <td>

Auch abrufbar als: Unified diff