Revision fbfac896
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
bin/mozilla/dn.pl | ||
---|---|---|
42 | 42 |
require "bin/mozilla/reportgenerator.pl"; |
43 | 43 |
require "bin/mozilla/io.pl"; |
44 | 44 |
|
45 |
use strict; |
|
46 |
|
|
45 | 47 |
1; |
46 | 48 |
|
47 | 49 |
sub edit_config { |
48 |
$lxdebug->enter_sub(); |
|
50 |
$main::lxdebug->enter_sub(); |
|
51 |
|
|
52 |
my $form = $main::form; |
|
53 |
my %myconfig = %main::myconfig; |
|
54 |
my $locale = $main::locale; |
|
49 | 55 |
|
50 |
$auth->assert('config'); |
|
56 |
$main::auth->assert('config');
|
|
51 | 57 |
|
52 | 58 |
DN->get_config(\%myconfig, \%$form); |
53 | 59 |
$form->get_lists('charts' => { 'key' => 'ALL_CHARTS', |
... | ... | |
77 | 83 |
$form->header(); |
78 | 84 |
print $form->parse_html_template("dunning/edit_config"); |
79 | 85 |
|
80 |
$lxdebug->leave_sub(); |
|
86 |
$main::lxdebug->leave_sub();
|
|
81 | 87 |
} |
82 | 88 |
|
83 | 89 |
sub add { |
84 |
$lxdebug->enter_sub(); |
|
90 |
$main::lxdebug->enter_sub(); |
|
91 |
|
|
92 |
my $form = $main::form; |
|
93 |
my %myconfig = %main::myconfig; |
|
94 |
my $locale = $main::locale; |
|
85 | 95 |
|
86 |
$auth->assert('dunning_edit'); |
|
96 |
$main::auth->assert('dunning_edit');
|
|
87 | 97 |
|
88 | 98 |
# setup customer selection |
89 | 99 |
$form->all_vc(\%myconfig, "customer", "AR"); |
... | ... | |
101 | 111 |
|
102 | 112 |
print $form->parse_html_template("dunning/add"); |
103 | 113 |
|
104 |
$lxdebug->leave_sub(); |
|
114 |
$main::lxdebug->leave_sub();
|
|
105 | 115 |
} |
106 | 116 |
|
107 | 117 |
sub show_invoices { |
108 |
$lxdebug->enter_sub(); |
|
118 |
$main::lxdebug->enter_sub();
|
|
109 | 119 |
|
110 |
$auth->assert('dunning_edit'); |
|
120 |
my $form = $main::form; |
|
121 |
my %myconfig = %main::myconfig; |
|
122 |
my $locale = $main::locale; |
|
123 |
|
|
124 |
$main::auth->assert('dunning_edit'); |
|
111 | 125 |
|
112 | 126 |
DN->get_invoices(\%myconfig, \%$form); |
113 | 127 |
$form->{title} = $locale->text('Start Dunning Process'); |
... | ... | |
138 | 152 |
$form->header(); |
139 | 153 |
print $form->parse_html_template("dunning/show_invoices"); |
140 | 154 |
|
141 |
$lxdebug->leave_sub(); |
|
155 |
$main::lxdebug->leave_sub();
|
|
142 | 156 |
} |
143 | 157 |
|
144 | 158 |
sub save { |
145 |
$lxdebug->enter_sub(); |
|
159 |
$main::lxdebug->enter_sub(); |
|
160 |
|
|
161 |
my $form = $main::form; |
|
162 |
my %myconfig = %main::myconfig; |
|
163 |
my $locale = $main::locale; |
|
146 | 164 |
|
147 |
$auth->assert('config'); |
|
165 |
$main::auth->assert('config');
|
|
148 | 166 |
|
149 | 167 |
for my $i (1 .. $form->{rowcount}) { |
150 | 168 |
if ($form->{"dunning_description_$i"} ne "") { |
... | ... | |
165 | 183 |
# /saving the history |
166 | 184 |
$form->redirect($locale->text('Dunning Process Config saved!')); |
167 | 185 |
|
168 |
$lxdebug->leave_sub(); |
|
186 |
$main::lxdebug->leave_sub();
|
|
169 | 187 |
} |
170 | 188 |
|
171 | 189 |
sub save_dunning { |
172 |
$lxdebug->enter_sub(); |
|
190 |
$main::lxdebug->enter_sub(); |
|
191 |
|
|
192 |
my $form = $main::form; |
|
193 |
my %myconfig = %main::myconfig; |
|
194 |
my $locale = $main::locale; |
|
173 | 195 |
|
174 |
$auth->assert('dunning_edit'); |
|
196 |
$main::auth->assert('dunning_edit');
|
|
175 | 197 |
|
176 | 198 |
my $active=1; |
177 | 199 |
my @rows = (); |
... | ... | |
200 | 222 |
foreach my $level (values %{ $levels }) { |
201 | 223 |
next unless scalar @{ $level }; |
202 | 224 |
|
203 |
DN->save_dunning(\%myconfig, $form, $level, $userspath, $spool);
|
|
225 |
DN->save_dunning(\%myconfig, $form, $level, $main::userspath, $main::spool);
|
|
204 | 226 |
} |
205 | 227 |
} |
206 | 228 |
|
... | ... | |
213 | 235 |
"customer_id" => $form->{"customer_id_$i"}, |
214 | 236 |
"next_dunning_config_id" => $form->{"next_dunning_config_id_$i"}, |
215 | 237 |
"email" => $form->{"email_$i"}, } ]; |
216 |
DN->save_dunning(\%myconfig, $form, $level, $userspath, $spool);
|
|
238 |
DN->save_dunning(\%myconfig, $form, $level, $main::userspath, $main::spool);
|
|
217 | 239 |
} |
218 | 240 |
} |
219 | 241 |
|
... | ... | |
234 | 256 |
$form->redirect($locale->text('Dunning Process started for selected invoices!')); |
235 | 257 |
} |
236 | 258 |
|
237 |
$lxdebug->leave_sub(); |
|
259 |
$main::lxdebug->leave_sub();
|
|
238 | 260 |
} |
239 | 261 |
|
240 | 262 |
sub set_email { |
241 |
$lxdebug->enter_sub(); |
|
263 |
$main::lxdebug->enter_sub();
|
|
242 | 264 |
|
243 |
$auth->assert('dunning_edit'); |
|
265 |
my $form = $main::form; |
|
266 |
my $locale = $main::locale; |
|
267 |
|
|
268 |
$main::auth->assert('dunning_edit'); |
|
244 | 269 |
|
245 | 270 |
$form->{"title"} = $locale->text("Set eMail text"); |
246 | 271 |
$form->header(); |
247 | 272 |
print($form->parse_html_template("dunning/set_email")); |
248 | 273 |
|
249 |
$lxdebug->leave_sub(); |
|
274 |
$main::lxdebug->leave_sub();
|
|
250 | 275 |
} |
251 | 276 |
|
252 | 277 |
sub search { |
253 |
$lxdebug->enter_sub(); |
|
278 |
$main::lxdebug->enter_sub(); |
|
279 |
|
|
280 |
my $form = $main::form; |
|
281 |
my %myconfig = %main::myconfig; |
|
282 |
my $locale = $main::locale; |
|
254 | 283 |
|
255 |
$auth->assert('dunning_edit'); |
|
284 |
$main::auth->assert('dunning_edit');
|
|
256 | 285 |
|
257 | 286 |
$form->get_lists("customers" => "ALL_CUSTOMERS", |
258 | 287 |
"departments" => "ALL_DEPARTMENTS"); |
... | ... | |
275 | 304 |
|
276 | 305 |
print $form->parse_html_template("dunning/search"); |
277 | 306 |
|
278 |
$lxdebug->leave_sub(); |
|
307 |
$main::lxdebug->leave_sub();
|
|
279 | 308 |
|
280 | 309 |
} |
281 | 310 |
|
282 | 311 |
sub show_dunning { |
283 |
$lxdebug->enter_sub(); |
|
312 |
$main::lxdebug->enter_sub(); |
|
313 |
|
|
314 |
my $form = $main::form; |
|
315 |
my %myconfig = %main::myconfig; |
|
316 |
my $locale = $main::locale; |
|
317 |
my $cgi = $main::cgi; |
|
284 | 318 |
|
285 |
$auth->assert('dunning_edit'); |
|
319 |
$main::auth->assert('dunning_edit');
|
|
286 | 320 |
|
287 | 321 |
my @filter_field_list = qw(customer_id customer dunning_level department_id invnumber ordnumber |
288 | 322 |
transdatefrom transdateto dunningfrom dunningto notes showold); |
... | ... | |
350 | 384 |
|
351 | 385 |
my $i = 0; |
352 | 386 |
|
353 |
foreach $ref (@{ $form->{DUNNINGS} }) { |
|
387 |
foreach my $ref (@{ $form->{DUNNINGS} }) {
|
|
354 | 388 |
$i++; |
355 | 389 |
|
356 | 390 |
if ($previous_dunning_id != $ref->{dunning_id}) { |
... | ... | |
396 | 430 |
|
397 | 431 |
$report->generate_with_headers(); |
398 | 432 |
|
399 |
$lxdebug->leave_sub(); |
|
433 |
$main::lxdebug->leave_sub();
|
|
400 | 434 |
|
401 | 435 |
} |
402 | 436 |
|
403 | 437 |
sub print_dunning { |
404 |
$lxdebug->enter_sub(); |
|
438 |
$main::lxdebug->enter_sub();
|
|
405 | 439 |
|
406 |
$auth->assert('dunning_edit'); |
|
440 |
my $form = $main::form; |
|
441 |
|
|
442 |
$main::auth->assert('dunning_edit'); |
|
407 | 443 |
|
408 | 444 |
$form->{rowcount} = 1; |
409 | 445 |
$form->{selected_1} = 1; |
... | ... | |
411 | 447 |
|
412 | 448 |
print_multiple(); |
413 | 449 |
|
414 |
$lxdebug->leave_sub(); |
|
450 |
$main::lxdebug->leave_sub();
|
|
415 | 451 |
} |
416 | 452 |
|
417 | 453 |
sub print_multiple { |
418 |
$lxdebug->enter_sub(); |
|
454 |
$main::lxdebug->enter_sub(); |
|
455 |
|
|
456 |
my $form = $main::form; |
|
457 |
my %myconfig = %main::myconfig; |
|
458 |
my $locale = $main::locale; |
|
419 | 459 |
|
420 |
$auth->assert('dunning_edit'); |
|
460 |
$main::auth->assert('dunning_edit');
|
|
421 | 461 |
|
422 | 462 |
$form->{title} = $locale->text('Print dunnings'); |
423 | 463 |
|
... | ... | |
447 | 487 |
$form->redirect($locale->text('Could not print dunning.')); |
448 | 488 |
} |
449 | 489 |
|
450 |
$lxdebug->leave_sub(); |
|
490 |
$main::lxdebug->leave_sub();
|
|
451 | 491 |
} |
452 | 492 |
|
453 | 493 |
sub continue { |
454 |
call_sub($form->{nextsub}); |
|
494 |
call_sub($main::form->{nextsub});
|
|
455 | 495 |
} |
456 | 496 |
|
457 | 497 |
# end of main |
Auch abrufbar als: Unified diff
dn strict