[open-ils-commits] [GIT] Evergreen ILS branch master updated. 2ec43ab54aeea5b08205ab9f1c4c3473fa632263

Evergreen Git git at git.evergreen-ils.org
Fri Aug 26 15:16:51 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  2ec43ab54aeea5b08205ab9f1c4c3473fa632263 (commit)
      from  60d24be6e41583f419178f24ca0abf369b2d0186 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2ec43ab54aeea5b08205ab9f1c4c3473fa632263
Author: Jason Stephenson <jstephenson at mvlc.org>
Date:   Thu Jun 30 13:43:24 2011 -0400

    Add SIP2 chargeable loan support.
    
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm
index 729fc5c..acfa572 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm
@@ -297,16 +297,18 @@ sub offline_ok {
 
 
 ##
-## Checkout(patron_id, item_id, sc_renew):
+## Checkout(patron_id, item_id, sc_renew, fee_ack):
 ##    patron_id & item_id are the identifiers send by the terminal
 ##    sc_renew is the renewal policy configured on the terminal
 ## returns a status opject that can be queried for the various bits
 ## of information that the protocol (SIP or NCIP) needs to generate
 ## the response.
+##    fee_ack is the fee_acknowledged field (BO) sent from the sc
+## when doing chargeable loans.
 ##
 
 sub checkout {
-	my ($self, $patron_id, $item_id, $sc_renew) = @_;
+	my ($self, $patron_id, $item_id, $sc_renew, $fee_ack) = @_;
 	$sc_renew = 0;
 
 	$self->verify_session;
@@ -347,6 +349,21 @@ sub checkout {
 		$xact->ok(0);
 	} 
 
+        # Check for fee and $fee_ack. If there is a fee, and $fee_ack
+        # is 'Y', we proceed, otherwise we reject the checkout.
+        if ($item->fee > 0.0) {
+            $xact->fee_amount($item->fee);
+            $xact->sip_fee_type($item->sip_fee_type);
+            $xact->sip_currency($item->fee_currency);
+            if ($fee_ack && $fee_ack eq 'Y') {
+                $xact->fee_ack(1);
+            } else {
+                $xact->screen_msg('Fee required');
+                $xact->ok(0);
+                return $xact;
+            }
+        }
+
 	$xact->do_checkout($sc_renew);
 	$xact->desensitize(!$item->magnetic);
 
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Item.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Item.pm
index 91302a1..35d9ee4 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Item.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Item.pm
@@ -364,12 +364,15 @@ sub sip_security_marker {
 }
 
 sub sip_fee_type {
-    return '01';    # FIXME? 01-09 enumerated in spec.  We just use O1-other/unknown.
+    my $self = shift;
+    # Return '06' for rental unless the fee is a deposit, or there is
+    # no fee. In the latter cases, return '01'.
+    return ($self->{copy}->deposit_amount > 0.0 && $self->{copy}->deposit =~ /^f/i) ? '06' : '01';
 }
 
-sub fee {           # TODO
+sub fee {
     my $self = shift;
-    return 0;
+    return $self->{copy}->deposit_amount;
 }
 
 
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction.pm
index a4813cb..5ef185d 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction.pm
@@ -26,6 +26,7 @@ my %fields = (
       print_line    => '',
       editor        => undef,
       authtoken     => '',
+      fee_ack       => 0,
 );
 
 our $AUTOLOAD;
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/Checkout.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/Checkout.pm
index bb751b2..bcfdc3b 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/Checkout.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Transaction/Checkout.pm
@@ -102,6 +102,9 @@ sub do_checkout {
                     if ($override_events{$txt} && $method !~ /override$/) {
                         # Found an event we've been configured to override.
                         $override = 1;
+                    } elsif ($txt =~ /ITEM_(?:DEPOSIT|RENTAL)_FEE_REQUIRED/ && $self->fee_ack) {
+                        # Patron acknowledged the fee.
+                        $override = 1;
                     } elsif ( $txt eq 'OPEN_CIRCULATION_EXISTS' ) {
                         $self->screen_msg(OILS_SIP_MSG_CIRC_EXISTS);
                         return 0;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/perlmods/lib/OpenILS/SIP.pm           |   21 ++++++++++++++++++-
 Open-ILS/src/perlmods/lib/OpenILS/SIP/Item.pm      |    9 +++++--
 .../src/perlmods/lib/OpenILS/SIP/Transaction.pm    |    1 +
 .../lib/OpenILS/SIP/Transaction/Checkout.pm        |    3 ++
 4 files changed, 29 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list