From 8e9ede8f7ca6895f8d68d0637b9ba0a84d6515bf Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 22 Dec 2008 15:50:49 +0000 Subject: [PATCH] Zahlenformatierung mit H/S in eigene Funktion gesteckt. --- bin/mozilla/ca.pl | 21 +++++++++++++++++---- locale/de/all | 2 ++ locale/de/ca | 3 +++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/bin/mozilla/ca.pl b/bin/mozilla/ca.pl index 372004e1b..1d431916a 100644 --- a/bin/mozilla/ca.pl +++ b/bin/mozilla/ca.pl @@ -368,6 +368,20 @@ $jsscript $lxdebug->leave_sub(); } +sub format_debit_credit { + $lxdebug->enter_sub(); + + my $dc = shift; + + my $formatted_dc = $form->format_amount(\%myconfig, abs($dc), 2) . ' '; + $formatted_dc .= ($dc > 0) ? $locale->text('Credit (one letter abbreviation)') : $locale->text('Debit (one letter abbreviation)'); + + $lxdebug->leave_sub(); + + return $formatted_dc; +} + + sub list_transactions { $lxdebug->enter_sub(); @@ -479,9 +493,8 @@ sub list_transactions { CA->all_transactions(\%myconfig, \%$form); - 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"; + my $saldo_old = format_debit_credit($form->{saldo_old}); + my $eb_string = format_debit_credit($form->{beginning_balance}); my @options; if ($form->{department}) { @@ -696,7 +709,7 @@ sub list_transactions { }; $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 $saldo_new = format_debit_credit($form->{saldo_new}); my $row = { 'transdate' => { 'data' => "", diff --git a/locale/de/all b/locale/de/all index 4403a205a..e4f77326f 100644 --- a/locale/de/all +++ b/locale/de/all @@ -367,6 +367,7 @@ $self->{texts} = { 'Created for' => 'Erstellt für', 'Created on' => 'Erstellt am', 'Credit' => 'Haben', + 'Credit (one letter abbreviation)' => 'H', 'Credit Account' => 'Habenkonto', 'Credit Limit' => 'Kreditlimit', 'Credit Limit exceeded!!!' => 'Kreditlimit überschritten!', @@ -427,6 +428,7 @@ $self->{texts} = { 'Datevautomatik' => 'Datevexport', 'Datum von' => 'Datum von', 'Debit' => 'Soll', + 'Debit (one letter abbreviation)' => 'S', 'Debit Account' => 'Sollkonto', 'Debit Starting Balance' => 'EB Passiva', 'Debit Tax' => 'Vorsteuer', diff --git a/locale/de/ca b/locale/de/ca index aa5925136..8a8f0e1dd 100644 --- a/locale/de/ca +++ b/locale/de/ca @@ -37,6 +37,7 @@ $self->{texts} = { 'Create and edit sales quotations' => 'Angebote erfassen und bearbeiten', 'Create and edit vendor invoices' => 'Eingangsrechnungen erfassen und bearbeiten', 'Credit' => 'Haben', + 'Credit (one letter abbreviation)' => 'H', 'Credit Note' => 'Gutschrift', 'Customized Report' => 'Vorgewählte Zeiträume', 'DATEV Export' => 'DATEV-Export', @@ -45,6 +46,7 @@ $self->{texts} = { 'Dataset upgrade' => 'Datenbankaktualisierung', 'Date' => 'Datum', 'Debit' => 'Soll', + 'Debit (one letter abbreviation)' => 'S', 'Dec' => 'Dez', 'December' => 'Dezember', 'Decimalplaces' => 'Dezimalstellen', @@ -171,6 +173,7 @@ $self->{texts} = { $self->{subs} = { 'chart_of_accounts' => 'chart_of_accounts', 'create_subtotal_row' => 'create_subtotal_row', + 'format_debit_credit' => 'format_debit_credit', 'list' => 'list', 'list_transactions' => 'list_transactions', 'report_generator_back' => 'report_generator_back', -- 2.20.1