Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3e79972f

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

  • ID 3e79972f6ef5617708e4eef5d66c82a66cf6a588
  • Vorgänger 11560e68
  • Nachfolger 932e6428

QS Bernd/Sven: Weniger Code und klarer

zu: c22e188b4d7aabd
und: 8453789b

Unterschiede anzeigen:

SL/Helper/ShippedQty.pm
221 221
    } elsif ('SL::DB::Order' eq ref $obj) {
222 222
      if (defined $obj->{orderitems}) {
223 223
        $self->write_to($obj->{orderitems});
224
        $obj->{delivered} = all { $_->{delivered} } grep { !$_->{optional} || $_->{optional} == 0 } @{ $obj->{orderitems} };
224
        $obj->{delivered} = all { $_->{delivered} } grep { !$_->{optional} } @{ $obj->{orderitems} };
225 225
      } else {
226 226
        # don't force a load on items. just compute by oe_id directly
227 227
        $obj->{delivered} = $self->delivered->{$obj->id};
bin/mozilla/do.pl
245 245
  my $insertdate = DateTime->from_kivitendo($::form->{insertdate});
246 246
  my $undo_transfer  = 0;
247 247
  if (ref $undo_date eq 'DateTime' && ref $insertdate eq 'DateTime') {
248
    # DateTime->compare      it returns 1 if $dt1 > $dt2
249
    $undo_transfer = DateTime->compare($insertdate, $undo_date) == 1 ? 1 : 0;
248
    $undo_transfer = $insertdate > $undo_date;
250 249
  }
251 250
  for my $bar ($::request->layout->get('actionbar')) {
252 251
    $bar->add(
bin/mozilla/wh.pl
753 753

  
754 754
    if ($entry->{assembled}) {
755 755
      my $insertdate = DateTime->from_kivitendo($entry->{shippingdate});
756
      if (ref $undo_date eq 'DateTime' && ref $insertdate eq 'DateTime') {
757
        my $undo_assembly = DateTime->compare($insertdate, $undo_date) == 1 ? 1 : 0;
758
        $row->{ids}->{raw_data} = checkbox_tag("ids[]", value => $entry->{trans_id}, "data-checkall" => 1) if $undo_assembly;
756
      if (ref $undo_date eq 'DateTime' && ref $insertdate eq 'DateTime' && $insertdate > $undo_date) {
757
        $row->{ids}->{raw_data} = checkbox_tag("ids[]", value => $entry->{trans_id}, "data-checkall" => 1);
759 758
      }
760 759
    }
761 760
    $row->{trans_type}->{raw_data} = $entry->{trans_type};

Auch abrufbar als: Unified diff