X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=7cc8c016278d4e30c1f527363f3da3f3d203722f;hb=786b3862388eb8d4cdcc5dfc663a37fe0e9a82a1;hp=6c4b413560a9c60e7a149de45fb72e3b875b124f;hpb=8c7e44938a661e035f62840e1e177353240ace5d;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 6c4b41356..7cc8c0162 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -32,7 +32,9 @@ #====================================================================== use POSIX qw(strftime); +use List::Util qw(sum); +use SL::FU; use SL::GL; use SL::IS; use SL::PE; @@ -449,36 +451,22 @@ sub generate_report { my @hidden_variables = qw(accno source reference department description notes project_id datefrom dateto category l_subtotal); push @hidden_variables, map { "l_${_}" } @columns; - my (@options, $date_option); - if ($form->{accno}) { - push @options, $locale->text('Account') . " : $form->{accno} $form->{account_description}"; - } - if ($form->{source}) { - push @options, $locale->text('Source') . " : $form->{source}"; - } - if ($form->{reference}) { - push @options, $locale->text('Reference') . " : $form->{reference}"; - } + my (@options, @date_options); + push @options, $locale->text('Account') . " : $form->{accno} $form->{account_description}" if ($form->{accno}); + push @options, $locale->text('Source') . " : $form->{source}" if ($form->{source}); + push @options, $locale->text('Reference') . " : $form->{reference}" if ($form->{reference}); + push @options, $locale->text('Description') . " : $form->{description}" if ($form->{description}); + push @options, $locale->text('Notes') . " : $form->{notes}" if ($form->{notes}); + + push @date_options, $locale->text('From'), $locale->date(\%myconfig, $form->{datefrom}, 1) if ($form->{datefrom}); + push @date_options, $locale->text('Bis'), $locale->date(\%myconfig, $form->{dateto}, 1) if ($form->{dateto}); + push @options, join(' ', @date_options) if (scalar @date_options); + if ($form->{department}) { my ($department) = split /--/, $form->{department}; push @options, $locale->text('Department') . " : $department"; } - if ($form->{description}) { - push @options, $locale->text('Description') . " : $form->{description}"; - } - if ($form->{notes}) { - push @options, $locale->text('Notes') . " : $form->{notes}"; - } - if ($form->{datefrom}) { - $date_option = $locale->text('From') . " " . $locale->date(\%myconfig, $form->{datefrom}, 1); - } - if ($form->{dateto}) { - if ($form->{datefrom}) { - $date_option .= " "; - } - $date_option .= $locale->text('Bis') . " " . $locale->date(\%myconfig, $form->{dateto}, 1); - } - push @options, $date_option if $date_option; + my $callback = build_std_url('action=generate_report', @hidden_variables); @@ -825,6 +813,10 @@ sub display_rows { |; $memo = qq| |; + $source_hidden = qq| + |; + $memo_hidden = qq| + |; my $selected_accno_full; my ($accno_row) = split(/--/, $form->{"accno_$i"}); @@ -952,6 +944,8 @@ sub display_rows { |; } print qq| + $source_hidden + $memo_hidden |; } @@ -974,6 +968,9 @@ sub form_header { $show_details_checked = "checked" if $form->{show_details}; + $ob_transaction_checked = "checked" if $form->{ob_transaction}; + $cb_transaction_checked = "checked" if $form->{cb_transaction}; + # $locale->text('Add General Ledger Transaction') # $locale->text('Edit General Ledger Transaction') @@ -1068,6 +1065,9 @@ sub form_header { print qq| + + +
|; @@ -1076,6 +1076,10 @@ sub form_header { print qq| + + + + @@ -1160,7 +1164,17 @@ sub form_header { |; } - print qq| + print qq| + + + |; @@ -1205,6 +1219,16 @@ sub form_footer { $auth->assert('general_ledger'); + my $follow_ups_block; + if ($form->{id}) { + my $follow_ups = FU->follow_ups('trans_id' => $form->{id}); + + if (@{ $follow_ups} ) { + my $num_due = sum map { $_->{due} * 1 } @{ $follow_ups }; + $follow_ups_block = qq|

| . $locale->text("There are #1 unfinished follow-ups of which #2 are due.", scalar @{ $follow_ups }, $num_due) . qq|

|; + } + } + ($dec) = ($form->{totaldebit} =~ /\.(\d+)/); $dec = length $dec; $decimalplaces = ($dec > 2) ? $dec : 2; @@ -1228,6 +1252,8 @@ sub form_footer { +$follow_ups_block +
|; @@ -1247,12 +1273,16 @@ sub form_footer { |; } + print qq| + + |; + } else { - if ($transdate > $closedto) { print qq| |; - } } print " @@ -1445,7 +1475,7 @@ sub post_transaction { # this is just for the wise guys $form->error($locale->text('Cannot post transaction for a closed period!')) - if ($transdate <= $closedto); + if ($form->date_closed($form->{"transdate"}, \%myconfig)); if ($form->round_amount($debit, 2) != $form->round_amount($credit, 2)) { $form->error($locale->text('Out of balance transaction!')); }
+ + +
+ | . $locale->text('OB Transaction') . qq| + + | . $locale->text('CB Transaction') . qq| +
| . $locale->text('Show details') . qq|