if this prefence is switched on: the document returned in another library than homebranch, the system automaticly transfer the document to his homebranch (with notification for librarian in returns.tmpl) .
switch off : the document stay in the holdingbranch ...
correcting bugs :
- comment C4::acquisition (not using in request.pl).
- correcting date in request.pl
-add the new call of function getbranches in request.pl
# $messages->{'ResFound'} = $resrec;
$dotransfer = 1;
}
-
- if ($dotransfer and not $resfound) {
+
+ if ($dotransfer) {
dotransfer($iteminformation->{'itemnumber'}, $fbr, $tbr);
$messages->{'WasTransfered'} = 1;
}
#update holdingbranch in items .....
$dbh->do("UPDATE items set holdingbranch = $tbr WHERE items.itemnumber = $itm");
&itemseen($itm);
- &domarctransfer($dbh,$itm);
+ &domarctransfer($dbh,$itm);
return;
}
# now we check if there is a reservation with the validate of transfer if we have one, we can set it with the status 'W'
my $updateWaiting = SetWaitingStatus($iteminformation->{'itemnumber'});
}
-# if we don't have a transfer on run, we check if the document is not in his homebranch and there is not a reservation, we transfer this one to his home branch directly .
+# if we don't have a transfer on run, we check if the document is not in his homebranch and there is not a reservation, we transfer this one to his home branch directly if system preference Automaticreturn is turn on .
else {
- # new op dev
my $checkreserves = CheckReserves($iteminformation->{'itemnumber'});
- if (($iteminformation->{'homebranch'} ne $iteminformation->{'holdingbranch'}) and (not $checkreserves)){
- my $automatictransfer = dotransfer($iteminformation->{'itemnumber'},$iteminformation->{'holdingbranch'},$iteminformation->{'homebranch'});
- $messages->{'WasTransfered'} = 1;
+ if (($iteminformation->{'homebranch'} ne $iteminformation->{'holdingbranch'}) and (not $checkreserves) and (C4::Context->preference("AutomaticItemReturn") == 1)){
+ my $automatictransfer = dotransfer($iteminformation->{'itemnumber'},$iteminformation->{'holdingbranch'},$iteminformation->{'homebranch'});
+ $messages->{'WasTransfered'} = 1;
}
}
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
my $linecolor1 = '#ffffcc';
my $linecolor2 = 'white';
-my $branches = getbranches();
+my $branches = getbranches('IS');
my $printers = getprinters( \%env );
my $branch = C4::Context->userenv->{'branch'};
<input type="hidden" name="bn-<!-- TMPL_VAR Name="counter" -->" value="<!-- TMPL_VAR Name="bornum" -->" />
<!-- /TMPL_LOOP -->
<input type="hidden" name="barcode" value="0" />
- </form>
+ </form>
+ <!-- /TMPL_IF -->
-
+ <!-- TMPL_IF Name="transfer" -->
+ <h2>This item must return to his homebranch :</h2>
+ <p>The document <!-- TMPL_VAR NAME="itemtitle" --> (<!-- TMPL_VAR NAME="itemauthor" -->) Must be returned to his homebranch(<b><!-- TMPL_VAR NAME="itemhomebranch" --></b>)
+ <form method="post" action="returns.pl">
+ <!-- TMPL_LOOP Name="inputloop" -->
+ <input type="hidden" name="ri-<!-- TMPL_VAR NAME="counter" -->" value="<!-- TMPL_VAR NAME="barcode" -->">
+ <input type="hidden" name="dd-<!-- TMPL_VAR NAME="counter" -->" value="<!-- TMPL_VAR NAME="duedate" -->">
+ <input type="hidden" name="bn-<!-- TMPL_VAR NAME="counter" -->" value="<!-- TMPL_VAR NAME="bornum" -->">
+ <!-- /TMPL_LOOP -->
+ <input type="hidden" name="barcode" value="0">
+ <input type="submit" value="OK">
+ </form>
<!-- /TMPL_IF -->
+
<!-- TMPL_IF Name="diffbranch" -->
<h3>Item Consigned:</h3>
use Date::Manip;
use List::MoreUtils qw/uniq/;
use Data::Dumper;
+use Date::Calc qw/Today/;
use C4::Search;
use C4::Output;
use C4::Biblio;
use C4::Koha;
use C4::Circulation::Circ2;
-use C4::Acquisition;
+# FIXME Is there utility to use Acquisition.pm ????
+# use C4::Acquisition;
use C4::Date;
use C4::Members;
my $borrowerslist;
my $messageborrower;
-my $date = today();
+# my $date = today();
+my $date= sprintf('%04d-%02d-%02d', Today());
if ($findborrower) {
my ($count,$borrowers) = BornameSearch(\%env, $findborrower, 'cardnumber', 'web');
# existingreserves building
my @reserveloop;
-my $branches = getbranches();
+my $branches = getbranches('RE');
foreach my $res (sort {$a->{found} cmp $b->{found}} @$reserves){
my %reserve;
my @optionloop;
push @values, $branchcode;
$label_of{$branchcode} = $branches->{$branchcode}->{branchname};
}
-
my $CGIbranch = CGI::scrolling_list(
-name => 'pickup',
-values => \@values,
explanation => 'Allow no debt alert if the patron is issuing item that accumulate debt',
type => 'YesNo',
},
+ {
+ uniquefieldrequired => 'variable',
+ variable => 'AutomaticItemReturn',
+ value => '1',
+ forceupdate => { 'explanation' => 1,
+ 'type' => 1},
+ explanation => 'This Variable allow or not to return automaticly to his homebranch',
+ type => 'YesNo',
+ },
],
);
exit;
# $Log$
+# Revision 1.144 2006/06/08 15:36:31 alaurin
+# Add a new system preference 'AutomaticItemReturn' :
+#
+# if this prefence is switched on: the document returned in another library than homebranch, the system automaticly transfer the document to his homebranch (with notification for librarian in returns.tmpl) .
+#
+# switch off : the document stay in the holdingbranch ...
+#
+# correcting bugs :
+# - comment C4::acquisition (not using in request.pl).
+# - correcting date in request.pl
+# -add the new call of function getbranches in request.pl
+#
# Revision 1.143 2006/06/07 02:02:47 bob_lyon
# merging katipo changes...
#