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

(-)a/C4/Circulation.pm (-31 / +20 lines)
Lines 319-339 A recall for this item was found, and the item needs to be transferred to the re Link Here
319
319
320
=cut
320
=cut
321
321
322
my $query = CGI->new;
323
324
my $stickyduedate      = $query->param('stickyduedate');
325
my $duedatespec        = $query->param('duedatespec');
326
my $restoreduedatespec = $query->param('restoreduedatespec') || $duedatespec;
327
if ( $restoreduedatespec && $restoreduedatespec eq "highholds_empty" ) {
328
    undef $restoreduedatespec;
329
}
330
my $issueconfirmed = $query->param('issueconfirmed');
331
my $cancelreserve  = $query->param('cancelreserve');
332
my $cancel_recall  = $query->param('cancel_recall');
333
my $recall_id      = $query->param('recall_id');
334
my $debt_confirmed = $query->param('debt_confirmed') || 0;     # Don't show the debt error dialog twice
335
my $charges        = $query->param('charges')        || q{};
336
337
sub transferbook {
322
sub transferbook {
338
    my $params = shift;
323
    my $params = shift;
339
    my $tbr      = $params->{to_branch};
324
    my $tbr      = $params->{to_branch};
Lines 796-801 sub CanBookBeIssued { Link Here
796
781
797
    my $onsite_checkout     = $params->{onsite_checkout}     || 0;
782
    my $onsite_checkout     = $params->{onsite_checkout}     || 0;
798
    my $override_high_holds = $params->{override_high_holds} || 0;
783
    my $override_high_holds = $params->{override_high_holds} || 0;
784
    my $issueconfirmed      = $params->{issueconfirmed}      || 0;
799
785
800
    my $item_object = $params->{item}
786
    my $item_object = $params->{item}
801
      // Koha::Items->find( { barcode => $barcode } );
787
      // Koha::Items->find( { barcode => $barcode } );
Lines 819-825 sub CanBookBeIssued { Link Here
819
805
820
    my $now = dt_from_string();
806
    my $now = dt_from_string();
821
    my $message;
807
    my $message;
822
    my @message;
808
    my @message_log;
823
809
824
    $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron );
810
    $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron );
825
811
Lines 831-837 sub CanBookBeIssued { Link Here
831
            } else {
817
            } else {
832
                $message = "sticky due date is invalid or due date in the past";
818
                $message = "sticky due date is invalid or due date in the past";
833
            }
819
            }
834
            push( @message, "sticky due date is invalid or due date in the past" );
820
            push( @message_log, "sticky due date is invalid or due date in the past" );
835
        }
821
        }
836
822
837
    }
823
    }
Lines 884-890 sub CanBookBeIssued { Link Here
884
            } else {
870
            } else {
885
                $message = "borrower is restricted";
871
                $message = "borrower is restricted";
886
            }
872
            }
887
            push( @message, "borrower is restricted" );
873
            push( @message_log, "borrower is restricted" );
888
        }
874
        }
889
    }
875
    }
890
876
Lines 964-970 sub CanBookBeIssued { Link Here
964
                } else {
950
                } else {
965
                    $message = "borrower had amend";
951
                    $message = "borrower had amend";
966
                }
952
                }
967
                push( @message, "borrower had amend" );
953
                push( @message_log, "borrower had amend" );
968
            }
954
            }
969
        } elsif ( $patron_borrowing_status->{noissuescharge}->{overlimit} && !$allowfineoverride ) {
955
        } elsif ( $patron_borrowing_status->{noissuescharge}->{overlimit} && !$allowfineoverride ) {
970
            $issuingimpossible{DEBT} = $patron_borrowing_status->{noissuescharge}->{charge};
956
            $issuingimpossible{DEBT} = $patron_borrowing_status->{noissuescharge}->{charge};
Lines 976-982 sub CanBookBeIssued { Link Here
976
                } else {
962
                } else {
977
                    $message = "borrower had amend";
963
                    $message = "borrower had amend";
978
                }
964
                }
979
                push( @message, "borrower had amend" );
965
                push( @message_log, "borrower had amend" );
980
            }
966
            }
981
        }
967
        }
982
    }
968
    }
Lines 1067-1073 sub CanBookBeIssued { Link Here
1067
                    } else {
1053
                    } else {
1068
                        $message = "item is checked out for someone else";
1054
                        $message = "item is checked out for someone else";
1069
                    }
1055
                    }
1070
                    push( @message, "item is checked out for someone else" );
1056
                    push( @message_log, "item is checked out for someone else" );
1071
                }
1057
                }
1072
            }
1058
            }
1073
        }
1059
        }
Lines 1098-1104 sub CanBookBeIssued { Link Here
1098
                } else {
1084
                } else {
1099
                    $message = "too many checkout";
1085
                    $message = "too many checkout";
1100
                }
1086
                }
1101
                push( @message, "too many checkout" );
1087
                push( @message_log, "too many checkout" );
1102
            }
1088
            }
1103
        } else {
1089
        } else {
1104
            $issuingimpossible{TOO_MANY}                  = $toomany->{reason};
1090
            $issuingimpossible{TOO_MANY}                  = $toomany->{reason};
Lines 1133-1139 sub CanBookBeIssued { Link Here
1133
                } else {
1119
                } else {
1134
                    $message = "item not for loan";
1120
                    $message = "item not for loan";
1135
                }
1121
                }
1136
                push( @message, "item not for loan" );
1122
                push( @message_log, "item not for loan" );
1137
            }
1123
            }
1138
        }
1124
        }
1139
    }
1125
    }
Lines 1187-1193 sub CanBookBeIssued { Link Here
1187
            } else {
1173
            } else {
1188
                $message = "item lost";
1174
                $message = "item lost";
1189
            }
1175
            }
1190
            push( @message, "item lost" );
1176
            push( @message_log, "item lost" );
1191
        }
1177
        }
1192
    }
1178
    }
1193
    if ( C4::Context->preference("IndependentBranches") ) {
1179
    if ( C4::Context->preference("IndependentBranches") ) {
Lines 1292-1298 sub CanBookBeIssued { Link Here
1292
                        } else {
1278
                        } else {
1293
                            $message = "item is on reserve and waiting, but has been reserved by some other patron.";
1279
                            $message = "item is on reserve and waiting, but has been reserved by some other patron.";
1294
                        }
1280
                        }
1295
                        push( @message, "item is on reserve and waiting, but has been reserved by some other patron" );
1281
                        push(
1282
                            @message_log,
1283
                            "item is on reserve and waiting, but has been reserved by some other patron"
1284
                        );
1296
                    }
1285
                    }
1297
                }
1286
                }
1298
                elsif ( $restype eq "Reserved" ) {
1287
                elsif ( $restype eq "Reserved" ) {
Lines 1311-1317 sub CanBookBeIssued { Link Here
1311
                        } else {
1300
                        } else {
1312
                            $message = "item is on reserve for someone else";
1301
                            $message = "item is on reserve for someone else";
1313
                        }
1302
                        }
1314
                        push( @message, "item is on reserve for someone else" );
1303
                        push( @message_log, "item is on reserve for someone else" );
1315
                    }
1304
                    }
1316
                }
1305
                }
1317
                elsif ( $restype eq "Transferred" ) {
1306
                elsif ( $restype eq "Transferred" ) {
Lines 1330-1336 sub CanBookBeIssued { Link Here
1330
                        } else {
1319
                        } else {
1331
                            $message = "item is determined hold being transferred for someone else";
1320
                            $message = "item is determined hold being transferred for someone else";
1332
                        }
1321
                        }
1333
                        push( @message, "item is determined hold being transferred for someone else" );
1322
                        push( @message_log, "item is determined hold being transferred for someone else" );
1334
                    }
1323
                    }
1335
                }
1324
                }
1336
                elsif ( $restype eq "Processing" ) {
1325
                elsif ( $restype eq "Processing" ) {
Lines 1349-1355 sub CanBookBeIssued { Link Here
1349
                        } else {
1338
                        } else {
1350
                            $message = "item is determined hold being processed for someone else";
1339
                            $message = "item is determined hold being processed for someone else";
1351
                        }
1340
                        }
1352
                        push( @message, "item is determined hold being processed for someone else" );
1341
                        push( @message_log, "item is determined hold being processed for someone else" );
1353
                    }
1342
                    }
1354
                }
1343
                }
1355
            }
1344
            }
Lines 1399-1405 sub CanBookBeIssued { Link Here
1399
            } else {
1388
            } else {
1400
                $message = "age restriction";
1389
                $message = "age restriction";
1401
            }
1390
            }
1402
            push( @message, "age restriction" );
1391
            push( @message_log, "age restriction" );
1403
        }
1392
        }
1404
        else {
1393
        else {
1405
            $issuingimpossible{AGE_RESTRICTION} = "$agerestriction";
1394
            $issuingimpossible{AGE_RESTRICTION} = "$agerestriction";
Lines 1467-1473 sub CanBookBeIssued { Link Here
1467
1456
1468
        my $infos = (
1457
        my $infos = (
1469
            {
1458
            {
1470
                message        => \@message,
1459
                message        => \@message_log,
1471
                borrowernumber => $borrower->borrowernumber,
1460
                borrowernumber => $borrower->borrowernumber,
1472
                barcode        => $barcode,
1461
                barcode        => $barcode,
1473
                manager_id     => $user,
1462
                manager_id     => $user,
Lines 1486-1492 sub CanBookBeIssued { Link Here
1486
    }
1475
    }
1487
1476
1488
1477
1489
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, );
1478
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, \@message_log );
1490
}
1479
}
1491
1480
1492
=head2 CanBookBeReturned
1481
=head2 CanBookBeReturned
(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 343-348 if (@$barcodes && $op eq 'cud-checkout') { Link Here
343
                {
343
                {
344
                    onsite_checkout     => $onsite_checkout,
344
                    onsite_checkout     => $onsite_checkout,
345
                    override_high_holds => $override_high_holds || $override_high_holds_tmp || 0,
345
                    override_high_holds => $override_high_holds || $override_high_holds_tmp || 0,
346
                    issueconfirmed      => $issueconfirmed,
346
                }
347
                }
347
            );
348
            );
348
        } catch {
349
        } catch {
349
- 

Return to bug 9762