View | Details | Raw Unified | Return to bug 5632
Collapse All | Expand All

(-)a/C4/SIP/ILS/Patron.pm (-15 / +16 lines)
Lines 38-58 sub new { Link Here
38
	my ($class, $patron_id) = @_;
38
	my ($class, $patron_id) = @_;
39
    my $type = ref($class) || $class;
39
    my $type = ref($class) || $class;
40
    my $self;
40
    my $self;
41
	$kp = GetMember(cardnumber=>$patron_id);
41
    $kp = GetMember( cardnumber => $patron_id );
42
	$debug and warn "new Patron (GetMember): " . Dumper($kp);
42
    $debug and warn "new Patron (GetMember): " . Dumper($kp);
43
    unless (defined $kp) {
43
    unless ( defined $kp ) {
44
		syslog("LOG_DEBUG", "new ILS::Patron(%s): no such patron", $patron_id);
44
        syslog( "LOG_DEBUG", "new ILS::Patron(%s): no such patron", $patron_id );
45
		return undef;
45
        return undef;
46
	}
46
    }
47
	$kp = GetMemberDetails(undef,$patron_id);
47
    $kp = GetMemberDetails( undef, $patron_id );
48
	$debug and warn "new Patron (GetMemberDetails): " . Dumper($kp);
48
    $debug and warn "new Patron (GetMemberDetails): " . Dumper($kp);
49
	my $pw        = $kp->{password};  ### FIXME - md5hash -- deal with . 
49
    my $pw       = $kp->{password};    ### FIXME - md5hash -- deal with .
50
	my $flags     = $kp->{flags};     # or warn "Warning: No flags from patron object for '$patron_id'"; 
50
    my $flags    = $kp->{flags};       # or warn "Warning: No flags from patron object for '$patron_id'";
51
	my $debarred  = $kp->{debarred};  # 1 if ($kp->{flags}->{DBARRED}->{noissues});
51
	my $debarred  = defined($kp->{flags}->{DEBARRED});  # 1 if ($kp->{flags}->{DBARRED}->{noissues});
52
	$debug and warn sprintf("Debarred = %s : ", ($debarred||'undef')) . Dumper(%{$kp->{flags}});
52
    $debug and warn sprintf( "Debarred = %s : ", ( $debarred || 'undef' ) ) . Dumper( %{ $kp->{flags} } );
53
    my ($day, $month, $year) = (localtime)[3,4,5];
53
    my ( $day, $month, $year ) = (localtime)[ 3, 4, 5 ];
54
    my $today    = sprintf '%04d-%02d-%02d', $year+1900, $month+1, $day;
54
    my $today = sprintf '%04d-%02d-%02d', $year + 1900, $month + 1, $day;
55
    my $expired  = ($today gt $kp->{dateexpiry}) ? 1 : 0;
55
    my $expired = ( $today gt $kp->{dateexpiry} ) ? 1 : 0;
56
56
    if ($expired) {
57
    if ($expired) {
57
        if ($kp->{opacnote} ) {
58
        if ($kp->{opacnote} ) {
58
            $kp->{opacnote} .= q{ };
59
            $kp->{opacnote} .= q{ };
(-)a/C4/SIP/ILS/Transaction/Checkout.pm (-1 / +2 lines)
Lines 60-65 sub do_checkout { Link Here
60
	$debug and warn "do_checkout borrower: . " . Dumper $borrower;
60
	$debug and warn "do_checkout borrower: . " . Dumper $borrower;
61
	my ($issuingimpossible,$needsconfirmation) = CanBookBeIssued( $borrower, $barcode );
61
	my ($issuingimpossible,$needsconfirmation) = CanBookBeIssued( $borrower, $barcode );
62
	my $noerror=1;
62
	my $noerror=1;
63
	$debug and warn "do_checkout IssuingImpossible: . " , Dumper($issuingimpossible),"\n",Dumper($needsconfirmation);
63
    if (scalar keys %$issuingimpossible) {
64
    if (scalar keys %$issuingimpossible) {
64
        foreach (keys %$issuingimpossible) {
65
        foreach (keys %$issuingimpossible) {
65
            # do something here so we pass these errors
66
            # do something here so we pass these errors
Lines 116-122 sub do_checkout { Link Here
116
	$debug and warn "do_checkout: calling AddIssue(\$borrower,$barcode, undef, 0)\n"
117
	$debug and warn "do_checkout: calling AddIssue(\$borrower,$barcode, undef, 0)\n"
117
		# . "w/ \$borrower: " . Dumper($borrower)
118
		# . "w/ \$borrower: " . Dumper($borrower)
118
		. "w/ C4::Context->userenv: " . Dumper(C4::Context->userenv);
119
		. "w/ C4::Context->userenv: " . Dumper(C4::Context->userenv);
119
	my $c4due  = AddIssue($borrower, $barcode, undef, 0);
120
	my $c4due  = AddIssue($borrower, $barcode, undef, 0,undef,1);
120
	my $due  = $c4due->output('iso') || undef;
121
	my $due  = $c4due->output('iso') || undef;
121
	$debug and warn "Item due: $due";
122
	$debug and warn "Item due: $due";
122
	$self->{'due'} = $due;
123
	$self->{'due'} = $due;
(-)a/C4/SIP/ILS/Transaction/Renew.pm (-1 / +3 lines)
Lines 37-42 sub do_renew_for ($$) { Link Here
37
	my $borrower = shift;
37
	my $borrower = shift;
38
	my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
38
	my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
39
	if ($renewokay){
39
	if ($renewokay){
40
        #Why not AddRenewal ????
41
		#my $datedue = AddRenewal( $borrower, $self->{item}->id, undef, 0 );
42
40
		my $datedue = AddIssue( $borrower, $self->{item}->id, undef, 0 );
43
		my $datedue = AddIssue( $borrower, $self->{item}->id, undef, 0 );
41
		$self->{due} = $datedue;
44
		$self->{due} = $datedue;
42
		$self->renewal_ok(1);
45
		$self->renewal_ok(1);
43
- 

Return to bug 5632