From 8c94b0eaaf4e1b3717f36a755d71d848abcb21a5 Mon Sep 17 00:00:00 2001 From: Philip Reetz Date: Thu, 24 Apr 2008 17:09:39 +0000 Subject: [PATCH] Ueberarbeiteter Kontenbericht --- SL/CA.pm | 147 +++++++++------- bin/mozilla/ca.pl | 428 ++++++++++++++++++++++++++++++++++++++++++---- locale/de/all | 6 + locale/de/ca | 26 ++- 4 files changed, 506 insertions(+), 101 deletions(-) diff --git a/SL/CA.pm b/SL/CA.pm index 76d2b320a..d0862a4aa 100644 --- a/SL/CA.pm +++ b/SL/CA.pm @@ -188,57 +188,48 @@ sub all_transactions { ($form->{category}) = selectrow_query($form, $dbh, $query, $form->{accno}); if ($form->{fromdate}) { - # get beginning balance + # get beginning balances $query = - qq|SELECT SUM(ac.amount) | . - qq|FROM acc_trans ac | . - qq|JOIN chart c ON (ac.chart_id = c.id) | . - $dpt_join . - qq|WHERE c.accno = ? | . - qq|AND ac.transdate < ? | . - $dpt_where . - $project; - @values = ($form->{accno}, conv_date($form->{fromdate}), - @department_values, @project_values); - - if ($form->{project_id}) { - $query .= - qq|UNION | . - - qq|SELECT SUM(ac.qty * ac.sellprice) | . - qq|FROM invoice ac | . - qq|JOIN ar a ON (ac.trans_id = a.id) | . - qq|JOIN parts p ON (ac.parts_id = p.id) | . - qq|JOIN chart c ON (p.income_accno_id = c.id) | . - $dpt_join . - qq|WHERE c.accno = ? | . - qq| AND a.transdate < ? | . - qq| AND c.category = 'I' | . - $dpt_where . - $project . - - qq|UNION | . - - qq|SELECT SUM(ac.qty * ac.sellprice) | . - qq|FROM invoice ac | . - qq|JOIN ap a ON (ac.trans_id = a.id) | . - qq|JOIN parts p ON (ac.parts_id = p.id) | . - qq|JOIN chart c ON (p.expense_accno_id = c.id) | . - $dpt_join . - qq|WHERE c.accno = ? | . - qq| AND a.transdate < ? | . - qq| AND c.category = 'E' | . - $dpt_where . - $project; - - push(@values, - $form->{accno}, conv_date($form->{transdate}), - @department_values, @project_values, - $form->{accno}, conv_date($form->{transdate}), - @department_values, @project_values); - } + qq|SELECT SUM(ac.amount) AS amount + FROM acc_trans ac + JOIN chart c ON (ac.chart_id = c.id) + $dpt_join + WHERE ((select date_trunc('year', ac.transdate::date)) = (select date_trunc('year', ?::date))) AND ac.ob_transaction + $dpt_where + $project + AND c.accno = ?|; + + ($form->{beginning_balance}) = selectrow_query($form, $dbh, $query, $form->{fromdate}, $form->{accno}); + + # get last transaction date + my $todate = ($form->{todate}) ? " AND ac.transdate <= '$form->{todate}' " : ""; + $query = qq|SELECT max(ac.transdate) FROM acc_trans ac LEFT JOIN chart c ON (ac.chart_id = c.id)WHERE ((select date_trunc('year', ac.transdate::date)) = (select date_trunc('year', ?::date))) $todate AND c.accno = ?|; + ($form->{last_transaction}) = selectrow_query($form, $dbh, $query, $form->{fromdate}, $form->{accno}); + + # get old saldo + $query = qq|SELECT sum(ac.amount) FROM acc_trans ac LEFT JOIN chart c ON (ac.chart_id = c.id)WHERE ((select date_trunc('year', ac.transdate::date)) = (select date_trunc('year', ?::date))) AND ac.transdate < ? AND c.accno = ?|; + ($form->{saldo_old}) = selectrow_query($form, $dbh, $query, $form->{fromdate}, $form->{fromdate}, $form->{accno}); + + #get old balance + $query = qq|SELECT sum(ac.amount) FROM acc_trans ac LEFT JOIN chart c ON (ac.chart_id = c.id)WHERE ((select date_trunc('year', ac.transdate::date)) = (select date_trunc('year', ?::date))) AND ac.transdate < ? AND c.accno = ? AND ac.amount < 0 AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL)|; + ($form->{old_balance_debit}) = selectrow_query($form, $dbh, $query, $form->{fromdate}, $form->{fromdate}, $form->{accno}); - ($form->{balance}) = selectrow_query($form, $dbh, $query, @values); + $query = qq|SELECT sum(ac.amount) FROM acc_trans ac LEFT JOIN chart c ON (ac.chart_id = c.id)WHERE ((select date_trunc('year', ac.transdate::date)) = (select date_trunc('year', ?::date))) AND ac.transdate < ? AND c.accno = ? AND ac.amount > 0 AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL)|; + ($form->{old_balance_credit}) = selectrow_query($form, $dbh, $query, $form->{fromdate}, $form->{fromdate}, $form->{accno}); + + # get current saldo + my $todate = ($form->{todate} ne "") ? " AND ac.transdate <= '$form->{todate}' " : ""; + $query = qq|SELECT sum(ac.amount) FROM acc_trans ac LEFT JOIN chart c ON (ac.chart_id = c.id)WHERE ((select date_trunc('year', ac.transdate::date)) = (select date_trunc('year', ?::date))) $todate AND c.accno = ?|; + ($form->{saldo_new}) = selectrow_query($form, $dbh, $query, $form->{fromdate}, $form->{accno}); + + #get current balance + my $todate = ($form->{todate} ne "") ? " AND ac.transdate <= '$form->{todate}' " : ""; + $query = qq|SELECT sum(ac.amount) FROM acc_trans ac LEFT JOIN chart c ON (ac.chart_id = c.id)WHERE ((select date_trunc('year', ac.transdate::date)) = (select date_trunc('year', ?::date))) $todate AND c.accno = ? AND ac.amount < 0 AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL)|; + ($form->{current_balance_debit}) = selectrow_query($form, $dbh, $query, $form->{fromdate}, $form->{accno}); + + my $todate = ($form->{todate} ne "") ? " AND ac.transdate <= '$form->{todate}' " : ""; + $query = qq|SELECT sum(ac.amount) FROM acc_trans ac LEFT JOIN chart c ON (ac.chart_id = c.id)WHERE ((select date_trunc('year', ac.transdate::date)) = (select date_trunc('year', ?::date))) $todate AND c.accno = ? AND ac.amount > 0 AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL)|; + ($form->{current_balance_credit}) = selectrow_query($form, $dbh, $query, $form->{fromdate}, $form->{accno}); } } @@ -258,39 +249,42 @@ sub all_transactions { # JOIN ... that also works. # get all transactions - $query .= - $union . - qq|SELECT a.id, a.reference, a.description, ac.transdate, | . - qq| $false AS invoice, ac.amount, 'gl' as module | . + $query = + qq|SELECT a.id, a.reference, a.description, ac.transdate, ac.chart_id, | . + qq| $false AS invoice, ac.amount, 'gl' as module, | . + qq§(SELECT accno||'--'||rate FROM tax LEFT JOIN chart ON (tax.chart_id=chart.id) WHERE tax.id = (SELECT tax_id FROM taxkeys WHERE taxkey_id = ac.taxkey AND taxkeys.startdate <= ac.transdate ORDER BY taxkeys.startdate DESC LIMIT 1)) AS taxinfo § . qq|FROM acc_trans ac, gl a | . $dpt_join . qq|WHERE | . $where . $dpt_where . $project . qq| AND ac.chart_id = ? | . qq| AND ac.trans_id = a.id | . + qq| AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL) | . qq|UNION ALL | . - qq|SELECT a.id, a.invnumber, c.name, ac.transdate, | . - qq| a.invoice, ac.amount, 'ar' as module | . + qq|SELECT a.id, a.invnumber, c.name, ac.transdate, ac.chart_id, | . + qq| a.invoice, ac.amount, 'ar' as module, | . + qq§(SELECT accno||'--'||rate FROM tax LEFT JOIN chart ON (tax.chart_id=chart.id) WHERE tax.id = (SELECT tax_id FROM taxkeys WHERE taxkey_id = ac.taxkey AND taxkeys.startdate <= ac.transdate ORDER BY taxkeys.startdate DESC LIMIT 1)) AS taxinfo § . qq|FROM acc_trans ac, customer c, ar a | . $dpt_join . qq|WHERE | . $where . $dpt_where . $project . qq| AND ac.chart_id = ? | . - qq| AND NOT a.storno | . qq| AND ac.trans_id = a.id | . qq| AND a.customer_id = c.id | . + qq| AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL) | . qq|UNION ALL | . - qq|SELECT a.id, a.invnumber, v.name, ac.transdate, | . - qq| a.invoice, ac.amount, 'ap' as module | . + qq|SELECT a.id, a.invnumber, v.name, ac.transdate, ac.chart_id, | . + qq| a.invoice, ac.amount, 'ap' as module, | . + qq§(SELECT accno||'--'||rate FROM tax LEFT JOIN chart ON (tax.chart_id=chart.id) WHERE tax.id = (SELECT tax_id FROM taxkeys WHERE taxkey_id = ac.taxkey AND taxkeys.startdate <= ac.transdate ORDER BY taxkeys.startdate DESC LIMIT 1)) AS taxinfo § . qq|FROM acc_trans ac, vendor v, ap a | . $dpt_join . qq|WHERE | . $where . $dpt_where . $project . qq| AND ac.chart_id = ? | . qq| AND ac.trans_id = a.id | . - qq| AND NOT a.storno | . qq| AND a.vendor_id = v.id |; + qq| AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL) | . push(@values, @where_values, @department_values, @project_values, $id, @@ -308,7 +302,8 @@ sub all_transactions { qq|UNION ALL | . qq|SELECT a.id, a.invnumber, c.name, a.transdate, | . - qq| a.invoice, ac.qty * ac.sellprice AS sellprice, 'ar' as module | . + qq| a.invoice, ac.qty * ac.sellprice AS sellprice, 'ar' as module, | . + qq§(SELECT accno||'--'||rate FROM tax LEFT JOIN chart ON (tax.chart_id=chart.id) WHERE tax.id = (SELECT tax_id FROM taxkeys WHERE taxkey_id = ac.taxkey AND taxkeys.startdate <= ac.transdate ORDER BY taxkeys.startdate DESC LIMIT 1)) AS taxinfo § . qq|FROM ar a | . qq|JOIN invoice ac ON (ac.trans_id = a.id) | . qq|JOIN parts p ON (ac.parts_id = p.id) | . @@ -323,7 +318,8 @@ sub all_transactions { qq|UNION ALL | . qq|SELECT a.id, a.invnumber, v.name, a.transdate, | . - qq| a.invoice, ac.qty * ac.sellprice AS sellprice, 'ap' as module | . + qq| a.invoice, ac.qty * ac.sellprice AS sellprice, 'ap' as module, | . + qq§(SELECT accno||'--'||rate FROM tax LEFT JOIN chart ON (tax.chart_id=chart.id) WHERE tax.id = (SELECT tax_id FROM taxkeys WHERE taxkey_id = ac.taxkey AND taxkeys.startdate <= ac.transdate ORDER BY taxkeys.startdate DESC LIMIT 1)) AS taxinfo § . qq|FROM ap a | . qq|JOIN invoice ac ON (ac.trans_id = a.id) | . qq|JOIN parts p ON (ac.parts_id = p.id) | . @@ -352,6 +348,13 @@ sub all_transactions { $query .= qq|ORDER BY $sort|; $sth = prepare_execute_query($form, $dbh, $query, @values); + #get detail information for each transaction + $trans_query = + qq|SELECT accno, | . + qq|amount, transdate FROM acc_trans LEFT JOIN chart ON (chart_id=chart.id) WHERE | . + qq|trans_id = ? AND sign(amount) <> sign(?) AND chart_id <> ? AND transdate = ?|; + my $trans_sth = $dbh->prepare($trans_query); + $form->{CA} = []; while (my $ca = $sth->fetchrow_hashref(NAME_lc)) { # ap @@ -372,7 +375,27 @@ sub all_transactions { $ca->{debit} = 0; } - $ca->{index} = join "--", map { $ca->{$_} } qw(id reference description); + ($ca->{ustkonto},$ca->{ustrate}) = split /--/, $ca->{taxinfo}; + + #get detail information for this transaction + $trans_sth->execute($ca->{id}, $ca->{amount}, $ca->{chart_id}, $ca->{transdate}) || + $form->dberror($trans_query . " (" . join(", ", $ca->{id}) . ")"); + while (my $trans = $trans_sth->fetchrow_hashref(NAME_lc)) { + if (($ca->{transdate} eq $trans->{transdate}) && ($ca->{amount} * $trans->{amount} < 0)) { + if ($trans->{amount} < 0) { + $trans->{debit} = $trans->{amount} * -1; + $trans->{credit} = 0; + } else { + $trans->{credit} = $trans->{amount}; + $trans->{debit} = 0; + } + push(@{ $ca->{GEGENKONTO} }, $trans); + } else { + next; + } + } + + $ca->{index} = join "--", map { $ca->{$_} } qw(id reference description transdate); push(@{ $form->{CA} }, $ca); diff --git a/bin/mozilla/ca.pl b/bin/mozilla/ca.pl index a4de2310e..dc36b9766 100644 --- a/bin/mozilla/ca.pl +++ b/bin/mozilla/ca.pl @@ -142,6 +142,7 @@ sub list { $form->{title} = $locale->text('List Transactions'); $form->{title} .= " - " . $locale->text('Account') . " $form->{accno}"; + $year = (localtime)[5] + 1900; # get departments $form->all_departments(\%myconfig); @@ -160,13 +161,76 @@ sub list { | if $form->{selectdepartment}; + $accrual = ($eur) ? "" : "checked"; + $cash = ($eur) ? "checked" : ""; + + $name_1 = "fromdate"; + $id_1 = "fromdate"; + $value_1 = "$form->{fromdate}"; + $trigger_1 = "trigger1"; + $name_2 = "todate"; + $id_2 = "todate"; + $value_2 = ""; + $trigger_2 = "trigger2"; + + + # with JavaScript Calendar + if ($form->{jsscript}) { + if ($name_1 eq "") { + + $button1 = qq| + |; + $button1_2 = qq| + text('button') . qq|>|; + + #write Trigger + $jsscript = + Form->write_trigger(\%myconfig, "1", "$name_2", "BR", "$trigger_2"); + } else { + $button1 = qq| + |; + $button1_2 = qq| + text('button') . qq|>|; + $button2 = qq| + |; + $button2_2 = qq| + text('button') . qq|> + |; + + #write Trigger + $jsscript = + Form->write_trigger(\%myconfig, "2", "$name_1", "BR", "$trigger_1", + "$name_2", "BL", "$trigger_2"); + } + } else { + + # without JavaScript Calendar + if ($name_1 eq "") { + $button1 = + qq||; + } else { + $button1 = + qq||; + $button2 = + qq||; + } + } + $form->{javascript} .= qq||; + $form->header; + $onload = qq|focus()|; + $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|; + $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|; + $form->header; $form->{description} =~ s/\"/"/g; print qq| - +
{script}> @@ -177,28 +241,117 @@ sub list { {accounttype}> - - - - - +|; + + print qq| + + + + + + + + +|; + $checked = "checked"; + print qq| + +|; + $checked = ""; + print qq| + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +$jsscript +
$form->{title}
- - $department + + + + +
$form->{title}
+ - - - - + - - + + -
| . $locale->text('From') . qq|| . $locale->text('To') . qq| | + . $locale->text('Customized Report') . qq|
| . $locale->text('Include in Report') . qq| -  | - . $locale->text('Subtotal') . qq|| . $locale->text('Year') . qq|
-

+ | . $locale->text('Yearly') . qq| | . $locale->text('Quarterly') . qq|| . $locale->text('Monthly') . qq|
   1. | + . $locale->text('Quarter') . qq| | + . $locale->text('January') . qq| | + . $locale->text('May') . qq| | + . $locale->text('September') . qq|
  2. | + . $locale->text('Quarter') . qq| | + . $locale->text('February') . qq| | + . $locale->text('June') . qq| | + . $locale->text('October') . qq|
  3. | + . $locale->text('Quarter') . qq| | + . $locale->text('March') . qq| | + . $locale->text('July') . qq| | + . $locale->text('November') . qq|
  4. | + . $locale->text('Quarter') . qq|  | + . $locale->text('April') . qq| | + . $locale->text('August') . qq| | + . $locale->text('December') . qq|

| + . $locale->text('Free report period') . qq|| . $locale->text('From') . qq|  + $button1 + $button1_2  + | . $locale->text('Bis') . qq|  + $button2 + $button2_2 +

| . $locale->text('Method') . qq|| + . $locale->text('Accrual') . qq| +  | + . $locale->text('EUR') . qq|
| + . $locale->text('Decimalplaces') + . qq|


{accno} - $form->{description}"; + if ($form->{reporttype} eq "custom") { + + #forgotten the year --> thisyear + if ($form->{year} !~ m/^\d\d\d\d$/) { + $locale->date(\%myconfig, $form->current_date(\%myconfig), 0) =~ + /(\d\d\d\d)/; + $form->{year} = $1; + } + + #yearly report + if ($form->{duetyp} eq "13") { + $form->{fromdate} = "1.1.$form->{year}"; + $form->{todate} = "31.12.$form->{year}"; + } + + #Quater reports + if ($form->{duetyp} eq "A") { + $form->{fromdate} = "1.1.$form->{year}"; + $form->{todate} = "31.3.$form->{year}"; + } + if ($form->{duetyp} eq "B") { + $form->{fromdate} = "1.4.$form->{year}"; + $form->{todate} = "30.6.$form->{year}"; + } + if ($form->{duetyp} eq "C") { + $form->{fromdate} = "1.7.$form->{year}"; + $form->{todate} = "30.9.$form->{year}"; + } + if ($form->{duetyp} eq "D") { + $form->{fromdate} = "1.10.$form->{year}"; + $form->{todate} = "31.12.$form->{year}"; + } + + #Monthly reports + SWITCH: { + $form->{duetyp} eq "1" && do { + $form->{fromdate} = "1.1.$form->{year}"; + $form->{todate} = "31.1.$form->{year}"; + last SWITCH; + }; + $form->{duetyp} eq "2" && do { + $form->{fromdate} = "1.2.$form->{year}"; + + #this works from 1901 to 2099, 1900 and 2100 fail. + $leap = ($form->{year} % 4 == 0) ? "29" : "28"; + $form->{todate} = "$leap.2.$form->{year}"; + last SWITCH; + }; + $form->{duetyp} eq "3" && do { + $form->{fromdate} = "1.3.$form->{year}"; + $form->{todate} = "31.3.$form->{year}"; + last SWITCH; + }; + $form->{duetyp} eq "4" && do { + $form->{fromdate} = "1.4.$form->{year}"; + $form->{todate} = "30.4.$form->{year}"; + last SWITCH; + }; + $form->{duetyp} eq "5" && do { + $form->{fromdate} = "1.5.$form->{year}"; + $form->{todate} = "31.5.$form->{year}"; + last SWITCH; + }; + $form->{duetyp} eq "6" && do { + $form->{fromdate} = "1.6.$form->{year}"; + $form->{todate} = "30.6.$form->{year}"; + last SWITCH; + }; + $form->{duetyp} eq "7" && do { + $form->{fromdate} = "1.7.$form->{year}"; + $form->{todate} = "31.7.$form->{year}"; + last SWITCH; + }; + $form->{duetyp} eq "8" && do { + $form->{fromdate} = "1.8.$form->{year}"; + $form->{todate} = "31.8.$form->{year}"; + last SWITCH; + }; + $form->{duetyp} eq "9" && do { + $form->{fromdate} = "1.9.$form->{year}"; + $form->{todate} = "30.9.$form->{year}"; + last SWITCH; + }; + $form->{duetyp} eq "10" && do { + $form->{fromdate} = "1.10.$form->{year}"; + $form->{todate} = "31.10.$form->{year}"; + last SWITCH; + }; + $form->{duetyp} eq "11" && do { + $form->{fromdate} = "1.11.$form->{year}"; + $form->{todate} = "30.11.$form->{year}"; + last SWITCH; + }; + $form->{duetyp} eq "12" && do { + $form->{fromdate} = "1.12.$form->{year}"; + $form->{todate} = "31.12.$form->{year}"; + last SWITCH; + }; + } + } + CA->all_transactions(\%myconfig, \%$form); + print(STDERR "EB: $form->{beginning_balance}\n"); + + my $saldo_old = ($form->{saldo_old} > 0) ? $form->format_amount(\%myconfig, $form->{saldo_old}, 2) . " H" : $form->format_amount(\%myconfig, abs($form->{saldo_old}) , 2) . " S"; + + my $eb_string = ($form->{beginning_balance} > 0) ? $form->format_amount(\%myconfig, $form->{beginning_balance}, 2) . " H" : $form->format_amount(\%myconfig, abs($form->{beginning_balance}), 2) . " S"; + print(STDERR "EB: $eb_string\n"); + my @options; if ($form->{department}) { my ($department) = split /--/, $form->{department}; @@ -249,16 +510,49 @@ sub list_transactions { push @options, $period; - my @columns = qw(transdate reference description debit credit balance); + my @columns = qw(transdate reference description gegenkonto debit credit ustkonto ustrate); my %column_defs = ( 'transdate' => { 'text' => $locale->text('Date'), }, 'reference' => { 'text' => $locale->text('Reference'), }, 'description' => { 'text' => $locale->text('Description'), }, 'debit' => { 'text' => $locale->text('Debit'), }, 'credit' => { 'text' => $locale->text('Credit'), }, - 'balance' => { 'text' => $locale->text('Balance'), }, - ); - my %column_alignment = map { $_ => 'right' } qw(debit credit balance); + 'gegenkonto' => { 'text' => $locale->text('Gegenkonto'), }, + 'ustkonto' => { 'text' => $locale->text('USt-Konto'), }, + 'ustrate' => { 'text' => $locale->text('Satz %'), }, + ); + my %column_alignment = map { $_ => 'right' } qw(debit credit); + + @custom_headers = (); + # Zeile 1: + push @custom_headers, [ + { 'text' => 'Letzte Buchung', }, + { 'text' => 'EB-Wert', }, + { 'text' => 'Saldo alt', 'colspan' => 2, }, + { 'text' => 'Jahresverkehrszahlen alt', 'colspan' => 2, }, + { 'text' => '', 'colspan' => 2, }, + ]; + push @custom_headers, [ + { 'text' => $form->{last_transaction}, }, + { 'text' => $eb_string, }, + { 'text' => $saldo_old, 'colspan' => 2, }, + { 'text' => $form->format_amount(\%myconfig, abs($form->{old_balance_debit}), 2) . " S", }, + { 'text' => $form->format_amount(\%myconfig, $form->{old_balance_credit}, 2) . " H", }, + { 'text' => '', 'colspan' => 2, }, + ]; + # Zeile 2: + push @custom_headers, [ + { 'text' => $locale->text('Date'), }, + { 'text' => $locale->text('Reference'), }, + { 'text' => $locale->text('Description'), }, + { 'text' => $locale->text('Gegenkonto'), }, + { 'text' => $locale->text('Debit'), }, + { 'text' => $locale->text('Credit'), }, + { 'text' => $locale->text('USt-Konto'), }, + { 'text' => $locale->text('Satz %'), }, + ]; + + my @hidden_variables = qw(accno fromdate todate description accounttype l_heading l_subtotal department projectnumber project_id sort); @@ -268,6 +562,7 @@ sub list_transactions { $form->{callback} = $link . '&sort=' . E($form->{sort}); my $report = SL::ReportGenerator->new(\%myconfig, $form); + $report->set_custom_headers(@custom_headers); $report->set_options('top_info_text' => join("\n", @options), 'output_format' => 'HTML', @@ -288,16 +583,6 @@ sub list_transactions { my $ml = ($form->{category} =~ /(A|E)/) ? -1 : 1; - if ($form->{accno} && $form->{balance}) { - my $row = { - 'balance' => { - 'data' => $form->format_amount(\%myconfig, $form->{balance} * $ml, 2), - 'align' => 'right', - }, - }; - - $report->add_data($row); - } my $idx = 0; my %totals = ( 'debit' => 0, 'credit' => 0 ); @@ -305,7 +590,6 @@ sub list_transactions { my ($previous_index, $row_set); foreach my $ca (@{ $form->{CA} }) { - $form->{balance} += $ca->{amount}; foreach (qw(debit credit)) { $subtotals{$_} += $ca->{$_}; @@ -313,10 +597,21 @@ sub list_transactions { $ca->{$_} = $form->format_amount(\%myconfig, $ca->{$_}, 2) if ($ca->{$_} != 0); } - $ca->{balance} = $form->format_amount(\%myconfig, $form->{balance} * $ml, 2); my $row = { }; + $ca->{ustrate} = $form->format_amount(\%myconfig, $ca->{ustrate} * 100, 2) if ($ca->{ustrate} != 0); + + + + foreach my $gegenkonto (@{ $ca->{GEGENKONTO} }) { + if ($ca->{gegenkonto} eq "") { + $ca->{gegenkonto} = $gegenkonto->{accno}; + } else { + $ca->{gegenkonto} .= ", " . $gegenkonto->{accno}; + } + } + foreach (@columns) { $row->{$_} = { 'data' => $ca->{$_}, @@ -356,6 +651,69 @@ sub list_transactions { $row->{balance}->{data} = $form->format_amount(\%myconfig, $form->{balance} * $ml, 2); $report->add_data($row); + + $report->add_separator(); + my $row = { + 'transdate' => { + 'data' => "", + 'class' => 'listtotal', + }, + 'reference' => { + 'data' => $locale->text('EB-Wert'), + 'class' => 'listtotal', + }, + 'description' => { + 'data' => $locale->text('Saldo neu'), + 'colspan' => 2, + 'class' => 'listtotal', + }, + 'debit' => { + 'data' => $locale->text('Jahresverkehrszahlen neu'), + 'colspan' => 2, + 'align' => 'left', + 'class' => 'listtotal', + }, + 'ustkonto' => { + 'data' => '', + 'colspan' => 2, + 'align' => 'left', + 'class' => 'listtotal', + }, + }; + + $report->add_data($row); + my $saldo_new = ($form->{saldo_new} > 0) ? $form->format_amount(\%myconfig, $form->{saldo_new}, 2) . " H" : $form->format_amount(\%myconfig, abs($form->{saldo_new}) , 2) . " S"; + my $row = { + 'transdate' => { + 'data' => "", + 'class' => 'listtotal', + }, + 'reference' => { + 'data' => $eb_string, + 'class' => 'listtotal', + }, + 'description' => { + 'data' => $saldo_new, + 'colspan' => 2, + 'class' => 'listtotal', + }, + 'debit' => { + 'data' => $form->format_amount(\%myconfig, abs($form->{current_balance_debit}) , 2) . " S", + 'class' => 'listtotal', + }, + 'credit' => { + 'data' => $form->format_amount(\%myconfig, $form->{current_balance_credit}, 2) . " H", + 'class' => 'listtotal', + }, + 'ustkonto' => { + 'data' => "", + 'colspan' => 2, + 'class' => 'listtotal', + }, + }; + + $report->add_data($row); + $report->generate_with_headers(); $lxdebug->leave_sub(); diff --git a/locale/de/all b/locale/de/all index 7ae065096..0c068c465 100644 --- a/locale/de/all +++ b/locale/de/all @@ -509,6 +509,7 @@ aktualisieren wollen?', 'E-mail address missing!' => 'E-Mail-Adresse fehlt!', 'EAN' => 'EAN', 'EAN-Code' => 'EAN-Code', + 'EB-Wert' => 'EB-Wert', 'EK' => 'EK', 'ELSE' => 'Zusatz', 'ELSTER Export (Taxbird)' => 'ELSTER-Export nach Taxbird', @@ -659,6 +660,7 @@ aktualisieren wollen?', 'Full Access' => 'Vollzugriff', 'Full access to all functions' => 'Vollzugriff auf alle Funktionen', 'GL Transaction' => 'Dialogbuchung', + 'Gegenkonto' => 'Gegenkonto', 'General Ledger' => 'Finanzbuchhaltung', 'General ledger and cash' => 'Finanzbuchhaltung und Zahlungsverkehr', 'Generic Tax Report' => 'USTVA Bericht', @@ -758,6 +760,7 @@ aktualisieren wollen?', 'It may optionally be compressed with "gzip".' => 'Sie darf optional mit "gzip" komprimiert sein.', 'Item deleted!' => 'Artikel gelöscht!', 'Item not on file!' => 'Dieser Artikel ist nicht in der Datenbank!', + 'Jahresverkehrszahlen neu' => 'Jahresverkehrszahlen neu', 'Jan' => 'Jan', 'January' => 'Januar', 'Journal' => 'Buchungsjournal', @@ -1177,6 +1180,7 @@ aktualisieren wollen?', 'SIC' => 'SIC', 'Saldo Credit' => 'Saldo Haben', 'Saldo Debit' => 'Saldo Soll', + 'Saldo neu' => 'Saldo neu', 'Saldo per' => 'Saldo per', 'Sales Invoice' => 'Rechnung', 'Sales Invoices' => 'Kundenrechnung', @@ -1189,6 +1193,7 @@ aktualisieren wollen?', 'Same as the quote character' => 'Wie Anführungszeichen', 'Sat. Fax' => 'Sat. Fax', 'Sat. Phone' => 'Sat. Tel.', + 'Satz %' => 'Satz %', 'Save' => 'Speichern', 'Save account first to insert taxkeys' => 'Einstellungen sind nach dem Speichern des Kontos verfügbar...', @@ -1503,6 +1508,7 @@ aktualisieren wollen?', 'USTVA-Hint: Method' => 'Wenn Sie Ist-Versteuert sind, wählen Sie die Einnahmen-/Überschuß-Rechnung aus. Sind Sie Soll-Versteuert und bilanzverpflichtet, dann wählen Sie Bilanz aus.', 'USTVA-Hint: Tax Authoritys' => 'Bitte das Bundesland UND die Stadt bzw. den Einzugsbereich Ihres zuständigen Finanzamts auswählen.', 'USt-IdNr.' => 'USt-IdNr.', + 'USt-Konto' => 'USt-Konto', 'UStVA' => 'UStVA', 'UStVA (PDF-Dokument)' => 'UStVa als PDF-Dokument', 'UStVa' => 'UStVa', diff --git a/locale/de/ca b/locale/de/ca index b459fcf06..2657717a9 100644 --- a/locale/de/ca +++ b/locale/de/ca @@ -5,16 +5,17 @@ $self->{texts} = { 'AP' => 'Einkauf', 'AR' => 'Verkauf', 'Account' => 'Konto', + 'Accrual' => 'Bilanzierung', 'Advance turnover tax return' => 'Umsatzsteuervoranmeldung', 'All reports' => 'Alle Berichte (Kontenübersicht, Summen- u. Saldenliste, GuV, BWA, Bilanz, Projektbuchungen)', 'Apr' => 'Apr', 'April' => 'April', 'Aug' => 'Aug', 'August' => 'August', - 'Balance' => 'Bilanz', 'Bcc' => 'Bcc', 'Bin List' => 'Lagerliste', 'Binding to the LDAP server as "#1" failed. Please check config/authentication.pl.' => 'Die Anmeldung am LDAP-Server als "#1" schlug fehl. Bitte überprüfen Sie die Angaben in config/authentication.pl.', + 'Bis' => 'bis', 'CANCELED' => 'Storniert', 'CSV export -- options' => 'CSV-Export -- Optionen', 'Cc' => 'Cc', @@ -36,6 +37,7 @@ $self->{texts} = { 'Create and edit vendor invoices' => 'Eingangsrechnungen erfassen und bearbeiten', 'Credit' => 'Haben', 'Credit Note' => 'Gutschrift', + 'Customized Report' => 'Vorgewählte Zeiträume', 'DATEV Export' => 'DATEV-Export', 'DELETED' => 'Gelöscht', 'DUNNING STARTED' => 'Mahnprozess gestartet', @@ -44,20 +46,26 @@ $self->{texts} = { 'Debit' => 'Soll', 'Dec' => 'Dez', 'December' => 'Dezember', + 'Decimalplaces' => 'Dezimalstellen', 'Delivery Order' => 'Lieferschein', 'Department' => 'Abteilung', 'Dependency loop detected:' => 'Schleife in den Abhängigkeiten entdeckt:', 'Description' => 'Beschreibung', 'Directory' => 'Verzeichnis', + 'EB-Wert' => 'EB-Wert', 'ELSE' => 'Zusatz', + 'EUR' => 'E/Ü-Rechnung', 'Error in database control file \'%s\': %s' => 'Fehler in Datenbankupgradekontrolldatei \'%s\': %s', + 'Falsches Datumsformat!' => 'Falsches Datumsformat!', 'Feb' => 'Feb', 'February' => 'Februar', 'File' => 'Datei', + 'Free report period' => 'Freier Zeitraum', 'From' => 'Von', + 'Gegenkonto' => 'Gegenkonto', 'General ledger and cash' => 'Finanzbuchhaltung und Zahlungsverkehr', - 'Include in Report' => 'In Bericht aufnehmen', 'Invoice' => 'Rechnung', + 'Jahresverkehrszahlen neu' => 'Jahresverkehrszahlen neu', 'Jan' => 'Jan', 'January' => 'Januar', 'Jul' => 'Jul', @@ -74,9 +82,11 @@ $self->{texts} = { 'May ' => 'Mai', 'May set the BCC field when sending emails' => 'Beim Verschicken von Emails das Feld \'BCC\' setzen', 'Message' => 'Nachricht', + 'Method' => 'Verfahren', 'Missing \'description\' field.' => 'Fehlendes Feld \'description\'.', 'Missing \'tag\' field.' => 'Fehlendes Feld \'tag\'.', 'Missing parameter #1 in call to sub #2.' => 'Fehlernder Parameter \'#1\' in Funktionsaufruf \'#2\'.', + 'Monthly' => 'monatlich', 'More than one control file with the tag \'%s\' exist.' => 'Es gibt mehr als eine Kontrolldatei mit dem Tag \'%s\'.', 'No or an unknown authenticantion module specified in "config/authentication.pl".' => 'Es wurde kein oder ein unbekanntes Authentifizierungsmodul in "config/authentication.pl" angegeben.', 'Nov' => 'Nov', @@ -95,6 +105,8 @@ $self->{texts} = { 'Proforma Invoice' => 'Proformarechnung', 'Project Number' => 'Projektnummer', 'Purchase Order' => 'Lieferantenauftrag', + 'Quarter' => 'Quartal', + 'Quarterly' => 'quartalsweise', 'Quotation' => 'Angebot', 'RFQ' => 'Anfrage', 'Receipt, payment, reconciliation' => 'Zahlungseingang, Zahlungsausgang, Kontenabgleich', @@ -103,12 +115,13 @@ $self->{texts} = { 'SAVED' => 'Gespeichert', 'SAVED FOR DUNNING' => 'Gespeichert', 'SCREENED' => 'Angezeigt', + 'Saldo neu' => 'Saldo neu', + 'Satz %' => 'Satz %', 'Sep' => 'Sep', 'September' => 'September', 'Storno Invoice' => 'Stornorechnung', 'Storno Packing List' => 'Stornolieferschein', 'Subject' => 'Betreff', - 'Subtotal' => 'Zwischensumme', 'The \'tag\' field must only consist of alphanumeric characters or the carachters - _ ( )' => 'Das Feld \'tag\' darf nur aus alphanumerischen Zeichen und den Zeichen - _ ( ) bestehen.', 'The LDAP server "#1:#2" is unreachable. Please check config/authentication.pl.' => 'Der LDAP-Server "#1:#2" ist nicht erreichbar. Bitte überprüfen Sie die Angaben in config/authentication.pl.', 'The config file "config/authentication.pl" contained invalid Perl code:' => 'Die Konfigurationsdatei "config/authentication.pl" enthielt ungütigen Perl-Code:', @@ -118,15 +131,19 @@ $self->{texts} = { 'The connection to the template database failed:' => 'Die Verbindung zur Vorlagendatenbank schlug fehl:', 'The creation of the authentication database failed:' => 'Das Anlegen der Authentifizierungsdatenbank schlug fehl:', 'The list has been printed.' => 'Die Liste wurde ausgedruckt.', - 'To' => 'An', 'To (email)' => 'An', 'Transactions, AR transactions, AP transactions' => 'Dialogbuchen, Debitorenrechnungen, Kreditorenrechnungen', + 'USt-Konto' => 'USt-Konto', 'Unknown dependency \'%s\'.' => 'Unbekannte Abhängigkeit \'%s\'.', 'View warehouse content' => 'Lagerbestand ansehen', 'Warehouse management' => 'Lagerverwaltung/Bestandsveränderung', + 'YYYY' => 'JJJJ', + 'Year' => 'Jahr', + 'Yearly' => 'jährlich', 'You do not have the permissions to access this function.' => 'Sie verfügen nicht über die notwendigen Rechte, um auf diese Funktion zuzugreifen.', '[email]' => '[email]', 'bin_list' => 'Lagerliste', + 'button' => '?', 'chart_of_accounts' => 'kontenuebersicht', 'config/authentication.pl: Key "DB_config" is missing.' => 'config/authentication.pl: Das Schlüsselwort "DB_config" fehlt.', 'config/authentication.pl: Key "LDAP_config" is missing.' => 'config/authentication.pl: Der Schlüssel "LDAP_config" fehlt.', @@ -143,6 +160,7 @@ $self->{texts} = { 'request_quotation' => 'Angebotsanforderung', 'sales_order' => 'Kundenauftrag', 'sales_quotation' => 'Verkaufsangebot', + 'wrongformat' => 'Falsches Format', }; $self->{subs} = { -- 2.20.1