From: Thomas Heck Date: Wed, 26 Jun 2013 09:07:05 +0000 (+0200) Subject: CustomerVendor: History-Einträge erstellen X-Git-Tag: release-3.1.0beta1~161^2^2~27 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d94503b203c3f012020cd0c442092ae5064cac56;p=kivitendo-erp.git CustomerVendor: History-Einträge erstellen --- diff --git a/SL/Controller/CustomerVendor.pm b/SL/Controller/CustomerVendor.pm index 5985e94d7..9becb61da 100644 --- a/SL/Controller/CustomerVendor.pm +++ b/SL/Controller/CustomerVendor.pm @@ -18,6 +18,7 @@ use SL::DB::PaymentTerm; use SL::DB::Pricegroup; use SL::DB::Contact; use SL::DB::FollowUp; +use SL::DB::History; # safety __PACKAGE__->run_before( @@ -125,7 +126,13 @@ sub _save { $self->{shipto}->save(); } - #TODO: history + my $snumbers = $self->is_vendor() ? 'vendornumber_'. $self->{cv}->vendornumber : 'customernumber_'. $self->{cv}->customernumber; + SL::DB::History->new( + trans_id => $self->{cv}->id, + snumbers => $snumbers, + employee_id => SL::DB::Manager::Employee->current->id, + addition => 'SAVED', + )->save(); } sub action_save { @@ -240,7 +247,13 @@ sub action_delete { else { $self->{cv}->delete(); - #TODO: history + my $snumbers = $self->is_vendor() ? 'vendornumber_'. $self->{cv}->vendornumber : 'customernumber_'. $self->{cv}->customernumber; + SL::DB::History->new( + trans_id => $self->{cv}->id, + snumbers => $snumbers, + employee_id => SL::DB::Manager::Employee->current->id, + addition => 'DELETED', + )->save(); my $msg = $self->is_vendor() ? $::locale->text('Vendor deleted!') : $::locale->text('Customer deleted!'); $::form->redirect($msg);