From: Sven Schöling Date: Tue, 13 Oct 2009 08:23:58 +0000 (+0200) Subject: Weitere Template Fixes. X-Git-Tag: release-2.6.1beta1~113^2~18 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=58d115ff64da5d061341defca6d3a308f8a772b8;p=kivitendo-erp.git Weitere Template Fixes. --- diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 8490d05c0..417b0a87b 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -195,6 +195,7 @@ sub invoice_links { } $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}"; + $form->{selectcustomer} = 1; # departments if ($form->{all_departments}) { @@ -356,10 +357,10 @@ sub form_header { # customer $TMPL_VAR{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" }; $TMPL_VAR{vclimit} = $myconfig{vclimit}; - $TMPL_VAR{vc_select} = "customer_or_vendor_selection_window('$form->{vc}', '', @{[ $form->{vc} eq 'vendor' ? 1 : 0 ]}, 0)"; - push @custom_hiddens, "$form->{vc}_id"; - push @custom_hiddens, "old$form->{vc}"; - push @custom_hiddens, "select$form->{vc}"; + $TMPL_VAR{vc_select} = "customer_or_vendor_selection_window('customer', '', 0, 0)"; + push @custom_hiddens, "customer_id"; + push @custom_hiddens, "oldcustomer"; + push @custom_hiddens, "selectcustomer"; # currencies and exchangerate my @values = map { $_ } @{ $form->{ALL_CURRENCIES} }; @@ -430,18 +431,14 @@ sub form_footer { $introws = 2; } $rows = ($rows > $introws) ? $rows : $introws; - my $notes = - qq||; - my $intnotes = - qq||; + my $notes = qq||; + my $intnotes = qq||; $form->{taxincluded} = ($form->{taxincluded} ? "checked" : ""); my $taxincluded = ""; if ($form->{taxaccounts}) { - $taxincluded = qq| - {taxincluded}> | - . $locale->text('Tax Included') . qq|

|; + $taxincluded = qq| {taxincluded}> | . $locale->text('Tax Included') . qq|

|; } my ($tax, $subtotal); @@ -449,26 +446,20 @@ sub form_footer { foreach my $item (split / /, $form->{taxaccounts}) { if ($form->{"${item}_base"}) { - $form->{"${item}_total"} = - $form->round_amount( - $form->{"${item}_base"} * $form->{"${item}_rate"}, - 2); + $form->{"${item}_total"} = $form->round_amount( $form->{"${item}_base"} * $form->{"${item}_rate"}, 2); $form->{invtotal} += $form->{"${item}_total"}; - $form->{"${item}_total"} = - $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2); + $form->{"${item}_total"} = $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2); $tax .= qq| - $form->{"${item}_description"} | - . $form->{"${item}_rate"} * 100 .qq|% - $form->{"${item}_total"} + $form->{"${item}_description"} | . $form->{"${item}_rate"} * 100 .qq|% + $form->{"${item}_total"} |; } } - $form->{invsubtotal} = - $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0); + $form->{invsubtotal} = $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0); $subtotal = qq| @@ -482,20 +473,10 @@ sub form_footer { if ($form->{taxincluded}) { foreach my $item (split / /, $form->{taxaccounts}) { if ($form->{"${item}_base"}) { - $form->{"${item}_total"} = - $form->round_amount( - ($form->{"${item}_base"} * $form->{"${item}_rate"} / - (1 + $form->{"${item}_rate"}) - ), - 2); - $form->{"${item}_netto"} = - $form->round_amount( - ($form->{"${item}_base"} - $form->{"${item}_total"}), - 2); - $form->{"${item}_total"} = - $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2); - $form->{"${item}_netto"} = - $form->format_amount(\%myconfig, $form->{"${item}_netto"}, 2); + $form->{"${item}_total"} = $form->round_amount( ($form->{"${item}_base"} * $form->{"${item}_rate"} / (1 + $form->{"${item}_rate"})), 2); + $form->{"${item}_netto"} = $form->round_amount( ($form->{"${item}_base"} - $form->{"${item}_total"}), 2); + $form->{"${item}_total"} = $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2); + $form->{"${item}_netto"} = $form->format_amount(\%myconfig, $form->{"${item}_netto"}, 2); $tax .= qq| @@ -514,8 +495,7 @@ sub form_footer { } $form->{oldinvtotal} = $form->{invtotal}; - $form->{invtotal} = - $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0); + $form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0); my $follow_ups_block; if ($form->{id}) { @@ -671,11 +651,9 @@ if ($form->{type} eq "credit_note") { # format amounts $totalpaid += $form->{"paid_$i"}; if ($form->{"paid_$i"}) { - $form->{"paid_$i"} = - $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2); + $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2); } - $form->{"exchangerate_$i"} = - $form->format_amount(\%myconfig, $form->{"exchangerate_$i"}); + $form->{"exchangerate_$i"} = $form->format_amount(\%myconfig, $form->{"exchangerate_$i"}); if ($form->{"exchangerate_$i"} == 0) { $form->{"exchangerate_$i"} = ""; @@ -754,64 +732,37 @@ if ($form->{type} eq "credit_note") { my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar") && (($totalpaid == 0) || ($totalpaid eq "")); print qq| - - - - |; - print qq| | if ($show_storno); - print qq| -|; - print qq| -|; + + + + |; + print qq| | if ($show_storno); + print qq| |; + print qq| |; if ($form->{id} && !($form->{type} eq "credit_note")) { - print qq| - -|; + print qq| |; } if ($form->{radier}) { - print qq| - -|; + print qq| |; } if ($invdate > $closedto) { - print qq| - -|; + print qq| |; } - print qq| - |; + print qq| |; } else { if ($invdate > $closedto) { - print qq| - - - - - | . - NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), - '-class' => 'submit')); + print qq| + + + + + + | . + NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), '-class' => 'submit')); } } @@ -828,8 +779,7 @@ if ($form->{type} eq "credit_note") { # mark_as_paid button if($form->{id} ne "") { - print qq||; + print qq||; } # /mark_as_paid button print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) .