LP1904036 billing history
authorBill Erickson <berickxx@gmail.com>
Fri, 16 Apr 2021 22:17:46 +0000 (18:17 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:31 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/circ/patron/billing-history.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/billing-history.component.ts

index 118ee19..66e1e24 100644 (file)
@@ -95,6 +95,7 @@
 
         <eg-grid-column path="circulation.target_copy.circ_lib.shortname" 
           i18n-label label="Item Owning Library"></eg-grid-column>
+
         <eg-grid-column path="circulation.circ_lib.shortname" 
           i18n-label label="Checkout or Renewal Library" [hidden]="true"></eg-grid-column>
         <eg-grid-column path="circulation.due_date" 
         <div class="col-lg-4">
           <div class="row">
             <div class="col-lg-5" i18n>Selected Paid:</div>
-            <div class="col-lg-4" i18n>{{selectedXactsInfo().paid | currency}}</div>
+            <div class="col-lg-4" i18n>{{selectedPaymentsInfo().paid | currency}}</div>
           </div>
         </div>
         <div class="col-lg-4 form-inline">
         </div>
       </div>
 
-      <eg-grid idlClass="mp" #xactsGrid
+      <eg-grid idlClass="mp" #paymentsGrid
         persistKey="circ.patron.billhistory_payments"
         (onRowActivate)="showStatement($event)"
         [reloadOnColumnChange]="true"
index a5ae77d..54c1e50 100644 (file)
@@ -101,7 +101,7 @@ export class BillingHistoryComponent implements OnInit {
             };
 
             return this.flatData.getRows(
-                this.xactsGrid.context, query, pager, sort);
+                this.paymentsGrid.context, query, pager, sort);
         };
     }
 
@@ -155,6 +155,20 @@ export class BillingHistoryComponent implements OnInit {
         });
     }
 
+    selectedPaymentsInfo(): {paid: number} {
+        const info = {paid: 0};
+        if (!this.paymentsGrid) { return info; }
+
+        this.paymentsGrid.context.rowSelector.selected().forEach(id => {
+            const row = this.paymentsGrid.context.getRowByIndex(id);
+            if (!row) { return; }
+            info.paid += Number(row.amount) * 100;
+        });
+
+        info.paid /= 100;
+        return info;
+    }
+
     selectedXactsInfo(): {owed: number, billed: number, paid: number} {
         const info = {owed : 0, billed : 0, paid : 0};