Revision 7dab0cbd
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
bin/mozilla/dn.pl | ||
---|---|---|
105 | 105 |
|
106 | 106 |
<table width=100%> |
107 | 107 |
<tr> |
108 |
<th class=listtop colspan=9>$form->{title}</th>
|
|
108 |
<th class=listtop colspan=10>$form->{title}</th>
|
|
109 | 109 |
</tr> |
110 | 110 |
<tr height="5"></tr> |
111 | 111 |
<tr>|; |
... | ... | |
321 | 321 |
<th align=right nowrap>| . $locale->text('Payment until') . qq|</th> |
322 | 322 |
$button1 |
323 | 323 |
</tr> |
324 |
<input type=hidden name=sort value=transdate> |
|
325 | 324 |
</table> |
326 | 325 |
</td> |
327 | 326 |
</tr> |
... | ... | |
446 | 445 |
|
447 | 446 |
<table width=100%> |
448 | 447 |
<tr> |
449 |
<th class=listtop colspan=9>$form->{title}</th>
|
|
448 |
<th class=listtop colspan=11>$form->{title}</th>
|
|
450 | 449 |
</tr> |
451 | 450 |
<tr height="5"></tr> |
452 | 451 |
<tr>|; |
... | ... | |
572 | 571 |
if ($form->{groupinvoices}) { |
573 | 572 |
while ($active) { |
574 | 573 |
$lastcustomer = 0; |
575 |
$form->{inv_ids} = "";
|
|
574 |
$form->{inv_ids} = [];
|
|
576 | 575 |
$active = 0; |
577 | 576 |
@rows = (); |
578 | 577 |
for my $i (1 .. $form->{rowcount}) { |
579 | 578 |
$form->{"active_$i"} *= 1; |
580 | 579 |
$lastcustomer = $form->{"customer_id_$i"} unless ($lastcustomer); |
581 | 580 |
if ($form->{"active_$i"} && ($form->{"customer_id_$i"} == $lastcustomer)) { |
582 |
if ($form->{inv_ids}) { |
|
583 |
$form->{inv_ids} .= qq|,$form->{"inv_id_$i"}|; |
|
584 |
} else { |
|
585 |
$form->{inv_ids} = qq|($form->{"inv_id_$i"}|; |
|
586 |
} |
|
581 |
push(@{ $form->{inv_ids} }, $form->{"inv_id_$i"}); |
|
587 | 582 |
$form->{"active_$i"} = 0; |
588 | 583 |
$form->{"customer_id_$i"} = 0; |
589 | 584 |
push(@rows, $i); |
... | ... | |
593 | 588 |
$form->{"customer_id_$i"} = 0; |
594 | 589 |
} |
595 | 590 |
} |
596 |
if ($form->{inv_ids} ne "") { |
|
597 |
$form->{inv_ids} .= ")"; |
|
591 |
if (scalar(@{ $form->{inv_ids} }) != 0) { |
|
598 | 592 |
DN->save_dunning(\%myconfig, \%$form, \@rows, $userspath,$spool, $sendmail); |
599 | 593 |
} |
600 | 594 |
} |
... | ... | |
602 | 596 |
for my $i (1 .. $form->{rowcount}) { |
603 | 597 |
if ($form->{"active_$i"}) { |
604 | 598 |
@rows = (); |
605 |
$form->{inv_ids} = qq|($form->{"inv_id_$i"})|;
|
|
599 |
$form->{inv_ids} = [ $form->{"inv_id_$i"} ];
|
|
606 | 600 |
push(@rows, $i); |
607 | 601 |
DN->save_dunning(\%myconfig, \%$form, \@rows, $userspath,$spool, $sendmail); |
608 | 602 |
} |
... | ... | |
774 | 768 |
$button4 |
775 | 769 |
</tr> |
776 | 770 |
|
777 |
<input type=hidden name=sort value=transdate> |
|
778 | 771 |
</table> |
779 | 772 |
</td> |
780 | 773 |
</tr> |
... | ... | |
885 | 878 |
|
886 | 879 |
<table width=100%> |
887 | 880 |
<tr> |
888 |
<th class=listtop colspan=9>$form->{title}</th>
|
|
881 |
<th class=listtop colspan=10>$form->{title}</th>
|
|
889 | 882 |
</tr> |
890 | 883 |
<tr height="5"></tr> |
891 | 884 |
<tr>|; |
... | ... | |
895 | 888 |
</tr> |
896 | 889 |
|; |
897 | 890 |
my $i = 0; |
891 |
my $j = 0; |
|
892 |
my $previous_customer_id; |
|
898 | 893 |
foreach $ref (@{ $form->{DUNNINGS} }) { |
899 |
|
|
900 | 894 |
$i++; |
901 |
my $j = $i % 2; |
|
895 |
$j++ if ($previous_customer_id != $ref->{customer_id}); |
|
896 |
$j = $j % 2; |
|
897 |
$previous_customer_id = $ref->{customer_id}; |
|
902 | 898 |
|
903 | 899 |
print qq| |
904 | 900 |
<tr valign=top class=listrow$j> |
... | ... | |
913 | 909 |
} else { |
914 | 910 |
$script = "ar.pl"; |
915 | 911 |
} |
916 |
$column_data{dunning_description} = qq|<td><a href=dn.pl?action=print_dunning&dunning_id=$ref->{dunning_id}&format=pdf&media=screen&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$form->{callback}>$ref->{dunning_description}</a></td>|; |
|
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>|;
|
|
917 | 913 |
my $active = "checked"; |
918 | 914 |
$column_data{dunning_date} = qq|<td>$ref->{dunning_date}</td>|; |
919 | 915 |
$column_data{next_duedate} = qq|<td>$ref->{dunning_duedate}</td>|; |
... | ... | |
972 | 968 |
sub print_dunning { |
973 | 969 |
$lxdebug->enter_sub(); |
974 | 970 |
|
975 |
DN->print_dunning(\%myconfig, \%$form, $form->{dunning_id}, $userspath,$spool, $sendmail);
|
|
971 |
DN->print_dunning(\%myconfig, \%$form, $form->{dunning_id}, $form->{customer_id}, $userspath, $spool, $sendmail);
|
|
976 | 972 |
|
977 | 973 |
if($form->{DUNNING_PDFS}) { |
978 | 974 |
DN->melt_pdfs(\%myconfig, \%$form,$spool); |
Auch abrufbar als: Unified diff
Vermeidung von SQL injection durch Verwendung von parametrisierten Queries. Zusätzlich die Optik beim Bericht über laufende Mahnungen verbessert. Fehler beseitigt, dass das erneute Ausdrucken von Mahnungen alle Mahnungen zusammengefasst hat, auch über Kundengrenzen hinaus.