X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fis.pl;h=10dc43ef1574bb0c4ef6777295c3773c87f85b87;hb=3c5e4df9e938a8f2c9b045774bda00095b976e49;hp=b05c8fddd5343343f87cb62a43e16e14c339c3a3;hpb=bde667c235b2347bdd1322f118b032a2f0d93367;p=kivitendo-erp.git
diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl
index b05c8fddd..10dc43ef1 100644
--- a/bin/mozilla/is.pl
+++ b/bin/mozilla/is.pl
@@ -35,8 +35,8 @@ use SL::IS;
use SL::PE;
use Data::Dumper;
-require "$form->{path}/io.pl";
-require "$form->{path}/arap.pl";
+require "bin/mozilla/io.pl";
+require "bin/mozilla/arap.pl";
require "bin/mozilla/drafts.pl";
1;
@@ -61,7 +61,7 @@ sub add {
$form->{callback} =
- "$form->{script}?action=add&type=$form->{type}&login=$form->{login}&path=$form->{path}&password=$form->{password}"
+ "$form->{script}?action=add&type=$form->{type}&login=$form->{login}&password=$form->{password}"
unless $form->{callback};
$form{jsscript} = "date";
@@ -121,6 +121,7 @@ sub invoice_links {
if ($form->{all_customer}) {
unless ($form->{customer_id}) {
$form->{customer_id} = $form->{all_customer}->[0]->{id};
+ $form->{salesman_id} = $form->{all_customer}->[0]->{salesman_id};
}
}
@@ -171,13 +172,13 @@ sub invoice_links {
chomp $curr[0];
$form->{defaultcurrency} = $curr[0];
- map { $form->{selectcurrency} .= "\n" } @curr;
$form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
if (@{ $form->{all_customer} }) {
$form->{customer} = "$form->{customer}--$form->{customer_id}";
- map { $form->{selectcustomer} .= "\n" }
(@{ $form->{all_customer} });
}
@@ -188,7 +189,7 @@ sub invoice_links {
map {
$form->{selectdepartment} .=
- "\n"
} (@{ $form->{all_departments} });
}
@@ -197,7 +198,7 @@ sub invoice_links {
# sales staff
if ($form->{all_employees}) {
$form->{selectemployee} = "";
- map { $form->{selectemployee} .= "\n" }
(@{ $form->{all_employees} });
}
@@ -207,7 +208,8 @@ sub invoice_links {
foreach $key (keys %{ $form->{AR_links} }) {
foreach $ref (@{ $form->{AR_links}{$key} }) {
- $form->{"select$key"} .= "\n";
}
if ($key eq "AR_paid") {
@@ -327,38 +329,11 @@ sub form_header {
}
my $set_duedate_url =
- "$form->{script}?login=$form->{login}&path=$form->{path}&password=$form->{password}&action=set_duedate";
+ "$form->{script}?login=$form->{login}&password=$form->{password}&action=set_duedate";
my $pjx = new CGI::Ajax( 'set_duedate' => $set_duedate_url );
push(@ { $form->{AJAX} }, $pjx);
- if (@{ $form->{TAXZONE} }) {
- $form->{selecttaxzone} = "";
- foreach $item (@{ $form->{TAXZONE} }) {
- if ($item->{id} == $form->{taxzone_id}) {
- $form->{selecttaxzone} .=
- "";
- } else {
- $form->{selecttaxzone} .=
- "";
- }
-
- }
- } else {
- $form->{selecttaxzone} =~ s/ selected//g;
- if ($form->{taxzone_id} ne "") {
- $form->{selecttaxzone} =~ s/value=$form->{taxzone_id}/value=$form->{taxzone_id} selected/;
- }
- }
-
- $taxzone = qq|
-
- | . $locale->text('Steuersatz') . qq| |
- |
-
-
|;
-
my @old_project_ids = ($form->{"globalproject_id"});
map({ push(@old_project_ids, $form->{"project_id_$_"})
if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
@@ -367,9 +342,12 @@ sub form_header {
"shipto" => "ALL_SHIPTO",
"projects" => { "key" => "ALL_PROJECTS",
"all" => 0,
- "old_id" => \@old_project_ids });
+ "old_id" => \@old_project_ids },
+ "employees" => "ALL_SALESMEN",
+ "taxzones" => "ALL_TAXZONES");
- my (%labels, @values);
+ my %labels;
+ my @values = (undef);
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
push(@values, $item->{"cp_id"});
$labels{$item->{"cp_id"}} = $item->{"cp_name"} .
@@ -405,6 +383,50 @@ sub form_header {
'-labels' => \%labels,
'-default' => $form->{"globalproject_id"}));
+ %labels = ();
+ @values = ("");
+ foreach my $item (@{ $form->{ALL_SALESMEN} }) {
+ push(@values, $item->{id});
+ $labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login};
+ }
+
+ $salesman =
+ qq|
+ | . $locale->text('Salesman') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id},
+ '-values' => \@values, '-labels' => \%labels))
+ . qq| |
+
|;
+
+ %labels = ();
+ @values = ();
+ foreach my $item (@{ $form->{"ALL_TAXZONES"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"description"};
+ }
+
+ if (!$form->{"id"}) {
+ $taxzone = qq|
+
+ | . $locale->text('Steuersatz') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
+ |
+
|;
+
+ } else {
+ $taxzone = qq|
+
+ | . $locale->text('Steuersatz') . qq| |
+
+
+ | . H($labels{$form->{"taxzone_id"}}) . qq|
+ |
+
|;
+ }
+
# set option selected
foreach $item (qw(AR customer currency department employee)) {
$form->{"select$item"} =~ s/ selected//;
@@ -414,6 +436,9 @@ sub form_header {
#quote customer Bug 133
$form->{selectcustomer} = $form->quote($form->{selectcustomer});
+
+ #substitute \n and \r to \s (bug 543)
+ $form->{selectcustomer} =~ s/[\n\r]/ /g;
if (($form->{creditlimit} != 0) && ($form->{creditremaining} < 0) && !$form->{update}) {
$creditwarning = 1;
@@ -433,30 +458,33 @@ sub form_header {
if ($form->{currency} ne $form->{defaultcurrency}) {
if ($form->{forex}) {
$exchangerate .=
- qq||
+ qq| | |
. $locale->text('Exchangerate')
- . qq| | $form->{exchangerate}{exchangerate}> | |;
+ . qq|$form->{exchangerate} | |;
} else {
$exchangerate .=
- qq||
+ qq| | |
. $locale->text('Exchangerate')
- . qq| | {exchangerate}> | |;
+ . qq| | |;
}
}
$exchangerate .= qq|
-{forex}>
+
|;
$customer =
($form->{selectcustomer})
- ? qq|\n|
- : qq||;
+ ? qq|\n|
+ : qq||;
$department = qq|
| . $locale->text('Department') . qq| |
-
-
+ |
+
|
| if $form->{selectdepartment};
@@ -466,9 +494,9 @@ sub form_header {
if ($form->{business}) {
$business = qq|
- | . $locale->text('Business') . qq| |
+ | . $locale->text('Business') . qq| |
$form->{business} |
- | . $locale->text('Trade Discount') . qq| |
+ | . $locale->text('Trade Discount') . qq| |
|
. $form->format_amount(\%myconfig, $form->{tradediscount} * 100)
. qq| % |
@@ -479,12 +507,12 @@ sub form_header {
if ($form->{max_dunning_level}) {
$dunning = qq|
-
+ |
- | . $locale->text('Max. Dunning Level') . qq|: |
+ | . $locale->text('Max. Dunning Level') . qq|: |
$form->{max_dunning_level} |
- | . $locale->text('Dunning Amount') . qq|: |
+ | . $locale->text('Dunning Amount') . qq|: |
|
. $form->format_amount(\%myconfig, $form->{dunning_amount},2)
. qq| |
@@ -505,11 +533,10 @@ sub form_header {
# with JavaScript Calendar
$button1 = qq|
- {invdate}> |
- text('button') . qq|> |
- |;
-
+ |
+ | |;
+
#write Trigger
$jsscript =
Form->write_trigger(\%myconfig, "1",
@@ -519,28 +546,28 @@ sub form_header {
# without JavaScript Calendar
$button1 =
- qq|{invdate}> | |;
+ qq| | |;
$button2 =
- qq|{duedate}> | |;
+ qq| | |;
}
} else {
if ($form->{jsscript}) {
# with JavaScript Calendar
$button1 = qq|
- {invdate}> |
- text('button') . qq|> |
+ |
+ |
|;
$button2 = qq|
- {duedate}> |
- text('button') . qq|> |
+ |
+ |
|;
$button3 = qq|
- {deliverydate}> |
- text('button') . qq|> |
+ |
+ |
|;
#write Trigger
@@ -555,9 +582,9 @@ sub form_header {
# without JavaScript Calendar
$button1 =
- qq|{invdate}> | |;
+ qq| | |;
$button2 =
- qq|{duedate}> | |;
+ qq|{duedate} onBlur=\"check_right_date_format(this)\"> | |;
}
}
if ($form->{resubmit} && ($form->{format} eq "html")) {
@@ -566,9 +593,10 @@ sub form_header {
} elsif ($form->{resubmit}) {
$onload = qq|document.invoice.submit()|;
} else {
- $onload = "fokus()";
+ $onload = "focus()";
}
-
+ $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
+ $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
$credittext = $locale->text('Credit Limit exceeded!!!');
if ($creditwarning) {
$onload = qq|alert('$credittext')|;
@@ -592,69 +620,45 @@ sub form_header {
- |
-
|;
@@ -1637,6 +1614,7 @@ sub yes {
if (IS->delete_invoice(\%myconfig, \%$form, $spool)) {
# saving the history
if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
$form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
@@ -1647,3 +1625,24 @@ sub yes {
$lxdebug->leave_sub();
}
+
+sub e_mail {
+ $lxdebug->enter_sub();
+
+ if (!$form->{id}) {
+ $print_post = 1;
+
+ my $saved_form = save_form();
+
+ post();
+
+ my %saved_vars;
+ map({ $saved_vars{$_} = $form->{$_}; } qw(id invnumber));
+ restore_form($saved_form);
+ map({ $form->{$_} = $saved_vars{$_}; } qw(id invnumber));
+ }
+
+ edit_e_mail();
+
+ $lxdebug->leave_sub();
+}