From d0b49f673e3e8d59324570461d3a191f25b3d24c Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 15 Mar 2007 15:23:22 +0000 Subject: [PATCH] =?utf8?q?Kreditorenrechnungsmaske:=20Drop-Down-Boxen=20f?= =?utf8?q?=C3=BCr=20Konten=20werden=20jetzt=20bei=20jedem=20Seitenaufbau?= =?utf8?q?=20richtig=20aufgebaut=20(kein=20Mitschleppen=20der=20HTML-gecod?= =?utf8?q?eten=20Drop-Down-Box=20im=20Formular)=20analog=20zu=20ar.pl.=20B?= =?utf8?q?ehebt=20au=C3=9Ferdem=20ein=20paar=20Bugs=20mit=20Auswahl=20der?= =?utf8?q?=20Steuerschl=C3=BCssel.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/IR.pm | 18 ++++- bin/mozilla/ap.pl | 184 ++++++++++++++++++++++++++++++---------------- 2 files changed, 134 insertions(+), 68 deletions(-) diff --git a/SL/IR.pm b/SL/IR.pm index 885fb9e91..5533a2775 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -1083,11 +1083,23 @@ sub get_vendor { while ($ref = $sth->fetchrow_hashref(NAME_lc)) { if ($ref->{category} eq 'E') { $i++; - $form->{"AP_amount_$i"} = "$ref->{accno}--$ref->{description}"; + + if ($form->{initial_transdate}) { + my $tax_query = + qq|SELECT tk.tax_id, t.rate FROM taxkeys tk | . + qq|LEFT JOIN tax t ON tk.tax_id = t.id | . + qq|WHERE tk.chart_id = ? AND startdate <= ? | . + qq|ORDER BY tk.startdate DESC LIMIT 1|; + my ($tax_id, $rate) = + selectrow_query($form, $dbh, $tax_query, $ref->{id}, + $form->{initial_transdate}); + $form->{"taxchart_$i"} = "${tax_id}--${rate}"; + } + + $form->{"AP_amount_$i"} = "$ref->{accno}--$tax_id"; } if ($ref->{category} eq 'L') { - $form->{APselected} = $form->{AP_1} = - "$ref->{accno}--$ref->{description}"; + $form->{APselected} = $form->{AP_1} = $ref->{accno}; } } $sth->finish; diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 189249796..c6eda1b9f 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -82,8 +82,10 @@ sub add { "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback}; - &create_links; AP->get_transdate(\%myconfig, $form); + $form->{initial_transdate} = $form->{transdate}; + &create_links; + $form->{transdate} = $form->{initial_transdate}; &display_form; $lxdebug->leave_sub(); @@ -128,14 +130,6 @@ sub create_links { # build the popup menus $form->{taxincluded} = ($form->{id}) ? $form->{taxincluded} : "checked"; - map { - $tax .= - qq|