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

(-)a/C4/Circulation.pm (-31 / +20 lines)
Lines 318-338 A recall for this item was found, and the item needs to be transferred to the re Link Here
318
318
319
=cut
319
=cut
320
320
321
my $query = CGI->new;
322
323
my $stickyduedate      = $query->param('stickyduedate');
324
my $duedatespec        = $query->param('duedatespec');
325
my $restoreduedatespec = $query->param('restoreduedatespec') || $duedatespec;
326
if ( $restoreduedatespec && $restoreduedatespec eq "highholds_empty" ) {
327
    undef $restoreduedatespec;
328
}
329
my $issueconfirmed = $query->param('issueconfirmed');
330
my $cancelreserve  = $query->param('cancelreserve');
331
my $cancel_recall  = $query->param('cancel_recall');
332
my $recall_id      = $query->param('recall_id');
333
my $debt_confirmed = $query->param('debt_confirmed') || 0;     # Don't show the debt error dialog twice
334
my $charges        = $query->param('charges')        || q{};
335
336
sub transferbook {
321
sub transferbook {
337
    my $params = shift;
322
    my $params = shift;
338
    my $tbr      = $params->{to_branch};
323
    my $tbr      = $params->{to_branch};
Lines 795-800 sub CanBookBeIssued { Link Here
795
780
796
    my $onsite_checkout     = $params->{onsite_checkout}     || 0;
781
    my $onsite_checkout     = $params->{onsite_checkout}     || 0;
797
    my $override_high_holds = $params->{override_high_holds} || 0;
782
    my $override_high_holds = $params->{override_high_holds} || 0;
783
    my $issueconfirmed      = $params->{issueconfirmed}      || 0;
798
784
799
    my $item_object = $params->{item}
785
    my $item_object = $params->{item}
800
      // Koha::Items->find( { barcode => $barcode } );
786
      // Koha::Items->find( { barcode => $barcode } );
Lines 818-824 sub CanBookBeIssued { Link Here
818
804
819
    my $now = dt_from_string();
805
    my $now = dt_from_string();
820
    my $message;
806
    my $message;
821
    my @message;
807
    my @message_log;
822
808
823
    $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron );
809
    $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron );
824
810
Lines 830-836 sub CanBookBeIssued { Link Here
830
            } else {
816
            } else {
831
                $message = "sticky due date is invalid or due date in the past";
817
                $message = "sticky due date is invalid or due date in the past";
832
            }
818
            }
833
            push( @message, "sticky due date is invalid or due date in the past" );
819
            push( @message_log, "sticky due date is invalid or due date in the past" );
834
        }
820
        }
835
821
836
    }
822
    }
Lines 883-889 sub CanBookBeIssued { Link Here
883
            } else {
869
            } else {
884
                $message = "borrower is restricted";
870
                $message = "borrower is restricted";
885
            }
871
            }
886
            push( @message, "borrower is restricted" );
872
            push( @message_log, "borrower is restricted" );
887
        }
873
        }
888
    }
874
    }
889
875
Lines 957-963 sub CanBookBeIssued { Link Here
957
                } else {
943
                } else {
958
                    $message = "borrower had amend";
944
                    $message = "borrower had amend";
959
                }
945
                }
960
                push( @message, "borrower had amend" );
946
                push( @message_log, "borrower had amend" );
961
            }
947
            }
962
        } elsif ( $non_issues_charges > $amountlimit && !$allowfineoverride) {
948
        } elsif ( $non_issues_charges > $amountlimit && !$allowfineoverride) {
963
            $issuingimpossible{DEBT} = $non_issues_charges;
949
            $issuingimpossible{DEBT} = $non_issues_charges;
Lines 969-975 sub CanBookBeIssued { Link Here
969
                } else {
955
                } else {
970
                    $message = "borrower had amend";
956
                    $message = "borrower had amend";
971
                }
957
                }
972
                push( @message, "borrower had amend" );
958
                push( @message_log, "borrower had amend" );
973
            }
959
            }
974
        }
960
        }
975
    }
961
    }
Lines 1059-1065 sub CanBookBeIssued { Link Here
1059
                    } else {
1045
                    } else {
1060
                        $message = "item is checked out for someone else";
1046
                        $message = "item is checked out for someone else";
1061
                    }
1047
                    }
1062
                    push( @message, "item is checked out for someone else" );
1048
                    push( @message_log, "item is checked out for someone else" );
1063
                }
1049
                }
1064
            }
1050
            }
1065
        }
1051
        }
Lines 1090-1096 sub CanBookBeIssued { Link Here
1090
                } else {
1076
                } else {
1091
                    $message = "too many checkout";
1077
                    $message = "too many checkout";
1092
                }
1078
                }
1093
                push( @message, "too many checkout" );
1079
                push( @message_log, "too many checkout" );
1094
            }
1080
            }
1095
        } else {
1081
        } else {
1096
            $issuingimpossible{TOO_MANY}                  = $toomany->{reason};
1082
            $issuingimpossible{TOO_MANY}                  = $toomany->{reason};
Lines 1125-1131 sub CanBookBeIssued { Link Here
1125
                } else {
1111
                } else {
1126
                    $message = "item not for loan";
1112
                    $message = "item not for loan";
1127
                }
1113
                }
1128
                push( @message, "item not for loan" );
1114
                push( @message_log, "item not for loan" );
1129
            }
1115
            }
1130
        }
1116
        }
1131
    }
1117
    }
Lines 1179-1185 sub CanBookBeIssued { Link Here
1179
            } else {
1165
            } else {
1180
                $message = "item lost";
1166
                $message = "item lost";
1181
            }
1167
            }
1182
            push( @message, "item lost" );
1168
            push( @message_log, "item lost" );
1183
        }
1169
        }
1184
    }
1170
    }
1185
    if ( C4::Context->preference("IndependentBranches") ) {
1171
    if ( C4::Context->preference("IndependentBranches") ) {
Lines 1284-1290 sub CanBookBeIssued { Link Here
1284
                        } else {
1270
                        } else {
1285
                            $message = "item is on reserve and waiting, but has been reserved by some other patron.";
1271
                            $message = "item is on reserve and waiting, but has been reserved by some other patron.";
1286
                        }
1272
                        }
1287
                        push( @message, "item is on reserve and waiting, but has been reserved by some other patron" );
1273
                        push(
1274
                            @message_log,
1275
                            "item is on reserve and waiting, but has been reserved by some other patron"
1276
                        );
1288
                    }
1277
                    }
1289
                }
1278
                }
1290
                elsif ( $restype eq "Reserved" ) {
1279
                elsif ( $restype eq "Reserved" ) {
Lines 1303-1309 sub CanBookBeIssued { Link Here
1303
                        } else {
1292
                        } else {
1304
                            $message = "item is on reserve for someone else";
1293
                            $message = "item is on reserve for someone else";
1305
                        }
1294
                        }
1306
                        push( @message, "item is on reserve for someone else" );
1295
                        push( @message_log, "item is on reserve for someone else" );
1307
                    }
1296
                    }
1308
                }
1297
                }
1309
                elsif ( $restype eq "Transferred" ) {
1298
                elsif ( $restype eq "Transferred" ) {
Lines 1322-1328 sub CanBookBeIssued { Link Here
1322
                        } else {
1311
                        } else {
1323
                            $message = "item is determined hold being transferred for someone else";
1312
                            $message = "item is determined hold being transferred for someone else";
1324
                        }
1313
                        }
1325
                        push( @message, "item is determined hold being transferred for someone else" );
1314
                        push( @message_log, "item is determined hold being transferred for someone else" );
1326
                    }
1315
                    }
1327
                }
1316
                }
1328
                elsif ( $restype eq "Processing" ) {
1317
                elsif ( $restype eq "Processing" ) {
Lines 1341-1347 sub CanBookBeIssued { Link Here
1341
                        } else {
1330
                        } else {
1342
                            $message = "item is determined hold being processed for someone else";
1331
                            $message = "item is determined hold being processed for someone else";
1343
                        }
1332
                        }
1344
                        push( @message, "item is determined hold being processed for someone else" );
1333
                        push( @message_log, "item is determined hold being processed for someone else" );
1345
                    }
1334
                    }
1346
                }
1335
                }
1347
            }
1336
            }
Lines 1391-1397 sub CanBookBeIssued { Link Here
1391
            } else {
1380
            } else {
1392
                $message = "age restriction";
1381
                $message = "age restriction";
1393
            }
1382
            }
1394
            push( @message, "age restriction" );
1383
            push( @message_log, "age restriction" );
1395
        }
1384
        }
1396
        else {
1385
        else {
1397
            $issuingimpossible{AGE_RESTRICTION} = "$agerestriction";
1386
            $issuingimpossible{AGE_RESTRICTION} = "$agerestriction";
Lines 1459-1465 sub CanBookBeIssued { Link Here
1459
1448
1460
        my $infos = (
1449
        my $infos = (
1461
            {
1450
            {
1462
                message        => \@message,
1451
                message        => \@message_log,
1463
                borrowernumber => $borrower->borrowernumber,
1452
                borrowernumber => $borrower->borrowernumber,
1464
                barcode        => $barcode,
1453
                barcode        => $barcode,
1465
                manager_id     => $user,
1454
                manager_id     => $user,
Lines 1478-1484 sub CanBookBeIssued { Link Here
1478
    }
1467
    }
1479
1468
1480
1469
1481
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, );
1470
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, \@message_log );
1482
}
1471
}
1483
1472
1484
=head2 CanBookBeReturned
1473
=head2 CanBookBeReturned
(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 342-347 if (@$barcodes && $op eq 'cud-checkout') { Link Here
342
                {
342
                {
343
                    onsite_checkout     => $onsite_checkout,
343
                    onsite_checkout     => $onsite_checkout,
344
                    override_high_holds => $override_high_holds || $override_high_holds_tmp || 0,
344
                    override_high_holds => $override_high_holds || $override_high_holds_tmp || 0,
345
                    issueconfirmed      => $issueconfirmed,
345
                }
346
                }
346
            );
347
            );
347
        } catch {
348
        } catch {
348
- 

Return to bug 9762