Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c7f777ac

Von T. Eickmeyer vor etwa 12 Jahren hinzugefügt

  • ID c7f777ac5f9a7c13bf402d008cf609a7ba33a9c5
  • Vorgänger aac51ec7
  • Nachfolger 357d134d

SelfTest: Ungepaarte Stornos auch im Einkauf prüfen

Unterschiede anzeigen:

SL/BackgroundJob/SelfTest/Transactions.pm
284 284
  my ($self) = @_;
285 285

  
286 286
  my $query = qq|
287
      select ar.id,invnumber,storno,amount,transdate,type,customernumber
288
    from ar
289
    left join customer c on (c.id = ar.customer_id)
290
    where storno_id is null and storno is true and ar.id not in (select storno_id from ar where storno_id is not null and storno is true);
287
    SELECT (SELECT cast ('ar' as text)) as invoice ,ar.id,invnumber,storno,amount,transdate,type,customernumber as cv_number
288
    FROM ar
289
    LEFT JOIN customer c on (c.id = ar.customer_id)
290
    WHERE storno_id is null AND storno is true AND ar.id not in (SELECT storno_id FROM ar WHERE storno_id is not null AND storno is true)
291
    UNION
292
    SELECT (SELECT cast ('ap' as text)) as invoice,ap.id,invnumber,storno,amount,transdate,type,vendornumber as cv_number
293
    FROM ap
294
    LEFT JOIN vendor v on (v.id = ap.vendor_id)
295
    WHERE storno_id is null AND storno is true AND ap.id not in (SELECT storno_id FROM ap WHERE storno_id is not null AND storno is true);
291 296
  |;
297
 
292 298
  my $stornos_ohne_partner =  selectall_hashref_query($::form, $self->dbh, $query);
293 299

  
294 300
  $self->tester->ok(@$stornos_ohne_partner == 0, 'Es sollte keine Stornos ohne Partner geben');
295 301
  if (@$stornos_ohne_partner) {
296
    $self->tester->diag("stornos ohne partner:   (kann passieren wenn Stornorechnung außerhalb Zeitraum liegt)");
302
    $self->tester->diag("Stornos ohne Partner:   (kann passieren wenn Stornorechnung außerhalb Zeitraum liegt)");
297 303
    $self->tester->diag("gilt aber trotzdem als paid zu dem Zeitpunkt, oder?");
298 304
  }
299 305
  my $stornoheader = 0;

Auch abrufbar als: Unified diff