From 0437033e3e747a77b8999ae13a599e3c614be817 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 20 Feb 2007 09:11:59 +0000 Subject: [PATCH] =?utf8?q?Dialogbuchen:=20Anzeigen=20und=20Speichern=20von?= =?utf8?q?=20Projektnummern=20f=C3=BCr=20jede=20Zeile.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/GL.pm | 23 ++++++--------- bin/mozilla/gl.pl | 73 ++++++++++++++++++----------------------------- locale/de/gl | 1 + 3 files changed, 38 insertions(+), 59 deletions(-) diff --git a/SL/GL.pm b/SL/GL.pm index 4dbd703c7..8aef1b108 100644 --- a/SL/GL.pm +++ b/SL/GL.pm @@ -39,6 +39,7 @@ package GL; use Data::Dumper; +use SL::DBUtils; sub delete_transaction { my ($self, $myconfig, $form) = @_; @@ -179,10 +180,10 @@ sub post_transaction { $posted = 0; } + $project_id = conv_i($form->{"project_id_$i"}); + # if there is an amount, add the record if ($amount != 0) { - $project_id = - ($form->{"project_id_$i"}) ? $form->{"project_id_$i"} : 'NULL'; $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, memo, project_id, taxkey) VALUES @@ -192,30 +193,24 @@ sub post_transaction { $amount, '$form->{transdate}', | . $dbh->quote($form->{"source_$i"}) . qq|, | . $dbh->quote($form->{"memo_$i"}) . qq|, - $project_id, $taxkey)|; + ?, $taxkey)|; - $dbh->do($query) || $form->dberror($query); + do_query($form, $dbh, $query, $project_id); } if ($tax != 0) { - # add taxentry - $amount = $tax; - - $project_id = - ($form->{"project_id_$i"}) ? $form->{"project_id_$i"} : 'NULL'; $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, - source, memo, project_id, taxkey) + source, memo, taxkey) VALUES ($form->{id}, (SELECT t.chart_id FROM tax t WHERE t.id = $form->{"tax_id_$i"}), - $amount, '$form->{transdate}', | + $tax, '$form->{transdate}', | . $dbh->quote($form->{"source_$i"}) . qq|, | - . $dbh->quote($form->{"memo_$i"}) . qq|, - $project_id, $taxkey)|; + . $dbh->quote($form->{"memo_$i"}) . qq|, ?, $taxkey)|; - $dbh->do($query) || $form->dberror($query); + do_query($form, $dbh, $query, $project_id); } } diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 87e20d13b..89febc208 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -35,6 +35,7 @@ use SL::GL; use SL::PE; require "$form->{path}/arap.pl"; +require "bin/mozilla/common.pl"; 1; @@ -154,8 +155,6 @@ sub edit { my $tax = 0; my $taxaccno = ""; foreach $ref (@{ $form->{GL} }) { - $form->{"projectnumber_$i"} = "$ref->{projectnumber}--$ref->{project_id}"; - $j = $i - 1; if ($tax && ($ref->{accno} eq $taxaccno)) { $form->{"tax_$j"} = abs($ref->{amount}); @@ -895,21 +894,7 @@ sub gl_subtotal { sub update { $lxdebug->enter_sub(); - if ($form->{transdate} ne $form->{oldtransdate}) { - if ($form->{selectprojectnumber}) { - $form->all_projects(\%myconfig, undef, $form->{transdate}); - if (@{ $form->{all_project} }) { - $form->{selectprojectnumber} = "