View | Details | Raw Unified | Return to bug 23463
Collapse All | Expand All

(-)a/C4/Items.pm (-1 lines)
Lines 203-209 sub AddItem { Link Here
203
        $unlinked_item_subfields = shift;
203
        $unlinked_item_subfields = shift;
204
    }
204
    }
205
205
206
    _set_derived_columns_for_add($item);
207
    $item->{'more_subfields_xml'} = _get_unlinked_subfields_xml($unlinked_item_subfields);
206
    $item->{'more_subfields_xml'} = _get_unlinked_subfields_xml($unlinked_item_subfields);
208
207
209
    my ( $itemnumber, $error ) = _koha_new_item( $item, $item->{barcode} );
208
    my ( $itemnumber, $error ) = _koha_new_item( $item, $item->{barcode} );
(-)a/Koha/Item.pm (-2 / +10 lines)
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
- 

Return to bug 23463