Revision 232a9153
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
bin/mozilla/dn.pl | ||
---|---|---|
31 | 31 |
# |
32 | 32 |
#====================================================================== |
33 | 33 |
|
34 |
use POSIX; |
|
35 |
|
|
34 | 36 |
use SL::IS; |
35 | 37 |
use SL::PE; |
36 | 38 |
use SL::DN; |
37 |
use Data::Dumper; |
|
38 | 39 |
|
39 | 40 |
require "bin/mozilla/common.pl"; |
40 | 41 |
require "bin/mozilla/io.pl"; |
... | ... | |
46 | 47 |
$lxdebug->enter_sub(); |
47 | 48 |
|
48 | 49 |
DN->get_config(\%myconfig, \%$form); |
50 |
$form->get_lists('charts' => { 'key' => 'ALL_CHARTS', |
|
51 |
'transdate' => 'current_date' }); |
|
52 |
|
|
53 |
$form->{SELECT_AR_AMOUNT} = []; |
|
54 |
$form->{SELECT_AR} = []; |
|
55 |
|
|
56 |
foreach my $chart (@{ $form->{ALL_CHARTS} }) { |
|
57 |
$chart->{LINKS} = { map { $_, 1 } split m/:/, $chart->{link} }; |
|
58 |
|
|
59 |
if ($chart->{LINKS}->{AR}) { |
|
60 |
$chart->{AR_selected} = "selected" if $chart->{id} == $form->{AR}; |
|
61 |
push @{ $form->{SELECT_AR} }, $chart; |
|
62 |
} |
|
63 |
|
|
64 |
if ($chart->{LINKS}->{AR_amount}) { |
|
65 |
$chart->{AR_amount_fee_selected} = "selected" if $chart->{id} == $form->{AR_amount_fee}; |
|
66 |
$chart->{AR_amount_interest_selected} = "selected" if $chart->{id} == $form->{AR_amount_interest}; |
|
67 |
push @{ $form->{SELECT_AR_AMOUNT} }, $chart; |
|
68 |
} |
|
69 |
} |
|
49 | 70 |
|
50 | 71 |
$form->{title} = $locale->text('Edit Dunning Process Config'); |
51 | 72 |
$form->{callback} ||= build_std_url("action=edit_config"); |
... | ... | |
95 | 116 |
map { $row->{$_} = $form->format_amount(\%myconfig, $row->{$_} * 1, -2) } qw(amount fee interest); |
96 | 117 |
} |
97 | 118 |
|
119 |
$form->get_lists('printers' => 'printers', |
|
120 |
'languages' => 'languages'); |
|
121 |
|
|
98 | 122 |
$form->{type} = 'dunning'; |
99 | 123 |
$form->{rowcount} = scalar @{ $form->{DUNNINGS} }; |
100 | 124 |
$form->{jsscript} = 1; |
101 | 125 |
$form->{callback} ||= build_std_url("action=show_invoices", qw(login password customer invnumber ordnumber groupinvoices minamount dunning_level notes)); |
102 | 126 |
|
103 |
$form->{PRINT_OPTIONS} = print_options({ 'inline' => 1 }); |
|
127 |
$form->{PRINT_OPTIONS} = print_options({ 'inline' => 1, |
|
128 |
'no_queue' => 1, |
|
129 |
'no_postscript' => 1, |
|
130 |
'no_html' => 1, |
|
131 |
'no_opendocument' => 1, }); |
|
104 | 132 |
|
105 | 133 |
$form->header(); |
106 | 134 |
print $form->parse_html_template("dunning/show_invoices"); |
... | ... | |
163 | 191 |
foreach my $level (values %{ $levels }) { |
164 | 192 |
next unless scalar @{ $level }; |
165 | 193 |
|
166 |
DN->save_dunning(\%myconfig, \%$form, $level, $userspath, $spool, $sendmail);
|
|
194 |
DN->save_dunning(\%myconfig, $form, $level, $userspath, $spool, $sendmail); |
|
167 | 195 |
} |
168 | 196 |
} |
169 | 197 |
|
... | ... | |
176 | 204 |
"customer_id" => $form->{"customer_id_$i"}, |
177 | 205 |
"next_dunning_config_id" => $form->{"next_dunning_config_id_$i"}, |
178 | 206 |
"email" => $form->{"email_$i"}, } ]; |
179 |
DN->save_dunning(\%myconfig, \%$form, $level, $userspath, $spool, $sendmail);
|
|
207 |
DN->save_dunning(\%myconfig, $form, $level, $userspath, $spool, $sendmail); |
|
180 | 208 |
} |
181 | 209 |
} |
182 | 210 |
|
183 | 211 |
if($form->{DUNNING_PDFS}) { |
184 |
DN->melt_pdfs(\%myconfig, \%$form,$spool);
|
|
212 |
DN->melt_pdfs(\%myconfig, $form);
|
|
185 | 213 |
} |
186 | 214 |
|
187 | 215 |
# saving the history |
... | ... | |
192 | 220 |
} |
193 | 221 |
# /saving the history |
194 | 222 |
|
195 |
$form->redirect($locale->text('Dunning Process started for selected invoices!')); |
|
223 |
$form->redirect($locale->text('Dunning Process started for selected invoices!')) if ($form->{media} eq 'printer');
|
|
196 | 224 |
|
197 | 225 |
$lxdebug->leave_sub(); |
198 | 226 |
} |
... | ... | |
270 | 298 |
ransdatefrom transdateto dunningfrom dunningto notes showold)); |
271 | 299 |
} |
272 | 300 |
|
273 |
$form->{title} = $locale->text('Dunning overview'); |
|
301 |
$form->get_lists('printers' => 'printers', |
|
302 |
'languages' => 'languages'); |
|
303 |
|
|
304 |
$form->{type} = 'dunning'; |
|
305 |
$form->{PRINT_OPTIONS} = print_options({ 'inline' => 1, |
|
306 |
'no_queue' => 1, |
|
307 |
'no_postscript' => 1, |
|
308 |
'no_html' => 1, |
|
309 |
'no_opendocument' => 1, }); |
|
310 |
$form->{title} = $locale->text('Dunning overview'); |
|
311 |
|
|
274 | 312 |
$form->header(); |
275 | 313 |
|
276 | 314 |
print $form->parse_html_template("dunning/show_dunning"); |
... | ... | |
282 | 320 |
sub print_dunning { |
283 | 321 |
$lxdebug->enter_sub(); |
284 | 322 |
|
285 |
DN->print_dunning(\%myconfig, \%$form, $form->{dunning_id}, $userspath, $spool, $sendmail); |
|
323 |
$form->{rowcount} = 1; |
|
324 |
$form->{selected_1} = 1; |
|
325 |
$form->{dunning_id_1} = $form->{dunning_id}; |
|
326 |
|
|
327 |
print_multiple(); |
|
328 |
|
|
329 |
$lxdebug->leave_sub(); |
|
330 |
} |
|
331 |
|
|
332 |
sub print_multiple { |
|
333 |
$lxdebug->enter_sub(); |
|
334 |
|
|
335 |
$form->{title} = $locale->text('Print dunnings'); |
|
336 |
|
|
337 |
my @dunning_ids = map { $form->{"dunning_id_$_"} } grep { $form->{"selected_$_"} } (1..$form->{rowcount}); |
|
338 |
|
|
339 |
if (!scalar @dunning_ids) { |
|
340 |
$form->error($locale->text('No dunnings have been selected for printing.')); |
|
341 |
} |
|
342 |
|
|
343 |
$form->{DUNNING_PDFS} = []; |
|
344 |
|
|
345 |
foreach my $dunning_id (@dunning_ids) { |
|
346 |
DN->print_invoice_for_fees(\%myconfig, $form, $dunning_id); |
|
347 |
DN->print_dunning(\%myconfig, $form, $dunning_id); |
|
348 |
} |
|
349 |
|
|
350 |
if (scalar @{ $form->{DUNNING_PDFS} }) { |
|
351 |
$form->{dunning_id} = strftime("%Y%m%d", localtime time); |
|
352 |
DN->melt_pdfs(\%myconfig, $form, $form->{copies}); |
|
353 |
|
|
354 |
if ($form->{media} eq 'printer') { |
|
355 |
$form->header(); |
|
356 |
$form->info($locale->text('The dunnings have been printed.')); |
|
357 |
} |
|
286 | 358 |
|
287 |
if($form->{DUNNING_PDFS}) { |
|
288 |
DN->melt_pdfs(\%myconfig, \%$form,$spool); |
|
289 | 359 |
} else { |
290 |
$form->redirect($locale->text('Could not create dunning copy!'));
|
|
360 |
$form->redirect($locale->text('Could not print dunning.'));
|
|
291 | 361 |
} |
292 | 362 |
|
293 | 363 |
$lxdebug->leave_sub(); |
294 |
|
|
295 | 364 |
} |
296 | 365 |
|
297 | 366 |
# end of main |
Auch abrufbar als: Unified diff
Mahnwesen:
1. Neues Feature: Automatisches Erzeugen von Debitorenrechnungen über die Mahngebühren und -zinsen. Diese werden ebenfalls als PDFs ausgegeben.
2. Neues Feature: Beim Bericht über aktive Mahnungen ermöglichen, dass mehrere Mahnungen und die eventuell dazu erstellen Debitorenrechnungen auf einmal ausgedruckt werden können.
3. Neues Feature: Mahnungen können wahlweise am Bildschirm oder direkt auf Druckern ausgegeben werden. Zusätzlich können andere Sprachen ausgewählt werden.
4. Bugfix: Beim Bearbeiten von Emaileinstellungen in der Mahnkonfiguration wurden +-Zeichen falsch escapet und verschwanden.
5. Code zum Ersetzen von $form-Variablen in Strings entfernt und durch die Verwendung von PlainTextTemplate ersetzt.
Fixes für Bugs 473 und 553.