Revision db7ddbbe
Von Moritz Bunkus vor etwa 4 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
use SL::MIME;
|
||
use SL::Util qw(trim);
|
||
use SL::YAML;
|
||
use SL::DB::History;
|
||
use SL::DB::Order;
|
||
use SL::DB::Default;
|
||
use SL::DB::Unit;
|
||
... | ... | |
$self->js->flash('error', t8('Storing PDF in storage backend failed: #1', $@));
|
||
}
|
||
}
|
||
|
||
$self->save_history('PRINTED');
|
||
|
||
$self->js->render;
|
||
}
|
||
|
||
... | ... | |
|
||
$self->order->update_attributes(intnotes => $intnotes);
|
||
|
||
$self->save_history('MAILED');
|
||
|
||
flash_later('info', t8('The email has been sent.'));
|
||
|
||
my @redirect_params = (
|
||
... | ... | |
my $spool = $::lx_office_conf{paths}->{spool};
|
||
unlink map { "$spool/$_" } @spoolfiles if $spool;
|
||
|
||
$self->save_history('DELETED');
|
||
|
||
1;
|
||
}) || push(@{$errors}, $db->error);
|
||
|
||
... | ... | |
}
|
||
}
|
||
}
|
||
|
||
$self->save_history('SAVED');
|
||
|
||
1;
|
||
}) || push(@{$errors}, $db->error);
|
||
|
||
... | ... | |
$self->get_item_cvpartnumber($_) for @{$self->order->items_sorted};
|
||
|
||
$::request->{layout}->use_javascript("${_}.js") for qw(kivi.SalesPurchase kivi.Order kivi.File ckeditor/ckeditor ckeditor/adapters/jquery
|
||
edit_periodic_invoices_config calculate_qty kivi.Validator follow_up);
|
||
edit_periodic_invoices_config calculate_qty kivi.Validator follow_up show_history);
|
||
$self->setup_edit_action_bar;
|
||
}
|
||
|
||
... | ... | |
disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
|
||
only_if => $::auth->assert('productivity', 1),
|
||
],
|
||
action => [
|
||
t8('History'),
|
||
call => [ 'set_history_window', $self->order->id, 'id' ],
|
||
disabled => !$self->order->id ? t8('This record has not been saved yet.') : undef,
|
||
],
|
||
], # end of combobox "more"
|
||
);
|
||
}
|
||
... | ... | |
$self->redirect_to(%params, id => $self->order->id);
|
||
}
|
||
|
||
sub save_history {
|
||
my ($self, $addition) = @_;
|
||
|
||
my $number_type = $self->order->type =~ m{order} ? 'ordnumber' : 'quonumber';
|
||
my $snumbers = $number_type . '_' . $self->order->$number_type;
|
||
|
||
SL::DB::History->new(
|
||
trans_id => $self->order->id,
|
||
employee_id => SL::DB::Manager::Employee->current->id,
|
||
what_done => $self->order->type,
|
||
snumbers => $snumbers,
|
||
addition => $addition,
|
||
)->save;
|
||
}
|
||
|
||
1;
|
||
|
||
__END__
|
||
... | ... | |
|
||
=item * display weights
|
||
|
||
=item * history
|
||
|
||
=item * mtime check
|
||
|
||
=item * optional client/user behaviour
|
Auch abrufbar als: Unified diff
Order-Controller: Historienfunktion implementiert (aufzeichnen & anzeigen)