Darrell Ulm --- .../prog/en/modules/offline_circ/process_koc.tmpl | 1 + offline_circ/process_koc.pl | 35 ++++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tmpl index d4d2d57..7992e71 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tmpl @@ -55,6 +55,7 @@ function CheckForm(f) { <!-- /TMPL_IF --> <!-- TMPL_IF NAME="ERROR_no_borrower_from_item" --><p>Warning: Unable to determine patron from item barcode (<!-- TMPL_VAR NAME="badbarcode" -->). Cannot check in.</p><!-- /TMPL_IF --> <!-- TMPL_IF NAME="issue" --><p>Checked out <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a> (<!-- TMPL_VAR NAME="barcode" -->) to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></a> (<!-- TMPL_VAR NAME="cardnumber" -->): <!-- TMPL_VAR NAME="datetime" --></p><!-- /TMPL_IF --> + <!-- TMPL_IF NAME="noissue" --><p>Warning: No Check-out, cannot determine patron from borrower barcode <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a> (<!-- TMPL_VAR NAME="barcode" -->) to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></a> (<!-- TMPL_VAR NAME="cardnumber" -->): <!-- TMPL_VAR NAME="datetime" --></p><!-- /TMPL_IF --> <!-- TMPL_IF NAME="renew" --><p>Renewed <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a> (<!-- TMPL_VAR NAME="barcode" -->) for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></a> (<!-- TMPL_VAR NAME="cardnumber" -->): <!-- TMPL_VAR NAME="datetime" --></p><!-- /TMPL_IF --> <!-- TMPL_IF NAME="return" --><p>Checked in <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a> (<!-- TMPL_VAR NAME="barcode" -->) from <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></a> (<!-- TMPL_VAR NAME="cardnumber" -->): <!-- TMPL_VAR NAME="datetime" --></p><!-- /TMPL_IF --> <!-- TMPL_IF NAME="payment" --><p>Accepted payment (<!-- TMPL_VAR NAME="amount" -->) from <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></a> (<!-- TMPL_VAR NAME="cardnumber" -->): <!-- TMPL_VAR NAME="datetime" --></p><!-- /TMPL_IF --> diff --git a/offline_circ/process_koc.pl b/offline_circ/process_koc.pl index 87ae5c1..73eca6f 100755 --- a/offline_circ/process_koc.pl +++ b/offline_circ/process_koc.pl @@ -240,6 +240,7 @@ sub kocIssueItem { $circ->{ 'barcode' } = barcodedecode($circ->{'barcode'}) if( $circ->{'barcode'} && C4::Context->preference('itemBarcodeInputFilter')); my $branchcode = C4::Context->userenv->{branch}; my $borrower = GetMember( $circ->{ 'cardnumber' }, 'cardnumber' ); + my $item = GetBiblioFromItemNumber( undef, $circ->{ 'barcode' } ); my $issue = GetItemIssue( $item->{'itemnumber'} ); @@ -248,7 +249,13 @@ sub kocIssueItem { my ( $year, $month, $day ) = split( /-/, $circ->{'date'} ); ( $year, $month, $day ) = Add_Delta_Days( $year, $month, $day, $issuelength ); my $date_due = sprintf("%04d-%02d-%02d", $year, $month, $day); + +my $noitem = ""; +if ($item->{'biblionumber'} eq '' || $item->{'biblionumber'} eq 0) { + $noitem = "Item Barcode ( ". $circ->{'barcode'} ." ) Not Found"; +} +if ($borrower->{'borrowernumber'} ne ''&& $borrower->{'borrowernumber'} ne 0) { ## Only do something if borrower is not NULL (must exist!) if ( $issue->{ 'date_due' } ) { ## Item is currently checked out to another person. #warn "Item Currently Issued."; my $issue = GetOpenIssue( $item->{'itemnumber'} ); @@ -268,7 +275,7 @@ sub kocIssueItem { push( @output, { renew => 1, title => $item->{ 'title' }, biblionumber => $item->{'biblionumber'}, - barcode => $item->{ 'barcode' }, + barcode => $item->{ 'barcode' } . $noitem, firstname => $borrower->{ 'firstname' }, surname => $borrower->{ 'surname' }, borrowernumber => $borrower->{'borrowernumber'}, @@ -289,7 +296,7 @@ sub kocIssueItem { push( @output, { issue => 1, title => $item->{ 'title' }, biblionumber => $item->{'biblionumber'}, - barcode => $item->{ 'barcode' }, + barcode => $item->{ 'barcode' } . $noitem, firstname => $borrower->{ 'firstname' }, surname => $borrower->{ 'surname' }, borrowernumber => $borrower->{'borrowernumber'}, @@ -310,7 +317,7 @@ sub kocIssueItem { push( @output, { issue => 1, title => $item->{ 'title' }, biblionumber => $item->{'biblionumber'}, - barcode => $item->{ 'barcode' }, + barcode => $item->{ 'barcode' } . $noitem, firstname => $borrower->{ 'firstname' }, surname => $borrower->{ 'surname' }, borrowernumber => $borrower->{'borrowernumber'}, @@ -318,6 +325,24 @@ sub kocIssueItem { datetime =>$circ->{ 'datetime' } } ); } + } + else + { ## borrower does not exit, do nothing! +#warn "Borrower does not exist, doing nothing."; + push( @output, { noissue => 1, + title => $item->{ 'title' }, + biblionumber => $item->{'biblionumber'}, + #barcode => $item->{ 'barcode' }, + barcode => "Item-Barcode: " . $circ->{'barcode'}, + firstname => $borrower->{ 'firstname' }, + surname => $borrower->{ 'surname' }, + #borrowernumber => $borrower->{'borrowernumber'}, + borrowernumber => $circ->{ 'cardnumber' }, + #cardnumber => $borrower->{'cardnumber'}, + cardnumber => "Bad-Patron-Barcode: " . $circ->{ 'cardnumber' }, + datetime =>$circ->{ 'datetime' } + } ); + } } sub kocReturnItem { @@ -347,9 +372,7 @@ sub kocReturnItem { push( @output, { ERROR_no_borrower_from_item => 1, badbarcode => $circ->{'barcode'} } ); - } - } sub kocMakePayment { @@ -361,7 +384,7 @@ sub kocMakePayment { firstname => $borrower->{'firstname'}, surname => $borrower->{'surname'}, cardnumber => $circ->{'cardnumber'}, - borrower => $borrower->{'borrowernumber'} + borrower => $borrower->{'borrowernumber'}, } ); } -- 1.5.6.5 _______________________________________________ Koha-patches mailing list Koha-patches@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-patches