From 689b97d0b20eb451224531a434b94c3bddeda0be Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Wed, 26 Jun 2013 11:07:05 +0200 Subject: [PATCH] =?utf8?q?CustomerVendor:=20History-Eintr=C3=A4ge=20erstel?= =?utf8?q?len?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/CustomerVendor.pm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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); -- 2.20.1