From: djfiander Date: Tue, 21 Mar 2006 00:28:25 +0000 (+0000) Subject: Beginnings of the stub Transaction class. All ILS transactions X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0b2512d59fb612a2d2df5e441b9eb114fb141ee0;p=working%2FSIPServer.git Beginnings of the stub Transaction class. All ILS transactions (checkout, renew, etc.) are derived from this base class. --- diff --git a/ILS/Transaction.pm b/ILS/Transaction.pm new file mode 100644 index 0000000..7cb85e0 --- /dev/null +++ b/ILS/Transaction.pm @@ -0,0 +1,70 @@ +# +# Transaction: Superclass of all the transactional status objects +# + +package ILS::Transaction; + +use Exporter; +use strict; +use warnings; + +our @ISA = qw(Exporter); + +sub new { + my ($class, $obj) = @_; + my $type = ref($class) || $class; + + return bless {}, $type; +} + +sub ok { + my $self = shift; + + return $self->{ok} ? 1 : 0; # normalize, just because +} + +sub screen_msg { + my $self = shift; + + return ($self->{screen_msg} || ""); +} + +sub print_line { + my $self = shift; + + return ($self->{print_line} || ""); +} + +sub patron { + my $self = shift; + + return $self->{patron}; +} + +sub item { + my $self = shift; + + return $self->{item}; +} + +sub fee_amount { + return 0; +} + +sub sip_currency { + return 'CAD'; # ;-) +} + +sub sip_fee_type { + my $self = shift; + + return $self->{sip_fee_type} || '01'; # "Other/Unknown" +} + +sub desensitize { + my $self = shift; + + return $self->{desensitize}; +} + +1;