} elsif ('SL::DB::Order' eq ref $obj) {
if (defined $obj->{orderitems}) {
$self->write_to($obj->{orderitems});
- $obj->{delivered} = all { $_->{delivered} } grep { !$_->{optional} || $_->{optional} == 0 } @{ $obj->{orderitems} };
+ $obj->{delivered} = all { $_->{delivered} } grep { !$_->{optional} } @{ $obj->{orderitems} };
} else {
# don't force a load on items. just compute by oe_id directly
$obj->{delivered} = $self->delivered->{$obj->id};
my $insertdate = DateTime->from_kivitendo($::form->{insertdate});
my $undo_transfer = 0;
if (ref $undo_date eq 'DateTime' && ref $insertdate eq 'DateTime') {
- # DateTime->compare it returns 1 if $dt1 > $dt2
- $undo_transfer = DateTime->compare($insertdate, $undo_date) == 1 ? 1 : 0;
+ $undo_transfer = $insertdate > $undo_date;
}
for my $bar ($::request->layout->get('actionbar')) {
$bar->add(
if ($entry->{assembled}) {
my $insertdate = DateTime->from_kivitendo($entry->{shippingdate});
- if (ref $undo_date eq 'DateTime' && ref $insertdate eq 'DateTime') {
- my $undo_assembly = DateTime->compare($insertdate, $undo_date) == 1 ? 1 : 0;
- $row->{ids}->{raw_data} = checkbox_tag("ids[]", value => $entry->{trans_id}, "data-checkall" => 1) if $undo_assembly;
+ if (ref $undo_date eq 'DateTime' && ref $insertdate eq 'DateTime' && $insertdate > $undo_date) {
+ $row->{ids}->{raw_data} = checkbox_tag("ids[]", value => $entry->{trans_id}, "data-checkall" => 1);
}
}
$row->{trans_type}->{raw_data} = $entry->{trans_type};