Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 840aea13

Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt

  • ID 840aea131eef33512dccc13184e01affafaafb37
  • Vorgänger 7dab0cbd
  • Nachfolger f6a5acf0

Mahnwesen: Die Tabelle dunning so umgebaut, dass gemeinsam gestartete Mahnungen auch später gemeinsam erneut ausgedruckt werden können. Dafür auch die Listenansicht bereits gestarteter Mahnungen verbessert.

Unterschiede anzeigen:

bin/mozilla/dn.pl
163 163
  $column_data{dunning_level} =
164 164
    qq|<td><input type=hidden size=2 name=dunning_level_$i value=$i>$i</td>|;
165 165
  $column_data{dunning_description}           = qq|<td><input name=dunning_description_$i ></td>|;
166
  my $active = "";
167 166
  $column_data{active} =
168
    qq|<td><input type=checkbox name=active_$i value=1 $active></td>|;
167
    qq|<td><input type=checkbox name=active_$i value=1></td>|;
169 168
  my $email = "";
170 169
  $column_data{email} =
171 170
    qq|<td><input type=checkbox name=email_$i value=1 $email><button type="button" onclick="set_email_window('email_subject_$i', 'email_body_$i', 'email_attachment_$i')">| . $locale->text('L') . qq|</button><input type=hidden name=email_body_$i><input type=hidden name=email_subject_$i><input type=hidden name=email_attachment_$i></td>|;
......
465 464
|;
466 465

  
467 466
  $form->{selectdunning} =~ s/ selected//g;
468
  if ($ref->{next_dunning_id} ne "") {
469
     $form->{selectdunning} =~ s/value=$ref->{next_dunning_id}/value=$ref->{next_dunning_id} selected/;
467
  if ($ref->{next_dunning_config_id} ne "") {
468
     $form->{selectdunning} =~ s/value=$ref->{next_dunning_config_id}/value=$ref->{next_dunning_config_id} selected/;
470 469
  }
471 470
  
472 471

  
473
  $dunning = qq|<select name=next_dunning_id_$i>$form->{selectdunning}</select>|;
472
  $dunning = qq|<select name=next_dunning_config_id_$i>$form->{selectdunning}</select>|;
474 473

  
475 474

  
476 475
    $column_data{dunning_description}           = qq|<td><input type=hidden name=inv_id_$i size=2 value="$ref->{id}"><input type=hidden name=customer_id_$i size=2 value="$ref->{customer_id}">$ref->{dunning_level}:&nbsp;$dunning</td>|;
......
589 588
        }
590 589
      }
591 590
      if (scalar(@{ $form->{inv_ids} }) != 0) {
592
        DN->save_dunning(\%myconfig, \%$form, \@rows, $userspath,$spool, $sendmail);
591
        DN->save_dunning(\%myconfig, \%$form, \@rows, $userspath, $spool, $sendmail);
593 592
      }
594 593
    }
595 594
  } else {
......
598 597
        @rows = ();
599 598
        $form->{inv_ids} = [ $form->{"inv_id_$i"} ];
600 599
        push(@rows, $i);
601
        DN->save_dunning(\%myconfig, \%$form, \@rows, $userspath,$spool, $sendmail);
600
        DN->save_dunning(\%myconfig, \%$form, \@rows, $userspath, $spool, $sendmail);
602 601
      }
603 602
    }
604 603
  }
......
887 886
  print qq|
888 887
        </tr>
889 888
|;
889

  
890
  my %columns = (
891
    "dunning_duedate" => "next_duedate",
892
    "duedate" => "inv_duedate",
893
    "transdate" => "invdate",
894
    "amount" => "invamount",
895
    );
896

  
890 897
  my $i = 0;
891 898
  my $j = 0;
892
  my $previous_customer_id;
899
  my ($previous_dunning_id, $first_row_for_dunning);
893 900
  foreach $ref (@{ $form->{DUNNINGS} }) {
894 901
    $i++;
895
    $j++ if ($previous_customer_id != $ref->{customer_id});
896
    $j = $j % 2;
897
    $previous_customer_id = $ref->{customer_id};
902

  
903
    if ($previous_dunning_id != $ref->{dunning_id}) {
904
      $j++;
905
      $j = $j % 2;
906
      $first_row_for_dunning = 1;
907
    } else {
908
      $first_row_for_dunning = 0;
909
    }
910
    $previous_dunning_id = $ref->{dunning_id};
898 911

  
899 912
    print qq|
900 913
        <tr valign=top class=listrow$j>
......
902 915

  
903 916
  
904 917

  
905
  $dunning = qq|<select name=next_dunning_id_$i>$form->{selectdunning}</select>|;
906
    my $script = "";
907
    if ($ref->{invoice}) {
908
      $script = "is.pl";
909
    } else {
910
      $script = "ar.pl";
918
    foreach (qw(dunning_date dunning_duedate duedate transdate customername
919
                amount fee interest)) {
920
      my $col = $columns{$_} ? $columns{$_} : $_;
921
      $column_data{$col} = "<td>" . H($ref->{$_}) . "</td>";
911 922
    }
912
    $column_data{dunning_description}           = qq|<td><a href=dn.pl?action=print_dunning&dunning_id=$ref->{dunning_id}&customer_id=$ref->{customer_id}&format=pdf&media=screen&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$form->{callback}>$ref->{dunning_description}</a></td>|;
913
    my $active = "checked";
914
    $column_data{dunning_date}           = qq|<td>$ref->{dunning_date}</td>|;
915
    $column_data{next_duedate}           = qq|<td>$ref->{dunning_duedate}</td>|;
916

  
917
    $column_data{inv_duedate}           = qq|<td>$ref->{duedate}</td>|;
918
    $column_data{invdate}           = qq|<td>$ref->{transdate}</td>|;
919
    $column_data{invnumber}           = qq|<td><a href=$script?action=edit&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$form->{callback}>$ref->{invnumber}</a></td>|;
920
    $column_data{customername}           = qq|<td>$ref->{customername}</td>|;
921
    $column_data{invamount}           = qq|<td>$ref->{amount}</td>|;
922
    $column_data{fee}           = qq|<td>$ref->{fee}</td>|;
923
    $column_data{interest}           = qq|<td>$ref->{interest}</td>|;
924 923

  
924
    if ($first_row_for_dunning) {
925
      $column_data{dunning_description} =
926
        qq|<td><a href="dn.pl?action=print_dunning&format=pdf&media=screen&| .
927
        qq|dunning_id=| . E($ref->{dunning_id}) .
928
        join(map({ "&${_}=" . E($form->{$_}) } qw(login path password callback))) .
929
        qq|">| . H($ref->{dunning_description}) . qq|</a></td>|;
930
    } else {
931
      $column_data{dunning_description} = qq|<td>&nbsp;</td>|;
932
      $column_data{customername} = qq|<td>&nbsp;</td>|;
933
    }
925 934

  
935
    $column_data{invnumber} =
936
      qq|<td><a href="| . ($ref->{invoice} ? "is.pl" : "ar.pl" ) .
937
      qq|?action=edit&id=| . H($ref->{id}) .
938
      join(map({ "&${_}=" . E($form->{$_}) } qw(login path password callback))) .
939
      qq|">| . H($ref->{invnumber}) . qq|</a></td>|;
926 940

  
927 941
    map { print "$column_data{$_}\n" } @column_index;
928 942

  
......
968 982
sub print_dunning {
969 983
  $lxdebug->enter_sub();
970 984

  
971
  DN->print_dunning(\%myconfig, \%$form, $form->{dunning_id}, $form->{customer_id}, $userspath, $spool, $sendmail);
985
  DN->print_dunning(\%myconfig, \%$form, $form->{dunning_id}, $userspath, $spool, $sendmail);
972 986

  
973 987
  if($form->{DUNNING_PDFS}) {
974 988
    DN->melt_pdfs(\%myconfig, \%$form,$spool);

Auch abrufbar als: Unified diff