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

(-)a/Koha/Account.pm (-2 / +20 lines)
Lines 224-229 sub add_credit { Link Here
224
    my $item_id       = $params->{item_id};
224
    my $item_id       = $params->{item_id};
225
    my $issue_id      = $params->{issue_id};
225
    my $issue_id      = $params->{issue_id};
226
226
227
    my $old_issue_id;
228
    if ( $issue_id ) {
229
        my $issue = Koha::Checkouts->find($issue_id);
230
        unless ( $issue ) {
231
            my $old_issue = Koha::Old::Checkouts->find($issue_id);
232
            $issue_id = undef;
233
            $old_issue_id = $old_issue->id;
234
        }
235
    }
236
227
    Koha::Exceptions::Account::RegisterRequired->throw()
237
    Koha::Exceptions::Account::RegisterRequired->throw()
228
      if ( C4::Context->preference("UseCashRegisters")
238
      if ( C4::Context->preference("UseCashRegisters")
229
        && defined($payment_type)
239
        && defined($payment_type)
Lines 252-258 sub add_credit { Link Here
252
                        branchcode        => $library_id,
262
                        branchcode        => $library_id,
253
                        register_id       => $cash_register,
263
                        register_id       => $cash_register,
254
                        itemnumber        => $item_id,
264
                        itemnumber        => $item_id,
255
                        issue_id          => $issue_id,
265
                        (
266
                            $issue_id
267
                            ? ( issue_id => $issue_id )
268
                            : ()
269
                        ),
270
                        (
271
                            $old_issue_id
272
                            ? ( old_issue_id => $old_issue_id )
273
                            : ()
274
                        ),
256
                    }
275
                    }
257
                )->store();
276
                )->store();
258
277
259
- 

Return to bug 22421