Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 51b0e217

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

  • ID 51b0e217d00123575f362fb81827e89d1534d6fb
  • Vorgänger 66e56cbe
  • Nachfolger 5cd8b1ff

SelfTest: gldate mit itime vergleichen - sollte übereinstimmen

Unterschiede anzeigen:

SL/BackgroundJob/SelfTest/Transactions.pm
15 15

  
16 16
  $self->_setup;
17 17

  
18
  $self->tester->plan(tests => 29);
18
  $self->tester->plan(tests => 32);
19 19

  
20 20
  $self->check_konten_mit_saldo_nicht_in_guv;
21 21
  $self->check_bilanzkonten_mit_pos_eur;
......
44 44
  $self->check_orphaned_reconciliated_links;
45 45
  $self->check_recommended_client_settings;
46 46
  $self->check_orphaned_bank_transaction_acc_trans_links;
47
  $self->check_consistent_itimes;
47 48
}
48 49

  
49 50
sub _setup {
......
716 717
  }
717 718
}
718 719

  
720
sub check_consistent_itimes {
721
  my ($self) = @_;
722
  my $query;
723

  
724
  $query = qq|
725
    SELECT mtime, itime,gldate, acc_trans_id, trans_id
726
    FROM  acc_trans a
727
    WHERE itime::date <> gldate::date
728
    AND a.transdate >= ? and a.transdate <= ?|;
729

  
730
  my $itimes_ac = selectall_hashref_query($::form, $self->dbh, $query, $self->fromdate, $self->todate);
731

  
732
  if ( scalar @{ $itimes_ac } > 0 ) {
733
    $self->tester->ok(0, "Inkonsistente Zeitstempel in der acc_trans gefunden. Bei folgenden ids:");
734
    for my $bogus_time (@{ $itimes_ac }) {
735
      $self->tester->diag("ID: $bogus_time->{trans_id} acc_trans_id: $bogus_time->{acc_trans_id} ");
736
    }
737
  } else {
738
    $self->tester->ok(1, "Keine inkonsistenten Zeitstempel in der acc_trans.");
739
  }
740
  $query = qq|
741
    SELECT amount, itime, gldate, id
742
    FROM ap a
743
    WHERE itime::date <> gldate::date
744
    AND a.transdate >= ? and a.transdate <= ?|;
745

  
746
  my $itimes_ap = selectall_hashref_query($::form, $self->dbh, $query, $self->fromdate, $self->todate);
747

  
748
  if ( scalar @{ $itimes_ap } > 0 ) {
749
    $self->tester->ok(0, "Inkonsistente Zeitstempel in ap gefunden. Bei folgenden ids:");
750
    for my $bogus_time (@{ $itimes_ap }) {
751
      $self->tester->diag("ID: $bogus_time->{id} itime: $bogus_time->{itime} mtime: $bogus_time->{mtime} ");
752
    }
753
  } else {
754
    $self->tester->ok(1, "Keine inkonsistenten Zeitstempel in ap.");
755
  }
756
  $query = qq|
757
    SELECT amount, itime, gldate, id
758
    FROM ar a
759
    WHERE itime::date <> gldate::date
760
    AND a.transdate >= ? and a.transdate <= ?|;
761

  
762
  my $itimes_ar = selectall_hashref_query($::form, $self->dbh, $query, $self->fromdate, $self->todate);
763

  
764
  if ( scalar @{ $itimes_ap } > 0 ) {
765
    $self->tester->ok(0, "Inkonsistente Zeitstempel in ar gefunden. Bei folgenden ids:");
766
    for my $bogus_time (@{ $itimes_ar }) {
767
      $self->tester->diag("ID: $bogus_time->{id} itime: $bogus_time->{itime} mtime: $bogus_time->{mtime} ");
768
    }
769
  } else {
770
    $self->tester->ok(1, "Keine inkonsistenten Zeitstempel in ar.");
771
  }
772
  $query = qq|
773
    SELECT itime, gldate, id, mtime
774
    FROM gl a
775
    WHERE itime::date <> gldate::date
776
    AND a.transdate >= ? and a.transdate <= ?|;
777

  
778
  my $itimes_gl = selectall_hashref_query($::form, $self->dbh, $query, $self->fromdate, $self->todate);
779

  
780
  if ( scalar @{ $itimes_gl } > 0 ) {
781
    $self->tester->ok(0, "Inkonsistente Zeitstempel in gl gefunden. Bei folgenden ids:");
782
    for my $bogus_time (@{ $itimes_ar }) {
783
      $self->tester->diag("ID: $bogus_time->{id} itime: $bogus_time->{itime} mtime: $bogus_time->{mtime} ");
784
    }
785
  } else {
786
    $self->tester->ok(1, "Keine inkonsistenten Zeitstempel in gl.");
787
  }
788
}
789

  
719 790
1;
720 791

  
721 792
__END__

Auch abrufbar als: Unified diff