diff --git a/Koha/Account/Offset.pm b/Koha/Account/Offset.pm index b41165338e..3110d6a52b 100644 --- a/Koha/Account/Offset.pm +++ b/Koha/Account/Offset.pm @@ -20,6 +20,7 @@ use Modern::Perl; use Carp; use Koha::Database; +use Koha::Account::Line; use base qw(Koha::Object); @@ -35,6 +36,28 @@ Account offsets are used to track the changes in account lines =cut +=head3 debit + +=cut + +sub debit { + my ( $self ) = @_; + my $debit_rs = $self->_result->debit; + return unless $debit_rs; + return Koha::Account::Line->_new_from_dbic( $debit_rs ); +} + +=head3 credit + +=cut + +sub credit { + my ( $self ) = @_; + my $credit_rs = $self->_result->credit; + return unless $credit_rs; + return Koha::Account::Line->_new_from_dbic( $credit_rs ); +} + =head3 _type =cut diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/account_offset_type.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/account_offset_type.inc new file mode 100644 index 0000000000..a36a883a86 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/account_offset_type.inc @@ -0,0 +1,8 @@ +[% SWITCH account_offset.type %] + [% CASE 'Payment' %]Payment + [% CASE 'Manual Debit' %]Manual invoice + [% CASE 'Lost Item Return' %]Lost item returned + [% CASE 'Writeoff' %]Writeoff + [% CASE 'Void Payment' %]Void payment + [% CASE %][% account_offset.type %] +[%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounttype.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounttype.inc new file mode 100644 index 0000000000..7d7cdc6109 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounttype.inc @@ -0,0 +1,24 @@ +[% SWITCH account.accounttype %] + [% CASE 'Pay' %]Payment, thanks + [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) + [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) + [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) + [% CASE 'VOID' %]Payment, Voided + [% CASE 'N' %]New card + [% CASE 'F' %]Fine + [% CASE 'A' %]Account management fee + [% CASE 'M' %]Sundry + [% CASE 'L' %]Lost item + [% CASE 'W' %]Writeoff + [% CASE 'FU' %]Accruing fine + [% CASE 'HE' %]Hold waiting too long + [% CASE 'Rent' %]Rental fee + [% CASE 'FOR' %]Forgiven + [% CASE 'LR' %]Lost item fee refund + [% CASE 'PF' %]Processing fee + [% CASE 'PAY' %]Payment + [% CASE 'WO' %]Writeoff + [% CASE 'C' %]Credit + [% CASE 'CR' %]Credit + [% CASE %][% account.accounttype %] +[%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt new file mode 100644 index 0000000000..5e5a5049d6 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.tt @@ -0,0 +1,137 @@ +[%- USE Price -%] +[%- USE KohaDates -%] +[%- USE AuthorisedValues -%] + +[% INCLUDE 'doc-head-open.inc' %] +
| Date | +Description of charges | +Note | +Amount | +Outstanding | +
|---|---|---|---|---|
| + [% accountline.date |$KohaDates %] + | ++ [% INCLUDE 'accounttype.inc' accountline => accountline %] + [%- IF accountline.payment_type -%] + , [% AuthorisedValues.GetByCode('PAYMENT_TYPE', accountline.payment_type) %] + [%- END =%] + [%- IF accountline.description -%] + , [% accountline.description %] + [%- END -%] + + + [% IF ( accountline.itemnumber ) %] + [% accountline.title |html %] + [% END %] + | + ++ [% accountline.note | html_line_break %] + | + ++ [% accountline.amount | $Price %] + | + ++ [% accountline.amountoutstanding | $Price %] + | +
| Date created | +Date updated | +Amount | +Amount outstanding | +Type | +Note | +Transacting librarian id |
+ Date/Time of change | +Amount of change | +Type of change | ++ |
|---|---|---|---|---|---|---|---|---|---|---|
| [% offset_accountline.date | $KohaDates %] | +[% offset_accountline.timestamp | $KohaDates with_hours => 1 %] | +[% offset_accountline.amount | $Price %] | +[% offset_accountline.amountoutstanding | $Price %] | +[% INCLUDE 'accounttype.inc' accountline => offset_accountline %] | +[% offset_accountline.note %] | +[% IF offset_accountline.manager_id %][% offset_accountline.manager_id %][% END %] | +[% ao.created_on | $KohaDates with_hours => 1 %] | +[% ao.amount | $Price %] | +[% INCLUDE 'account_offset_type.inc' account_offset => ao %] | +Details | +