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

(-)a/circ/branchtransfers.pl (+2 lines)
Lines 80-85 my $setwaiting; Link Here
80
80
81
my $request        = $query->param('request')        || '';
81
my $request        = $query->param('request')        || '';
82
my $borrowernumber = $query->param('borrowernumber') ||  0;
82
my $borrowernumber = $query->param('borrowernumber') ||  0;
83
my $frombranchcd   = $query->param('frombranchcd')   || C4::Context->userenv->{'branch'};
83
my $tobranchcd     = $query->param('tobranchcd')     || '';
84
my $tobranchcd     = $query->param('tobranchcd')     || '';
84
85
85
my $ignoreRs = 0;
86
my $ignoreRs = 0;
Lines 223-228 $template->param( Link Here
223
    itemnumber              => $itemnumber,
224
    itemnumber              => $itemnumber,
224
    barcode                 => $barcode,
225
    barcode                 => $barcode,
225
    biblionumber            => $biblionumber,
226
    biblionumber            => $biblionumber,
227
    frombranchcd            => $frombranchcd,
226
    tobranchcd              => $tobranchcd,
228
    tobranchcd              => $tobranchcd,
227
    reqmessage              => $reqmessage,
229
    reqmessage              => $reqmessage,
228
    cancelled               => $cancelled,
230
    cancelled               => $cancelled,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt (+11 lines)
Lines 72-77 Link Here
72
                            <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
72
                            <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
73
                            <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
73
                            <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
74
                            <input type="hidden" name="tobranchcd" value="[% tobranchcd | html %]" />
74
                            <input type="hidden" name="tobranchcd" value="[% tobranchcd | html %]" />
75
                            <input type="hidden" name="frombranchcd" value="[% tobranchcd | html %]" />
75
                            <input type="hidden" name="barcode" value="[% barcode | html %]" />
76
                            <input type="hidden" name="barcode" value="[% barcode | html %]" />
76
                            <input type="hidden" name="request" value="KillReserved" />
77
                            <input type="hidden" name="request" value="KillReserved" />
77
                            <input type="submit" value="Cancel" />
78
                            <input type="submit" value="Cancel" />
Lines 128-133 Link Here
128
                                          [% ELSE %]
129
                                          [% ELSE %]
129
                                              <li>Collection: <b>[% AuthorisedValues.GetByCode( 'CCODE', errmsgloo.code ) | html %]</b></li>
130
                                              <li>Collection: <b>[% AuthorisedValues.GetByCode( 'CCODE', errmsgloo.code ) | html %]</b></li>
130
                                          [% END %]
131
                                          [% END %]
132
                                          <li>Originating library: <b>[% Branches.GetName( errmsgloo.fbr ) | html %]</b></li>
131
                                          <li>Destination library: <b>[% Branches.GetName( errmsgloo.tbr ) | html %]</b></li>
133
                                          <li>Destination library: <b>[% Branches.GetName( errmsgloo.tbr ) | html %]</b></li>
132
                                      </ol>
134
                                      </ol>
133
                                  </li>
135
                                  </li>
Lines 151-156 Link Here
151
            <legend>Transfer</legend>
153
            <legend>Transfer</legend>
152
            <ol>
154
            <ol>
153
			<li>
155
			<li>
156
                <label for="frombranchcd">Originating library: </label>
157
                    <select name="frombranchcd" id="frombranchcd">
158
                        <option value="current_holding">Item's holding branch</option>
159
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => '', unfiltered => 1) %]
160
                    </select>
161
            </li>
162
            <li>
154
                <label for="tobranchcd">Destination library: </label>
163
                <label for="tobranchcd">Destination library: </label>
155
                    <select name="tobranchcd" id="tobranchcd">
164
                    <select name="tobranchcd" id="tobranchcd">
156
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => tobranchcd, unfiltered => 1) %]
165
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => tobranchcd, unfiltered => 1) %]
Lines 182-187 Link Here
182
                <th class="tf-itemcallnumber">Call number</th>
191
                <th class="tf-itemcallnumber">Call number</th>
183
                <th class="tf-itemtype">Item type</th>
192
                <th class="tf-itemtype">Item type</th>
184
                <th class="tf-ccode">Collection</th>
193
                <th class="tf-ccode">Collection</th>
194
                <th class="tf-origin">Origin</th>
185
                <th class="tf-destination">Destination</th>
195
                <th class="tf-destination">Destination</th>
186
            </tr>
196
            </tr>
187
            [% FOREACH trsfitemloo IN trsfitemloop %]
197
            [% FOREACH trsfitemloo IN trsfitemloop %]
Lines 197-202 Link Here
197
                    <td class="tf-itemcallnumber">[% trsfitemloo.item.itemcallnumber | html %]</td>
207
                    <td class="tf-itemcallnumber">[% trsfitemloo.item.itemcallnumber | html %]</td>
198
                    <td class="tf-itemtype">[% ItemTypes.GetDescription( trsfitemloo.item.effective_itemtype ) | html %]</td>
208
                    <td class="tf-itemtype">[% ItemTypes.GetDescription( trsfitemloo.item.effective_itemtype ) | html %]</td>
199
                    <td class="tf-ccode">[% AuthorisedValues.GetByCode( 'CCODE', trsfitemloo.item.ccode ) | html %]</td>
209
                    <td class="tf-ccode">[% AuthorisedValues.GetByCode( 'CCODE', trsfitemloo.item.ccode ) | html %]</td>
210
                    <td class="tf-origin">[% Branches.GetName( trsfitemloo.frombrcd ) | html %]</td>
200
                    <td class="tf-destination">[% Branches.GetName( trsfitemloo.tobrcd ) | html %]</td>
211
                    <td class="tf-destination">[% Branches.GetName( trsfitemloo.tobrcd ) | html %]</td>
201
                </tr>
212
                </tr>
202
            [% END %]
213
            [% END %]
(-)a/t/db_dependent/Circulation.t (-2 / +27 lines)
Lines 18-24 Link Here
18
use Modern::Perl;
18
use Modern::Perl;
19
use utf8;
19
use utf8;
20
20
21
use Test::More tests => 49;
21
use Test::More tests => 50;
22
use Test::MockModule;
22
use Test::MockModule;
23
use Test::Deep qw( cmp_deeply );
23
use Test::Deep qw( cmp_deeply );
24
24
Lines 3293-3298 subtest 'Cancel transfers on lost items' => sub { Link Here
3293
    is( $tobranch, undef, 'The transfer on the lost item has been deleted as the LostItemCancelOutstandingTransfer is enabled');
3293
    is( $tobranch, undef, 'The transfer on the lost item has been deleted as the LostItemCancelOutstandingTransfer is enabled');
3294
    $itemcheck = Koha::Items->find($item->itemnumber);
3294
    $itemcheck = Koha::Items->find($item->itemnumber);
3295
    is( $itemcheck->holdingbranch, $library_1->{branchcode}, 'Lost item with cancelled hold has holding branch equallying the transfers source branch' );
3295
    is( $itemcheck->holdingbranch, $library_1->{branchcode}, 'Lost item with cancelled hold has holding branch equallying the transfers source branch' );
3296
3297
};
3298
3299
subtest 'transferbook test' => sub {
3300
    plan tests => 5;
3301
3302
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
3303
    my $item = $builder->build_sample_item();
3304
    ok( $item->holdingbranch ne $library->branchcode && $item->homebranch ne $library->branchcode, "Item is not held or owned by library");
3305
    C4::Circulation::transferbook({
3306
        from_branch => $library->branchcode,
3307
        to_branch => $item->homebranch,
3308
        barcode   => $item->barcode,
3309
    });
3310
    my ($datesent,$from_branch,$to_branch) = GetTransfers($item->itemnumber);
3311
    is( $from_branch, $library->branchcode, 'The transfer is initiated from the specified branch, not the items home or holdingbranch');
3312
    is( $to_branch, $item->homebranch, 'The transfer is initiated to the specified branch');
3313
    C4::Circulation::transferbook({
3314
        from_branch => $item->homebranch,
3315
        to_branch => $library->branchcode,
3316
        barcode   => $item->barcode,
3317
    });
3318
    ($datesent,$from_branch,$to_branch) = GetTransfers($item->itemnumber);
3319
    is( $from_branch, $item->homebranch, 'The transfer is initiated from the specified branch');
3320
    is( $to_branch, $library->branchcode, 'The transfer is initiated to the specified branch');
3321
3296
};
3322
};
3297
3323
3298
subtest 'CanBookBeIssued | is_overdue' => sub {
3324
subtest 'CanBookBeIssued | is_overdue' => sub {
3299
- 

Return to bug 23695