Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6aefd19d

Von Moritz Bunkus vor fast 18 Jahren hinzugefügt

  • ID 6aefd19def6a7d2f205e5401451e4c0bf3cebc46
  • Vorgänger a104b890
  • Nachfolger d18a84df

Dialogbuchen, Debitorenbuchungen: Wird das transdate verändert, so wird eventuell auch der Steuerschlüssel geändert. Auch in diesem Fall müssen die ausgewählten Konten beibehalten werden. Die Steuerkonten werden in so einem Fall aber auf das mit dem ausgewählten Konto verknüpften Steuerkonto gesetzt. Fix für Bug 577.

Unterschiede anzeigen:

bin/mozilla/ar.pl
428 428
  my (%AR_amount_labels, @AR_amount_values);
429 429
  my (%AR_labels, @AR_values);
430 430
  my (%AR_paid_labels, @AR_paid_values);
431
  my %charts;
431 432
  my $taxchart_init;
432 433

  
433 434
  foreach my $item (@{ $form->{ALL_CHARTS} }) {
......
447 448
      $AR_paid_labels{$item->{accno}} =
448 449
        "$item->{accno}--$item->{description}";
449 450
    }
451

  
452
    $charts{$item->{accno}} = $item;
450 453
  }
451 454

  
452 455
  my %taxchart_labels = ();
453 456
  my @taxchart_values = ();
457
  my %taxcharts = ();
454 458
  foreach my $item (@{ $form->{ALL_TAXCHARTS} }) {
455 459
    my $key = "$item->{id}--$item->{rate}";
456 460
    $taxchart_init = $key if ($taxchart_init eq $item->{id});
457 461
    push(@taxchart_values, $key);
458 462
    $taxchart_labels{$key} =
459 463
      "$item->{taxdescription} " . ($item->{rate} * 100) . ' %';
464
    $taxcharts{$item->{id}} = $item;
460 465
  }
461 466

  
462 467
  $form->{fokus} = "arledger.customer";
......
610 615
      $form->format_amount(\%myconfig, $form->{"amount_$i"}, 2);
611 616
    $form->{"tax_$i"} = $form->format_amount(\%myconfig, $form->{"tax_$i"}, 2);
612 617

  
618
    my $selected_accno_full;
619
    my ($accno_row) = split(/--/, $form->{"AR_amount_$i"});
620
    my $item = $charts{$accno_row};
621
    $selected_accno_full = "$item->{accno}--$item->{tax_id}";
622

  
623
    my $selected_taxchart = $form->{"taxchart_$i"};
624
    my ($selected_accno, $selected_tax_id) = split(/--/, $selected_accno_full);
625
    my ($previous_accno, $previous_tax_id) = split(/--/, $form->{"previous_AR_amount_$i"});
626

  
627
    if ($previous_accno &&
628
        ($previous_accno eq $selected_accno) &&
629
        ($previous_tax_id ne $selected_tax_id)) {
630
      $lxdebug->message(0, "yeah");
631
      my $item = $taxcharts{$selected_tax_id};
632
      $selected_taxchart = "$item->{id}--$item->{rate}";
633
    }
634

  
635
    $selected_taxchart = $taxchart_init unless ($form->{"taxchart_$i"});
636

  
613 637
    $selectAR_amount =
614 638
      NTI($cgi->popup_menu('-name' => "AR_amount_$i",
615 639
                           '-id' => "AR_amount_$i",
......
617 641
                           '-onChange' => "setTaxkey(this, $i)",
618 642
                           '-values' => \@AR_amount_values,
619 643
                           '-labels' => \%AR_amount_labels,
620
                           '-default' => $form->{"AR_amount_$i"}));
644
                           '-default' => $selected_accno_full))
645
      . $cgi->hidden('-name' => "previous_AR_amount_$i",
646
                     '-default' => $selected_accno_full);
621 647

  
622 648
    $tax = qq|<td>| .
623 649
      NTI($cgi->popup_menu('-name' => "taxchart_$i",
......
625 651
                           '-style' => 'width:200px',
626 652
                           '-values' => \@taxchart_values,
627 653
                           '-labels' => \%taxchart_labels,
628
                           '-default' => $form->{"taxchart_$i"} eq "" ?
629
                           $taxchart_init : $form->{"taxchart_$i"}))
654
                           '-default' => $selected_taxchart))
630 655
      . qq|</td>|;
631 656

  
632 657
    $korrektur_checked = ($form->{"korrektur_$i"} ? 'checked' : '');
bin/mozilla/gl.pl
1086 1086

  
1087 1087
  my %chart_labels = ();
1088 1088
  my @chart_values = ();
1089
  my %charts = ();
1089 1090
  my $taxchart_init;
1090 1091
  foreach my $item (@{ $form->{ALL_CHARTS} }) {
1091 1092
    my $key = Q($item->{accno}) . "--" . Q($item->{tax_id});
1092 1093
    $taxchart_init = $item->{taxkey_id} unless (@chart_values);
1093 1094
    push(@chart_values, $key);
1094 1095
    $chart_labels{$key} = H($item->{accno}) . "--" . H($item->{description});
1096
    $charts{$item->{accno}} = $item;
1095 1097
  }
1096 1098

  
1097 1099
  my %taxchart_labels = ();
1098 1100
  my @taxchart_values = ();
1101
  my %taxcharts = ();
1099 1102
  foreach my $item (@{ $form->{ALL_TAXCHARTS} }) {
1100 1103
    my $key = Q($item->{id}) . "--" . Q($item->{rate});
1101 1104
    $taxchart_init = $key if ($taxchart_init eq $item->{taxkey});
1102 1105
    push(@taxchart_values, $key);
1103 1106
    $taxchart_labels{$key} = H($item->{taxdescription}) . " " .
1104 1107
      H($item->{rate} * 100) . ' %';
1108
    $taxcharts{$item->{id}} = $item;
1105 1109
  }
1106 1110

  
1107 1111
  for $i (1 .. $form->{rowcount}) {
......
1113 1117
    <td><input name="memo_$i" value="$form->{"memo_$i"}" size="16" tabindex=|
1114 1118
      . ($i + 12 + (($i - 1) * 8)) . qq|></td>|;
1115 1119

  
1120
    my $selected_accno_full;
1121
    my ($accno_row) = split(/--/, $form->{"accno_$i"});
1122
    my $item = $charts{$accno_row};
1123
    $selected_accno_full = "$item->{accno}--$item->{tax_id}";
1124

  
1125
    my $selected_taxchart = $form->{"taxchart_$i"};
1126
    my ($selected_accno, $selected_tax_id) = split(/--/, $selected_accno_full);
1127
    my ($previous_accno, $previous_tax_id) = split(/--/, $form->{"previous_accno_$i"});
1128

  
1129
    if ($previous_accno &&
1130
        ($previous_accno eq $selected_accno) &&
1131
        ($previous_tax_id ne $selected_tax_id)) {
1132
      $lxdebug->message(0, "yeah");
1133
      my $item = $taxcharts{$selected_tax_id};
1134
      $selected_taxchart = "$item->{id}--$item->{rate}";
1135
    }
1136

  
1137
    if ($init) {
1138
      $selected_accno = '';
1139
      $selected_taxchart = $taxchart_init;
1140
    }
1141

  
1116 1142
    $accno = qq|<td>| .
1117 1143
      $cgi->popup_menu('-name' => "accno_$i",
1118 1144
                       '-id' => "accno_$i",
......
1121 1147
                       '-tabindex' => ($i + 5 + (($i - 1) * 8)),
1122 1148
                       '-values' => \@chart_values,
1123 1149
                       '-labels' => \%chart_labels,
1124
                       '-default' => $init ? '' : $form->{"accno_$i"})
1150
                       '-default' => $selected_accno_full)
1151
      . $cgi->hidden('-name' => "previous_accno_$i",
1152
                     '-default' => $selected_accno_full)
1125 1153
      . qq|</td>|;
1126 1154
    $tax = qq|<td>| .
1127 1155
      $cgi->popup_menu('-name' => "taxchart_$i",
......
1130 1158
                       '-tabindex' => ($i + 10 + (($i - 1) * 8)),
1131 1159
                       '-values' => \@taxchart_values,
1132 1160
                       '-labels' => \%taxchart_labels,
1133
                       '-default' => $init ? $taxchart_init : $form->{"taxchart_$i"})
1161
                       '-default' => $selected_taxchart)
1134 1162
      . qq|</td>|;
1135 1163

  
1136 1164
    if ($init) {

Auch abrufbar als: Unified diff