X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdn.pl;h=293f076406360ad4a357b5ec309cb05fa51e1e1a;hb=3c5e4df9e938a8f2c9b045774bda00095b976e49;hp=c1d0f8bf6a1ea2042090bbb045aea36e8452fc37;hpb=595dc614f285c4ad859ab410e2c0e32026dd2dce;p=kivitendo-erp.git
diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl
index c1d0f8bf6..293f07640 100644
--- a/bin/mozilla/dn.pl
+++ b/bin/mozilla/dn.pl
@@ -36,8 +36,8 @@ use SL::PE;
use SL::DN;
use Data::Dumper;
-require "$form->{path}/io.pl";
-require "$form->{path}/arap.pl";
+require "bin/mozilla/io.pl";
+require "bin/mozilla/arap.pl";
1;
@@ -51,7 +51,7 @@ sub edit_config {
$form->{title} = $locale->text('Edit Dunning Process Config');
$form->{callback} =
- "$form->{script}?action=edit_config&path=$form->{path}&login=$form->{login}&password=$form->{password}"
+ "$form->{script}?action=edit_config&login=$form->{login}&password=$form->{password}"
unless $form->{callback};
@column_index = qw(dunning_level dunning_description active auto email payment_terms terms fee interest template);
@@ -105,7 +105,7 @@ sub edit_config {
- $form->{title} |
+ $form->{title} |
|;
@@ -163,9 +163,8 @@ sub edit_config {
$column_data{dunning_level} =
qq|$i | |;
$column_data{dunning_description} = qq| | |;
- my $active = "";
$column_data{active} =
- qq| | |;
+ qq| | |;
my $email = "";
$column_data{email} =
qq| | |;
@@ -202,19 +201,11 @@ sub edit_config {
-{path}>
{login}>
{password}>
|;
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
+ . $locale->text('Save') . qq|">
@@ -279,7 +270,7 @@ sub add {
# with JavaScript Calendar
$button1 = qq|
-
+ |
text('button') . qq|> |
|;
@@ -291,12 +282,16 @@ sub add {
# without JavaScript Calendar
$button1 =
- qq| | |;
+ qq| | |;
}
$form->{fokus} = "search.customer";
+ $form->{javascript} .= qq||;
$form->header;
+ $onload = qq|focus()|;
+ $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
+ $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
print qq|
-
+
-
@@ -353,7 +347,6 @@ sub add {
{nextsub}>
-{path}>
{login}>
{password}>
@@ -391,7 +384,7 @@ sub show_invoices {
$form->{nextsub} = "save_dunning";
$form->{callback} =
- "$form->{script}?action=show_invoices&path=$form->{path}&login=$form->{login}&password=$form->{password}&customer=$form->{customer}&invnumber=$form->{invnumber}&ordnumber=$form->{ordnumber}&paymentuntil=$form->{paymentuntil}&groupinvoices=$form->{groupinvoices}&minamount=$form->{minamount}&dunning_level=$form->{dunning_level}¬es=$form->{notes}"
+ "$form->{script}?action=show_invoices&login=$form->{login}&password=$form->{password}&customer=$form->{customer}&invnumber=$form->{invnumber}&ordnumber=$form->{ordnumber}&paymentuntil=$form->{paymentuntil}&groupinvoices=$form->{groupinvoices}&minamount=$form->{minamount}&dunning_level=$form->{dunning_level}¬es=$form->{notes}"
unless $form->{callback};
@column_index = qw(dunning_description active email customername invnumber invdate inv_duedate invamount next_duedate fee interest );
@@ -448,12 +441,12 @@ sub show_invoices {
-
@@ -566,6 +551,13 @@ sub save {
}
DN->save_config(\%myconfig, \%$form);
+ # saving the history
+ if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumbers} = qq|dunning_id_| . $form->{"dunning_id"};
+ $form->{addition} = "SAVED FOR DUNNING";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
$form->redirect($locale->text('Dunning Process Config saved!'));
$lxdebug->leave_sub();
@@ -580,18 +572,14 @@ sub save_dunning {
if ($form->{groupinvoices}) {
while ($active) {
$lastcustomer = 0;
- $form->{inv_ids} = "";
+ $form->{inv_ids} = [];
$active = 0;
@rows = ();
for my $i (1 .. $form->{rowcount}) {
$form->{"active_$i"} *= 1;
$lastcustomer = $form->{"customer_id_$i"} unless ($lastcustomer);
if ($form->{"active_$i"} && ($form->{"customer_id_$i"} == $lastcustomer)) {
- if ($form->{inv_ids}) {
- $form->{inv_ids} .= qq|,$form->{"inv_id_$i"}|;
- } else {
- $form->{inv_ids} = qq|($form->{"inv_id_$i"}|;
- }
+ push(@{ $form->{inv_ids} }, $form->{"inv_id_$i"});
$form->{"active_$i"} = 0;
$form->{"customer_id_$i"} = 0;
push(@rows, $i);
@@ -601,25 +589,30 @@ sub save_dunning {
$form->{"customer_id_$i"} = 0;
}
}
- if ($form->{inv_ids} ne "") {
- $form->{inv_ids} .= ")";
- DN->save_dunning(\%myconfig, \%$form, \@rows, $userspath,$spool, $sendmail);
+ if (scalar(@{ $form->{inv_ids} }) != 0) {
+ DN->save_dunning(\%myconfig, \%$form, \@rows, $userspath, $spool, $sendmail);
}
}
} else {
for my $i (1 .. $form->{rowcount}) {
if ($form->{"active_$i"}) {
@rows = ();
- $form->{inv_ids} = qq|($form->{"inv_id_$i"})|;
+ $form->{inv_ids} = [ $form->{"inv_id_$i"} ];
push(@rows, $i);
- DN->save_dunning(\%myconfig, \%$form, \@rows, $userspath,$spool, $sendmail);
+ DN->save_dunning(\%myconfig, \%$form, \@rows, $userspath, $spool, $sendmail);
}
}
}
if($form->{DUNNING_PDFS}) {
DN->melt_pdfs(\%myconfig, \%$form,$spool);
}
-
+ # saving the history
+ if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumbers} = qq|dunning_id_| . $form->{"dunning_id"};
+ $form->{addition} = "DUNNING STARTED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
$form->redirect($locale->text('Dunning Process started for selected invoices!'));
$lxdebug->leave_sub();
@@ -631,7 +624,7 @@ sub set_email {
my $callback = "$form->{script}?action=set_email&";
map({ $callback .= "$_=" . $form->escape($form->{$_}) . "&" }
- (qw(login path password name input_subject input_body input_attachment email_subject email_body email_attachment), grep({ /^[fl]_/ } keys %$form)));
+ (qw(login password name input_subject input_body input_attachment email_subject email_body email_attachment), grep({ /^[fl]_/ } keys %$form)));
if ($form->{email_attachment}) {
$form->{email_attachment} = "checked";
@@ -697,22 +690,22 @@ sub search {
# with JavaScript Calendar
$button1 = qq|
-
+ |
text('button') . qq|> |
|;
$button2 = qq|
-
+ |
text('button') . qq|> |
|;
$button3 = qq|
-
+ |
text('button') . qq|> |
|;
$button4 = qq|
-
+ |
text('button') . qq|> |
|;
@@ -724,19 +717,24 @@ sub search {
# without JavaScript Calendar
$button1 =
- qq| | |;
+ qq| | |;
$button2 =
- qq| | |;
- $button1 =
- qq| | |;
- $button1 =
- qq| | |;
+ qq| | |;
+ $button3 =
+ qq| | |;
+ $button4 =
+ qq| | |;
}
$form->{fokus} = "search.customer";
+ $form->{javascript} .= qq||;
$form->header;
+ $onload = qq|focus()|;
+ $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
+ $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
+
print qq|
-
+