[open-ils-commits] [GIT] Evergreen ILS branch master updated. 16b661149701d8125fb626ff39a3292ba0cbe711

Evergreen Git git at git.evergreen-ils.org
Wed Feb 28 10:56:18 EST 2018


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  16b661149701d8125fb626ff39a3292ba0cbe711 (commit)
       via  a94a102b12cf27e2a827811ae6c20415cf6d5877 (commit)
       via  b649140060793a2bed8ff9dbedc7c25851c2fe06 (commit)
      from  f9159c9de6c2e90c8983d02854c0a3831daf9b1a (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 16b661149701d8125fb626ff39a3292ba0cbe711
Author: Remington Steed <rjs7 at calvin.edu>
Date:   Tue Feb 27 16:10:15 2018 -0500

    LP#1748986 Release notes
    
    Release notes for the new Billing Statement View.
    
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/docs/RELEASE_NOTES_NEXT/Circulation/billing_statement_view.adoc b/docs/RELEASE_NOTES_NEXT/Circulation/billing_statement_view.adoc
new file mode 100644
index 0000000..94b2bab
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Circulation/billing_statement_view.adoc
@@ -0,0 +1,7 @@
+New Patron Billing Statement
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The Evergreen web staff client now includes a patron billing statement,
+which summarizes a patron's bills, credits and payments in a familiar
+layout.  This can be found on the "Statement" tab of the Patron Bill
+Details page. (From the Patron Bills page, double-click a row to view
+its details, or choose "Full Details" from the Actions menu.)

commit a94a102b12cf27e2a827811ae6c20415cf6d5877
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Tue Feb 20 17:39:17 2018 -0500

    LP#1748986 Broaden billing interface labels
    
    In a few places we use the word "Paid", but there are quite a few
    things in that bucket (forgiveness, adjustments, etc.) which don't fit
    well under the term "Paid".
    
    Though we have some deep structural causes for this, we can take a baby
    step in the right direction by sprinkling the term "Credited" in a few
    key places.
    
    Also, correct an mislabeled "Balance" field.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/src/templates/staff/circ/patron/t_bills.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_bills.tt2
index 835e1bf..bdc6c27 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_bills.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_bills.tt2
@@ -15,7 +15,7 @@
       <div class="col-md-2">{{patron().credit_forward_balance() | currency}}</div>
     </div>
     <div class="row">
-      <div class="col-md-4">[% l('Total Paid:') %]</div>
+      <div class="col-md-4">[% l('Total Paid/Credited:') %]</div>
       <div class="col-md-2">{{summary.total_paid() | currency}}</div>
       <div class="col-md-4">[% l('Session Voided:') %]</div>
       <div class="col-md-2">{{session_voided | currency}}</div>
@@ -34,7 +34,7 @@
       <div class="col-md-2 strong-text">{{pending_change() | currency}}</div>
     </div>
     <div class="row">
-      <div class="col-md-4">[% l('Paid for Selected:') %]</div>
+      <div class="col-md-4">[% l('Paid/Credited for Selected:') %]</div>
       <div class="col-md-2">{{paid_selected() | currency}}</div>
     </div>
   </div><!-- col -->
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2
index c7c5d1b..0be1f7d 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2
@@ -14,7 +14,7 @@
 <div class="row">
   <div class="col-md-2 strong-text">[% l('Type') %]</div>
   <div class="col-md-2">{{xact.summary().xact_type()}}</div>
-  <div class="col-md-2 strong-text">[% l('Total Paid') %]</div>
+  <div class="col-md-2 strong-text">[% l('Total Paid/Credited') %]</div>
   <div class="col-md-2">{{xact.summary().total_paid() | currency}}</div>
   <div class="col-md-2 strong-text">[% l('Checked Out') %]</div>
   <div class="col-md-2">{{xact.circulation().xact_start() | date:$root.egDateAndTimeFormat}}</div>
@@ -22,7 +22,7 @@
 <div class="row">
   <div class="col-md-2 strong-text">[% l('Start') %]</div>
   <div class="col-md-2">{{xact.xact_start() | date:$root.egDateAndTimeFormat}}</div>
-  <div class="col-md-2 strong-text">[% l('Total Billed') %]</div>
+  <div class="col-md-2 strong-text">[% l('Balance Due') %]</div>
   <div class="col-md-2">{{xact.summary().balance_owed() | currency}}</div>
   <div class="col-md-2 strong-text">[% l('Due Date') %]</div>
   <div class="col-md-2">{{xact.circulation().due_date() | egDueDate:$root.egDateAndTimeFormat:xact.circulation().circ_lib():xact.circulation().duration()}}</div>

commit b649140060793a2bed8ff9dbedc7c25851c2fe06
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Mon Feb 12 14:47:21 2018 -0500

    LP#1748986 Billing Statement View
    
    Over time, Evergreen has developed a rich set of features to support
    various billing scenarios.  Unfortunately, our interface has not kept up
    in some ways, and this leads to some confusion at times, particularly
    for front line staff.
    
    One way to bring clarity is to apply better grouping, labeling, and
    ordering of the various transactional events.  By doing so, we can
    generate a billing "statement" with similarities to the statements we
    regularly encounter when dealing with other financial institutions.
    
    This branch does so for the staff client view, but it also seems viable
    to carry over the same idea to an eventual patron (or print) view as
    well.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
index 17c496b..f177e5d 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
@@ -32,6 +32,9 @@ use OpenILS::Utils::Penalty;
 use Business::Stripe;
 $Data::Dumper::Indent = 0;
 use OpenILS::Const qw/:const/;
+use OpenSRF::Utils qw/:datetime/;
+use DateTime::Format::ISO8601;
+my $parser = DateTime::Format::ISO8601->new;
 
 sub get_processor_settings {
     my $e = shift;
@@ -1273,4 +1276,137 @@ sub retrieve_credit_payable_balance {
 }
 
 
+__PACKAGE__->register_method(
+    method    => "retrieve_statement",
+    authoritative => 1,
+    api_name    => "open-ils.circ.money.statement.retrieve",
+    notes        => "Returns an organized summary of a billable transaction, including all bills, payments, adjustments, and voids."
+    );
+
+sub _to_epoch {
+    my $ts = shift @_;
+
+    return $parser->parse_datetime(cleanse_ISO8601($ts))->epoch;
+}
+
+my %_statement_sort = (
+    'billing' => 0,
+    'account_adjustment' => 1,
+    'void' => 2,
+    'payment' => 3
+);
+
+sub retrieve_statement {
+    my ( $self, $client, $auth, $xact_id ) = @_;
+
+    my $e = new_editor(authtoken=>$auth);
+    return $e->event unless $e->checkauth;
+    return $e->event unless $e->allowed('VIEW_TRANSACTION');
+
+    # XXX: move this lookup login into a DB query?
+    my @line_prep;
+
+    # collect all payments/adjustments
+    my $payments = $e->search_money_payment({ xact => $xact_id });
+    foreach my $payment (@$payments) {
+        my $type = $payment->payment_type;
+        $type = 'payment' if $type ne 'account_adjustment';
+        push(@line_prep, [$type, _to_epoch($payment->payment_ts), $payment->payment_ts, $payment->id, $payment]);
+    }
+
+    # collect all billings
+    my $billings = $e->search_money_billing({ xact => $xact_id });
+    foreach my $billing (@$billings) {
+        if ($U->is_true($billing->voided)){
+            push(@line_prep, ['void', _to_epoch($billing->void_time), $billing->void_time, $billing->id, $billing]); # voids get two entries, one to represent the bill event, one for the void event
+        }
+        push(@line_prep, ['billing', _to_epoch($billing->billing_ts), $billing->billing_ts, $billing->id, $billing]);
+    }
+
+    # order every event by timestamp, then bills/adjustments/voids/payments order, then id
+    my @ordered_line_prep = sort {
+        $a->[1] <=> $b->[1]
+            ||
+        $_statement_sort{$a->[0]} <=> $_statement_sort{$b->[0]}
+            ||
+        $a->[3] <=> $b->[3]
+    } @line_prep;
+
+    # let's start building the statement structure
+    my (@lines, %current_line, $running_balance);
+    foreach my $event (@ordered_line_prep) {
+        my $obj = $event->[4];
+        my $type = $event->[0];
+        my $ts = $event->[2];
+        my $billing_type = $type =~ /billing|void/ ? $obj->billing_type : ''; # TODO: get non-legacy billing type
+        my $note = $obj->note || '';
+        # last line should be void information, try to isolate it
+        if ($type eq 'billing' and $obj->voided) {
+            $note =~ s/\n.*$//;
+        } elsif ($type eq 'void') {
+            $note = (split(/\n/, $note))[-1];
+        }
+
+        # if we have new details, start a new line
+        if ($current_line{amount} and (
+                $type ne $current_line{type}
+                or ($note ne $current_line{note})
+                or ($billing_type ne $current_line{billing_type})
+            )
+        ) {
+            push(@lines, {%current_line}); # push a copy of the hash, not the real thing
+            %current_line = ();
+        }
+        if (!$current_line{type}) {
+            $current_line{type} = $type;
+            $current_line{billing_type} = $billing_type;
+            $current_line{note} = $note;
+        }
+        if (!$current_line{start_date}) {
+            $current_line{start_date} = $ts;
+        } elsif ($ts ne $current_line{start_date}) {
+            $current_line{end_date} = $ts;
+        }
+        $current_line{amount} += $obj->amount;
+        if ($current_line{details}) {
+            push(@{$current_line{details}}, $obj);
+        } else {
+            $current_line{details} = [$obj];
+        }
+    }
+    push(@lines, {%current_line}); # push last one on
+
+    # get/update totals, format notes
+    my %totals = (
+        billing => 0,
+        payment => 0,
+        account_adjustment => 0,
+        void => 0
+    );
+    foreach my $line (@lines) {
+        $totals{$line->{type}} += $line->{amount};
+        if ($line->{type} eq 'billing') {
+            $running_balance += $line->{amount};
+        } else { # not a billing; balance goes down for everything else
+            $running_balance -= $line->{amount};
+        }
+        $line->{running_balance} = $running_balance;
+        $line->{note} = $line->{note} ? [split(/\n/, $line->{note})] : [];
+    }
+
+    return {
+        xact_id => $xact_id,
+        summary => {
+            balance_due => $totals{billing} - ($totals{payment} + $totals{account_adjustment} + $totals{void}),
+            billing_total => $totals{billing},
+            credit_total => $totals{payment} + $totals{account_adjustment},
+            payment_total => $totals{payment},
+            account_adjustment_total => $totals{account_adjustment},
+            void_total => $totals{void}
+        },
+        lines => \@lines
+    }
+}
+
+
 1;
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2
index fdab723..c7c5d1b 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2
@@ -105,61 +105,18 @@
   </div>
 </div>
 
-
-<!-- set a lower default page size (limit) to allow for more space -->
 <hr/>
-<eg-grid
-  main-label="[% l('Bills') %]"
-  idl-class="mb"
-  id-field="id"
-  grid-controls="xactGridControls"
-  auto-fields="true"
-  page-size="10"
-  dateformat="{{$root.egDateAndTimeFormat}}">
-
-  <eg-grid-action 
-    label="[% l('Void Billings') %]" handler="voidBillings"></eg-grid-action>
-
-  <eg-grid-action 
-    label="[% l('Edit Note') %]" handler="editBillNotes"></eg-grid-action>
-
-</eg-grid>
-
-<!-- TODO: this grid may contain objects (payments) of different types.. 
-    apply manual columns, see xul -->
-<!-- NOTE: sorting disabled since payments are fetched via non-sortable API -->
-<br/>
-<eg-grid
-  main-label="[% l('Payments') %]"
-  idl-class="mbp"
-  id-field="id"
-  grid-controls="paymentGridControls"
-  page-size="10"
-  dateformat="{{$root.egDateAndTimeFormat}}">
-  <eg-grid-action
-    label="[% l('Edit Note') %]" handler="editPaymentNotes"></eg-grid-action>
-
-  <eg-grid-field path="cash_payment.cash_drawer.name" parent-idl-class="mbp"
-    label="[% l('Cash Drawer') %]"></eg-grid-field>
-
-  <eg-grid-field path="accepting_usr">{{item.staff_name}} ({{item.staff_barcode}}) @ {{item.staff_org}}</eg-grid-field>
-
-  <eg-grid-field path="amount"></eg-grid-field>
-  <eg-grid-field path="id"></eg-grid-field>
-  <eg-grid-field path="note"></eg-grid-field>
-  <eg-grid-field path="payment_ts"></eg-grid-field>
-  <eg-grid-field path="payment_type"></eg-grid-field>
-  <eg-grid-field path="xact"></eg-grid-field>
-  <eg-grid-field path="voided"></eg-grid-field>
-
-  <eg-grid-field path="accepting_usr.family_name" name="staff_name"
-    label="[% l('Staff Last Name') %]" hidden required></eg-grid-field>
-
-  <eg-grid-field path="accepting_usr.card.barcode" name="staff_barcode"
-    label="[% l('Staff Barcode') %]" hidden required></eg-grid-field>
-
-  <eg-grid-field path="accepting_usr.home_ou.shortname" name="staff_org"
-    label="[% l('Staff Org Unit') %]" hidden required></eg-grid-field>
-
-</eg-grid>
-
+<ul class="nav nav-tabs">
+  <li ng-class="{active : xact_tab == 'statement'}">
+    <a href="./circ/patron/{{patron().id()}}/bill/{{xact.id()}}/statement">
+        [% l('Statement') %]
+    </a>
+  </li>
+  <li ng-class="{active : xact_tab == 'details'}">
+    <a href="./circ/patron/{{patron().id()}}/bill/{{xact.id()}}/details">
+        [% l('Details') %]
+    </a>
+  </li>
+</ul>
+[% INCLUDE 'staff/circ/patron/t_xact_details_statement.tt2' %]
+[% INCLUDE 'staff/circ/patron/t_xact_details_details.tt2' %]
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_xact_details_details.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_xact_details_details.tt2
new file mode 100644
index 0000000..6cd026a
--- /dev/null
+++ b/Open-ILS/src/templates/staff/circ/patron/t_xact_details_details.tt2
@@ -0,0 +1,59 @@
+<div ng-if="xact_tab == 'details'">
+
+<!-- set a lower default page size (limit) to allow for more space -->
+<eg-grid
+  main-label="[% l('Bills') %]"
+  idl-class="mb"
+  id-field="id"
+  grid-controls="xactGridControls"
+  auto-fields="true"
+  page-size="10"
+  dateformat="{{$root.egDateAndTimeFormat}}">
+
+  <eg-grid-action 
+    label="[% l('Void Billings') %]" handler="voidBillings"></eg-grid-action>
+
+  <eg-grid-action 
+    label="[% l('Edit Note') %]" handler="editBillNotes"></eg-grid-action>
+
+</eg-grid>
+
+<!-- TODO: this grid may contain objects (payments) of different types.. 
+    apply manual columns, see xul -->
+<!-- NOTE: sorting disabled since payments are fetched via non-sortable API -->
+<br/>
+<eg-grid
+  main-label="[% l('Payments') %]"
+  idl-class="mbp"
+  id-field="id"
+  grid-controls="paymentGridControls"
+  page-size="10"
+  dateformat="{{$root.egDateAndTimeFormat}}">
+  <eg-grid-action
+    label="[% l('Edit Note') %]" handler="editPaymentNotes"></eg-grid-action>
+
+  <eg-grid-field path="cash_payment.cash_drawer.name" parent-idl-class="mbp"
+    label="[% l('Cash Drawer') %]"></eg-grid-field>
+
+  <eg-grid-field path="accepting_usr">{{item.staff_name}} ({{item.staff_barcode}}) @ {{item.staff_org}}</eg-grid-field>
+
+  <eg-grid-field path="amount"></eg-grid-field>
+  <eg-grid-field path="id"></eg-grid-field>
+  <eg-grid-field path="note"></eg-grid-field>
+  <eg-grid-field path="payment_ts"></eg-grid-field>
+  <eg-grid-field path="payment_type"></eg-grid-field>
+  <eg-grid-field path="xact"></eg-grid-field>
+  <eg-grid-field path="voided"></eg-grid-field>
+
+  <eg-grid-field path="accepting_usr.family_name" name="staff_name"
+    label="[% l('Staff Last Name') %]" hidden required></eg-grid-field>
+
+  <eg-grid-field path="accepting_usr.card.barcode" name="staff_barcode"
+    label="[% l('Staff Barcode') %]" hidden required></eg-grid-field>
+
+  <eg-grid-field path="accepting_usr.home_ou.shortname" name="staff_org"
+    label="[% l('Staff Org Unit') %]" hidden required></eg-grid-field>
+
+</eg-grid>
+
+</div>
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_xact_details_statement.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_xact_details_statement.tt2
new file mode 100644
index 0000000..7dc5cea
--- /dev/null
+++ b/Open-ILS/src/templates/staff/circ/patron/t_xact_details_statement.tt2
@@ -0,0 +1,72 @@
+<div ng-if="xact_tab == 'statement'">
+
+<h4>[% l('Billing Statement') %]</h4>
+<div class="panel panel-default">
+    <div class="panel-heading">
+        <div class="row">
+            <div class="col-md-2">[% l('Type') %]</div>
+            <div class="col-md-6">[% l('Description') %]</div>
+            <div class="col-md-2">[% l('Amount') %]</div>
+            <div class="col-md-2">[% l('Balance') %]</div>
+        </div>
+    </div>
+    <div class="panel-body flex-container-striped">
+        <div class="row" ng-repeat="line in statement_data.lines">
+            <div class="col-md-2" ng-switch="line.type">
+                <span ng-switch-when="billing">[% l('Billing') %]</span>
+                <span ng-switch-when="payment">[% l('Payment') %]</span>
+                <span ng-switch-when="account_adjustment">[% l('Adjustment') %]</span>
+                <span ng-switch-when="void">[% l('Void') %]</span>
+            </div>
+            <div class="col-md-6">
+                <span ng-if="line.billing_type" class="strong-text">{{line.billing_type}}<br/></span>
+                <span ng-if="line.note.length" ng-class="{'strong-text' : !line.billing_type}">{{line.note | join:', '}}<br/></span>
+                <span class="small">{{line.start_date  | date:$root.egDateAndTimeFormat}}</span><span ng-if="line.end_date" class="small"> - {{line.end_date  | date:$root.egDateAndTimeFormat}}</span>
+            </div>
+            <div ng-style="line.type != 'billing' && {'color':'red'}" class="col-md-2">
+                <span ng-if="line.type != 'billing'">-</span>{{line.amount | currency}}
+            </div>
+            <div class="col-md-2">
+                {{line.running_balance | currency}}
+            </div>
+        </div>
+        <hr/>
+        <div class="row">
+            <div class="col-md-4 col-md-offset-8">
+                <div class="row">
+                    <div class="col-md-6 strong-text">[% l('Total Charges') %]</div>
+                    <div class="col-md-6 text-right">
+                      {{statement_data.summary.billing_total | currency}}
+                    </div>
+                </div>
+                <div class="row">
+                    <div class="col-md-6 strong-text">[% l('Total Payments') %]</div>
+                    <div class="col-md-6 text-right" style="color:red">
+                      -{{statement_data.summary.payment_total || 0 | currency}}
+                    </div>
+                </div>
+                <div ng-if="statement_data.summary.account_adjustment_total > 0" class="row">
+                    <div class="col-md-6 strong-text">[% l('Total Adjustments') %]</div>
+                    <div class="col-md-6 text-right" style="color:red">
+                      -{{statement_data.summary.account_adjustment_total | currency}}
+                    </div>
+                </div>
+                <div ng-if="statement_data.summary.void_total > 0" class="row">
+                    <div class="col-md-6 strong-text">[% l('Total Voids') %]</div>
+                    <div class="col-md-6 text-right" style="color:red">
+                      -{{statement_data.summary.void_total | currency}}
+                    </div>
+                </div>
+                <hr/>
+                <div class="row">
+                    <div class="col-md-6 strong-text">[% l('Balance Due') %]</div>
+                    <div class="col-md-6 text-right">
+                      {{statement_data.summary.balance_due | currency}}
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+</div>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js
index a52c8b8..580b430 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js
@@ -138,7 +138,7 @@ angular.module('egPatronApp', ['ngRoute', 'ui.bootstrap', 'egUserBucketMod',
         resolve : resolver
     });
 
-    $routeProvider.when('/circ/patron/:id/bill/:xact_id', {
+    $routeProvider.when('/circ/patron/:id/bill/:xact_id/:xact_tab', {
         templateUrl: './circ/patron/t_xact_details',
         controller: 'XactDetailsCtrl',
         resolve : resolver
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
index d9e1bf7..392b696 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js
@@ -87,6 +87,17 @@ function($q , egCore , egWorkLog , patronSvc) {
         );
     }
 
+    service.fetchStatement = function(xact_id) {
+        return egCore.net.request(
+            'open-ils.circ',
+            'open-ils.circ.money.statement.retrieve',
+            egCore.auth.token(), xact_id
+        ).then(function(resp) {
+            if (evt = egCore.evt.parse(resp)) return alert(evt);
+            return resp;
+        });
+    }
+
     // TODO: no longer needed?
     service.fetchPayments = function(xact_id) {
         return egCore.net.request(
@@ -723,7 +734,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
     $scope.showFullDetails = function(all) {
         if (all[0]) 
             $location.path('/circ/patron/' + 
-                patronSvc.current.id() + '/bill/' + all[0].id);
+                patronSvc.current.id() + '/bill/' + all[0].id + '/statement');
     }
 
     $scope.activateBill = function(xact) {
@@ -741,6 +752,7 @@ function($scope,  $q , $routeParams , egCore , egGridDataProvider , patronSvc ,
 
     $scope.initTab('bills', $routeParams.id);
     var xact_id = $routeParams.xact_id;
+    $scope.xact_tab = $routeParams.xact_tab;
 
     var xactGrid = $scope.xactGridControls = {
         setQuery : function() { return {xact : xact_id} },
@@ -827,6 +839,13 @@ function($scope,  $q , $routeParams , egCore , egGridDataProvider , patronSvc ,
     }
 
     // -- retrieve our data
+    if ($scope.xact_tab == 'statement') {
+        //fetch combined billing statement data
+        billSvc.fetchStatement(xact_id).then(function(statement) {
+            //console.log(statement);
+            $scope.statement_data = statement;
+        });
+    }
     $scope.total_circs = 0; // start with 0 instead of undefined
     egBilling.fetchXact(xact_id).then(function(xact) {
         $scope.xact = xact;
@@ -940,7 +959,7 @@ function($scope,  $q , egCore , patronSvc , billSvc , egPromptDialog , $location
     $scope.showFullDetails = function(all) {
         if (all[0]) 
             $location.path('/circ/patron/' + 
-                patronSvc.current.id() + '/bill/' + all[0].id);
+                patronSvc.current.id() + '/bill/' + all[0].id + '/statement');
     }
 
     // For now, only adds billing to first selected item.
@@ -1043,7 +1062,7 @@ function($scope,  $q , egCore , patronSvc , billSvc , $location) {
     $scope.showFullDetails = function(all) {
         if (all[0]) 
             $location.path('/circ/patron/' + 
-                patronSvc.current.id() + '/bill/' + all[0]['xact.id']);
+                patronSvc.current.id() + '/bill/' + all[0]['xact.id'] + '/statement');
     }
 
     $scope.totals.selected_paid = function() {

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

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Circ/Money.pm |  136 ++++++++++++++++++++
 .../src/templates/staff/circ/patron/t_bills.tt2    |    4 +-
 .../templates/staff/circ/patron/t_xact_details.tt2 |   75 +++---------
 .../staff/circ/patron/t_xact_details_details.tt2   |   59 +++++++++
 .../staff/circ/patron/t_xact_details_statement.tt2 |   72 ++++++++++
 .../web/js/ui/default/staff/circ/patron/app.js     |    2 +-
 .../web/js/ui/default/staff/circ/patron/bills.js   |   25 +++-
 .../Circulation/billing_statement_view.adoc        |    7 +
 8 files changed, 315 insertions(+), 65 deletions(-)
 create mode 100644 Open-ILS/src/templates/staff/circ/patron/t_xact_details_details.tt2
 create mode 100644 Open-ILS/src/templates/staff/circ/patron/t_xact_details_statement.tt2
 create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/billing_statement_view.adoc


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list