From: Moritz Bunkus Date: Thu, 15 Mar 2007 15:23:22 +0000 (+0000) Subject: Kreditorenrechnungsmaske: Drop-Down-Boxen für Konten werden jetzt bei jedem Seitenauf... X-Git-Tag: release-2.4.3^2~607 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d0b49f673e3e8d59324570461d3a191f25b3d24c;p=kivitendo-erp.git Kreditorenrechnungsmaske: Drop-Down-Boxen für Konten werden jetzt bei jedem Seitenaufbau richtig aufgebaut (kein Mitschleppen der HTML-gecodeten Drop-Down-Box im Formular) analog zu ar.pl. Behebt außerdem ein paar Bugs mit Auswahl der Steuerschlüssel. --- 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|