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

(-)a/C4/Circulation.pm (-10 lines)
Lines 2458-2465 sub _FixAccountForLostAndReturned { Link Here
2458
    $accountline->discard_changes->accounttype('LR');
2458
    $accountline->discard_changes->accounttype('LR');
2459
    $accountline->store;
2459
    $accountline->store;
2460
2460
2461
    ModItem( { paidfor => '' }, undef, $itemnumber, { log_action => 0 } );
2462
2463
    if ( defined $account and C4::Context->preference('AccountAutoReconcile') ) {
2461
    if ( defined $account and C4::Context->preference('AccountAutoReconcile') ) {
2464
        $account->reconcile_balance;
2462
        $account->reconcile_balance;
2465
    }
2463
    }
Lines 3664-3678 sub DeleteBranchTransferLimits { Link Here
3664
3662
3665
sub ReturnLostItem{
3663
sub ReturnLostItem{
3666
    my ( $borrowernumber, $itemnum ) = @_;
3664
    my ( $borrowernumber, $itemnum ) = @_;
3667
3668
    MarkIssueReturned( $borrowernumber, $itemnum );
3665
    MarkIssueReturned( $borrowernumber, $itemnum );
3669
    my $patron = Koha::Patrons->find( $borrowernumber );
3670
    my $item = Koha::Items->find($itemnum);
3671
    my $old_note = ($item->paidfor && ($item->paidfor ne q{})) ? $item->paidfor.' / ' : q{};
3672
    my @datearr = localtime(time);
3673
    my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3];
3674
    my $bor = $patron->firstname . ' ' . $patron->surname . ' ' . $patron->cardnumber;
3675
    ModItem({ paidfor =>  $old_note."Paid for by $bor $date" }, undef, $itemnum);
3676
}
3666
}
3677
3667
3678
3668
(-)a/C4/Items.pm (-3 lines)
Lines 390-396 sub _build_default_values_for_mod_marc { Link Here
390
        materials                => undef,
390
        materials                => undef,
391
        new_status               => undef,
391
        new_status               => undef,
392
        notforloan               => 0,
392
        notforloan               => 0,
393
        # paidfor => undef, # commented, see bug 12817
394
        price                    => undef,
393
        price                    => undef,
395
        replacementprice         => undef,
394
        replacementprice         => undef,
396
        replacementpricedate     => undef,
395
        replacementpricedate     => undef,
Lines 1569-1575 sub _koha_new_item { Link Here
1569
            itemnotes           = ?,
1568
            itemnotes           = ?,
1570
            itemnotes_nonpublic = ?,
1569
            itemnotes_nonpublic = ?,
1571
            holdingbranch       = ?,
1570
            holdingbranch       = ?,
1572
            paidfor             = ?,
1573
            location            = ?,
1571
            location            = ?,
1574
            permanent_location  = ?,
1572
            permanent_location  = ?,
1575
            onloan              = ?,
1573
            onloan              = ?,
Lines 1613-1619 sub _koha_new_item { Link Here
1613
            $item->{'itemnotes'},
1611
            $item->{'itemnotes'},
1614
            $item->{'itemnotes_nonpublic'},
1612
            $item->{'itemnotes_nonpublic'},
1615
            $item->{'holdingbranch'},
1613
            $item->{'holdingbranch'},
1616
            $item->{'paidfor'},
1617
            $item->{'location'},
1614
            $item->{'location'},
1618
            $item->{'permanent_location'},
1615
            $item->{'permanent_location'},
1619
            $item->{'onloan'},
1616
            $item->{'onloan'},
(-)a/Koha/Account/Line.pm (+13 lines)
Lines 41-46 Koha::Account::Line - Koha accountline Object class Link Here
41
41
42
=cut
42
=cut
43
43
44
=head3 patron
45
46
Return the patron linked to this account line
47
48
=cut
49
50
sub patron {
51
    my ( $self ) = @_;
52
    my $rs = $self->_result->borrowernumber;
53
    return unless $rs;
54
    return Koha::Item->_new_from_dbic( $rs );
55
}
56
44
=head3 item
57
=head3 item
45
58
46
Return the item linked to this account line if exists
59
Return the item linked to this account line if exists
(-)a/admin/columns_settings.yml (-2 lines)
Lines 272-279 modules: Link Here
272
          columnname: itemnotes_nonpublic
272
          columnname: itemnotes_nonpublic
273
        -
273
        -
274
          columnname: holdingbranch
274
          columnname: holdingbranch
275
        -
276
          columnname: paidfor
277
        -
275
        -
278
          columnname: timestamp
276
          columnname: timestamp
279
        -
277
        -
(-)a/catalogue/moredetail.pl (+25 lines)
Lines 174-179 foreach my $item (@items){ Link Here
174
        $item->{status_advisory} = 1;
174
        $item->{status_advisory} = 1;
175
    }
175
    }
176
176
177
    # Add paidfor info
178
    if ( $item->{itemlost} ) {
179
        my $accountlines = Koha::Account::Lines->search(
180
            {
181
                itemnumber        => $item->{itemnumber},
182
                accounttype       => 'LOST',
183
                status            => [ undef, { '<>' => 'RETURNED' } ],
184
                amountoutstanding => 0
185
            },
186
            {
187
                order_by => { '-asc' => 'date' },
188
                rows     => 1
189
            }
190
        );
191
192
        if ( my $accountline = $accountlines->next ) {
193
            my $patron = $accountline->patron;
194
            $item->{paidfor} =
195
                $patron->firstname . " "
196
              . $patron->surname . " "
197
              . $patron->cardnumber . " "
198
              . $accountline->date;
199
        }
200
    }
201
177
    if (C4::Context->preference("IndependentBranches")) {
202
    if (C4::Context->preference("IndependentBranches")) {
178
        #verifying rights
203
        #verifying rights
179
        my $userenv = C4::Context->userenv();
204
        my $userenv = C4::Context->userenv();
(-)a/koha-tmpl/intranet-tmpl/prog/en/columns.def (-2 lines)
Lines 92-98 Link Here
92
<field name="items.itemnotes">Public note</field>
92
<field name="items.itemnotes">Public note</field>
93
<field name="items.itemnotes_nonpublic">Internal note</field>
93
<field name="items.itemnotes_nonpublic">Internal note</field>
94
<field name="items.holdingbranch">Current library</field>
94
<field name="items.holdingbranch">Current library</field>
95
<field name="items.paidfor">Paid for (unused)</field>
96
<field name="items.timestamp">Timestamp</field>
95
<field name="items.timestamp">Timestamp</field>
97
<field name="items.location">Shelving location</field>
96
<field name="items.location">Shelving location</field>
98
<field name="items.permanent_location">Permanent shelving location</field>
97
<field name="items.permanent_location">Permanent shelving location</field>
99
- 

Return to bug 19919