Bug 5549 : Sip scripts should handle dt due dates

This commit is contained in:
Colin Campbell 2011-06-21 12:11:05 +01:00 committed by Chris Cormack
parent 3b5ac7543a
commit 31a3a7ed93
4 changed files with 11 additions and 10 deletions

View file

@ -17,7 +17,6 @@ use Data::Dumper;
use C4::Debug;
use C4::Context;
# use C4::Dates;
use C4::Koha;
use C4::Members;
use C4::Reserves;

View file

@ -122,11 +122,14 @@ sub do_checkout {
$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;
}

View file

@ -37,8 +37,7 @@ sub do_renew_for ($$) {
my $borrower = shift;
my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
if ($renewokay){
my $datedue = AddIssue( $borrower, $self->{item}->id, undef, 0 );
$self->{due} = $datedue;
$self->{due} = AddIssue( $borrower, $self->{item}->id, undef, 0 );
$self->renewal_ok(1);
} else {
$self->screen_msg(($self->screen_msg || '') . " " . $renewerror);

View file

@ -53,8 +53,8 @@ sub do_renew_all {
$self->{item} = $item;
$self->do_renew_for($borrower);
if ($self->ok) {
$item->{due_date} = $self->{due};
push @{$self->{renewed} }, $item_id;
$item->{due_date} = $self->{due}->clone();
push @{$self->renewed }, $item_id;
} else {
push @{$self->{unrenewed}}, $item_id;
}