Verknüpfte Dokumente: Auch SEPA-Überweisungen/-Einzüge anzeigen
[kivitendo-erp.git] / SL / DB / SepaExportItem.pm
index 3c46ee3..7570116 100644 (file)
@@ -1,6 +1,3 @@
-# This file has been auto-generated only because it didn't exist.
-# Feel free to modify it at will; it will not be overwritten automatically.
-
 package SL::DB::SepaExportItem;
 
 use strict;
@@ -10,4 +7,15 @@ use SL::DB::MetaSetup::SepaExportItem;
 # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
 __PACKAGE__->meta->make_manager_class;
 
+sub compare_to {
+  my ($self, $other) = @_;
+
+  return  1 if  $self->execution_date && !$other->execution_date;
+  return -1 if !$self->execution_date &&  $other->execution_date;
+
+  my $result = 0;
+  $result    = $self->execution_date <=> $other->execution_date if $self->execution_date;
+  return $result || ($self->sepa_export_id <=> $other->sepa_export_id) || ($self->id <=> $other->id);
+}
+
 1;