use SL::DB::Pricegroup;
use SL::DB::Contact;
use SL::DB::FollowUp;
+use SL::DB::History;
# safety
__PACKAGE__->run_before(
$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 {
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);