|
Lines 26-31
use Koha::Database;
Link Here
|
| 26 |
use Koha::DateUtils qw( dt_from_string ); |
26 |
use Koha::DateUtils qw( dt_from_string ); |
| 27 |
|
27 |
|
| 28 |
use C4::Context; |
28 |
use C4::Context; |
|
|
29 |
use C4::ClassSource; # FIXME We would like to avoid that |
| 29 |
|
30 |
|
| 30 |
use Koha::Checkouts; |
31 |
use Koha::Checkouts; |
| 31 |
use Koha::IssuingRules; |
32 |
use Koha::IssuingRules; |
|
Lines 66-73
sub store {
Link Here
|
| 66 |
$self->itype($self->biblio->biblioitem->itemtype); |
67 |
$self->itype($self->biblio->biblioitem->itemtype); |
| 67 |
} |
68 |
} |
| 68 |
|
69 |
|
|
|
70 |
my $today = dt_from_string; |
| 69 |
unless ( $self->in_storage ) { #AddItem |
71 |
unless ( $self->in_storage ) { #AddItem |
| 70 |
my $today = dt_from_string; |
|
|
| 71 |
unless ( $self->permanent_location ) { |
72 |
unless ( $self->permanent_location ) { |
| 72 |
$self->permanent_location($self->location); |
73 |
$self->permanent_location($self->location); |
| 73 |
} |
74 |
} |
|
Lines 78-83
sub store {
Link Here
|
| 78 |
$self->datelastseen($today); |
79 |
$self->datelastseen($today); |
| 79 |
} |
80 |
} |
| 80 |
|
81 |
|
|
|
82 |
unless ( $self->dateaccessioned ) { |
| 83 |
$self->dateaccessioned($today); |
| 84 |
} |
| 85 |
|
| 86 |
if ( $self->itemcallnumber ) { # This could be improved, we should recalculate it only if changed |
| 87 |
my $cn_sort = GetClassSort($self->cn_source, $self->itemcallnumber, ""); |
| 88 |
$self->cn_sort($cn_sort); |
| 89 |
} |
| 81 |
} |
90 |
} |
| 82 |
|
91 |
|
| 83 |
unless ( $self->dateaccessioned ) { |
92 |
unless ( $self->dateaccessioned ) { |
| 84 |
- |
|
|