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

(-)a/C4/Circulation.pm (-26 / +26 lines)
Lines 567-573 sub TooMany { Link Here
567
567
568
=head2 CanBookBeIssued
568
=head2 CanBookBeIssued
569
569
570
  ( $issuingimpossible, $needsconfirmation, [ $alerts ] ) =  CanBookBeIssued( $borrower,
570
  ( $issuingimpossible, $needsconfirmation, [ $alerts ] ) =  CanBookBeIssued( $patron,
571
                      $barcode, $duedate, $inprocess, $ignore_reserves, $params );
571
                      $barcode, $duedate, $inprocess, $ignore_reserves, $params );
572
572
573
Check if a book can be issued.
573
Check if a book can be issued.
Lines 580-586 data is keyed in lower case! Link Here
580
580
581
=over 4
581
=over 4
582
582
583
=item C<$borrower> hash with borrower informations (from Koha::Patron->unblessed)
583
=item C<$patron> is a Koha::Patron
584
584
585
=item C<$barcode> is the bar code of the book being issued.
585
=item C<$barcode> is the bar code of the book being issued.
586
586
Lines 671-677 if the borrower borrows to much things Link Here
671
=cut
671
=cut
672
672
673
sub CanBookBeIssued {
673
sub CanBookBeIssued {
674
    my ( $borrower, $barcode, $duedate, $inprocess, $ignore_reserves, $params ) = @_;
674
    my ( $patron, $barcode, $duedate, $inprocess, $ignore_reserves, $params ) = @_;
675
    my %needsconfirmation;    # filled with problems that needs confirmations
675
    my %needsconfirmation;    # filled with problems that needs confirmations
676
    my %issuingimpossible;    # filled with problems that causes the issue to be IMPOSSIBLE
676
    my %issuingimpossible;    # filled with problems that causes the issue to be IMPOSSIBLE
677
    my %alerts;               # filled with messages that shouldn't stop issuing, but the librarian should be aware of.
677
    my %alerts;               # filled with messages that shouldn't stop issuing, but the librarian should be aware of.
Lines 685-690 sub CanBookBeIssued { Link Here
685
	my $biblioitem = GetBiblioItemData($item->{biblioitemnumber});
685
	my $biblioitem = GetBiblioItemData($item->{biblioitemnumber});
686
	$item->{'itemtype'}=$item->{'itype'}; 
686
	$item->{'itemtype'}=$item->{'itype'}; 
687
    my $dbh             = C4::Context->dbh;
687
    my $dbh             = C4::Context->dbh;
688
    my $patron_unblessed = $patron->unblessed;
688
689
689
    # MANDATORY CHECKS - unless item exists, nothing else matters
690
    # MANDATORY CHECKS - unless item exists, nothing else matters
690
    unless ( $item->{barcode} ) {
691
    unless ( $item->{barcode} ) {
Lines 702-710 sub CanBookBeIssued { Link Here
702
    unless ( $duedate ) {
703
    unless ( $duedate ) {
703
        my $issuedate = $now->clone();
704
        my $issuedate = $now->clone();
704
705
705
        my $branch = _GetCircControlBranch($item,$borrower);
706
        my $branch = _GetCircControlBranch($item, $patron_unblessed);
706
        my $itype = ( C4::Context->preference('item-level_itypes') ) ? $item->{'itype'} : $biblioitem->{'itemtype'};
707
        my $itype = ( C4::Context->preference('item-level_itypes') ) ? $item->{'itype'} : $biblioitem->{'itemtype'};
707
        $duedate = CalcDateDue( $issuedate, $itype, $branch, $borrower );
708
        $duedate = CalcDateDue( $issuedate, $itype, $branch, $patron_unblessed );
708
709
709
        # Offline circ calls AddIssue directly, doesn't run through here
710
        # Offline circ calls AddIssue directly, doesn't run through here
710
        #  So issuingimpossible should be ok.
711
        #  So issuingimpossible should be ok.
Lines 722-728 sub CanBookBeIssued { Link Here
722
    #
723
    #
723
    # BORROWER STATUS
724
    # BORROWER STATUS
724
    #
725
    #
725
    my $patron = Koha::Patrons->find( $borrower->{borrowernumber} );
726
    if ( $patron->category->category_type eq 'X' && (  $item->{barcode}  )) {
726
    if ( $patron->category->category_type eq 'X' && (  $item->{barcode}  )) {
727
    	# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1  .
727
    	# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1  .
728
        &UpdateStats({
728
        &UpdateStats({
Lines 730-743 sub CanBookBeIssued { Link Here
730
                     type => 'localuse',
730
                     type => 'localuse',
731
                     itemnumber => $item->{'itemnumber'},
731
                     itemnumber => $item->{'itemnumber'},
732
                     itemtype => $item->{'itype'},
732
                     itemtype => $item->{'itype'},
733
                     borrowernumber => $borrower->{'borrowernumber'},
733
                     borrowernumber => $patron->borrowernumber,
734
                     ccode => $item->{'ccode'}}
734
                     ccode => $item->{'ccode'}}
735
                    );
735
                    );
736
        ModDateLastSeen( $item->{'itemnumber'} );
736
        ModDateLastSeen( $item->{'itemnumber'} );
737
        return( { STATS => 1 }, {});
737
        return( { STATS => 1 }, {});
738
    }
738
    }
739
739
740
    my $flags = C4::Members::patronflags( $borrower );
740
    my $flags = C4::Members::patronflags( $patron_unblessed );
741
    if ( ref $flags ) {
741
    if ( ref $flags ) {
742
        if ( $flags->{GNA} ) {
742
        if ( $flags->{GNA} ) {
743
            $issuingimpossible{GNA} = 1;
743
            $issuingimpossible{GNA} = 1;
Lines 749-758 sub CanBookBeIssued { Link Here
749
            $issuingimpossible{DEBARRED} = 1;
749
            $issuingimpossible{DEBARRED} = 1;
750
        }
750
        }
751
    }
751
    }
752
    if ( !defined $borrower->{dateexpiry} || $borrower->{'dateexpiry'} eq '0000-00-00') {
752
    if ( !defined $patron->dateexpiry || $patron->dateexpiry eq '0000-00-00') {
753
        $issuingimpossible{EXPIRED} = 1;
753
        $issuingimpossible{EXPIRED} = 1;
754
    } else {
754
    } else {
755
        my $expiry_dt = dt_from_string( $borrower->{dateexpiry}, 'sql', 'floating' );
755
        my $expiry_dt = dt_from_string( $patron->dateexpiry, 'sql', 'floating' );
756
        $expiry_dt->truncate( to => 'day');
756
        $expiry_dt->truncate( to => 'day');
757
        my $today = $now->clone()->truncate(to => 'day');
757
        my $today = $now->clone()->truncate(to => 'day');
758
        $today->set_time_zone( 'floating' );
758
        $today->set_time_zone( 'floating' );
Lines 767-773 sub CanBookBeIssued { Link Here
767
767
768
    # DEBTS
768
    # DEBTS
769
    my ($balance, $non_issue_charges, $other_charges) =
769
    my ($balance, $non_issue_charges, $other_charges) =
770
      C4::Members::GetMemberAccountBalance( $borrower->{'borrowernumber'} );
770
      C4::Members::GetMemberAccountBalance( $patron->borrowernumber );
771
771
772
    my $amountlimit = C4::Context->preference("noissuescharge");
772
    my $amountlimit = C4::Context->preference("noissuescharge");
773
    my $allowfineoverride = C4::Context->preference("AllowFineOverride");
773
    my $allowfineoverride = C4::Context->preference("AllowFineOverride");
Lines 777-784 sub CanBookBeIssued { Link Here
777
    my $no_issues_charge_guarantees = C4::Context->preference("NoIssuesChargeGuarantees");
777
    my $no_issues_charge_guarantees = C4::Context->preference("NoIssuesChargeGuarantees");
778
    $no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees );
778
    $no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees );
779
    if ( defined $no_issues_charge_guarantees ) {
779
    if ( defined $no_issues_charge_guarantees ) {
780
        my $p = Koha::Patrons->find( $borrower->{borrowernumber} );
780
        my @guarantees = $patron->guarantees();
781
        my @guarantees = $p->guarantees();
782
        my $guarantees_non_issues_charges;
781
        my $guarantees_non_issues_charges;
783
        foreach my $g ( @guarantees ) {
782
        foreach my $g ( @guarantees ) {
784
            my ( $b, $n, $o ) = C4::Members::GetMemberAccountBalance( $g->id );
783
            my ( $b, $n, $o ) = C4::Members::GetMemberAccountBalance( $g->id );
Lines 817-823 sub CanBookBeIssued { Link Here
817
        $alerts{OTHER_CHARGES} = sprintf( "%.2f", $other_charges );
816
        $alerts{OTHER_CHARGES} = sprintf( "%.2f", $other_charges );
818
    }
817
    }
819
818
820
    $patron = Koha::Patrons->find( $borrower->{borrowernumber} );
819
    $patron = Koha::Patrons->find( $patron->borrowernumber ); # FIXME Refetch just in case, to avoid regressions. But must not be needed
821
    if ( my $debarred_date = $patron->is_debarred ) {
820
    if ( my $debarred_date = $patron->is_debarred ) {
822
         # patron has accrued fine days or has a restriction. $count is a date
821
         # patron has accrued fine days or has a restriction. $count is a date
823
        if ($debarred_date eq '9999-12-31') {
822
        if ($debarred_date eq '9999-12-31') {
Lines 839-845 sub CanBookBeIssued { Link Here
839
    #
838
    #
840
    # CHECK IF BOOK ALREADY ISSUED TO THIS BORROWER
839
    # CHECK IF BOOK ALREADY ISSUED TO THIS BORROWER
841
    #
840
    #
842
    if ( $issue && $issue->borrowernumber eq $borrower->{'borrowernumber'} ){
841
    if ( $issue && $issue->borrowernumber eq $patron->borrowernumber ){
843
842
844
        # Already issued to current borrower.
843
        # Already issued to current borrower.
845
        # If it is an on-site checkout if it can be switched to a normal checkout
844
        # If it is an on-site checkout if it can be switched to a normal checkout
Lines 850-856 sub CanBookBeIssued { Link Here
850
            $messages{ONSITE_CHECKOUT_WILL_BE_SWITCHED} = 1;
849
            $messages{ONSITE_CHECKOUT_WILL_BE_SWITCHED} = 1;
851
        } else {
850
        } else {
852
            my ($CanBookBeRenewed,$renewerror) = CanBookBeRenewed(
851
            my ($CanBookBeRenewed,$renewerror) = CanBookBeRenewed(
853
                $borrower->{'borrowernumber'},
852
                $patron->borrowernumber,
854
                $item->{'itemnumber'},
853
                $item->{'itemnumber'},
855
            );
854
            );
856
            if ( $CanBookBeRenewed == 0 ) {    # no more renewals allowed
855
            if ( $CanBookBeRenewed == 0 ) {    # no more renewals allowed
Lines 892-899 sub CanBookBeIssued { Link Here
892
          C4::Context->preference('SwitchOnSiteCheckouts')
891
          C4::Context->preference('SwitchOnSiteCheckouts')
893
      and $issue
892
      and $issue
894
      and $issue->onsite_checkout
893
      and $issue->onsite_checkout
895
      and $issue->borrowernumber == $borrower->{'borrowernumber'} ? 1 : 0 );
894
      and $issue->borrowernumber == $patron->borrowernumber ? 1 : 0 );
896
    my $toomany = TooMany( $borrower, $item->{biblionumber}, $item, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } );
895
    my $toomany = TooMany( $patron_unblessed, $item->{biblionumber}, $item, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } );
897
    # if TooMany max_allowed returns 0 the user doesn't have permission to check out this book
896
    # if TooMany max_allowed returns 0 the user doesn't have permission to check out this book
898
    if ( $toomany && not exists $needsconfirmation{RENEW_ISSUE} ) {
897
    if ( $toomany && not exists $needsconfirmation{RENEW_ISSUE} ) {
899
        if ( $toomany->{max_allowed} == 0 ) {
898
        if ( $toomany->{max_allowed} == 0 ) {
Lines 913-919 sub CanBookBeIssued { Link Here
913
    #
912
    #
914
    # CHECKPREVCHECKOUT: CHECK IF ITEM HAS EVER BEEN LENT TO PATRON
913
    # CHECKPREVCHECKOUT: CHECK IF ITEM HAS EVER BEEN LENT TO PATRON
915
    #
914
    #
916
    $patron = Koha::Patrons->find($borrower->{borrowernumber});
915
    $patron = Koha::Patrons->find( $patron->borrowernumber ); # FIXME Refetch just in case, to avoid regressions. But must not be needed
917
    my $wants_check = $patron->wants_check_for_previous_checkout;
916
    my $wants_check = $patron->wants_check_for_previous_checkout;
918
    $needsconfirmation{PREVISSUE} = 1
917
    $needsconfirmation{PREVISSUE} = 1
919
        if ($wants_check and $patron->do_check_for_previous_checkout($item));
918
        if ($wants_check and $patron->do_check_for_previous_checkout($item));
Lines 980-987 sub CanBookBeIssued { Link Here
980
                $issuingimpossible{ITEMNOTSAMEBRANCH} = 1;
979
                $issuingimpossible{ITEMNOTSAMEBRANCH} = 1;
981
                $issuingimpossible{'itemhomebranch'} = $item->{C4::Context->preference("HomeOrHoldingBranch")};
980
                $issuingimpossible{'itemhomebranch'} = $item->{C4::Context->preference("HomeOrHoldingBranch")};
982
            }
981
            }
983
            $needsconfirmation{BORRNOTSAMEBRANCH} = $borrower->{'branchcode'}
982
            $needsconfirmation{BORRNOTSAMEBRANCH} = $patron->branchcode
984
              if ( $borrower->{'branchcode'} ne $userenv->{branch} );
983
              if ( $patron->branchcode ne $userenv->{branch} );
985
        }
984
        }
986
    }
985
    }
987
    #
986
    #
Lines 990-996 sub CanBookBeIssued { Link Here
990
    my $rentalConfirmation = C4::Context->preference("RentalFeesCheckoutConfirmation");
989
    my $rentalConfirmation = C4::Context->preference("RentalFeesCheckoutConfirmation");
991
990
992
    if ( $rentalConfirmation ){
991
    if ( $rentalConfirmation ){
993
        my ($rentalCharge) = GetIssuingCharges( $item->{'itemnumber'}, $borrower->{'borrowernumber'} );
992
        my ($rentalCharge) = GetIssuingCharges( $item->{'itemnumber'}, $patron->borrowernumber );
994
        if ( $rentalCharge > 0 ){
993
        if ( $rentalCharge > 0 ){
995
            $needsconfirmation{RENTALCHARGE} = $rentalCharge;
994
            $needsconfirmation{RENTALCHARGE} = $rentalCharge;
996
        }
995
        }
Lines 1001-1007 sub CanBookBeIssued { Link Here
1001
        my ( $restype, $res ) = C4::Reserves::CheckReserves( $item->{'itemnumber'} );
1000
        my ( $restype, $res ) = C4::Reserves::CheckReserves( $item->{'itemnumber'} );
1002
        if ($restype) {
1001
        if ($restype) {
1003
            my $resbor = $res->{'borrowernumber'};
1002
            my $resbor = $res->{'borrowernumber'};
1004
            if ( $resbor ne $borrower->{'borrowernumber'} ) {
1003
            if ( $resbor ne $patron->borrowernumber ) {
1005
                my $patron = Koha::Patrons->find( $resbor );
1004
                my $patron = Koha::Patrons->find( $resbor );
1006
                if ( $restype eq "Waiting" )
1005
                if ( $restype eq "Waiting" )
1007
                {
1006
                {
Lines 1031-1037 sub CanBookBeIssued { Link Here
1031
1030
1032
    ## CHECK AGE RESTRICTION
1031
    ## CHECK AGE RESTRICTION
1033
    my $agerestriction  = $biblioitem->{'agerestriction'};
1032
    my $agerestriction  = $biblioitem->{'agerestriction'};
1034
    my ($restriction_age, $daysToAgeRestriction) = GetAgeRestriction( $agerestriction, $borrower );
1033
    my ($restriction_age, $daysToAgeRestriction) = GetAgeRestriction( $agerestriction, $patron->unblessed );
1035
    if ( $daysToAgeRestriction && $daysToAgeRestriction > 0 ) {
1034
    if ( $daysToAgeRestriction && $daysToAgeRestriction > 0 ) {
1036
        if ( C4::Context->preference('AgeRestrictionOverride') ) {
1035
        if ( C4::Context->preference('AgeRestrictionOverride') ) {
1037
            $needsconfirmation{AGE_RESTRICTION} = "$agerestriction";
1036
            $needsconfirmation{AGE_RESTRICTION} = "$agerestriction";
Lines 1043-1049 sub CanBookBeIssued { Link Here
1043
1042
1044
    ## check for high holds decreasing loan period
1043
    ## check for high holds decreasing loan period
1045
    if ( C4::Context->preference('decreaseLoanHighHolds') ) {
1044
    if ( C4::Context->preference('decreaseLoanHighHolds') ) {
1046
        my $check = checkHighHolds( $item, $borrower );
1045
        my $check = checkHighHolds( $item, $patron_unblessed );
1047
1046
1048
        if ( $check->{exceeded} ) {
1047
        if ( $check->{exceeded} ) {
1049
            if ($override_high_holds) {
1048
            if ($override_high_holds) {
Lines 1076-1084 sub CanBookBeIssued { Link Here
1076
        require C4::Serials;
1075
        require C4::Serials;
1077
        my $is_a_subscription = C4::Serials::CountSubscriptionFromBiblionumber($biblionumber);
1076
        my $is_a_subscription = C4::Serials::CountSubscriptionFromBiblionumber($biblionumber);
1078
        unless ($is_a_subscription) {
1077
        unless ($is_a_subscription) {
1078
            # FIXME Should be $patron->checkouts($args);
1079
            my $checkouts = Koha::Checkouts->search(
1079
            my $checkouts = Koha::Checkouts->search(
1080
                {
1080
                {
1081
                    borrowernumber => $borrower->{borrowernumber},
1081
                    borrowernumber => $patron->borrowernumber,
1082
                    biblionumber   => $biblionumber,
1082
                    biblionumber   => $biblionumber,
1083
                },
1083
                },
1084
                {
1084
                {
(-)a/C4/ILSDI/Services.pm (-1 / +1 lines)
Lines 550-556 sub GetServices { Link Here
550
    my $barcode = $item->{'barcode'} || '';
550
    my $barcode = $item->{'barcode'} || '';
551
    $barcode = barcodedecode($barcode) if ( $barcode && C4::Context->preference('itemBarcodeInputFilter') );
551
    $barcode = barcodedecode($barcode) if ( $barcode && C4::Context->preference('itemBarcodeInputFilter') );
552
    if ($barcode) {
552
    if ($barcode) {
553
        my ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $borrower, $barcode );
553
        my ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $barcode );
554
554
555
        # TODO push @availablefor, 'loan';
555
        # TODO push @availablefor, 'loan';
556
    }
556
    }
(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 315-321 if (@$barcodes) { Link Here
315
    my $template_params = { barcode => $barcode };
315
    my $template_params = { barcode => $barcode };
316
    # always check for blockers on issuing
316
    # always check for blockers on issuing
317
    my ( $error, $question, $alerts, $messages ) = CanBookBeIssued(
317
    my ( $error, $question, $alerts, $messages ) = CanBookBeIssued(
318
        $patron->unblessed,
318
        $patron,
319
        $barcode, $datedue,
319
        $barcode, $datedue,
320
        $inprocess,
320
        $inprocess,
321
        undef,
321
        undef,
(-)a/opac/sco/sco-main.pl (-5 / +5 lines)
Lines 108-117 if (C4::Context->preference('SelfCheckoutByLogin') && !$patronid) { Link Here
108
    ($resval, $patronid) = checkpw($dbh, $patronlogin, $patronpw);
108
    ($resval, $patronid) = checkpw($dbh, $patronlogin, $patronpw);
109
}
109
}
110
110
111
my $borrower;
111
my ( $borrower, $patron );
112
if ( $patronid ) {
112
if ( $patronid ) {
113
    $borrower = Koha::Patrons->find( { cardnumber => $patronid } );
113
    $patron = Koha::Patrons->find( { cardnumber => $patronid } );
114
    $borrower = $borrower->unblessed if $borrower;
114
    $borrower = $patron->unblessed if $patron;
115
}
115
}
116
116
117
my $currencySymbol = "";
117
my $currencySymbol = "";
Lines 130-140 if ($op eq "logout") { Link Here
130
elsif ( $op eq "returnbook" && $allowselfcheckreturns ) {
130
elsif ( $op eq "returnbook" && $allowselfcheckreturns ) {
131
    my ($doreturn) = AddReturn( $barcode, $branch );
131
    my ($doreturn) = AddReturn( $barcode, $branch );
132
}
132
}
133
elsif ( $borrower and $op eq "checkout" ) {
133
elsif ( $patron and $op eq "checkout" ) {
134
    my $impossible  = {};
134
    my $impossible  = {};
135
    my $needconfirm = {};
135
    my $needconfirm = {};
136
    ( $impossible, $needconfirm ) = CanBookBeIssued(
136
    ( $impossible, $needconfirm ) = CanBookBeIssued(
137
        $borrower,
137
        $patron,
138
        $barcode,
138
        $barcode,
139
        undef,
139
        undef,
140
        0,
140
        0,
(-)a/t/db_dependent/Circulation.t (-12 / +12 lines)
Lines 1198-1205 subtest 'CanBookBeIssued & AllowReturnToBranch' => sub { Link Here
1198
    my $homebranch    = $builder->build( { source => 'Branch' } );
1198
    my $homebranch    = $builder->build( { source => 'Branch' } );
1199
    my $holdingbranch = $builder->build( { source => 'Branch' } );
1199
    my $holdingbranch = $builder->build( { source => 'Branch' } );
1200
    my $otherbranch   = $builder->build( { source => 'Branch' } );
1200
    my $otherbranch   = $builder->build( { source => 'Branch' } );
1201
    my $patron_1      = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } );
1201
    my $patron_1      = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } );
1202
    my $patron_2      = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } );
1202
    my $patron_2      = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } );
1203
1203
1204
    my $biblioitem = $builder->build( { source => 'Biblioitem' } );
1204
    my $biblioitem = $builder->build( { source => 'Biblioitem' } );
1205
    my $item = $builder->build(
1205
    my $item = $builder->build(
Lines 1218-1224 subtest 'CanBookBeIssued & AllowReturnToBranch' => sub { Link Here
1218
1218
1219
    set_userenv($holdingbranch);
1219
    set_userenv($holdingbranch);
1220
1220
1221
    my $issue = AddIssue( $patron_1, $item->{barcode} );
1221
    my $issue = AddIssue( $patron_1->unblessed, $item->{barcode} );
1222
    is( ref($issue), 'Koha::Schema::Result::Issue' );    # FIXME Should be Koha::Checkout
1222
    is( ref($issue), 'Koha::Schema::Result::Issue' );    # FIXME Should be Koha::Checkout
1223
1223
1224
    my ( $error, $question, $alerts );
1224
    my ( $error, $question, $alerts );
Lines 1360-1366 subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { Link Here
1360
    plan tests => 8;
1360
    plan tests => 8;
1361
1361
1362
    my $library = $builder->build( { source => 'Branch' } );
1362
    my $library = $builder->build( { source => 'Branch' } );
1363
    my $patron  = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } );
1363
    my $patron  = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } );
1364
1364
1365
    my $biblioitem_1 = $builder->build( { source => 'Biblioitem' } );
1365
    my $biblioitem_1 = $builder->build( { source => 'Biblioitem' } );
1366
    my $item_1 = $builder->build(
1366
    my $item_1 = $builder->build(
Lines 1395-1401 subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { Link Here
1395
1395
1396
    # Patron cannot issue item_1, they have overdues
1396
    # Patron cannot issue item_1, they have overdues
1397
    my $yesterday = DateTime->today( time_zone => C4::Context->tz() )->add( days => -1 );
1397
    my $yesterday = DateTime->today( time_zone => C4::Context->tz() )->add( days => -1 );
1398
    my $issue = AddIssue( $patron, $item_1->{barcode}, $yesterday );    # Add an overdue
1398
    my $issue = AddIssue( $patron->unblessed, $item_1->{barcode}, $yesterday );    # Add an overdue
1399
1399
1400
    t::lib::Mocks::mock_preference( 'OverduesBlockCirc', 'confirmation' );
1400
    t::lib::Mocks::mock_preference( 'OverduesBlockCirc', 'confirmation' );
1401
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->{barcode} );
1401
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->{barcode} );
Lines 1409-1420 subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { Link Here
1409
1409
1410
    # Patron cannot issue item_1, they are debarred
1410
    # Patron cannot issue item_1, they are debarred
1411
    my $tomorrow = DateTime->today( time_zone => C4::Context->tz() )->add( days => 1 );
1411
    my $tomorrow = DateTime->today( time_zone => C4::Context->tz() )->add( days => 1 );
1412
    Koha::Patron::Debarments::AddDebarment( { borrowernumber => $patron->{borrowernumber}, expiration => $tomorrow } );
1412
    Koha::Patron::Debarments::AddDebarment( { borrowernumber => $patron->borrowernumber, expiration => $tomorrow } );
1413
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->{barcode} );
1413
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->{barcode} );
1414
    is( keys(%$question) + keys(%$alerts),  0, 'No key for question and alert ' . str($error, $question, $alerts) );
1414
    is( keys(%$question) + keys(%$alerts),  0, 'No key for question and alert ' . str($error, $question, $alerts) );
1415
    is( $error->{USERBLOCKEDWITHENDDATE}, output_pref( { dt => $tomorrow, dateformat => 'sql', dateonly => 1 } ), 'USERBLOCKEDWITHENDDATE should be tomorrow' );
1415
    is( $error->{USERBLOCKEDWITHENDDATE}, output_pref( { dt => $tomorrow, dateformat => 'sql', dateonly => 1 } ), 'USERBLOCKEDWITHENDDATE should be tomorrow' );
1416
1416
1417
    Koha::Patron::Debarments::AddDebarment( { borrowernumber => $patron->{borrowernumber} } );
1417
    Koha::Patron::Debarments::AddDebarment( { borrowernumber => $patron->borrowernumber } );
1418
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->{barcode} );
1418
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->{barcode} );
1419
    is( keys(%$question) + keys(%$alerts),  0, 'No key for question and alert ' . str($error, $question, $alerts) );
1419
    is( keys(%$question) + keys(%$alerts),  0, 'No key for question and alert ' . str($error, $question, $alerts) );
1420
    is( $error->{USERBLOCKEDNOENDDATE},    '9999-12-31', 'USERBLOCKEDNOENDDATE should be 9999-12-31 for unlimited debarments' );
1420
    is( $error->{USERBLOCKEDNOENDDATE},    '9999-12-31', 'USERBLOCKEDNOENDDATE should be 9999-12-31 for unlimited debarments' );
Lines 1458-1464 subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { Link Here
1458
        }
1458
        }
1459
    );
1459
    );
1460
1460
1461
    my ( $error, $question, $alerts ) = CanBookBeIssued( $patron->unblessed, $item_1->{barcode} );
1461
    my ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_1->{barcode} );
1462
    is( $error->{STATS}, 1, '"Error" flag "STATS" must be set if CanBookBeIssued is called with a statistic patron (category_type=X)' );
1462
    is( $error->{STATS}, 1, '"Error" flag "STATS" must be set if CanBookBeIssued is called with a statistic patron (category_type=X)' );
1463
1463
1464
    # TODO There are other tests to provide here
1464
    # TODO There are other tests to provide here
Lines 1570-1576 subtest 'CanBookBeIssued + AllowMultipleIssuesOnABiblio' => sub { Link Here
1570
    plan tests => 5;
1570
    plan tests => 5;
1571
1571
1572
    my $library = $builder->build( { source => 'Branch' } );
1572
    my $library = $builder->build( { source => 'Branch' } );
1573
    my $patron  = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } );
1573
    my $patron  = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } );
1574
1574
1575
    my $biblioitem = $builder->build( { source => 'Biblioitem' } );
1575
    my $biblioitem = $builder->build( { source => 'Biblioitem' } );
1576
    my $biblionumber = $biblioitem->{biblionumber};
1576
    my $biblionumber = $biblioitem->{biblionumber};
Lines 1600-1606 subtest 'CanBookBeIssued + AllowMultipleIssuesOnABiblio' => sub { Link Here
1600
    );
1600
    );
1601
1601
1602
    my ( $error, $question, $alerts );
1602
    my ( $error, $question, $alerts );
1603
    my $issue = AddIssue( $patron, $item_1->{barcode}, dt_from_string->add( days => 1 ) );
1603
    my $issue = AddIssue( $patron->unblessed, $item_1->{barcode}, dt_from_string->add( days => 1 ) );
1604
1604
1605
    t::lib::Mocks::mock_preference('AllowMultipleIssuesOnABiblio', 0);
1605
    t::lib::Mocks::mock_preference('AllowMultipleIssuesOnABiblio', 0);
1606
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->{barcode} );
1606
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->{barcode} );
Lines 2021-2027 subtest 'CanBookBeIssued | is_overdue' => sub { Link Here
2021
    my $five_days_go = output_pref({ dt => dt_from_string->add( days => 5 ), dateonly => 1});
2021
    my $five_days_go = output_pref({ dt => dt_from_string->add( days => 5 ), dateonly => 1});
2022
    my $ten_days_go  = output_pref({ dt => dt_from_string->add( days => 10), dateonly => 1 });
2022
    my $ten_days_go  = output_pref({ dt => dt_from_string->add( days => 10), dateonly => 1 });
2023
    my $library = $builder->build( { source => 'Branch' } );
2023
    my $library = $builder->build( { source => 'Branch' } );
2024
    my $patron  = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } );
2024
    my $patron  = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } );
2025
2025
2026
    my $biblioitem = $builder->build( { source => 'Biblioitem' } );
2026
    my $biblioitem = $builder->build( { source => 'Biblioitem' } );
2027
    my $item = $builder->build(
2027
    my $item = $builder->build(
Lines 2038-2044 subtest 'CanBookBeIssued | is_overdue' => sub { Link Here
2038
        }
2038
        }
2039
    );
2039
    );
2040
2040
2041
    my $issue = AddIssue( $patron, $item->{barcode}, $five_days_go ); # date due was 10d ago
2041
    my $issue = AddIssue( $patron->unblessed, $item->{barcode}, $five_days_go ); # date due was 10d ago
2042
    my $actualissue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
2042
    my $actualissue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
2043
    is( output_pref({ str => $actualissue->date_due, dateonly => 1}), $five_days_go, "First issue works");
2043
    is( output_pref({ str => $actualissue->date_due, dateonly => 1}), $five_days_go, "First issue works");
2044
    my ($issuingimpossible, $needsconfirmation) = CanBookBeIssued($patron,$item->{barcode},$ten_days_go, undef, undef, undef);
2044
    my ($issuingimpossible, $needsconfirmation) = CanBookBeIssued($patron,$item->{barcode},$ten_days_go, undef, undef, undef);
(-)a/t/db_dependent/Circulation/NoIssuesChargeGuarantees.t (-4 / +4 lines)
Lines 42-51 my $item = $builder->build( Link Here
42
    }
42
    }
43
);
43
);
44
44
45
my $patron_category = $builder->build({ source => 'Category', value => { category_type => 'P', enrolmentfee => 0 } });
45
my $patron_category = $builder->build({ source => 'Category', value => { categorycode => 'NOT_X', category_type => 'P', enrolmentfee => 0 } });
46
my $patron = $builder->build(
46
my $patron = $builder->build_object(
47
    {
47
    {
48
        source => 'Borrower',
48
        class => 'Koha::Patrons',
49
        value => {
49
        value => {
50
            patron_category => $patron_category->{categorycode},
50
            patron_category => $patron_category->{categorycode},
51
        }
51
        }
Lines 55-61 my $guarantee = $builder->build( Link Here
55
    {
55
    {
56
        source => 'Borrower',
56
        source => 'Borrower',
57
        value  => {
57
        value  => {
58
            guarantorid => $patron->{borrowernumber},
58
            guarantorid => $patron->borrowernumber,
59
            patron_category => $patron_category->{categorycode},
59
            patron_category => $patron_category->{categorycode},
60
        }
60
        }
61
    }
61
    }
(-)a/t/db_dependent/Circulation/SwitchOnSiteCheckouts.t (-7 / +8 lines)
Lines 50-64 my $branch = $builder->build({ Link Here
50
    source => 'Branch',
50
    source => 'Branch',
51
});
51
});
52
52
53
my $patron_category = $builder->build({ source => 'Category', value => { category_type => 'P', enrolmentfee => 0 } });
53
my $patron_category = $builder->build({ source => 'Category', value => { categorycode => 'NOT_X', category_type => 'P', enrolmentfee => 0 } });
54
my $patron = $builder->build({
54
my $patron = $builder->build_object({
55
    source => 'Borrower',
55
    class => 'Koha::Patrons',
56
    value => {
56
    value => {
57
        branchcode => $branch->{branchcode},
57
        branchcode => $branch->{branchcode},
58
        debarred => undef,
58
        debarred => undef,
59
        categorycode => $patron_category->{categorycode},
59
        categorycode => $patron_category->{categorycode},
60
    },
60
    },
61
});
61
});
62
my $patron_unblessed = $patron->unblessed;
62
63
63
my $biblio = $builder->build({
64
my $biblio = $builder->build({
64
    source => 'Biblio',
65
    source => 'Biblio',
Lines 92-103 my $issuingrule = $builder->build({ Link Here
92
});
93
});
93
94
94
C4::Context->_new_userenv ('DUMMY_SESSION_ID');
95
C4::Context->_new_userenv ('DUMMY_SESSION_ID');
95
C4::Context->set_userenv($patron->{borrowernumber}, $patron->{userid}, 'usercnum', 'First name', 'Surname', $branch->{branchcode}, 'My Library', 0);
96
C4::Context->set_userenv($patron->borrowernumber, $patron->userid, 'usercnum', 'First name', 'Surname', $branch->{branchcode}, 'My Library', 0);
96
97
97
t::lib::Mocks::mock_preference('AllowTooManyOverride', 0);
98
t::lib::Mocks::mock_preference('AllowTooManyOverride', 0);
98
99
99
# Add onsite checkout
100
# Add onsite checkout
100
C4::Circulation::AddIssue( $patron, $item->{barcode}, dt_from_string, undef, dt_from_string, undef, { onsite_checkout => 1 } );
101
C4::Circulation::AddIssue( $patron_unblessed, $item->{barcode}, dt_from_string, undef, dt_from_string, undef, { onsite_checkout => 1 } );
101
102
102
my ( $impossible, $messages );
103
my ( $impossible, $messages );
103
t::lib::Mocks::mock_preference('SwitchOnSiteCheckouts', 0);
104
t::lib::Mocks::mock_preference('SwitchOnSiteCheckouts', 0);
Lines 108-114 t::lib::Mocks::mock_preference('SwitchOnSiteCheckouts', 1); Link Here
108
( $impossible, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $item->{barcode} );
109
( $impossible, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $item->{barcode} );
109
is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, 'If SwitchOnSiteCheckouts, switch the on-site checkout' );
110
is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, 'If SwitchOnSiteCheckouts, switch the on-site checkout' );
110
is( exists $impossible->{TOO_MANY}, '', 'If SwitchOnSiteCheckouts, switch the on-site checkout' );
111
is( exists $impossible->{TOO_MANY}, '', 'If SwitchOnSiteCheckouts, switch the on-site checkout' );
111
C4::Circulation::AddIssue( $patron, $item->{barcode}, undef, undef, undef, undef, { switch_onsite_checkout => 1 } );
112
C4::Circulation::AddIssue( $patron_unblessed, $item->{barcode}, undef, undef, undef, undef, { switch_onsite_checkout => 1 } );
112
my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
113
my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } );
113
is( $issue->onsite_checkout, 0, 'The issue should have been switched to a regular checkout' );
114
is( $issue->onsite_checkout, 0, 'The issue should have been switched to a regular checkout' );
114
my $five_days_after = dt_from_string->add( days => 5 )->set( hour => 23, minute => 59, second => 0 );
115
my $five_days_after = dt_from_string->add( days => 5 )->set( hour => 23, minute => 59, second => 0 );
Lines 128-134 my $another_item = $builder->build({ Link Here
128
    },
129
    },
129
});
130
});
130
131
131
C4::Circulation::AddIssue( $patron, $another_item->{barcode}, dt_from_string, undef, dt_from_string, undef, { onsite_checkout => 1 } );
132
C4::Circulation::AddIssue( $patron_unblessed, $another_item->{barcode}, dt_from_string, undef, dt_from_string, undef, { onsite_checkout => 1 } );
132
( $impossible, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $another_item->{barcode} );
133
( $impossible, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $another_item->{barcode} );
133
is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, 'Specific case 1 - Switch is allowed' );
134
is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, 'Specific case 1 - Switch is allowed' );
134
is( exists $impossible->{TOO_MANY}, '', 'Specific case 1 - Switch is allowed' );
135
is( exists $impossible->{TOO_MANY}, '', 'Specific case 1 - Switch is allowed' );
(-)a/t/db_dependent/Circulation/dateexpiry.t (-9 / +6 lines)
Lines 47-61 subtest 'Tests for CalcDateDue related to dateexpiry' => sub { Link Here
47
47
48
sub can_book_be_issued {
48
sub can_book_be_issued {
49
    my $item    = $builder->build( { source => 'Item' } );
49
    my $item    = $builder->build( { source => 'Item' } );
50
    my $patron  = $builder->build(
50
    my $patron  = $builder->build_object(
51
        {   source => 'Borrower',
51
        {   class  => 'Koha::Patrons',
52
            value  => {
52
            value  => {
53
                dateexpiry => '9999-12-31',
53
                dateexpiry => '9999-12-31',
54
                categorycode => $patron_category->{categorycode},
54
                categorycode => $patron_category->{categorycode},
55
            }
55
            }
56
        }
56
        }
57
    );
57
    );
58
    $patron->{flags} = C4::Members::patronflags( $patron );
59
    my $duration = gettimeofday();
58
    my $duration = gettimeofday();
60
    my ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $patron, $item->{barcode} );
59
    my ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $patron, $item->{barcode} );
61
    $duration = gettimeofday() - $duration;
60
    $duration = gettimeofday() - $duration;
Lines 63-91 sub can_book_be_issued { Link Here
63
    is( not( exists $issuingimpossible->{EXPIRED} ), 1, 'The patron should not be considered as expired if dateexpiry is 9999-*' );
62
    is( not( exists $issuingimpossible->{EXPIRED} ), 1, 'The patron should not be considered as expired if dateexpiry is 9999-*' );
64
63
65
    $item = $builder->build( { source => 'Item' } );
64
    $item = $builder->build( { source => 'Item' } );
66
    $patron = $builder->build(
65
    $patron = $builder->build_object(
67
        {   source => 'Borrower',
66
        {   class  => 'Koha::Patrons',
68
            value  => {
67
            value  => {
69
                dateexpiry => '0000-00-00',
68
                dateexpiry => '0000-00-00',
70
                categorycode => $patron_category->{categorycode},
69
                categorycode => $patron_category->{categorycode},
71
            }
70
            }
72
        }
71
        }
73
    );
72
    );
74
    $patron->{flags} = C4::Members::patronflags( $patron );
75
    ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $patron, $item->{barcode} );
73
    ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $patron, $item->{barcode} );
76
    is( $issuingimpossible->{EXPIRED}, 1, 'The patron should be considered as expired if dateexpiry is 0000-00-00' );
74
    is( $issuingimpossible->{EXPIRED}, 1, 'The patron should be considered as expired if dateexpiry is 0000-00-00' );
77
75
78
    my $tomorrow = dt_from_string->add_duration( DateTime::Duration->new( days => 1 ) );
76
    my $tomorrow = dt_from_string->add_duration( DateTime::Duration->new( days => 1 ) );
79
    $item = $builder->build( { source => 'Item' } );
77
    $item = $builder->build( { source => 'Item' } );
80
    $patron = $builder->build(
78
    $patron = $builder->build_object(
81
        {   source => 'Borrower',
79
        {   class  => 'Koha::Patrons',
82
            value  => {
80
            value  => {
83
                dateexpiry => output_pref( { dt => $tomorrow, dateonly => 1, dateformat => 'sql' } ),
81
                dateexpiry => output_pref( { dt => $tomorrow, dateonly => 1, dateformat => 'sql' } ),
84
                categorycode => $patron_category->{categorycode},
82
                categorycode => $patron_category->{categorycode},
85
            },
83
            },
86
        }
84
        }
87
    );
85
    );
88
    $patron->{flags} = C4::Members::patronflags( $patron );
89
    ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $patron, $item->{barcode} );
86
    ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $patron, $item->{barcode} );
90
    is( not( exists $issuingimpossible->{EXPIRED} ), 1, 'The patron should not be considered as expired if dateexpiry is tomorrow' );
87
    is( not( exists $issuingimpossible->{EXPIRED} ), 1, 'The patron should not be considered as expired if dateexpiry is tomorrow' );
91
88
(-)a/t/db_dependent/DecreaseLoanHighHolds.t (-3 / +4 lines)
Lines 19-25 use Modern::Perl; Link Here
19
19
20
use C4::Circulation;
20
use C4::Circulation;
21
use Koha::Database;
21
use Koha::Database;
22
use Koha::Patron;
22
use Koha::Patrons;
23
use Koha::Biblio;
23
use Koha::Biblio;
24
use Koha::Item;
24
use Koha::Item;
25
use Koha::Holds;
25
use Koha::Holds;
Lines 184-193 is( $data->{exceeded}, 1, "Should exceed threshold with one withdrawn item" ); Link Here
184
184
185
t::lib::Mocks::mock_preference('CircControl', 'PatronLibrary');
185
t::lib::Mocks::mock_preference('CircControl', 'PatronLibrary');
186
186
187
my ( $un, $needsconfirmation ) = CanBookBeIssued( $patron_hr, $item->barcode );
187
my $patron_object = Koha::Patrons->find( $patron_hr->{borrowernumber} );
188
my ( undef, $needsconfirmation ) = CanBookBeIssued( $patron_object, $item->barcode );
188
ok( $needsconfirmation->{HIGHHOLDS}, "High holds checkout needs confirmation" );
189
ok( $needsconfirmation->{HIGHHOLDS}, "High holds checkout needs confirmation" );
189
190
190
( undef, $needsconfirmation ) = CanBookBeIssued( $patron_hr, $item->barcode, undef, undef, undef, { override_high_holds => 1 } );
191
( undef, $needsconfirmation ) = CanBookBeIssued( $patron_object, $item->barcode, undef, undef, undef, { override_high_holds => 1 } );
191
ok( !$needsconfirmation->{HIGHHOLDS}, "High holds checkout does not need confirmation" );
192
ok( !$needsconfirmation->{HIGHHOLDS}, "High holds checkout does not need confirmation" );
192
193
193
$schema->storage->txn_rollback();
194
$schema->storage->txn_rollback();
(-)a/t/db_dependent/Patron/Borrower_PrevCheckout.t (-2 / +2 lines)
Lines 379-385 test_it($cpvPmappings, "PostReturn"); Link Here
379
379
380
# Our Patron
380
# Our Patron
381
my $CBBI_patron = $builder->build({source => 'Borrower'});
381
my $CBBI_patron = $builder->build({source => 'Borrower'});
382
$patron = Koha::Patrons->find( $CBBI_patron->{borrowernumber} )->unblessed;
382
$patron = Koha::Patrons->find( $CBBI_patron->{borrowernumber} );
383
# Our Items
383
# Our Items
384
my $new_item = $builder->build({
384
my $new_item = $builder->build({
385
    source => 'Item',
385
    source => 'Item',
Lines 399-405 my $prev_item = $builder->build({ Link Here
399
});
399
});
400
# Second is Checked Out
400
# Second is Checked Out
401
BAIL_OUT("CanBookBeIssued Issue failed")
401
BAIL_OUT("CanBookBeIssued Issue failed")
402
    unless AddIssue($patron, $prev_item->{barcode});
402
    unless AddIssue($patron->unblessed, $prev_item->{barcode});
403
403
404
# Mappings
404
# Mappings
405
my $CBBI_mappings = [
405
my $CBBI_mappings = [
(-)a/t/db_dependent/rollingloans.t (-4 / +3 lines)
Lines 46-54 SKIP: { Link Here
46
sub try_issue {
46
sub try_issue {
47
    my ($cardnumber, $item ) = @_;
47
    my ($cardnumber, $item ) = @_;
48
    my $issuedate = '2011-05-16';
48
    my $issuedate = '2011-05-16';
49
    my $borrower = Koha::Patrons->find( { cardnumber => $cardnumber } )->unblessed;
49
    my $patron = Koha::Patrons->find( { cardnumber => $cardnumber } );
50
    my ($issuingimpossible,$needsconfirmation) = CanBookBeIssued( $borrower, $item );
50
    my ($issuingimpossible,$needsconfirmation) = CanBookBeIssued( $patron, $item );
51
    my $issue = AddIssue($borrower, $item, undef, 0, $issuedate);
51
    my $issue = AddIssue($patron->unblessed, $item, undef, 0, $issuedate);
52
    return dt_from_string( $issue->due_date() );
52
    return dt_from_string( $issue->due_date() );
53
}
53
}
54
54
55
- 

Return to bug 19280