Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8e08bedb

Von Sven Schöling vor mehr als 15 Jahren hinzugefügt

  • ID 8e08bedb4b4bfb97adcb4f4eb94a60012ca3729b
  • Vorgänger fa7a78e6
  • Nachfolger 20bb56c1

Mahnsystem - mehr Variablen exportieren

Ausserdem strict fixes.

Unterschiede anzeigen:

SL/DN.pm
457 457
    push(@values, $form->{minamount});
458 458
  }
459 459

  
460
  $query =
460
  my $query =
461 461
    qq|SELECT id
462 462
       FROM dunning_config
463 463
       WHERE dunning_level = (SELECT MAX(dunning_level) FROM dunning_config)|;
......
512 512

  
513 513
  $form->{DUNNINGS} = [];
514 514

  
515
  while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
515
  while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
516 516
    next if ($ref->{pastdue} < $ref->{terms});
517 517

  
518 518
    $ref->{interest} = $form->round_amount($ref->{interest}, 2);
......
537 537
  # connect to database
538 538
  my $dbh = $form->dbconnect($myconfig);
539 539

  
540
  $where = qq| WHERE (da.trans_id = a.id)|;
540
  my $where = qq| WHERE (da.trans_id = a.id)|;
541 541

  
542 542
  my @values;
543 543

  
......
663 663
    $form->error($main::locale->text('Could not spawn the printer command.')) unless $out;
664 664

  
665 665
  } else {
666
    my $dunning_filename = $form->get_formname_translation('dunning');
666 667
    $out = IO::File->new('>-');
667 668
    $out->print(qq|Content-Type: Application/PDF\n| .
668
                qq|Content-Disposition: attachment; filename="dunning_${dunning_id}.pdf"\n\n|);
669
                qq|Content-Disposition: attachment; filename="${dunning_filename}_${dunning_id}.pdf"\n\n|);
669 670
  }
670 671

  
671 672
  while (my $line = <$in>) {
......
712 713

  
713 714
  my $sth = prepare_execute_query($form, $dbh, $query, $dunning_id);
714 715
  my $first = 1;
715
  while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
716
  while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
716 717
    if ($first) {
717 718
      $form->{TEMPLATE_ARRAYS} = {};
718 719
      map({ $form->{TEMPLATE_ARRAYS}->{"dn_$_"} = []; } keys(%{$ref}));
......
737 738
       LEFT JOIN contacts co ON (ar.cp_id = co.cp_id)
738 739
       WHERE (d.dunning_id = ?)
739 740
       LIMIT 1|;
740
  $ref = selectfirst_hashref_query($form, $dbh, $query, $dunning_id);
741
  my $ref = selectfirst_hashref_query($form, $dbh, $query, $dunning_id);
741 742
  map { $form->{$_} = $ref->{$_} } keys %{ $ref };
742 743

  
743 744
  $query =
......
832 833
       FROM ar
833 834
       LEFT JOIN customer c ON (ar.customer_id = c.id)
834 835
       WHERE ar.id = ?|;
835
  $ref = selectfirst_hashref_query($form, $dbh, $query, $ar_id);
836
  my $ref = selectfirst_hashref_query($form, $dbh, $query, $ar_id);
836 837
  map { $form->{$_} = $ref->{$_} } keys %{ $ref };
837 838

  
838 839
  $query = qq|SELECT * FROM employee WHERE login = ?|;

Auch abrufbar als: Unified diff