use vars qw($VERSION @ISA $debug);
BEGIN {
- $VERSION = 1.03;
+ $VERSION = 3.07.00.049;
@ISA = qw(ILS::Transaction);
}
sub new {
my $class = shift;;
my $self = $class->SUPER::new();
- my $element;
- foreach $element (keys %fields) {
+ foreach my $element (keys %fields) {
$self->{_permitted}->{$element} = $fields{$element};
}
@{$self}{keys %fields} = values %fields;
$debug and warn "do_checkout: patron (" . $patron_barcode . ")";
my $borrower = $self->{patron}->getmemberdetails_object();
$debug and warn "do_checkout borrower: . " . Dumper $borrower;
- my ($issuingimpossible,$needsconfirmation) = CanBookBeIssued( $borrower, $barcode );
+ my ($issuingimpossible,$needsconfirmation) = CanBookBeIssued(
+ $borrower,
+ $barcode,
+ undef,
+ 0,
+ C4::Context->preference("AllowItemsOnHoldCheckout")
+ );
my $noerror=1;
if (scalar keys %$issuingimpossible) {
foreach (keys %$issuingimpossible) {
$debug and warn "do_checkout: calling AddIssue(\$borrower,$barcode, undef, 0)\n"
# . "w/ \$borrower: " . Dumper($borrower)
. "w/ C4::Context->userenv: " . Dumper(C4::Context->userenv);
- my $c4due = AddIssue($borrower, $barcode, undef, 0);
- my $due = $c4due->output('iso') || undef;
- $debug and warn "Item due: $due";
- $self->{'due'} = $due;
- $self->{item}->due_date($due);
+ my $due_dt = AddIssue($borrower, $barcode, undef, 0);
+ if ($due_dt) {
+ $self->{due} = $due_dt->clone();
+ } else {
+ $self->{due} = undef;
+ }
+
+ #$self->{item}->due_date($due);
$self->ok(1);
return $self;
}