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

(-)a/circ/returns.pl (-28 / +33 lines)
Lines 404-437 if ($barcode) { Link Here
404
        }
404
        }
405
        for my $missing_item ( keys %{$expected_items} ) {
405
        for my $missing_item ( keys %{$expected_items} ) {
406
            my $bundle_item = $expected_items->{$missing_item};
406
            my $bundle_item = $expected_items->{$missing_item};
407
            $bundle_item->itemlost($BundleLostValue)->store();
407
            # Mark as lost if it's not already lost
408
            # Add return_claim record if this is an actual checkin
408
            if ( !$bundle_item->itemlost ) {
409
            if ($issue) {
409
                $bundle_item->itemlost($BundleLostValue)->store();
410
                $bundle_item->_result->create_related(
410
411
                    'return_claims',
411
                # Add return_claim record if this is an actual checkin
412
                    {
412
                if ($issue) {
413
                        issue_id       => $issue->issue_id,
413
                    $bundle_item->_result->create_related(
414
                        itemnumber     => $bundle_item->itemnumber,
414
                        'return_claims',
415
                        borrowernumber => $issue->borrowernumber,
415
                        {
416
                        created_by     => C4::Context->userenv()->{number},
416
                            issue_id       => $issue->issue_id,
417
                        created_on     => dt_from_string
417
                            itemnumber     => $bundle_item->itemnumber,
418
                    }
418
                            borrowernumber => $issue->borrowernumber,
419
                );
419
                            created_by     => C4::Context->userenv()->{number},
420
            }
420
                            created_on     => dt_from_string
421
            push @missing_items, $bundle_item;
421
                        }
422
            # NOTE: We cannot use C4::LostItem here because the item itself doesn't have a checkout
422
                    );
423
            # and thus would not get charged.. it's checked out as part of the bundle.
423
                }
424
            if ( C4::Context->preference('WhenLostChargeReplacementFee') && $issue ) {
424
                push @missing_items, $bundle_item;
425
                C4::Accounts::chargelostitem(
425
426
                    $issue->borrowernumber,
426
                # NOTE: We cannot use C4::LostItem here because the item itself doesn't have a checkout
427
                    $bundle_item->itemnumber,
427
                # and thus would not get charged.. it's checked out as part of the bundle.
428
                    $bundle_item->replacementprice,
428
                if ( C4::Context->preference('WhenLostChargeReplacementFee') && $issue ) {
429
                    sprintf( "%s %s %s",
429
                    C4::Accounts::chargelostitem(
430
                        $bundle_item->biblio->title  || q{},
430
                        $issue->borrowernumber,
431
                        $bundle_item->barcode        || q{},
431
                        $bundle_item->itemnumber,
432
                        $bundle_item->itemcallnumber || q{},
432
                        $bundle_item->replacementprice,
433
                    ),
433
                        sprintf( "%s %s %s",
434
                );
434
                            $bundle_item->biblio->title  || q{},
435
                            $bundle_item->barcode        || q{},
436
                            $bundle_item->itemcallnumber || q{},
437
                        ),
438
                    );
439
                }
435
            }
440
            }
436
        }
441
        }
437
        $template->param(
442
        $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 1113-1118 Link Here
1113
1116
1114
    [% INCLUDE 'modals/bundle_contents.inc' %]
1117
    [% INCLUDE 'modals/bundle_contents.inc' %]
1115
1118
1119
    [% IF ( missing_items ) %]
1120
    <!-- Bundle missing modal -->
1121
    <div class="modal printable" id="bundleMissingModal" tabindex="-1" role="dialog" aria-labelledby="bundleMissingLabel">
1122
        <div class="modal-dialog" role="document">
1123
            <div class="modal-content">
1124
                <div class="modal-header">
1125
                    <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
1126
                    <h4 class="modal-title" id="bundleMissingLabel">Items missing from bundle at checking for [% item.barcode | html %]</h4>
1127
                </div>
1128
                <div class="modal-body">
1129
                    <table style="width:100%">
1130
                        <thead>
1131
                            <tr>
1132
                                <th>Barcode</th>
1133
                                <th>Title</th>
1134
                            </tr>
1135
                        </thead>
1136
                        <tbody>
1137
                        [% FOREACH bundle_item IN missing_items %]
1138
                            <tr>
1139
                                <td>[% bundle_item.barcode | html %]</td>
1140
                                <td>[% INCLUDE 'biblio-title.inc' biblio=bundle_item.biblio %]</td>
1141
                            </tr>
1142
                        [% END %]
1143
                        </tbody>
1144
                        <tfoot>
1145
                        </tfoot>
1146
                    </table>
1147
                </div> <!-- /.modal-body -->
1148
                <div class="modal-footer">
1149
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1150
                    <button type="button" class="printModal btn btn-primary"><i class="fa fa-print"></i> Print</button>
1151
                </div> <!-- /.modal-footer -->
1152
            </div> <!-- /.modal-content -->
1153
        </div> <!-- /.modal-dialog -->
1154
    </div> <!-- /#bundleMissingModal -->
1155
    [% END %]
1156
1116
[% MACRO jsinclude BLOCK %]
1157
[% MACRO jsinclude BLOCK %]
1117
    [% INCLUDE 'datatables.inc' %]
1158
    [% INCLUDE 'datatables.inc' %]
1118
    [% INCLUDE 'columns_settings.inc' %]
1159
    [% INCLUDE 'columns_settings.inc' %]
1119
- 

Return to bug 28854