X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ee2b1ef305f1723d7ad39a44e195c7e15f8af810..b8fee3fc:/SL/Form.pm?ds=sidebyside
diff --git a/SL/Form.pm b/SL/Form.pm
index f966a2d6f..6a6dc9c21 100644
--- a/SL/Form.pm
+++ b/SL/Form.pm
@@ -380,9 +380,10 @@ sub _get_request_uri {
my $self = shift;
return URI->new($ENV{HTTP_REFERER})->canonical() if $ENV{HTTP_X_FORWARDED_FOR};
+ return URI->new if !$ENV{REQUEST_URI}; # for testing
my $scheme = $ENV{HTTPS} && (lc $ENV{HTTPS} eq 'on') ? 'https' : 'http';
- my $port = $ENV{SERVER_PORT} || '';
+ my $port = $ENV{SERVER_PORT};
$port = undef if (($scheme eq 'http' ) && ($port == 80))
|| (($scheme eq 'https') && ($port == 443));
@@ -466,9 +467,10 @@ sub header {
# standard css for all
# this should gradually move to the layouts that need it
$layout->use_stylesheet("$_.css") for qw(
- main menu tabcontent list_accounts jquery.autocomplete
+ main menu list_accounts jquery.autocomplete
jquery.multiselect2side frame_header/header
- ui-lightness/jquery-ui-1.8.12.custom
+ ui-lightness/jquery-ui
+ jquery-ui.custom
js/jscalendar/calendar-win2k-1
);
@@ -479,7 +481,7 @@ sub header {
);
$self->{favicon} ||= "favicon.ico";
- $self->{titlebar} = join ' - ', grep $_, $self->{title}, $self->{login}, $::myconfig{dbname}, $self->{version} if $self->{title};
+ $self->{titlebar} = join ' - ', grep $_, $self->{title}, $self->{login}, $::myconfig{dbname}, $self->{version} if $self->{title} || !$self->{titlebar};
# build includes
if ($self->{refresh_url} || $self->{refresh_time}) {
@@ -488,10 +490,12 @@ sub header {
push @header, "";
}
- push @header, map { qq|| } $layout->stylesheets;
+ my $auto_reload_resources_param = $layout->auto_reload_resources_param;
+
+ push @header, map { qq|| } $layout->stylesheets;
push @header, " " if $self->{landscape};
push @header, "" if -f $self->{favicon};
- push @header, map { qq|| } $layout->javascripts;
+ push @header, map { qq|| } $layout->javascripts;
push @header, $self->{javascript} if $self->{javascript};
push @header, map { $_->show_javascript } @{ $self->{AJAX} || [] };
@@ -514,15 +518,6 @@ EOT
print " $_\n" for @header;
print <
-
@@ -2536,7 +2531,7 @@ sub all_vc {
# Hotfix für Bug 1837 - Besser wäre es alte Buchungsbelege
# OHNE Auswahlliste (reines Textfeld) zu laden. Hilft aber auch
# nicht für veränderbare Belege (oe, do, ...)
- my $obsolete = "WHERE NOT obsolete" unless $self->{id};
+ my $obsolete = $self->{id} ? '' : "WHERE NOT obsolete";
my $query = qq|SELECT count(*) FROM $table $obsolete|;
my ($count) = selectrow_query($self, $dbh, $query);
@@ -2737,7 +2732,7 @@ sub create_links {
}
my $extra_columns = '';
- $extra_columns .= 'a.direct_debit, ' if $module eq 'AR';
+ $extra_columns .= 'a.direct_debit, ' if ($module eq 'AR') || ($module eq 'AP');
if ($self->{id}) {
$query =
@@ -2812,7 +2807,14 @@ sub create_links {
FROM acc_trans a
LEFT JOIN chart c ON (c.id = a.chart_id)
LEFT JOIN project p ON (p.id = a.project_id)
- LEFT JOIN tax t ON (t.id= a.tax_id)
+ LEFT JOIN tax t ON (t.id= (SELECT tk.tax_id FROM taxkeys tk
+ WHERE (tk.taxkey_id=a.taxkey) AND
+ ((CASE WHEN a.chart_id IN (SELECT chart_id FROM taxkeys WHERE taxkey_id = a.taxkey)
+ THEN tk.chart_id = a.chart_id
+ ELSE 1 = 1
+ END)
+ OR (c.link='%tax%')) AND
+ (startdate <= a.transdate) ORDER BY startdate DESC LIMIT 1))
WHERE a.trans_id = ?
AND a.fx_transaction = '0'
ORDER BY a.acc_trans_id, a.transdate|;