From 2424e0523dacae4c9a1d72fa19738f9109e2d048 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 10 May 2007 11:08:46 +0000 Subject: [PATCH] =?utf8?q?Dialogbuchen:=201.=20Einige=20Spalten=20nur=20da?= =?utf8?q?nn=20anzeigen,=20wenn=20"Details=20anzeigen"=20aktiv=20ist.=202.?= =?utf8?q?=20Automatisch=20den=20eingegebenen=20Wert=20aus=20der=20ersten?= =?utf8?q?=20Zeile=20"Soll"=20in=20die=20zweite=20Zeile=20"Haben"=20kopier?= =?utf8?q?en,=20wenn=20er=20ver=C3=A4ndert=20wird.=20Patch=20von=20Rainer?= =?utf8?q?=20Guempelein.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/gl.pl | 62 ++++++++++++++++++++++++++++++++++++++--------- locale/de/gl | 1 + 2 files changed, 51 insertions(+), 12 deletions(-) diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 43f5447cc..fd75c2ed2 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -105,6 +105,8 @@ sub add { } (@{ $form->{all_departments} }); } + $form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details}; + &display_form(1); $lxdebug->leave_sub(); @@ -189,6 +191,8 @@ sub edit { $form->{title} = "Edit"; + $form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details}; + form_header(); display_rows(); form_footer(); @@ -1055,6 +1059,7 @@ sub display_rows { my ($init) = @_; $lxdebug->enter_sub(); + $form->{debit_1} = 0 if !$form->{"debit_1"}; $form->{totaldebit} = 0; $form->{totalcredit} = 0; @@ -1214,20 +1219,27 @@ sub display_rows { '-labels' => \%project_labels, '-default' => $form->{"project_id_$i"} )); + my $copy2credit = 'onkeyup="copy_debit_to_credit()"' if $i == 1; + print qq| $accno $fx_transaction - + $korrektur - $tax + $tax|; + + if ($form->{show_details}) { + print qq| $source $memo $projectnumber +|; + } + print qq| - - |; +|; } $form->hide_form(qw(rowcount selectaccno)); @@ -1243,11 +1255,14 @@ sub form_header { $form->{title} = $locale->text("$title General Ledger Transaction"); $readonly = ($form->{id}) ? "readonly" : ""; + $show_details_checked = "checked" if $form->{show_details}; + # $locale->text('Add General Ledger Transaction') # $locale->text('Edit General Ledger Transaction') map { $form->{$_} =~ s/\"/"/g } qw(reference description chart taxchart); + $form->{javascript} = qq||; + $form->{javascript} .= qq||; $form->{selectdepartment} =~ s/ selected//; $form->{selectdepartment} =~ @@ -1300,7 +1322,7 @@ sub form_header { } # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; if ($form->{jsscript}) { @@ -1409,6 +1431,12 @@ sub form_header { |; } + + print qq| + | . $locale->text('Show details') . qq| + + |; + print qq| @@ -1425,12 +1453,17 @@ sub form_header { | . $locale->text('Korrektur') . qq| | - . $locale->text('Taxkey') . qq| - | - . $locale->text('Source') . qq| + . $locale->text('Taxkey') . qq||; + + if ($form->{show_details}) { + print qq| + | . $locale->text('Source') . qq| | . $locale->text('Memo') . qq| - | - . $locale->text('Project Number') . qq| + | . $locale->text('Project Number') . qq| +|; + } + + print qq| $jsscript @@ -1497,7 +1530,7 @@ sub form_footer { # } } else { if ($transdate > $closedto) { - print qq|text('Update') . qq|"> |; @@ -1568,6 +1601,8 @@ sub yes { sub post { $lxdebug->enter_sub(); + $form->{title} = $locale->text("$form->{title} General Ledger Transaction"); + # check if there is something in reference and date $form->isblank("reference", $locale->text('Reference missing!')); $form->isblank("transdate", $locale->text('Transaction Date missing!')); @@ -1740,7 +1775,10 @@ sub post { $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history - $form->redirect("Buchung gespeichert. Buchungsnummer = " . $form->{id}); + + $form->{callback} = build_std_url("action=add", "show_details"); + $form->redirect($form->{callback}); + $lxdebug->leave_sub(); } diff --git a/locale/de/gl b/locale/de/gl index 92ad31e58..a0af63faa 100644 --- a/locale/de/gl +++ b/locale/de/gl @@ -139,6 +139,7 @@ $self->{texts} = { 'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte', 'Sep' => 'Sep', 'September' => 'September', + 'Show details' => 'Details anzeigen', 'Source' => 'Beleg', 'Storno' => 'Storno', 'Storno Invoice' => 'Stornorechnung', -- 2.20.1