X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/a84943da59d4910ad5baef33804daf97fc5cceb2..211de9e3a7748d80cada65e5dde13a41b9e3f749:/SL/CT.pm?ds=inline diff --git a/SL/CT.pm b/SL/CT.pm index 24bce2807..eece19e44 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -69,6 +69,9 @@ sub get_tuple { map { $form->{$_} = $ref->{$_} } keys %$ref; + # remove any trailing whitespace + $form->{curr} =~ s/\s*$//; + $sth->finish; if ( $form->{salesman_id} ) { my $query = @@ -315,7 +318,8 @@ sub save_customer { qq|taxzone_id = ?, | . qq|user_password = ?, | . qq|c_vendor_id = ?, | . - qq|klass = ? | . + qq|klass = ?, | . + qq|curr = ? | . qq|WHERE id = ?|; my @values = ( $form->{customernumber}, @@ -357,6 +361,7 @@ sub save_customer { $form->{user_password}, $form->{c_vendor_id}, conv_i($form->{klass}), + substr($form->{currency}, 0, 3), $form->{id} ); do_query( $form, $dbh, $query, @values ); @@ -524,7 +529,8 @@ sub save_vendor { qq| language_id = ?, | . qq| username = ?, | . qq| user_password = ?, | . - qq| v_customer_id = ? | . + qq| v_customer_id = ?, | . + qq| curr = ? | . qq|WHERE id = ?|; my @values = ( $form->{vendornumber}, @@ -564,6 +570,7 @@ sub save_vendor { $form->{username}, $form->{user_password}, $form->{v_customer_id}, + substr($form->{currency}, 0, 3), $form->{id} ); do_query($form, $dbh, $query, @values); @@ -762,6 +769,13 @@ sub search { push(@values, conv_i($form->{business_id})); } + # Nur Kunden finden, bei denen ich selber der Verkäufer bin + # Gilt nicht für Lieferanten + if ($cv eq 'customer' && !$main::auth->assert('customer_vendor_all_edit', 1)) { + $where .= qq| AND ct.salesman_id = (select id from employee where login= ?)|; + push(@values, $form->{login}); + } + my ($cvar_where, @cvar_values) = CVar->build_filter_query('module' => 'CT', 'trans_id_field' => 'ct.id', 'filter' => $form); @@ -854,6 +868,9 @@ sub get_contact { $main::lxdebug->enter_sub(); my ( $self, $myconfig, $form ) = @_; + + die 'Missing argument: cp_id' unless $::form->{cp_id}; + my $dbh = $form->dbconnect($myconfig); my $query = qq|SELECT * FROM contacts c | . @@ -1033,6 +1050,7 @@ sub _delete_selected_notes { $main::lxdebug->leave_sub(); } +# TODO: remove in 2.7.0 stable sub delete_shipto { $main::lxdebug->enter_sub(); @@ -1050,6 +1068,7 @@ sub delete_shipto { $main::lxdebug->leave_sub(); } +# TODO: remove in 2.7.0 stable sub delete_contact { $main::lxdebug->enter_sub();