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

(-)a/C4/Circulation.pm (-31 / +20 lines)
Lines 320-340 A recall for this item was found, and the item needs to be transferred to the re Link Here
320
320
321
=cut
321
=cut
322
322
323
my $query = CGI->new;
324
325
my $stickyduedate      = $query->param('stickyduedate');
326
my $duedatespec        = $query->param('duedatespec');
327
my $restoreduedatespec = $query->param('restoreduedatespec') || $duedatespec;
328
if ( $restoreduedatespec && $restoreduedatespec eq "highholds_empty" ) {
329
    undef $restoreduedatespec;
330
}
331
my $issueconfirmed = $query->param('issueconfirmed');
332
my $cancelreserve  = $query->param('cancelreserve');
333
my $cancel_recall  = $query->param('cancel_recall');
334
my $recall_id      = $query->param('recall_id');
335
my $debt_confirmed = $query->param('debt_confirmed') || 0;     # Don't show the debt error dialog twice
336
my $charges        = $query->param('charges')        || q{};
337
338
sub transferbook {
323
sub transferbook {
339
    my $params   = shift;
324
    my $params   = shift;
340
    my $tbr      = $params->{to_branch};
325
    my $tbr      = $params->{to_branch};
Lines 808-813 sub CanBookBeIssued { Link Here
808
793
809
    my $onsite_checkout     = $params->{onsite_checkout}     || 0;
794
    my $onsite_checkout     = $params->{onsite_checkout}     || 0;
810
    my $override_high_holds = $params->{override_high_holds} || 0;
795
    my $override_high_holds = $params->{override_high_holds} || 0;
796
    my $issueconfirmed      = $params->{issueconfirmed}      || 0;
811
797
812
    my $item_object = $params->{item};
798
    my $item_object = $params->{item};
813
    if ( !$item_object and $barcode ) {
799
    if ( !$item_object and $barcode ) {
Lines 833-839 sub CanBookBeIssued { Link Here
833
819
834
    my $now = dt_from_string();
820
    my $now = dt_from_string();
835
    my $message;
821
    my $message;
836
    my @message;
822
    my @message_log;
837
823
838
    $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron );
824
    $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron );
839
825
Lines 845-851 sub CanBookBeIssued { Link Here
845
            } else {
831
            } else {
846
                $message = "sticky due date is invalid or due date in the past";
832
                $message = "sticky due date is invalid or due date in the past";
847
            }
833
            }
848
            push( @message, "sticky due date is invalid or due date in the past" );
834
            push( @message_log, "sticky due date is invalid or due date in the past" );
849
        }
835
        }
850
836
851
    }
837
    }
Lines 899-905 sub CanBookBeIssued { Link Here
899
            } else {
885
            } else {
900
                $message = "borrower is restricted";
886
                $message = "borrower is restricted";
901
            }
887
            }
902
            push( @message, "borrower is restricted" );
888
            push( @message_log, "borrower is restricted" );
903
        }
889
        }
904
    }
890
    }
905
891
Lines 979-985 sub CanBookBeIssued { Link Here
979
                } else {
965
                } else {
980
                    $message = "borrower had amend";
966
                    $message = "borrower had amend";
981
                }
967
                }
982
                push( @message, "borrower had amend" );
968
                push( @message_log, "borrower had amend" );
983
            }
969
            }
984
        } elsif ( $patron_borrowing_status->{noissuescharge}->{overlimit} && !$allowfineoverride ) {
970
        } elsif ( $patron_borrowing_status->{noissuescharge}->{overlimit} && !$allowfineoverride ) {
985
            $issuingimpossible{DEBT} = $patron_borrowing_status->{noissuescharge}->{charge};
971
            $issuingimpossible{DEBT} = $patron_borrowing_status->{noissuescharge}->{charge};
Lines 991-997 sub CanBookBeIssued { Link Here
991
                } else {
977
                } else {
992
                    $message = "borrower had amend";
978
                    $message = "borrower had amend";
993
                }
979
                }
994
                push( @message, "borrower had amend" );
980
                push( @message_log, "borrower had amend" );
995
            }
981
            }
996
        }
982
        }
997
    }
983
    }
Lines 1079-1085 sub CanBookBeIssued { Link Here
1079
                    } else {
1065
                    } else {
1080
                        $message = "item is checked out for someone else";
1066
                        $message = "item is checked out for someone else";
1081
                    }
1067
                    }
1082
                    push( @message, "item is checked out for someone else" );
1068
                    push( @message_log, "item is checked out for someone else" );
1083
                }
1069
                }
1084
            }
1070
            }
1085
        }
1071
        }
Lines 1114-1120 sub CanBookBeIssued { Link Here
1114
                } else {
1100
                } else {
1115
                    $message = "too many checkout";
1101
                    $message = "too many checkout";
1116
                }
1102
                }
1117
                push( @message, "too many checkout" );
1103
                push( @message_log, "too many checkout" );
1118
            }
1104
            }
1119
        } else {
1105
        } else {
1120
            $issuingimpossible{TOO_MANY}                  = $toomany->{reason};
1106
            $issuingimpossible{TOO_MANY}                  = $toomany->{reason};
Lines 1149-1155 sub CanBookBeIssued { Link Here
1149
                } else {
1135
                } else {
1150
                    $message = "item not for loan";
1136
                    $message = "item not for loan";
1151
                }
1137
                }
1152
                push( @message, "item not for loan" );
1138
                push( @message_log, "item not for loan" );
1153
            }
1139
            }
1154
        }
1140
        }
1155
    } else {
1141
    } else {
Lines 1202-1208 sub CanBookBeIssued { Link Here
1202
            } else {
1188
            } else {
1203
                $message = "item lost";
1189
                $message = "item lost";
1204
            }
1190
            }
1205
            push( @message, "item lost" );
1191
            push( @message_log, "item lost" );
1206
        }
1192
        }
1207
    }
1193
    }
1208
    if ( C4::Context->preference("IndependentBranches") ) {
1194
    if ( C4::Context->preference("IndependentBranches") ) {
Lines 1312-1318 sub CanBookBeIssued { Link Here
1312
                        } else {
1298
                        } else {
1313
                            $message = "item is on reserve and waiting, but has been reserved by some other patron.";
1299
                            $message = "item is on reserve and waiting, but has been reserved by some other patron.";
1314
                        }
1300
                        }
1315
                        push( @message, "item is on reserve and waiting, but has been reserved by some other patron" );
1301
                        push(
1302
                            @message_log,
1303
                            "item is on reserve and waiting, but has been reserved by some other patron"
1304
                        );
1316
                    }
1305
                    }
1317
                } elsif ( $restype eq "Reserved" ) {
1306
                } elsif ( $restype eq "Reserved" ) {
1318
1307
Lines 1332-1338 sub CanBookBeIssued { Link Here
1332
                        } else {
1321
                        } else {
1333
                            $message = "item is on reserve for someone else";
1322
                            $message = "item is on reserve for someone else";
1334
                        }
1323
                        }
1335
                        push( @message, "item is on reserve for someone else" );
1324
                        push( @message_log, "item is on reserve for someone else" );
1336
                    }
1325
                    }
1337
                } elsif ( $restype eq "Transferred" ) {
1326
                } elsif ( $restype eq "Transferred" ) {
1338
1327
Lines 1352-1358 sub CanBookBeIssued { Link Here
1352
                        } else {
1341
                        } else {
1353
                            $message = "item is determined hold being transferred for someone else";
1342
                            $message = "item is determined hold being transferred for someone else";
1354
                        }
1343
                        }
1355
                        push( @message, "item is determined hold being transferred for someone else" );
1344
                        push( @message_log, "item is determined hold being transferred for someone else" );
1356
                    }
1345
                    }
1357
                } elsif ( $restype eq "Processing" ) {
1346
                } elsif ( $restype eq "Processing" ) {
1358
1347
Lines 1372-1378 sub CanBookBeIssued { Link Here
1372
                        } else {
1361
                        } else {
1373
                            $message = "item is determined hold being processed for someone else";
1362
                            $message = "item is determined hold being processed for someone else";
1374
                        }
1363
                        }
1375
                        push( @message, "item is determined hold being processed for someone else" );
1364
                        push( @message_log, "item is determined hold being processed for someone else" );
1376
                    }
1365
                    }
1377
                }
1366
                }
1378
            }
1367
            }
Lines 1422-1428 sub CanBookBeIssued { Link Here
1422
            } else {
1411
            } else {
1423
                $message = "age restriction";
1412
                $message = "age restriction";
1424
            }
1413
            }
1425
            push( @message, "age restriction" );
1414
            push( @message_log, "age restriction" );
1426
        } else {
1415
        } else {
1427
            $issuingimpossible{AGE_RESTRICTION} = "$agerestriction";
1416
            $issuingimpossible{AGE_RESTRICTION} = "$agerestriction";
1428
        }
1417
        }
Lines 1492-1498 sub CanBookBeIssued { Link Here
1492
1481
1493
        my $infos = (
1482
        my $infos = (
1494
            {
1483
            {
1495
                message        => \@message,
1484
                message        => \@message_log,
1496
                borrowernumber => $borrower->borrowernumber,
1485
                borrowernumber => $borrower->borrowernumber,
1497
                barcode        => $barcode,
1486
                barcode        => $barcode,
1498
                manager_id     => $user,
1487
                manager_id     => $user,
Lines 1510-1516 sub CanBookBeIssued { Link Here
1510
        ) if C4::Context->preference("IssueLog");
1499
        ) if C4::Context->preference("IssueLog");
1511
    }
1500
    }
1512
1501
1513
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, );
1502
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, \@message_log );
1514
}
1503
}
1515
1504
1516
=head2 CanBookBeReturned
1505
=head2 CanBookBeReturned
(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 349-354 if ( @$barcodes && $op eq 'cud-checkout' ) { Link Here
349
                {
349
                {
350
                    onsite_checkout     => $onsite_checkout,
350
                    onsite_checkout     => $onsite_checkout,
351
                    override_high_holds => $override_high_holds || $override_high_holds_tmp || 0,
351
                    override_high_holds => $override_high_holds || $override_high_holds_tmp || 0,
352
                    issueconfirmed      => $issueconfirmed,
352
                }
353
                }
353
            );
354
            );
354
        } catch {
355
        } catch {
355
- 

Return to bug 9762