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

(-)a/C4/Circulation.pm (-27 / +50 lines)
Lines 2-7 package C4::Circulation; Link Here
2
2
3
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
4
# copyright 2010 BibLibre
4
# copyright 2010 BibLibre
5
# Copyright 2011 Catalyst IT
5
#
6
#
6
# This file is part of Koha.
7
# This file is part of Koha.
7
#
8
#
Lines 569-576 sub itemissues { Link Here
569
570
570
=head2 CanBookBeIssued
571
=head2 CanBookBeIssued
571
572
572
  ( $issuingimpossible, $needsconfirmation ) =  CanBookBeIssued( $borrower, 
573
  ( $issuingimpossible, $needsconfirmation, $itemnumber ) =  
573
                                      $barcode, $duedatespec, $inprocess );
574
        CanBookBeIssued( $borrower, $barcode, $duedatespec, $inprocess, $itemnumber );
574
575
575
Check if a book can be issued.
576
Check if a book can be issued.
576
577
Lines 586-591 C<$issuingimpossible> and C<$needsconfirmation> are some hashref. Link Here
586
587
587
=item C<$inprocess>
588
=item C<$inprocess>
588
589
590
=item C<$itemnumber> is used to look up the record by item number if the barcode
591
doesn't match, based on the C<CircFallbackItemnumber> syspref. If C<$itemnumber>
592
is unset, then C<$barcode> will be tried as an item number instead.
593
589
=back
594
=back
590
595
591
Returns :
596
Returns :
Lines 658-680 sticky due date is invalid or due date in the past Link Here
658
663
659
if the borrower borrows to much things
664
if the borrower borrows to much things
660
665
666
C<$itemnumber> if the itemnumber was found.
667
661
=cut
668
=cut
662
669
663
sub CanBookBeIssued {
670
sub CanBookBeIssued {
664
    my ( $borrower, $barcode, $duedate, $inprocess ) = @_;
671
    my ( $borrower, $barcode, $duedate, $inprocess, $itemnumber ) = @_;
665
    my %needsconfirmation;    # filled with problems that needs confirmations
672
    my %needsconfirmation;    # filled with problems that needs confirmations
666
    my %issuingimpossible;    # filled with problems that causes the issue to be IMPOSSIBLE
673
    my %issuingimpossible;    # filled with problems that causes the issue to be IMPOSSIBLE
667
    my $item = GetItem(GetItemnumberFromBarcode( $barcode ));
674
    my $item = GetItem( GetItemnumberFromBarcode($barcode) );
668
    my $issue = GetItemIssue($item->{itemnumber});
675
warn Dumper($item);
669
	my $biblioitem = GetBiblioItemData($item->{biblioitemnumber});
676
    # If we should fall back to searching by item number...
670
	$item->{'itemtype'}=$item->{'itype'}; 
677
    my $fallback_itemnumber = C4::Context->preference('CircFallbackItemnumber');
671
    my $dbh             = C4::Context->dbh;
678
    warn "Fallback is set to: $fallback_itemnumber";
672
679
    if ( !defined( $item->{biblioitemnumber} )
680
        && $fallback_itemnumber)
681
    {
682
    	warn "Falling back to itemnumber $itemnumber // $barcode";
683
        $item = GetItem( $itemnumber // $barcode );
684
    }
673
    # MANDATORY CHECKS - unless item exists, nothing else matters
685
    # MANDATORY CHECKS - unless item exists, nothing else matters
674
    unless ( $item->{barcode} ) {
686
    unless ( defined($item->{biblioitemnumber}) ) {
687
    	warn "Oh no, nothing found.";
675
        $issuingimpossible{UNKNOWN_BARCODE} = 1;
688
        $issuingimpossible{UNKNOWN_BARCODE} = 1;
676
    }
689
    }
677
	return ( \%issuingimpossible, \%needsconfirmation ) if %issuingimpossible;
690
    return ( \%issuingimpossible, \%needsconfirmation, undef )
691
      if %issuingimpossible;
692
693
    my $issue      = GetItemIssue( $item->{itemnumber} );
694
    my $biblioitem = GetBiblioItemData( $item->{biblioitemnumber} );
695
    $item->{'itemtype'} = $item->{'itype'};
696
    my $dbh = C4::Context->dbh;
678
697
679
    #
698
    #
680
    # DUE DATE is OK ? -- should already have checked.
699
    # DUE DATE is OK ? -- should already have checked.
Lines 699-709 sub CanBookBeIssued { Link Here
699
    #
718
    #
700
    # BORROWER STATUS
719
    # BORROWER STATUS
701
    #
720
    #
702
    if ( $borrower->{'category_type'} eq 'X' && (  $item->{barcode}  )) { 
721
    if ( $borrower->{'category_type'} eq 'X'
703
    	# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1  .
722
        && ( defined( $item->{itemnumber} ) ) )
704
        &UpdateStats(C4::Context->userenv->{'branch'},'localuse','','',$item->{'itemnumber'},$item->{'itemtype'},$borrower->{'borrowernumber'});
723
    {
724
725
# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1  .
726
        &UpdateStats( C4::Context->userenv->{'branch'},
727
            'localuse', '', '', $item->{'itemnumber'}, $item->{'itemtype'},
728
            $borrower->{'borrowernumber'} );
705
        ModDateLastSeen( $item->{'itemnumber'} );
729
        ModDateLastSeen( $item->{'itemnumber'} );
706
        return( { STATS => 1 }, {});
730
        return ( { STATS => 1 }, {}, $item->{itemnumber} );
707
    }
731
    }
708
    if ( $borrower->{flags}->{GNA} ) {
732
    if ( $borrower->{flags}->{GNA} ) {
709
        $issuingimpossible{GNA} = 1;
733
        $issuingimpossible{GNA} = 1;
Lines 720-726 sub CanBookBeIssued { Link Here
720
        my @expirydate=  split /-/,$borrower->{'dateexpiry'};
744
        my @expirydate=  split /-/,$borrower->{'dateexpiry'};
721
        if($expirydate[0]==0 || $expirydate[1]==0|| $expirydate[2]==0 ||
745
        if($expirydate[0]==0 || $expirydate[1]==0|| $expirydate[2]==0 ||
722
            Date_to_Days(Today) > Date_to_Days( @expirydate )) {
746
            Date_to_Days(Today) > Date_to_Days( @expirydate )) {
723
            $issuingimpossible{EXPIRED} = 1;                                   
747
            $issuingimpossible{EXPIRED} = 1;
724
        }
748
        }
725
    }
749
    }
726
    #
750
    #
Lines 898-909 sub CanBookBeIssued { Link Here
898
            $needsconfirmation{'resreservedate'} = format_date($res->{'reservedate'});
922
            $needsconfirmation{'resreservedate'} = format_date($res->{'reservedate'});
899
        }
923
        }
900
    }
924
    }
901
	return ( \%issuingimpossible, \%needsconfirmation );
925
	return ( \%issuingimpossible, \%needsconfirmation, $item->{itemnumber} );
902
}
926
}
903
927
904
=head2 AddIssue
928
=head2 AddIssue
905
929
906
  &AddIssue($borrower, $barcode, [$datedue], [$cancelreserve], [$issuedate])
930
  &AddIssue($borrower, $itemnumber, [$datedue], [$cancelreserve], [$issuedate])
907
931
908
Issue a book. Does no check, they are done in CanBookBeIssued. If we reach this sub, it means the user confirmed if needed.
932
Issue a book. Does no check, they are done in CanBookBeIssued. If we reach this sub, it means the user confirmed if needed.
909
933
Lines 911-917 Issue a book. Does no check, they are done in CanBookBeIssued. If we reach this Link Here
911
935
912
=item C<$borrower> is a hash with borrower informations (from GetMember or GetMemberDetails).
936
=item C<$borrower> is a hash with borrower informations (from GetMember or GetMemberDetails).
913
937
914
=item C<$barcode> is the barcode of the item being issued.
938
=item C<$itemnumber> is the itemnumber of the item being issued.
915
939
916
=item C<$datedue> is a C4::Dates object for the max date of return, i.e. the date due (optional).
940
=item C<$datedue> is a C4::Dates object for the max date of return, i.e. the date due (optional).
917
Calculated if empty.
941
Calculated if empty.
Lines 923-929 Defaults to today. Unlike C<$datedue>, NOT a C4::Dates object, unfortunately. Link Here
923
947
924
AddIssue does the following things :
948
AddIssue does the following things :
925
949
926
  - step 01: check that there is a borrowernumber & a barcode provided
950
  - step 01: check that there is a borrowernumber & an itemnumber provided
927
  - check for RENEWAL (book issued & being issued to the same patron)
951
  - check for RENEWAL (book issued & being issued to the same patron)
928
      - renewal YES = Calculate Charge & renew
952
      - renewal YES = Calculate Charge & renew
929
      - renewal NO  =
953
      - renewal NO  =
Lines 940-965 AddIssue does the following things : Link Here
940
=cut
964
=cut
941
965
942
sub AddIssue {
966
sub AddIssue {
943
    my ( $borrower, $barcode, $datedue, $cancelreserve, $issuedate, $sipmode) = @_;
967
    my ( $borrower, $itemnumber, $datedue, $cancelreserve, $issuedate, $sipmode) = @_;
944
    my $dbh = C4::Context->dbh;
968
    my $dbh = C4::Context->dbh;
945
	my $barcodecheck=CheckValidBarcode($barcode);
946
    # $issuedate defaults to today.
969
    # $issuedate defaults to today.
947
    if ( ! defined $issuedate ) {
970
    if ( ! defined $issuedate ) {
948
        $issuedate = strftime( "%Y-%m-%d", localtime );
971
        $issuedate = strftime( "%Y-%m-%d", localtime );
949
        # TODO: for hourly circ, this will need to be a C4::Dates object
972
        # TODO: for hourly circ, this will need to be a C4::Dates object
950
        # and all calls to AddIssue including issuedate will need to pass a Dates object.
973
        # and all calls to AddIssue including issuedate will need to pass a Dates object.
951
    }
974
    }
952
	if ($borrower and $barcode and $barcodecheck ne '0'){
975
	if (defined($borrower) and defined($itemnumber)){
953
		# find which item we issue
976
		# find which item we issue
954
		my $item = GetItem('', $barcode) or return undef;	# if we don't get an Item, abort.
977
		my $item = GetItem($itemnumber) or return undef;	# if we don't get an Item, abort.
955
		my $branch = _GetCircControlBranch($item,$borrower);
978
		my $branch = _GetCircControlBranch($item,$borrower);
956
		
979
957
		# get actual issuing if there is one
980
		# get actual issuing if there is one
958
		my $actualissue = GetItemIssue( $item->{itemnumber});
981
		my $actualissue = GetItemIssue( $item->{itemnumber});
959
		
982
960
		# get biblioinformation for this item
983
		# get biblioinformation for this item
961
		my $biblio = GetBiblioFromItemNumber($item->{itemnumber});
984
		my $biblio = GetBiblioFromItemNumber($item->{itemnumber});
962
		
985
963
		#
986
		#
964
		# check if we just renew the issue.
987
		# check if we just renew the issue.
965
		#
988
		#
(-)a/C4/Dates.pm (-1 / +1 lines)
Lines 167-173 sub init ($;$$) { Link Here
167
    $self->{'dateformat'} = $dformat = ( scalar(@_) >= 2 ) ? $_[1] : _prefformat();
167
    $self->{'dateformat'} = $dformat = ( scalar(@_) >= 2 ) ? $_[1] : _prefformat();
168
    ( $format_map{$dformat} ) or croak "Invalid date format '$dformat' from " . ( ( scalar(@_) >= 2 ) ? 'argument' : 'system preferences' );
168
    ( $format_map{$dformat} ) or croak "Invalid date format '$dformat' from " . ( ( scalar(@_) >= 2 ) ? 'argument' : 'system preferences' );
169
    $self->{'dmy_arrayref'} = [ ( (@_) ? $self->dmy_map(shift) : localtime ) ];
169
    $self->{'dmy_arrayref'} = [ ( (@_) ? $self->dmy_map(shift) : localtime ) ];
170
    if ($debug > 1) { warn "(during init) \@\$self->{'dmy_arrayref'}: " . join( ' ', @{ $self->{'dmy_arrayref'} } ) . "\n"; }
170
    if ($debug && $debug > 1) { warn "(during init) \@\$self->{'dmy_arrayref'}: " . join( ' ', @{ $self->{'dmy_arrayref'} } ) . "\n"; }
171
    return $self;
171
    return $self;
172
}
172
}
173
173
(-)a/C4/SIP/ILS/Transaction/Checkout.pm (-2 / +2 lines)
Lines 113-122 sub do_checkout { Link Here
113
        # TODO: adjust representation in $self->item
113
        # TODO: adjust representation in $self->item
114
    }
114
    }
115
	# can issue
115
	# can issue
116
	$debug and warn "do_checkout: calling AddIssue(\$borrower,$barcode, undef, 0)\n"
116
	$debug and warn "do_checkout: calling AddIssue(\$borrower,$itemnumber, undef, 0)\n"
117
		# . "w/ \$borrower: " . Dumper($borrower)
117
		# . "w/ \$borrower: " . Dumper($borrower)
118
		. "w/ C4::Context->userenv: " . Dumper(C4::Context->userenv);
118
		. "w/ C4::Context->userenv: " . Dumper(C4::Context->userenv);
119
	my $c4due  = AddIssue($borrower, $barcode, undef, 0);
119
	my $c4due  = AddIssue($borrower, $itemnumber, undef, 0);
120
	my $due  = $c4due->output('iso') || undef;
120
	my $due  = $c4due->output('iso') || undef;
121
	$debug and warn "Item due: $due";
121
	$debug and warn "Item due: $due";
122
	$self->{'due'} = $due;
122
	$self->{'due'} = $due;
(-)a/C4/SIP/ILS/Transaction/Renew.pm (-1 / +1 lines)
Lines 37-43 sub do_renew_for ($$) { Link Here
37
	my $borrower = shift;
37
	my $borrower = shift;
38
	my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
38
	my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
39
	if ($renewokay){
39
	if ($renewokay){
40
		my $datedue = AddIssue( $borrower, $self->{item}->id, undef, 0 );
40
		my $datedue = AddIssue( $borrower, $self->{item}->{itemnumber}, undef, 0 );
41
		$self->{due} = $datedue;
41
		$self->{due} = $datedue;
42
		$self->renewal_ok(1);
42
		$self->renewal_ok(1);
43
	} else {
43
	} else {
(-)a/circ/circulation.pl (-15 / +23 lines)
Lines 4-9 Link Here
4
4
5
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
6
# copyright 2010 BibLibre
6
# copyright 2010 BibLibre
7
# Copyright 2011 Catalyst IT
7
#
8
#
8
# This file is part of Koha.
9
# This file is part of Koha.
9
#
10
#
Lines 116-125 if (C4::Context->preference("UseTablesortForCirc")) { Link Here
116
    $template->param(UseTablesortForCirc => 1);
117
    $template->param(UseTablesortForCirc => 1);
117
}
118
}
118
119
119
my $barcode        = $query->param('barcode') || '';
120
my $orig_barcode        = $query->param('barcode') || '';
120
$barcode =~  s/^\s*|\s*$//g; # remove leading/trailing whitespace
121
$orig_barcode =~  s/^\s*|\s*$//g; # remove leading/trailing whitespace
121
122
my $barcode = $orig_barcode;
122
$barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
123
$barcode = barcodedecode($orig_barcode) if( $orig_barcode && C4::Context->preference('itemBarcodeInputFilter'));
123
my $stickyduedate  = $query->param('stickyduedate') || $session->param('stickyduedate');
124
my $stickyduedate  = $query->param('stickyduedate') || $session->param('stickyduedate');
124
my $duedatespec    = $query->param('duedatespec')   || $session->param('stickyduedate');
125
my $duedatespec    = $query->param('duedatespec')   || $session->param('stickyduedate');
125
my $issueconfirmed = $query->param('issueconfirmed');
126
my $issueconfirmed = $query->param('issueconfirmed');
Lines 278-307 if ($borrowernumber) { Link Here
278
#
279
#
279
#
280
#
280
if ($barcode) {
281
if ($barcode) {
282
281
    # always check for blockers on issuing
283
    # always check for blockers on issuing
282
    my ( $error, $question ) =
284
    my ( $error, $question, $itemnumber ) =
283
    CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
285
      CanBookBeIssued( $borrower, $barcode, $datedue, $inprocess,
286
        $orig_barcode );
284
    my $blocker = $invalidduedate ? 1 : 0;
287
    my $blocker = $invalidduedate ? 1 : 0;
285
288
286
    delete $question->{'DEBT'} if ($debt_confirmed);
289
    delete $question->{'DEBT'} if ($debt_confirmed);
287
    foreach my $impossible ( keys %$error ) {
290
    foreach my $impossible ( keys %$error ) {
288
        $template->param(
291
        $template->param(
289
            $impossible => $$error{$impossible},
292
            $impossible => $error->{$impossible},
290
            IMPOSSIBLE  => 1
293
            IMPOSSIBLE  => 1,
291
        );
294
        );
292
        $blocker = 1;
295
        $blocker = 1;
293
    }
296
    }
294
    if( !$blocker ){
297
    if( !$blocker ){
295
        my $confirm_required = 0;
298
        my $confirm_required = 0;
296
        unless($issueconfirmed){
299
        unless ($issueconfirmed) {
300
warn "Issue confirmed! I have $itemnumber and $barcode";
297
            #  Get the item title for more information
301
            #  Get the item title for more information
298
            my $getmessageiteminfo  = GetBiblioFromItemNumber(undef,$barcode);
302
            my $getmessageiteminfo =
299
            $template->param( itemhomebranch => $getmessageiteminfo->{'homebranch'} );
303
              GetBiblioFromItemNumber( $itemnumber, $barcode );
300
304
            $template->param(
305
                itemhomebranch => $getmessageiteminfo->{'homebranch'} );
306
            use Data::Dumper;
307
            warn Dumper($getmessageiteminfo);
301
            # pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed.
308
            # pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed.
302
            foreach my $needsconfirmation ( keys %$question ) {
309
            foreach my $needsconfirmation ( keys %$question ) {
303
                $template->param(
310
                $template->param(
304
                    $needsconfirmation => $$question{$needsconfirmation},
311
                    $needsconfirmation => $question->{$needsconfirmation},
305
                    getTitleMessageIteminfo => $getmessageiteminfo->{'title'},
312
                    getTitleMessageIteminfo => $getmessageiteminfo->{'title'},
306
                    getBarcodeMessageIteminfo => $getmessageiteminfo->{'barcode'},
313
                    getBarcodeMessageIteminfo => $getmessageiteminfo->{'barcode'},
307
                    NEEDSCONFIRMATION  => 1
314
                    NEEDSCONFIRMATION  => 1
Lines 310-320 if ($barcode) { Link Here
310
            }
317
            }
311
        }
318
        }
312
        unless($confirm_required) {
319
        unless($confirm_required) {
313
            AddIssue( $borrower, $barcode, $datedue, $cancelreserve );
320
            AddIssue( $borrower, $itemnumber, $datedue, $cancelreserve );
314
            $inprocess = 1;
321
            $inprocess = 1;
315
        }
322
        }
316
    }
323
    }
317
    
324
318
    # FIXME If the issue is confirmed, we launch another time GetMemberIssuesAndFines, now display the issue count after issue 
325
    # FIXME If the issue is confirmed, we launch another time GetMemberIssuesAndFines, now display the issue count after issue 
319
    my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
326
    my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
320
    $template->param( issuecount   => $issue );
327
    $template->param( issuecount   => $issue );
Lines 656-661 $template->param( Link Here
656
    lib_messages_loop => $lib_messages_loop,
663
    lib_messages_loop => $lib_messages_loop,
657
    bor_messages_loop => $bor_messages_loop,
664
    bor_messages_loop => $bor_messages_loop,
658
    all_messages_del  => C4::Context->preference('AllowAllMessageDeletion'),
665
    all_messages_del  => C4::Context->preference('AllowAllMessageDeletion'),
666
    can_be_itemnumber => C4::Context->preference('CircFallbackItemnumber'),
659
    findborrower      => $findborrower,
667
    findborrower      => $findborrower,
660
    borrower          => $borrower,
668
    borrower          => $borrower,
661
    borrowernumber    => $borrowernumber,
669
    borrowernumber    => $borrowernumber,
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 328-331 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
328
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL);
328
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL);
329
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo');
329
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo');
330
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo');
330
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo');
331
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CircFallbackItemnumber',0,'If ON then checking out will look for a matching item number if a barcode is not found',NULL,'YesNo');
331
332
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 91-96 Circulation: Link Here
91
                  yes: Record
91
                  yes: Record
92
                  no: "Don't record"
92
                  no: "Don't record"
93
            - local use when an unissued item is checked in.
93
            - local use when an unissued item is checked in.
94
        -
95
            - pref: CircFallbackItemnumber
96
              choices:
97
                  yes: Do
98
                  no: "Don't"
99
            - fall back to search by itemnumber if a matching barcode isn't found.
94
    Checkout Policy:
100
    Checkout Policy:
95
        -
101
        -
96
            - pref: AllowNotForLoanOverride
102
            - pref: AllowNotForLoanOverride
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-2 / +2 lines)
Lines 343-349 function refocus(calendar) { Link Here
343
        [% END %]
343
        [% END %]
344
344
345
        [% IF ( UNKNOWN_BARCODE ) %]
345
        [% IF ( UNKNOWN_BARCODE ) %]
346
            <li>The barcode was not found [% barcode %]</li>
346
            <li>The barcode [% IF (can_be_itemnumber) %]or item number [% END %]was not found: [% barcode %]</li>
347
	    [% IF ( fast_cataloging ) %]
347
	    [% IF ( fast_cataloging ) %]
348
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
348
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
349
                    <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&barcode=[% barcode %]&borrowernumber=[% borrowernumber %]&branch=[% branch %]&duedatespec=[% duedatespec %]&stickyduedate=[% stickyduedate %]">Fast cataloging</a>
349
                    <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&barcode=[% barcode %]&borrowernumber=[% borrowernumber %]&branch=[% branch %]&duedatespec=[% duedatespec %]&stickyduedate=[% stickyduedate %]">Fast cataloging</a>
Lines 458-464 No patron matched <span class="ex">[% message %]</span> Link Here
458
458
459
    <label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
459
    <label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
460
460
461
	<div class="hint">Enter item barcode:</div>
461
	<div class="hint">Enter item [% IF (can_be_itemnumber) %]number or [% END %]barcode:</div>
462
462
463
    [% IF ( NEEDSCONFIRMATION ) %]
463
    [% IF ( NEEDSCONFIRMATION ) %]
464
	    <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" />
464
	    <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" />
(-)a/offline_circ/process_koc.pl (-2 / +2 lines)
Lines 281-287 sub kocIssueItem { Link Here
281
            my ( $c_y, $c_m, $c_d ) = split( /-/, $circ->{'date'} );
281
            my ( $c_y, $c_m, $c_d ) = split( /-/, $circ->{'date'} );
282
282
283
            if ( Date_to_Days( $i_y, $i_m, $i_d ) < Date_to_Days( $c_y, $c_m, $c_d ) ) { ## Current issue to a different persion is older than this issue, return and issue.
283
            if ( Date_to_Days( $i_y, $i_m, $i_d ) < Date_to_Days( $c_y, $c_m, $c_d ) ) { ## Current issue to a different persion is older than this issue, return and issue.
284
                C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, undef, undef, $circ->{'date'} ) unless ( DEBUG );
284
                C4::Circulation::AddIssue( $borrower, $item->{itemnumber}, undef, undef, $circ->{'date'} ) unless ( DEBUG );
285
                push @output, {
285
                push @output, {
286
                    issue => 1,
286
                    issue => 1,
287
                    title => $item->{ 'title' },
287
                    title => $item->{ 'title' },
Lines 301-307 sub kocIssueItem { Link Here
301
            }
301
            }
302
        }
302
        }
303
    } else { ## Item is not checked out to anyone at the moment, go ahead and issue it
303
    } else { ## Item is not checked out to anyone at the moment, go ahead and issue it
304
        C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, undef, undef, $circ->{'date'} ) unless ( DEBUG );
304
        C4::Circulation::AddIssue( $borrower, $item->{itemnumber}, undef, undef, $circ->{'date'} ) unless ( DEBUG );
305
        push @output, {
305
        push @output, {
306
            issue => 1,
306
            issue => 1,
307
            title => $item->{ 'title' },
307
            title => $item->{ 'title' },
(-)a/opac/sco/sco-main.pl (-1 / +1 lines)
Lines 186-192 elsif ( $op eq "checkout" ) { Link Here
186
    } else {
186
    } else {
187
        if ( $confirmed || $issuenoconfirm ) {    # we'll want to call getpatroninfo again to get updated issues.
187
        if ( $confirmed || $issuenoconfirm ) {    # we'll want to call getpatroninfo again to get updated issues.
188
            # warn "issuing book?";
188
            # warn "issuing book?";
189
            AddIssue( $borrower, $barcode );
189
            AddIssue( $borrower, $item->{itemnumber} );
190
            # ($borrower, $flags) = getpatroninformation(undef,undef, $patronid);
190
            # ($borrower, $flags) = getpatroninformation(undef,undef, $patronid);
191
            # $template->param(
191
            # $template->param(
192
            #   patronid => $patronid,
192
            #   patronid => $patronid,
(-)a/t/db_dependent/lib/KohaTest/Circulation.pm (-1 / +2 lines)
Lines 97-102 sub checkout_first_item { Link Here
97
        $barcode = $self->get_barcode_from_itemnumber( $self->{'items'}[0]{'itemnumber'} );
97
        $barcode = $self->get_barcode_from_itemnumber( $self->{'items'}[0]{'itemnumber'} );
98
    }
98
    }
99
99
100
    my $itemnumber = $self->{'items'}[0]{'itemnumber'};
100
    # get issuedate from parameters. Default to undef, which will be interpreted as today
101
    # get issuedate from parameters. Default to undef, which will be interpreted as today
101
    my $issuedate = $params->{'issuedate'};
102
    my $issuedate = $params->{'issuedate'};
102
103
Lines 104-110 sub checkout_first_item { Link Here
104
105
105
    my $datedue = C4::Circulation::AddIssue(
106
    my $datedue = C4::Circulation::AddIssue(
106
        $borrower,    # borrower
107
        $borrower,    # borrower
107
        $barcode,     # barcode
108
        $itemnumber,     # itemnumber
108
        undef,        # datedue
109
        undef,        # datedue
109
        undef,        # cancelreserve
110
        undef,        # cancelreserve
110
        $issuedate    # issuedate
111
        $issuedate    # issuedate
(-)a/t/db_dependent/lib/KohaTest/Circulation/AddIssue.pm (-2 / +2 lines)
Lines 49-55 sub basic_usage : Test( 13 ) { Link Here
49
    my $dbh = C4::Context->dbh;
49
    my $dbh = C4::Context->dbh;
50
    $dbh->do("UPDATE systempreferences SET value = 1 WHERE variable = 'IssuingInProcess'");
50
    $dbh->do("UPDATE systempreferences SET value = 1 WHERE variable = 'IssuingInProcess'");
51
    C4::Context->clear_syspref_cache(); # FIXME not needed after a syspref mutator is written
51
    C4::Context->clear_syspref_cache(); # FIXME not needed after a syspref mutator is written
52
    ( $issuingimpossible, $needsconfirmation ) = C4::Circulation::CanBookBeIssued( $borrower, $barcode );
52
    ( $issuingimpossible, $needsconfirmation, $itemnumber ) = C4::Circulation::CanBookBeIssued( $borrower, $barcode );
53
    is( scalar keys %$issuingimpossible, 0, 'the item CanBookBeIssued with IssuingInProcess ON (bug 2758)' )
53
    is( scalar keys %$issuingimpossible, 0, 'the item CanBookBeIssued with IssuingInProcess ON (bug 2758)' )
54
      or diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
54
      or diag( Data::Dumper->Dump( [ $issuingimpossible, $needsconfirmation ], [ qw( issuingimpossible needsconfirmation ) ] ) );
55
    is( scalar keys %$needsconfirmation, 0, 
55
    is( scalar keys %$needsconfirmation, 0, 
Lines 58-64 sub basic_usage : Test( 13 ) { Link Here
58
    $dbh->do("UPDATE systempreferences SET value = ? WHERE variable = 'IssuingInProcess'", {}, $orig_issuing_in_process);
58
    $dbh->do("UPDATE systempreferences SET value = ? WHERE variable = 'IssuingInProcess'", {}, $orig_issuing_in_process);
59
    C4::Context->clear_syspref_cache(); # FIXME not needed after a syspref mutator is written
59
    C4::Context->clear_syspref_cache(); # FIXME not needed after a syspref mutator is written
60
60
61
    my $datedue = C4::Circulation::AddIssue( $borrower, $barcode );
61
    my $datedue = C4::Circulation::AddIssue( $borrower, $itemnumber );
62
    ok( $datedue, "the item has been issued and it is due: $datedue" );
62
    ok( $datedue, "the item has been issued and it is due: $datedue" );
63
    
63
    
64
    my $after_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
64
    my $after_issues = C4::Circulation::GetItemIssue( $self->{'items'}[0]{'itemnumber'} );
(-)a/t/db_dependent/lib/KohaTest/Overdues/GetOverdues.pm (-1 / +1 lines)
Lines 52-58 sub startup_60_create_overdue_item : Test( startup => 17 ) { Link Here
52
    is( keys %$issuingimpossible, 0, 'issuing is not impossible' );
52
    is( keys %$issuingimpossible, 0, 'issuing is not impossible' );
53
    is( keys %$needsconfirmation, 0, 'issuing needs no confirmation' );
53
    is( keys %$needsconfirmation, 0, 'issuing needs no confirmation' );
54
54
55
    C4::Circulation::AddIssue( $borrower, $item->{'barcode'}, $duedate );
55
    C4::Circulation::AddIssue( $borrower, $item->{'itemnumber'}, $duedate );
56
}
56
}
57
57
58
sub basic_usage : Test( 2 ) {
58
sub basic_usage : Test( 2 ) {
(-)a/t/db_dependent/lib/KohaTest/Scripts/longoverdue.pm (-2 / +1 lines)
Lines 68-74 sub set_overdue_item_lost : Test( 13 ) { Link Here
68
    is( keys %$issuingimpossible, 0, 'issuing is not impossible' );
68
    is( keys %$issuingimpossible, 0, 'issuing is not impossible' );
69
    is( keys %$needsconfirmation, 0, 'issuing needs no confirmation' );
69
    is( keys %$needsconfirmation, 0, 'issuing needs no confirmation' );
70
70
71
    my $issue_due_date = C4::Circulation::AddIssue( $borrower, $item->{'barcode'}, $duedate );
71
    my $issue_due_date = C4::Circulation::AddIssue( $borrower, $item->{'itemnumber'}, $duedate );
72
    ok( $issue_due_date, 'due date' );
72
    ok( $issue_due_date, 'due date' );
73
    is( $issue_due_date, $duedate, 'AddIssue returned the same date we passed to it' );
73
    is( $issue_due_date, $duedate, 'AddIssue returned the same date we passed to it' );
74
    
74
    
75
- 

Return to bug 7362