Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision affafa23

Von Niclas Zimmermann vor fast 11 Jahren hinzugefügt

  • ID affafa23d66a18e409ac424f6e27f0f1b4008725
  • Vorgänger 95795aa0
  • Nachfolger 16fffacb

Behebt Bug bei Steuerfilterung in Dialogbuchungen

Bisher kam es zu einem Fehler, wenn in Dialogbuchungen auf 'Erneuern'
geklickt hat (der Filter für die Steuerkonten wurde für das erste
Konto in der Liste aller Konten gesetzt statt dem ausgewählten).

Unterschiede anzeigen:

SL/GL.pm
789 789
}
790 790

  
791 791
sub get_tax_dropdown {
792
  my ($self, $accno) = @_;
793

  
792 794
  my $myconfig = \%main::myconfig;
793 795
  my $form = $main::form;
794 796

  
795 797
  my $dbh = $form->get_standard_dbh($myconfig);
796 798

  
797 799
  my $query = qq|SELECT category FROM chart WHERE accno = ?|;
798
  my ($category) = selectrow_query($form, $dbh, $query, $form->{accno});
800
  my ($category) = selectrow_query($form, $dbh, $query, $accno);
799 801

  
800 802
  $query = qq|SELECT * FROM tax WHERE chart_categories like '%$category%' order by taxkey, rate|;
801 803

  
802 804
  my $sth = prepare_execute_query($form, $dbh, $query);
803 805

  
804
  $form->{TAX_ACCOUNTS} = [];
806
  my @tax_accounts = ();
805 807
  while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
806
    push(@{ $form->{TAX_ACCOUNTS} }, $ref);
808
    push(@tax_accounts, $ref);
807 809
  }
808 810

  
811
  return @tax_accounts;
809 812
}
810 813

  
811 814
1;
bin/mozilla/gl.pl
683 683
    $charts{$item->{accno}} = $item;
684 684
  }
685 685

  
686
  my %taxchart_labels = ();
687
  my @taxchart_values = ();
688
  my %taxcharts = ();
689
  foreach my $item (@{ $form->{TAX_ACCOUNTS} }) {
690
    my $key = $item->{id} . "--" . $item->{rate};
691
    $taxchart_init = $key if ($taxchart_init == $item->{id});
692
    push(@taxchart_values, $key);
693
    $taxchart_labels{$key} = $item->{taxdescription} . " " . $item->{rate} * 100 . ' %';
694
    $taxcharts{$item->{id}} = $item;
695
  }
696

  
697 686
  my ($source, $memo, $source_hidden, $memo_hidden);
698 687
  for my $i (1 .. $form->{rowcount}) {
699 688
    if ($form->{show_details}) {
......
717 706
    my ($selected_accno, $selected_tax_id) = split(/--/, $selected_accno_full);
718 707
    my ($previous_accno, $previous_tax_id) = split(/--/, $form->{"previous_accno_$i"});
719 708

  
709
    my %taxchart_labels = ();
710
    my @taxchart_values = ();
711
    my %taxcharts = ();
712
    my $filter_accno;
713
    $filter_accno = $::form->{ALL_CHARTS}[0]->{accno};
714
    $filter_accno = $selected_accno if (!$init and $i < $form->{rowcount});
715
    foreach my $item ( GL->get_tax_dropdown($filter_accno) ) {
716
      my $key = $item->{id} . "--" . $item->{rate};
717
      $taxchart_init = $key if ($taxchart_init == $item->{id});
718
      push(@taxchart_values, $key);
719
      $taxchart_labels{$key} = $item->{taxdescription} . " " . $item->{rate} * 100 . ' %';
720
      $taxcharts{$item->{id}} = $item;
721
    }
722

  
720 723
    if ($previous_accno &&
721 724
        ($previous_accno eq $selected_accno) &&
722 725
        ($previous_tax_id ne $selected_tax_id)) {
......
864 867
                   "charts"    => { "key"       => "ALL_CHARTS",
865 868
                                    "transdate" => $::form->{transdate} });
866 869

  
867
  $::form->{accno} = $::form->{ALL_CHARTS}[0]->{accno};
868
  GL->get_tax_dropdown();
869

  
870 870
  GL->get_chart_balances('charts' => $::form->{ALL_CHARTS});
871 871

  
872 872
  my $title      = $::form->{title};
......
1225 1225
}
1226 1226

  
1227 1227
sub get_tax_dropdown {
1228
  $main::lxdebug->enter_sub();
1228 1229

  
1229 1230
  my $form = $main::form;
1230
  $main::lxdebug->enter_sub();
1231
  GL->get_tax_dropdown();
1231
  my @tax_accounts = GL->get_tax_dropdown($form->{accno});
1232 1232

  
1233
  foreach my $item (@{ $form->{TAX_ACCOUNTS} }) {
1233
  foreach my $item (@tax_accounts) {
1234 1234
    $item->{taxdescription} = $::locale->{iconv_utf8}->convert($item->{taxdescription});
1235 1235
    $item->{taxdescription} .= ' ' . $form->round_amount($item->{rate} * 100);
1236 1236
  }
1237 1237

  
1238
  $form->{TAX_ACCOUNTS} = [ @tax_accounts ];
1239

  
1238 1240
  print $form->ajax_response_header, $form->parse_html_template("gl/update_tax_accounts");
1239 1241

  
1240 1242
  $main::lxdebug->leave_sub();

Auch abrufbar als: Unified diff