X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fis.pl;h=77ae22c8b1761180fcf2434c4aeeb56fa43fb3d8;hb=3f0ba2ba4caabdc8fc3191c5cbd0aba13a8643cb;hp=10dc43ef1574bb0c4ef6777295c3773c87f85b87;hpb=d629acd82a27e980899a044ca8b0f4becc8e94bb;p=kivitendo-erp.git
diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl
index 10dc43ef1..77ae22c8b 100644
--- a/bin/mozilla/is.pl
+++ b/bin/mozilla/is.pl
@@ -83,7 +83,7 @@ sub edit {
# show history button
$form->{javascript} = qq||;
#/show hhistory button
-
+
if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR")
{
$form->error("Access Denied");
@@ -167,19 +167,11 @@ sub invoice_links {
$form->{shipto_id} = $shipto_id;
}
- # currencies
- @curr = split(/:/, $form->{currencies});
- 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} });
+ $form->{customer} = "$form->{customer}--$form->{customer_id}";
+ $form->{selectcustomer} = "$form->{customer}--$form->{customer_id}";
}
# departments
@@ -195,13 +187,6 @@ sub invoice_links {
$form->{employee} = "$form->{employee}--$form->{employee_id}";
- # sales staff
- if ($form->{all_employees}) {
- $form->{selectemployee} = "";
- map { $form->{selectemployee} .= "\n" }
- (@{ $form->{all_employees} });
- }
-
# forex
$form->{forex} = $form->{exchangerate};
$exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
@@ -303,13 +288,13 @@ sub form_header {
if ($form->{type} eq "credit_note") {
$form->{title} = $locale->text('Edit Credit Note');
-
+
if ($form->{storno}) {
$form->{title} = $locale->text('Edit Storno Credit Note');
}
} else {
$form->{title} = $locale->text('Edit Sales Invoice');
-
+
if ($form->{storno}) {
$form->{title} = $locale->text('Edit Storno Invoice');
}
@@ -344,7 +329,9 @@ sub form_header {
"all" => 0,
"old_id" => \@old_project_ids },
"employees" => "ALL_SALESMEN",
- "taxzones" => "ALL_TAXZONES");
+ "taxzones" => "ALL_TAXZONES",
+ "currencies" => "ALL_CURRENCIES",
+ "customers" => "ALL_CUSTOMERS");
my %labels;
my @values = (undef);
@@ -353,9 +340,53 @@ sub form_header {
$labels{$item->{"cp_id"}} = $item->{"cp_name"} .
($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : "");
}
- my $contact =
- NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values,
- '-labels' => \%labels, '-default' => $form->{"cp_id"}));
+ my $contact;
+ if (scalar @values > 1) {
+ $contact = qq|
+
+ | . $locale->text('Contact Person') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values,
+ '-labels' => \%labels, '-default' => $form->{"cp_id"}))
+ . qq|
+ |
+
|;
+ }
+
+ %labels = ();
+ @values = ();
+ foreach my $item (@{ $form->{"ALL_SALESMEN"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"name"};
+ }
+
+ my $employees = qq|
+
+ | . $locale->text('Employee') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'employee', '-default' => $form->{"employee_id"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
+ |
+
|;
+
+
+ %labels = ();
+ @values = ();
+ foreach my $item (@{ $form->{"ALL_CUSTOMERS"} }) {
+ push(@values, $item->{name}.qq|--|.$item->{"id"});
+ $labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"};
+ }
+
+ my $customers = qq|
+ | . $locale->text('Customer') . qq| |
+ | .
+ (($myconfig{vclimit} <= scalar(@values))
+ ? qq||
+ : (NTI($cgi->popup_menu('-name' => 'customer', '-default' => $form->{oldcustomer},
+ '-onChange' => 'document.getElementById(\'update_button\').click();',
+ '-values' => \@values, '-labels' => \%labels)))) . qq|
+
+ | |;
%labels = ();
@values = ("");
@@ -365,12 +396,36 @@ sub form_header {
$item->{"shiptoname"} . " " . $item->{"shiptodepartment_1"};
}
- my $shipto = qq|
- | . $locale->text('Shipping Address') . qq| |
- | .
- NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values,
- '-labels' => \%labels, '-default' => $form->{"shipto_id"}))
+ my $shipto;
+ if (scalar @values > 1) {
+ $shipto = qq|
+ |
+ | . $locale->text('Shipping Address') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values,
+ '-labels' => \%labels, '-default' => $form->{"shipto_id"}))
. qq| | |;
+ }
+
+ %labels = ();
+ @values = ();
+ foreach my $item (@{ $form->{"ALL_CURRENCIES"} }) {
+ push(@values, $item);
+ $labels{$item} = $item;
+ }
+
+ $form->{currency} = $form->{defaultcurrency} unless $form->{currency};
+ my $currencies;
+ if (scalar @values) {
+ $currencies = qq|
+
+ | . $locale->text('Currency') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
+ |
+
|;
+ }
%labels = ();
@values = ("");
@@ -439,7 +494,7 @@ sub form_header {
#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;
} else {
@@ -472,14 +527,6 @@ sub form_header {
|;
- $customer =
- ($form->{selectcustomer})
- ? qq|\n|
- : qq||;
-
$department = qq|
| . $locale->text('Department') . qq| |
@@ -494,99 +541,71 @@ onchange="document.getElementById('update_button').click();">| .
if ($form->{business}) {
$business = qq|
- | . $locale->text('Business') . qq| |
- $form->{business} |
- | . $locale->text('Trade Discount') . qq| |
- |
+ | | . $locale->text('Customer type') . qq| |
+ $form->{business}; | . $locale->text('Trade Discount') . qq| |
. $form->format_amount(\%myconfig, $form->{tradediscount} * 100)
. qq| % |
-
+
|;
}
if ($form->{max_dunning_level}) {
$dunning = qq|
-
-
-
-
- | . $locale->text('Max. Dunning Level') . qq|: |
- $form->{max_dunning_level} |
- | . $locale->text('Dunning Amount') . qq|: |
- |
- . $form->format_amount(\%myconfig, $form->{dunning_amount},2)
- . qq| |
-
-
- |
-
+
+ | . $locale->text('Max. Dunning Level') . qq|: |
+
+ $form->{max_dunning_level};
+ | . $locale->text('Dunning Amount') . qq|: |
+ . $form->format_amount(\%myconfig, $form->{dunning_amount},2)
+ . qq|
+ |
+
|;
}
$form->{fokus} = "invoice.customer";
# use JavaScript Calendar or not
- $form->{jsscript} = $jscalendar;
+ $form->{jsscript} = 1;
$jsscript = "";
if ($form->{type} eq "credit_note") {
- if ($form->{jsscript}) {
-
- # with JavaScript Calendar
- $button1 = qq|
- |
- | |;
-
- #write Trigger
- $jsscript =
- Form->write_trigger(\%myconfig, "1",
- "invdate", "BL",
- "trigger1");
- } else {
-
- # without JavaScript Calendar
- $button1 =
- qq| | |;
- $button2 =
- qq| | |;
- }
+ $button1 = qq|
+
+ | |;
+
+ #write Trigger
+ $jsscript =
+ Form->write_trigger(\%myconfig, "1",
+ "invdate", "BL",
+ "trigger1");
} else {
- if ($form->{jsscript}) {
-
- # with JavaScript Calendar
- $button1 = qq|
- |
- |
- |;
- $button2 = qq|
- |
- |
- |;
- $button3 = qq|
- |
- |
+ $button1 = qq|
+
+ |
|;
-
- #write Trigger
- $jsscript =
- Form->write_trigger(\%myconfig, "3",
- "invdate", "BL",
- "trigger1", "duedate",
- "BL", "trigger2",
- "deliverydate", "BL",
- "trigger3");
- } else {
-
- # without JavaScript Calendar
- $button1 =
- qq| | |;
- $button2 =
- qq|{duedate} onBlur=\"check_right_date_format(this)\"> | |;
- }
+ $button2 = qq|
+
+ |
+ |;
+ $button3 = qq|
+
+ |
+ |;
+
+ #write Trigger
+ $jsscript =
+ Form->write_trigger(\%myconfig, "3",
+ "invdate", "BL",
+ "trigger1", "duedate",
+ "BL", "trigger2",
+ "deliverydate", "BL",
+ "trigger3");
}
+
if ($form->{resubmit} && ($form->{format} eq "html")) {
$onload =
qq|window.open('about:blank','Beleg'); document.invoice.target = 'Beleg';document.invoice.submit()|;
@@ -603,6 +622,7 @@ onchange="document.getElementById('update_button').click();">| .
}
$form->{"javascript"} .= qq||;
+ $form->{javascript} .= qq||;
$jsscript .=
$form->write_trigger(\%myconfig, 2,
@@ -622,52 +642,37 @@ onchange="document.getElementById('update_button').click();">| .