Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 45f68536

Von Sven Schöling vor mehr als 12 Jahren hinzugefügt

  • ID 45f68536866afc499810974ef02fe2947fa04f08
  • Vorgänger b213d89c
  • Nachfolger afd44e0e

Lieferplan: von/bis Filter, Kundennummer Filter, filter summary Grundstruktur

Unterschiede anzeigen:

SL/Controller/DeliveryPlan.pm
145 145
                             obj_link => sub { $self->link_to($_[0]->part) }},
146 146
    qty                     => { text => $::locale->text('Qty'),
147 147
                                  sub => sub { $_[0]->qty_as_number . ' ' . $_[0]->unit }},
148
    missing                 => { text => $::locale->text('Missing qty'),
149
                                  sub => sub { $::form->format_amount(\%::myconfig, $_[0]->qty - $_[0]->shipped_qty, 2) . ' ' . $_[0]->unit }},
148 150
    shipped_qty             => { text => $::locale->text('shipped'),
149 151
                                  sub => sub { $::form->format_amount(\%::myconfig, $_[0]->shipped_qty, 2) . ' ' . $_[0]->unit }},
150 152
    ordnumber               => { text => $::locale->text('Order'),
......
210 212
  return $self->{report}->generate_with_headers;
211 213
}
212 214

  
215
sub make_filter_summary {
216
  my ($self) = @_;
217

  
218
  my $filter = $::form->{filter};
219
  my @filter_strings;
220
  push @filter_strings, $::locale->text('Search Style') . ' ' . ($filter->{searchstyle} eq 'open' ? $::locale->text('Search for undelivered parts') : $::locale->text('Search for delivered parts')) if $filter->{searchstyle} =~ /open|delivered/;
221

  
222
  $self->{filter_summary} = join ', ', @filter_strings;
223
}
224

  
213 225
sub link_to {
214 226
  my ($self, $object, %params) = @_;
215 227

  
......
252 264
    push @{ $filter->{and} }, or => [ @part_filters ] if @part_filters;
253 265
  }
254 266

  
255
  if ($filter->{'reqdate:date::le'}) {
256
    $launder_to->{'reqdate_date__le'} = delete $filter->{'reqdate:date::le'};
257
    my $parsed_date = DateTime->from_lxoffice($launder_to->{'reqdate_date__le'});
258
    push @{ $filter->{and} }, or => [
259
      'reqdate' => { le => $parsed_date },
260
      and => [
261
        'reqdate' => undef,
262
        'order.reqdate' => { le => $parsed_date },
263
      ]
264
    ] if $parsed_date;
267
  for my $op (qw(le ge)) {
268
    if ($filter->{"reqdate:date::$op"}) {
269
      $launder_to->{"reqdate_date__$op"} = delete $filter->{"reqdate:date::$op"};
270
      my $parsed_date = DateTime->from_lxoffice($launder_to->{"reqdate_date__$op"});
271
      push @{ $filter->{and} }, or => [
272
        'reqdate' => { $op => $parsed_date },
273
        and => [
274
          'reqdate' => undef,
275
          'order.reqdate' => { $op => $parsed_date },
276
        ]
277
      ] if $parsed_date;
278
    }
279
  }
280

  
281
  if (my $style = delete $filter->{searchstyle}) {
282
    $self->{searchstyle}       = $style;
283
    $launder_to->{searchstyle} = $style;
265 284
  }
266 285

  
267 286
  return $filter;

Auch abrufbar als: Unified diff