From: Moritz Bunkus Date: Thu, 4 Mar 2010 09:31:03 +0000 (+0100) Subject: Flag "Vertreter" bei Kunden-/Lieferantentypen bearbeitbar gemacht X-Git-Tag: release-2.6.1beta1~33^2~14 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=54ea08cdb34a06dec0cb5575dc96f3d652637cc9;p=kivitendo-erp.git Flag "Vertreter" bei Kunden-/Lieferantentypen bearbeitbar gemacht Aber nur, wenn $::vertreter aktiv ist. Fix für Bug 1278. --- diff --git a/SL/AM.pm b/SL/AM.pm index 11b32ca4b..1dbf9d82f 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -647,7 +647,7 @@ sub business { # 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|; @@ -673,7 +673,7 @@ sub get_business { 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); @@ -699,20 +699,20 @@ sub save_business { # 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); diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 3cb5ac3d8..fe9199ef0 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -1107,6 +1107,7 @@ sub list_business { $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|| @@ -1120,6 +1121,10 @@ sub list_business { qq|| . $locale->text('Customernumberinit') . qq||; + $column_header{salesman} = + qq|| + . $locale->text('Representative') + . qq||; $form->header; @@ -1159,6 +1164,7 @@ sub list_business { $column_data{discount} = qq|$discount|; $column_data{customernumberinit} = qq|$ref->{customernumberinit}|; + $column_data{salesman} = '' . ($ref->{salesman} ? $::locale->text('Yes') : $::locale->text('No')) . ''; map { print "$column_data{$_}\n" } @column_index; @@ -1213,6 +1219,18 @@ sub business_header { $form->{discount} = $form->format_amount(\%myconfig, $form->{discount} * 100); + my $salesman_code; + if ($::vertreter) { + $salesman_code = qq| + + | . $locale->text('Representative') . qq| + | . $::cgi->checkbox(-name => "salesman", -value => 1, -label => '', 'checked' => $form->{salesman} ? 1 : 0) . qq| + +|; + } else { + $salesman_code = $::cgi->hidden(-name => 'salesman', -value => $form->{salesman} ? 1 : 0); + } + $form->header; print qq| @@ -1240,6 +1258,7 @@ sub business_header { | . $locale->text('Customernumberinit') . qq| {customernumberinit}> +$salesman_code
diff --git a/locale/de/am b/locale/de/am index 179517e44..b395a0c88 100644 --- a/locale/de/am +++ b/locale/de/am @@ -250,6 +250,7 @@ $self->{texts} = { '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öse EU m. UStId', 'Revenues EU without UStId' => 'Erlöse EU o. UStId',