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

(-)a/circ/returns.pl (-28 / +33 lines)
Lines 444-477 if ($barcode) { Link Here
444
        }
444
        }
445
        for my $missing_item ( keys %{$expected_items} ) {
445
        for my $missing_item ( keys %{$expected_items} ) {
446
            my $bundle_item = $expected_items->{$missing_item};
446
            my $bundle_item = $expected_items->{$missing_item};
447
            $bundle_item->itemlost($BundleLostValue)->store();
447
            # Mark as lost if it's not already lost
448
            # Add return_claim record if this is an actual checkin
448
            if ( !$bundle_item->itemlost ) {
449
            if ($issue) {
449
                $bundle_item->itemlost($BundleLostValue)->store();
450
                $bundle_item->_result->create_related(
450
451
                    'return_claims',
451
                # Add return_claim record if this is an actual checkin
452
                    {
452
                if ($issue) {
453
                        issue_id       => $issue->issue_id,
453
                    $bundle_item->_result->create_related(
454
                        itemnumber     => $bundle_item->itemnumber,
454
                        'return_claims',
455
                        borrowernumber => $issue->borrowernumber,
455
                        {
456
                        created_by     => C4::Context->userenv()->{number},
456
                            issue_id       => $issue->issue_id,
457
                        created_on     => dt_from_string
457
                            itemnumber     => $bundle_item->itemnumber,
458
                    }
458
                            borrowernumber => $issue->borrowernumber,
459
                );
459
                            created_by     => C4::Context->userenv()->{number},
460
            }
460
                            created_on     => dt_from_string
461
            push @missing_items, $bundle_item;
461
                        }
462
            # NOTE: We cannot use C4::LostItem here because the item itself doesn't have a checkout
462
                    );
463
            # and thus would not get charged.. it's checked out as part of the bundle.
463
                }
464
            if ( C4::Context->preference('WhenLostChargeReplacementFee') && $issue ) {
464
                push @missing_items, $bundle_item;
465
                C4::Accounts::chargelostitem(
465
466
                    $issue->borrowernumber,
466
                # NOTE: We cannot use C4::LostItem here because the item itself doesn't have a checkout
467
                    $bundle_item->itemnumber,
467
                # and thus would not get charged.. it's checked out as part of the bundle.
468
                    $bundle_item->replacementprice,
468
                if ( C4::Context->preference('WhenLostChargeReplacementFee') && $issue ) {
469
                    sprintf( "%s %s %s",
469
                    C4::Accounts::chargelostitem(
470
                        $bundle_item->biblio->title  || q{},
470
                        $issue->borrowernumber,
471
                        $bundle_item->barcode        || q{},
471
                        $bundle_item->itemnumber,
472
                        $bundle_item->itemcallnumber || q{},
472
                        $bundle_item->replacementprice,
473
                    ),
473
                        sprintf( "%s %s %s",
474
                );
474
                            $bundle_item->biblio->title  || q{},
475
                            $bundle_item->barcode        || q{},
476
                            $bundle_item->itemcallnumber || q{},
477
                        ),
478
                    );
479
                }
475
            }
480
            }
476
        }
481
        }
477
        $template->param(
482
        $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