Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 54ea08cd

Von Moritz Bunkus vor fast 15 Jahren hinzugefügt

  • ID 54ea08cdb34a06dec0cb5575dc96f3d652637cc9
  • Vorgänger b2d704ee
  • Nachfolger 94466d5c

Flag "Vertreter" bei Kunden-/Lieferantentypen bearbeitbar gemacht

Aber nur, wenn $::vertreter aktiv ist. Fix für Bug 1278.

Unterschiede anzeigen:

SL/AM.pm
647 647
  # connect to database
648 648
  my $dbh = $form->dbconnect($myconfig);
649 649

  
650
  my $query = qq|SELECT id, description, discount, customernumberinit
650
  my $query = qq|SELECT id, description, discount, customernumberinit, salesman
651 651
                 FROM business
652 652
                 ORDER BY 2|;
653 653

  
......
673 673
  my $dbh = $form->dbconnect($myconfig);
674 674

  
675 675
  my $query =
676
    qq|SELECT b.description, b.discount, b.customernumberinit
676
    qq|SELECT b.description, b.discount, b.customernumberinit, b.salesman
677 677
       FROM business b
678 678
       WHERE b.id = ?|;
679 679
  my $sth = $dbh->prepare($query);
......
699 699
  # connect to database
700 700
  my $dbh = $form->dbconnect($myconfig);
701 701

  
702
  my @values = ($form->{description}, $form->{discount},
703
                $form->{customernumberinit});
702
  my @values = ($form->{description}, $form->{discount}, $form->{customernumberinit}, $form->{salesman} ? 't' : 'f');
704 703
  # id is the old record
705 704
  if ($form->{id}) {
706 705
    $query = qq|UPDATE business SET
707 706
                description = ?,
708 707
                discount = ?,
709
                customernumberinit = ?
708
                customernumberinit = ?,
709
                salesman = ?
710 710
                WHERE id = ?|;
711 711
    push(@values, $form->{id});
712 712
  } else {
713 713
    $query = qq|INSERT INTO business
714
                (description, discount, customernumberinit)
715
                VALUES (?, ?, ?)|;
714
                (description, discount, customernumberinit, salesman)
715
                VALUES (?, ?, ?, ?)|;
716 716
  }
717 717
  do_query($form, $dbh, $query, @values);
718 718

  
bin/mozilla/am.pl
1107 1107
  $form->{title} = $locale->text('Type of Business');
1108 1108

  
1109 1109
  my @column_index = qw(description discount customernumberinit);
1110
  push @column_index, 'salesman' if $::vertreter;
1110 1111
  my %column_header;
1111 1112
  $column_header{description} =
1112 1113
      qq|<th class=listheading width=60%>|
......
1120 1121
      qq|<th class=listheading>|
1121 1122
    . $locale->text('Customernumberinit')
1122 1123
    . qq|</th>|;
1124
  $column_header{salesman} =
1125
      qq|<th class=listheading>|
1126
    . $locale->text('Representative')
1127
    . qq|</th>|;
1123 1128

  
1124 1129
  $form->header;
1125 1130

  
......
1159 1164
    $column_data{discount}           = qq|<td align=right>$discount</td>|;
1160 1165
    $column_data{customernumberinit} =
1161 1166
      qq|<td align=right>$ref->{customernumberinit}</td>|;
1167
    $column_data{salesman} = '<td>' . ($ref->{salesman} ? $::locale->text('Yes') : $::locale->text('No')) . '</td>';
1162 1168

  
1163 1169
    map { print "$column_data{$_}\n" } @column_index;
1164 1170

  
......
1213 1219
  $form->{discount} =
1214 1220
    $form->format_amount(\%myconfig, $form->{discount} * 100);
1215 1221

  
1222
  my $salesman_code;
1223
  if ($::vertreter) {
1224
    $salesman_code = qq|
1225
  <tr>
1226
    <th align="right">| . $locale->text('Representative') . qq|</th>
1227
    <td>| . $::cgi->checkbox(-name => "salesman", -value => 1, -label => '', 'checked' => $form->{salesman} ? 1 : 0) . qq|</td>
1228
  </tr>
1229
|;
1230
  } else {
1231
    $salesman_code = $::cgi->hidden(-name => 'salesman', -value => $form->{salesman} ? 1 : 0);
1232
  }
1233

  
1216 1234
  $form->header;
1217 1235

  
1218 1236
  print qq|
......
1240 1258
    <th align=right>| . $locale->text('Customernumberinit') . qq|</th>
1241 1259
    <td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
1242 1260
  </tr>
1261
$salesman_code
1243 1262
  <td colspan=2><hr size=3 noshade></td>
1244 1263
  </tr>
1245 1264
</table>
locale/de/am
250 250
  'Ranges of numbers and default accounts' => 'Nummernkreise und Standardkonten',
251 251
  'Receipt, payment, reconciliation' => 'Zahlungseingang, Zahlungsausgang, Kontenabgleich',
252 252
  'Reports'                     => 'Berichte',
253
  'Representative'              => 'Vertreter',
253 254
  'Revenue'                     => 'Erl?skonto',
254 255
  'Revenues EU with UStId'      => 'Erl&ouml;se EU m. UStId',
255 256
  'Revenues EU without UStId'   => 'Erl&ouml;se EU o. UStId',

Auch abrufbar als: Unified diff