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

(-)a/circ/returns.pl (-28 / +33 lines)
Lines 446-479 if ($barcode) { Link Here
446
        }
446
        }
447
        for my $missing_item ( keys %{$expected_items} ) {
447
        for my $missing_item ( keys %{$expected_items} ) {
448
            my $bundle_item = $expected_items->{$missing_item};
448
            my $bundle_item = $expected_items->{$missing_item};
449
            $bundle_item->itemlost($BundleLostValue)->store();
449
            # Mark as lost if it's not already lost
450
            # Add return_claim record if this is an actual checkin
450
            if ( !$bundle_item->itemlost ) {
451
            if ($issue) {
451
                $bundle_item->itemlost($BundleLostValue)->store();
452
                $bundle_item->_result->create_related(
452
453
                    'return_claims',
453
                # Add return_claim record if this is an actual checkin
454
                    {
454
                if ($issue) {
455
                        issue_id       => $issue->issue_id,
455
                    $bundle_item->_result->create_related(
456
                        itemnumber     => $bundle_item->itemnumber,
456
                        'return_claims',
457
                        borrowernumber => $issue->borrowernumber,
457
                        {
458
                        created_by     => C4::Context->userenv()->{number},
458
                            issue_id       => $issue->issue_id,
459
                        created_on     => dt_from_string
459
                            itemnumber     => $bundle_item->itemnumber,
460
                    }
460
                            borrowernumber => $issue->borrowernumber,
461
                );
461
                            created_by     => C4::Context->userenv()->{number},
462
            }
462
                            created_on     => dt_from_string
463
            push @missing_items, $bundle_item;
463
                        }
464
            # NOTE: We cannot use C4::LostItem here because the item itself doesn't have a checkout
464
                    );
465
            # and thus would not get charged.. it's checked out as part of the bundle.
465
                }
466
            if ( C4::Context->preference('WhenLostChargeReplacementFee') && $issue ) {
466
                push @missing_items, $bundle_item;
467
                C4::Accounts::chargelostitem(
467
468
                    $issue->borrowernumber,
468
                # NOTE: We cannot use C4::LostItem here because the item itself doesn't have a checkout
469
                    $bundle_item->itemnumber,
469
                # and thus would not get charged.. it's checked out as part of the bundle.
470
                    $bundle_item->replacementprice,
470
                if ( C4::Context->preference('WhenLostChargeReplacementFee') && $issue ) {
471
                    sprintf( "%s %s %s",
471
                    C4::Accounts::chargelostitem(
472
                        $bundle_item->biblio->title  || q{},
472
                        $issue->borrowernumber,
473
                        $bundle_item->barcode        || q{},
473
                        $bundle_item->itemnumber,
474
                        $bundle_item->itemcallnumber || q{},
474
                        $bundle_item->replacementprice,
475
                    ),
475
                        sprintf( "%s %s %s",
476
                );
476
                            $bundle_item->biblio->title  || q{},
477
                            $bundle_item->barcode        || q{},
478
                            $bundle_item->itemcallnumber || q{},
479
                        ),
480
                    );
481
                }
477
            }
482
            }
478
        }
483
        }
479
        $template->param(
484
        $template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +42 lines)
Lines 223-229 Link Here
223
                                <div id="bundle_missing_items" class="dialog alert">
223
                                <div id="bundle_missing_items" class="dialog alert">
224
                                    <h3>Bundle had missing items</h3>
224
                                    <h3>Bundle had missing items</h3>
225
                                    <p>Bundle contents list updated</p>
225
                                    <p>Bundle contents list updated</p>
226
                                    <p><a class="btn btn-default btn-xs" role="button" data-toggle="modal" href="#bundleContentsModal"><i class="fa fa-eye" aria-hidden="true"></i> View updated contents list</a></p>
226
                                    <p>
227
                                        <a class="btn btn-default btn-xs" role="button" data-toggle="modal" href="#bundleContentsModal"><i class="fa fa-eye" aria-hidden="true"></i> View updated contents list</a>
228
                                        <a class="btn btn-default btn-xs" role="button" data-toggle="modal" href="#bundleMissingModal"><i class="fa fa-eye" aria-hidden="true"></i> View list of missing items</a>
229
                                    </p>
227
                                </div>
230
                                </div>
228
                            [% END %]
231
                            [% END %]
229
232
Lines 1306-1311 Link Here
1306
1309
1307
    [% INCLUDE 'modals/bundle_contents.inc' %]
1310
    [% INCLUDE 'modals/bundle_contents.inc' %]
1308
1311
1312
    [% IF ( missing_items ) %]
1313
    <!-- Bundle missing modal -->
1314
    <div class="modal printable" id="bundleMissingModal" tabindex="-1" role="dialog" aria-labelledby="bundleMissingLabel">
1315
        <div class="modal-dialog" role="document">
1316
            <div class="modal-content">
1317
                <div class="modal-header">
1318
                    <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
1319
                    <h4 class="modal-title" id="bundleMissingLabel">Items missing from bundle at checking for [% item.barcode | html %]</h4>
1320
                </div>
1321
                <div class="modal-body">
1322
                    <table style="width:100%">
1323
                        <thead>
1324
                            <tr>
1325
                                <th>Barcode</th>
1326
                                <th>Title</th>
1327
                            </tr>
1328
                        </thead>
1329
                        <tbody>
1330
                        [% FOREACH bundle_item IN missing_items %]
1331
                            <tr>
1332
                                <td>[% bundle_item.barcode | html %]</td>
1333
                                <td>[% INCLUDE 'biblio-title.inc' biblio=bundle_item.biblio %]</td>
1334
                            </tr>
1335
                        [% END %]
1336
                        </tbody>
1337
                        <tfoot>
1338
                        </tfoot>
1339
                    </table>
1340
                </div> <!-- /.modal-body -->
1341
                <div class="modal-footer">
1342
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1343
                    <button type="button" class="printModal btn btn-primary"><i class="fa fa-print"></i> Print</button>
1344
                </div> <!-- /.modal-footer -->
1345
            </div> <!-- /.modal-content -->
1346
        </div> <!-- /.modal-dialog -->
1347
    </div> <!-- /#bundleMissingModal -->
1348
    [% END %]
1349
1309
[% MACRO jsinclude BLOCK %]
1350
[% MACRO jsinclude BLOCK %]
1310
    [% INCLUDE 'datatables.inc' %]
1351
    [% INCLUDE 'datatables.inc' %]
1311
    [% INCLUDE 'columns_settings.inc' %]
1352
    [% INCLUDE 'columns_settings.inc' %]
1312
- 

Return to bug 28854