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

(-)a/Koha/Checkout.pm (+5 lines)
Lines 242-247 sub claim_returned { Link Here
242
    my ( $self, $params ) = @_;
242
    my ( $self, $params ) = @_;
243
243
244
    my $charge_lost_fee = $params->{charge_lost_fee};
244
    my $charge_lost_fee = $params->{charge_lost_fee};
245
    my $refund_lost_fee = $params->{refund_lost_fee};
245
246
246
    try {
247
    try {
247
        $self->_result->result_source->schema->txn_do(
248
        $self->_result->result_source->schema->txn_do(
Lines 273-278 sub claim_returned { Link Here
273
                    C4::Circulation::MarkIssueReturned( $self->borrowernumber, $self->itemnumber, undef, $self->patron->privacy );
274
                    C4::Circulation::MarkIssueReturned( $self->borrowernumber, $self->itemnumber, undef, $self->patron->privacy );
274
                }
275
                }
275
276
277
                if ($refund_lost_fee) {
278
                    $self->item->store( { refund_lost_fee => $refund_lost_fee } );
279
                }
280
276
                return $claim;
281
                return $claim;
277
            }
282
            }
278
        );
283
        );
(-)a/Koha/Item.pm (-1 / +5 lines)
Lines 146-151 sub store { Link Here
146
146
147
        $action = 'modify';
147
        $action = 'modify';
148
148
149
        # refund lost fee if a return claim has been made on an item previously marked as lost
150
        if ( $params->{refund_lost_fee} ) {
151
            $self->_set_found_trigger( $self->get_from_storage );
152
        }
153
149
        my %updated_columns = $self->_result->get_dirty_columns;
154
        my %updated_columns = $self->_result->get_dirty_columns;
150
        return $self->SUPER::store unless %updated_columns;
155
        return $self->SUPER::store unless %updated_columns;
151
156
Lines 1453-1459 Internal function, not exported, called only by Koha::Item->store. Link Here
1453
1458
1454
sub _set_found_trigger {
1459
sub _set_found_trigger {
1455
    my ( $self, $pre_mod_item ) = @_;
1460
    my ( $self, $pre_mod_item ) = @_;
1456
1457
    # Reverse any lost item charges if necessary.
1461
    # Reverse any lost item charges if necessary.
1458
    my $no_refund_after_days =
1462
    my $no_refund_after_days =
1459
      C4::Context->preference('NoRefundOnLostReturnedItemsAge');
1463
      C4::Context->preference('NoRefundOnLostReturnedItemsAge');
(-)a/Koha/REST/V1/ReturnClaims.pm (+2 lines)
Lines 45-50 sub claim_returned { Link Here
45
    return try {
45
    return try {
46
        my $itemnumber      = $body->{item_id};
46
        my $itemnumber      = $body->{item_id};
47
        my $charge_lost_fee = $body->{charge_lost_fee} ? 1 : 0;
47
        my $charge_lost_fee = $body->{charge_lost_fee} ? 1 : 0;
48
        my $refund_lost_fee = $body->{refund_lost_fee} ? 1 : 0;
48
        my $created_by      = $body->{created_by};
49
        my $created_by      = $body->{created_by};
49
        my $notes           = $body->{notes};
50
        my $notes           = $body->{notes};
50
51
Lines 59-64 sub claim_returned { Link Here
59
        my $claim = $checkout->claim_returned(
60
        my $claim = $checkout->claim_returned(
60
            {
61
            {
61
                charge_lost_fee => $charge_lost_fee,
62
                charge_lost_fee => $charge_lost_fee,
63
                refund_lost_fee => $refund_lost_fee,
62
                created_by      => $created_by,
64
                created_by      => $created_by,
63
                notes           => $notes,
65
                notes           => $notes,
64
            }
66
            }
(-)a/api/v1/swagger/paths/return_claims.yaml (-1 / +4 lines)
Lines 27-32 Link Here
27
              description: Charge a lost fee if true and Koha is set to allow a choice.
27
              description: Charge a lost fee if true and Koha is set to allow a choice.
28
                Ignored otherwise.
28
                Ignored otherwise.
29
              type: boolean
29
              type: boolean
30
            refund_lost_fee:
31
              description: Refund a lost fee if true and a lost fee has previously been charged for the item.
32
                Ignored otherwise.
33
              type: boolean
30
          additionalProperties: false
34
          additionalProperties: false
31
    produces:
35
    produces:
32
      - application/json
36
      - application/json
33
- 

Return to bug 33292