Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[kivitendo-erp.git] / SL / DB / SepaExportItem.pm
1 package SL::DB::SepaExportItem;
2
3 use strict;
4
5 use SL::DB::MetaSetup::SepaExportItem;
6
7 __PACKAGE__->meta->initialize;
8
9 # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
10 __PACKAGE__->meta->make_manager_class;
11
12 sub compare_to {
13   my ($self, $other) = @_;
14
15   return  1 if  $self->execution_date && !$other->execution_date;
16   return -1 if !$self->execution_date &&  $other->execution_date;
17
18   my $result = 0;
19   $result    = $self->execution_date <=> $other->execution_date if $self->execution_date;
20   return $result || ($self->sepa_export_id <=> $other->sepa_export_id) || ($self->id <=> $other->id);
21 }
22
23 1;