Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 54ea08cd

Von Moritz Bunkus vor etwa 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
# connect to database
my $dbh = $form->dbconnect($myconfig);
my $query = qq|SELECT id, description, discount, customernumberinit
my $query = qq|SELECT id, description, discount, customernumberinit, salesman
FROM business
ORDER BY 2|;
......
my $dbh = $form->dbconnect($myconfig);
my $query =
qq|SELECT b.description, b.discount, b.customernumberinit
qq|SELECT b.description, b.discount, b.customernumberinit, b.salesman
FROM business b
WHERE b.id = ?|;
my $sth = $dbh->prepare($query);
......
# connect to database
my $dbh = $form->dbconnect($myconfig);
my @values = ($form->{description}, $form->{discount},
$form->{customernumberinit});
my @values = ($form->{description}, $form->{discount}, $form->{customernumberinit}, $form->{salesman} ? 't' : 'f');
# id is the old record
if ($form->{id}) {
$query = qq|UPDATE business SET
description = ?,
discount = ?,
customernumberinit = ?
customernumberinit = ?,
salesman = ?
WHERE id = ?|;
push(@values, $form->{id});
} else {
$query = qq|INSERT INTO business
(description, discount, customernumberinit)
VALUES (?, ?, ?)|;
(description, discount, customernumberinit, salesman)
VALUES (?, ?, ?, ?)|;
}
do_query($form, $dbh, $query, @values);
bin/mozilla/am.pl
$form->{title} = $locale->text('Type of Business');
my @column_index = qw(description discount customernumberinit);
push @column_index, 'salesman' if $::vertreter;
my %column_header;
$column_header{description} =
qq|<th class=listheading width=60%>|
......
qq|<th class=listheading>|
. $locale->text('Customernumberinit')
. qq|</th>|;
$column_header{salesman} =
qq|<th class=listheading>|
. $locale->text('Representative')
. qq|</th>|;
$form->header;
......
$column_data{discount} = qq|<td align=right>$discount</td>|;
$column_data{customernumberinit} =
qq|<td align=right>$ref->{customernumberinit}</td>|;
$column_data{salesman} = '<td>' . ($ref->{salesman} ? $::locale->text('Yes') : $::locale->text('No')) . '</td>';
map { print "$column_data{$_}\n" } @column_index;
......
$form->{discount} =
$form->format_amount(\%myconfig, $form->{discount} * 100);
my $salesman_code;
if ($::vertreter) {
$salesman_code = qq|
<tr>
<th align="right">| . $locale->text('Representative') . qq|</th>
<td>| . $::cgi->checkbox(-name => "salesman", -value => 1, -label => '', 'checked' => $form->{salesman} ? 1 : 0) . qq|</td>
</tr>
|;
} else {
$salesman_code = $::cgi->hidden(-name => 'salesman', -value => $form->{salesman} ? 1 : 0);
}
$form->header;
print qq|
......
<th align=right>| . $locale->text('Customernumberinit') . qq|</th>
<td><input name=customernumberinit size=10 value=$form->{customernumberinit}></td>
</tr>
$salesman_code
<td colspan=2><hr size=3 noshade></td>
</tr>
</table>
locale/de/am
'Ranges of numbers and default accounts' => 'Nummernkreise und Standardkonten',
'Receipt, payment, reconciliation' => 'Zahlungseingang, Zahlungsausgang, Kontenabgleich',
'Reports' => 'Berichte',
'Representative' => 'Vertreter',
'Revenue' => 'Erl?skonto',
'Revenues EU with UStId' => 'Erl&ouml;se EU m. UStId',
'Revenues EU without UStId' => 'Erl&ouml;se EU o. UStId',

Auch abrufbar als: Unified diff