require "bin/mozilla/reportgenerator.pl";
require "bin/mozilla/io.pl";
+use strict;
+
1;
sub edit_config {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
- $auth->assert('config');
+ $main::auth->assert('config');
DN->get_config(\%myconfig, \%$form);
$form->get_lists('charts' => { 'key' => 'ALL_CHARTS',
$form->header();
print $form->parse_html_template("dunning/edit_config");
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub add {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
- $auth->assert('dunning_edit');
+ $main::auth->assert('dunning_edit');
# setup customer selection
$form->all_vc(\%myconfig, "customer", "AR");
print $form->parse_html_template("dunning/add");
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub show_invoices {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
- $auth->assert('dunning_edit');
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+
+ $main::auth->assert('dunning_edit');
DN->get_invoices(\%myconfig, \%$form);
$form->{title} = $locale->text('Start Dunning Process');
$form->header();
print $form->parse_html_template("dunning/show_invoices");
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub save {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
- $auth->assert('config');
+ $main::auth->assert('config');
for my $i (1 .. $form->{rowcount}) {
if ($form->{"dunning_description_$i"} ne "") {
# /saving the history
$form->redirect($locale->text('Dunning Process Config saved!'));
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub save_dunning {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
- $auth->assert('dunning_edit');
+ $main::auth->assert('dunning_edit');
my $active=1;
my @rows = ();
foreach my $level (values %{ $levels }) {
next unless scalar @{ $level };
- DN->save_dunning(\%myconfig, $form, $level, $userspath, $spool);
+ DN->save_dunning(\%myconfig, $form, $level, $main::userspath, $main::spool);
}
}
"customer_id" => $form->{"customer_id_$i"},
"next_dunning_config_id" => $form->{"next_dunning_config_id_$i"},
"email" => $form->{"email_$i"}, } ];
- DN->save_dunning(\%myconfig, $form, $level, $userspath, $spool);
+ DN->save_dunning(\%myconfig, $form, $level, $main::userspath, $main::spool);
}
}
$form->redirect($locale->text('Dunning Process started for selected invoices!'));
}
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub set_email {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
- $auth->assert('dunning_edit');
+ my $form = $main::form;
+ my $locale = $main::locale;
+
+ $main::auth->assert('dunning_edit');
$form->{"title"} = $locale->text("Set eMail text");
$form->header();
print($form->parse_html_template("dunning/set_email"));
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub search {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
- $auth->assert('dunning_edit');
+ $main::auth->assert('dunning_edit');
$form->get_lists("customers" => "ALL_CUSTOMERS",
"departments" => "ALL_DEPARTMENTS");
print $form->parse_html_template("dunning/search");
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub show_dunning {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+ my $cgi = $main::cgi;
- $auth->assert('dunning_edit');
+ $main::auth->assert('dunning_edit');
my @filter_field_list = qw(customer_id customer dunning_level department_id invnumber ordnumber
transdatefrom transdateto dunningfrom dunningto notes showold);
my $i = 0;
- foreach $ref (@{ $form->{DUNNINGS} }) {
+ foreach my $ref (@{ $form->{DUNNINGS} }) {
$i++;
if ($previous_dunning_id != $ref->{dunning_id}) {
$report->generate_with_headers();
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub print_dunning {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
- $auth->assert('dunning_edit');
+ my $form = $main::form;
+
+ $main::auth->assert('dunning_edit');
$form->{rowcount} = 1;
$form->{selected_1} = 1;
print_multiple();
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub print_multiple {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
- $auth->assert('dunning_edit');
+ $main::auth->assert('dunning_edit');
$form->{title} = $locale->text('Print dunnings');
$form->redirect($locale->text('Could not print dunning.'));
}
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub continue {
- call_sub($form->{nextsub});
+ call_sub($main::form->{nextsub});
}
# end of main