my %branches;
my $dbh = C4::Context->dbh;
my $sth;
- my $query="SELECT * from branches";
+ my $query="SELECT * FROM branches";
if ($onlymine && C4::Context->userenv && C4::Context->userenv->{branch}){
$query .= " WHERE branchcode =".$dbh->quote(C4::Context->userenv->{branch});
}
- $query.=" order by branchname";
+ $query.=" ORDER BY branchname";
$sth = $dbh->prepare($query);
$sth->execute;
while ( my $branch = $sth->fetchrow_hashref ) {
my $nsth =
$dbh->prepare(
- "select categorycode from branchrelations where branchcode = ?");
+ "SELECT category_id FROM branchrelations WHERE branchcode = ?");
$nsth->execute( $branch->{'branchcode'} );
while ( my ($cat) = $nsth->fetchrow_array ) {
if ( $actualissue->{borrowernumber} eq $borrower->{'borrowernumber'} ) {
AddRenewal(
$borrower->{'borrowernumber'},
- $item->{'itemnumber'}
+ $item->{'itemnumber'},
+ C4::Context->userenv->{'branch'},
+ $date
);
}
#
my ($datedue,$invalidduedate);
-if($duedatespec) {
- $datedue= C4::Dates->new($duedatespec );
+if ($duedatespec) {
+ $datedue = C4::Dates->new($duedatespec,'iso' );
$invalidduedate=1 unless $datedue;
}
+
#if (defined($year)) {
# $duedatespec = "$year-$month-$day";
#} else {
# get the borrower information.....
my $borrower;
my @lines;
-warn $borrowernumber;
if ($borrowernumber) {
$borrower = GetMemberDetails( $borrowernumber, 0 );
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
$noquestion = 0;
}
$template->param(
- itemhomebranch => $getmessageiteminfo->{'homebranch'} ,
- day => $day,
- month => $month,
- year => $year
+ itemhomebranch => $getmessageiteminfo->{'homebranch'} ,
+ duedatespec => $duedatespec,
);
if ( $noerror && ( $noquestion || $issueconfirmed ) ) {
AddIssue( $borrower, $barcode, $datedue );
<input type="hidden" name="barcode" value="<!-- TMPL_VAR NAME="barcode" -->" />
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
<input type="hidden" name="issueconfirmed" value="1" />
+ <input type="hidden" name="duedatespec" value="<!-- TMPL_VAR NAME="duedatespec" -->" />
<input type="hidden" name="day" value="<!-- TMPL_VAR name="day" -->" />
<input type="hidden" name="month" value="<!-- TMPL_VAR name="month" -->" />
<input type="hidden" name="year" value="<!-- TMPL_VAR name="year" -->" />