X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=f02e066ddc65eecdd8b134499bc287d2ae4da4fb;hb=47916a374217afc8d84bd147f0fada5086970bae;hp=9140574546d40dd3c2ed513f4cb6269b711a701c;hpb=40662c08e22db199189b147a3a05446f5e4ddf24;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 914057454..f02e066dd 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -340,9 +340,18 @@ 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 = (); @@ -371,8 +380,8 @@ sub form_header { my $customers = qq| | . $locale->text('Customer') . qq| | . - (($myconfig{vclimit} == 1 ) - ? 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| @@ -386,12 +395,16 @@ 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 = (); @@ -401,7 +414,9 @@ sub form_header { } $form->{currency} = $form->{defaultcurrency} unless $form->{currency}; - my $currencies = qq| + my $currencies; + if (scalar @values) { + $currencies = qq| | . $locale->text('Currency') . qq| | . @@ -409,6 +424,7 @@ sub form_header { '-values' => \@values, '-labels' => \%labels)) . qq| |; + } %labels = (); @values = (""); @@ -536,20 +552,15 @@ sub form_header { 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| + + |; } @@ -563,8 +574,8 @@ sub form_header { # with JavaScript Calendar $button1 = qq| - - + |; #write Trigger @@ -585,18 +596,18 @@ sub form_header { # with JavaScript Calendar $button1 = qq| - - + |; $button2 = qq| - - + |; $button3 = qq| - - + |; @@ -660,44 +671,27 @@ print qq| +
$form->{title}
+ - - - - -
$form->{title}
- - -
- - - $customers - - - - - - - - - - - $shipto - - $business - $dunning +
| - . $locale->text('Contact Person') . qq|$contact
- - - - - - - - -
| . $locale->text('Credit Limit') . qq|$form->{creditlimit}| . $locale->text('Remaining') . qq|$form->{creditremaining}
-
+ + + $customers + + + + + + $contact + $shipto + + + + + $dunning + $business @@ -719,7 +713,11 @@ print qq| - |; + + + + + |; # # -
| . $locale->text('Credit Limit') . qq|$form->{creditlimit}; | . $locale->text('Remaining') . qq| $form->{creditremaining}
| . $locale->text('Record in') . qq|
| . $locale->text('Ship via') . qq|
| . $locale->text('Transaction description') . qq|| . $cgi->textfield("-name" => "transaction_description", "-size" => 35, "-value" => $form->{transaction_description}) . qq|
# @@ -742,7 +740,7 @@ print qq| # print qq|
+ $employees $salesman @@ -780,8 +778,8 @@ print qq| - - + @@ -789,8 +787,8 @@ print qq| - - + @@ -845,13 +843,13 @@ sub form_footer { qq||; $intnotes = qq||; - - $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : ""; + + $form->{taxincluded} = ($form->{taxincluded} ? "checked" : ""); $taxincluded = ""; if ($form->{taxaccounts}) { $taxincluded = qq| - {taxincluded}> | + {taxincluded}> | . $locale->text('Tax Included') . qq|

|; } @@ -1208,10 +1206,19 @@ sub update { $form->{print_and_post} = 0; } + + if($form->{taxincluded}) { + $taxincluded = "checked"; + } $form->{update} = 1; &check_name(customer); + if(!$form->{taxincluded}) { + $form->{taxincluded} = $taxincluded; + } + + $form->{exchangerate} = $exchangerate if ( $form->{forex} = ( @@ -1399,6 +1406,9 @@ sub post { $form->isblank("invdate", $locale->text('Invoice Date missing!')); $form->isblank("customer", $locale->text('Customer missing!')); + $form->{invnumber} =~ s/^\s*//g; + $form->{invnumber} =~ s/\s*$//g; + # if oldcustomer ne customer redo form if (&check_name(customer)) { &update; @@ -1509,21 +1519,25 @@ sub storno { } map({ my $key = $_; delete($form->{$key}) - unless (grep({ $key eq $_ } qw(login password id type))); } + unless (grep({ $key eq $_ } qw(login password id stylesheet type))); } keys(%{ $form })); - &invoice_links; - &prepare_invoice; + invoice_links(); + prepare_invoice(); relink_accounts(); + # Payments must not be recorded for the new storno invoice. + $form->{paidaccounts} = 0; + map { my $key = $_; delete $form->{$key} if grep { $key =~ /^$_/ } qw(datepaid_ source_ memo_ paid_ exchangerate_ AR_paid_) } keys %{ $form }; + $form->{storno_id} = $form->{id}; $form->{storno} = 1; $form->{id} = ""; $form->{invnumber} = "Storno zu " . $form->{invnumber}; + $form->{rowcount}++; - &post(); + post(); $lxdebug->leave_sub(); - } sub preview {
| . $locale->text('Order Date') . qq| +
| . $locale->text('Quotation Number') . qq|
| . $locale->text('Quotation Date') . qq| +
| . $locale->text('Customer Order Number') . qq|