X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=f4556cf2cfbfc29baa774c3fb8ea4bf605317ffe;hb=ebef09a8bde1d401fc7b0d60cfe09393e9a84c0f;hp=5901ab07403e732bd426ba3e3b8f7c40fc9fb1fd;hpb=a14a3ff56b00e22c39a2cfb0e465f8c7764a4cd4;p=kivitendo-erp.git
diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl
index 5901ab074..f4556cf2c 100644
--- a/bin/mozilla/is.pl
+++ b/bin/mozilla/is.pl
@@ -244,11 +244,9 @@ sub prepare_invoice {
if ($form->{type} eq "credit_note") {
$form->{type} = "credit_note";
$form->{formname} = "credit_note";
- $form->{media} = "screen";
} else {
$form->{type} = "invoice";
$form->{formname} = "invoice";
- $form->{media} = "screen";
}
if ($form->{id}) {
@@ -355,34 +353,51 @@ sub form_header {
|;
-
- if (@{ $form->{SHIPTO} }) {
- $form->{selectshipto} = "";
- foreach $item (@{ $form->{SHIPTO} }) {
- if ($item->{shipto_id} == $form->{shipto_id}) {
- $form->{selectshipto} .=
- "";
- } else {
- $form->{selectshipto} .=
- "";
- }
-
- }
- } else {
- $form->{selectshipto} = $form->unquote($form->{selectshipto});
- $form->{selectshipto} =~ s/ selected//g;
- if ($form->{shipto_id} ne "") {
- $form->{selectshipto} =~ s/value=$form->{shipto_id}/value=$form->{shipto_id} selected/;
- }
+ my @old_project_ids = ($form->{"globalproject_id"});
+ map({ push(@old_project_ids, $form->{"project_id_$_"})
+ if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
+
+ $form->get_lists("contacts" => "ALL_CONTACTS",
+ "shipto" => "ALL_SHIPTO",
+ "projects" => { "key" => "ALL_PROJECTS",
+ "all" => 0,
+ "old_id" => \@old_project_ids });
+
+ my (%labels, @values);
+ foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
+ push(@values, $item->{"cp_id"});
+ $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"}));
+
+ %labels = ();
+ @values = ("");
+ foreach my $item (@{ $form->{"ALL_SHIPTO"} }) {
+ push(@values, $item->{"shipto_id"});
+ $labels{$item->{"shipto_id"}} =
+ $item->{"shiptoname"} . " " . $item->{"shiptodepartment_1"};
}
- $shipto = qq|
+ my $shipto = qq|
| . $locale->text('Shipping Address') . qq| |
- | |;
- $form->{selectshipto} = $form->quote($form->{selectshipto});
- $shipto .= qq| |;
-
-
+ | .
+ NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values,
+ '-labels' => \%labels, '-default' => $form->{"shipto_id"}))
+ . qq| | |;
+
+ %labels = ();
+ @values = ("");
+ foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"projectnumber"};
+ }
+ my $globalprojectnumber =
+ NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values,
+ '-labels' => \%labels,
+ '-default' => $form->{"globalproject_id"}));
# set option selected
foreach $item (qw(AR customer currency department employee)) {
@@ -394,35 +409,12 @@ sub form_header {
#quote customer Bug 133
$form->{selectcustomer} = $form->quote($form->{selectcustomer});
- #build contacts
- if ($form->{all_contacts}) {
-
- $form->{selectcontact} = "";
- foreach $item (@{ $form->{all_contacts} }) {
- my $department = ($item->{cp_abteilung}) ? "--$item->{cp_abteilung}" : "";
- if ($form->{cp_id} == $item->{cp_id}) {
- $form->{selectcontact} .=
- "";
- } else {
- $form->{selectcontact} .= "";
- }
- }
- } else {
- $form->{selectcontact} =~ s/ selected//g;
- if ($form->{cp_id} ne "") {
- $form->{selectcontact} =~ s/value=$form->{cp_id}/value=$form->{cp_id} selected/;
- }
- }
-
-
if (($form->{creditlimit} != 0) && ($form->{creditremaining} < 0) && !$form->{update}) {
$creditwarning = 1;
} else {
$creditwarning = 0;
}
- #else {$form->{all_contacts} = 0;}
-
$form->{exchangerate} =
$form->format_amount(\%myconfig, $form->{exchangerate});
@@ -454,12 +446,6 @@ sub form_header {
? qq|\n|
: qq||;
- #sk
- $contact =
- ($form->{selectcontact})
- ? qq|\n|
- : qq||;
-
$department = qq|
| . $locale->text('Department') . qq| |
@@ -582,6 +568,13 @@ sub form_header {
$onload = qq|alert('$credittext')|;
}
+ $form->{"javascript"} .= qq||;
+
+ $jsscript .=
+ $form->write_trigger(\%myconfig, 2,
+ "orddate", "BL", "trigger_orddate",
+ "quodate", "BL", "trigger_quodate");
+
$form->header;
print qq|
@@ -748,14 +741,28 @@ print qq|
| . $locale->text('Order Number') . qq| |
|
+
+ | . $locale->text('Order Date') . qq| |
+ |
+ |
+
| . $locale->text('Quotation Number') . qq| |
|
+
+ | . $locale->text('Quotation Date') . qq| |
+ |
+ |
+
| . $locale->text('Customer Order Number') . qq| |
|
+
+ | . $locale->text('Project Number') . qq| |
+ $globalprojectnumber |
+
@@ -912,7 +919,7 @@ sub form_footer {
$notes |
$intnotes |
- |
@@ -1086,7 +1093,7 @@ if ($form->{type} eq "credit_note") {
if ($form->{id}) {
print qq|
-
@@ -1125,7 +1132,7 @@ if ($form->{type} eq "credit_note") {
} else {
if ($invdate > $closedto) {
- print qq|text('Update') . qq|">
@@ -1140,11 +1147,6 @@ if ($form->{type} eq "credit_note") {
}
}
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) .
qq|
@@ -1179,8 +1181,6 @@ sub update {
&check_name(customer);
- &check_project;
-
$form->{exchangerate} = $exchangerate
if (
$form->{forex} = (