LP1904036 Bill grid columns; data refreshing
authorBill Erickson <berickxx@gmail.com>
Tue, 24 Aug 2021 20:27:52 +0000 (16:27 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:36 +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/bill-statement.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.ts
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm

index f2fc980..99f07b5 100644 (file)
 <div *ngIf="statement" class="striped-rows-odd">
   <div class="row p-1">
     <div class="col-lg-2" i18n>Billing Location</div>
-    <div class="col-lg-2">{{context.orgSn(statement.billing_location)}}</div>
+    <div class="col-lg-2">
+      <a target="_blank" 
+        href="/eg/opac/library/{{context.orgSn(statement.billing_location)}}">
+        {{context.orgSn(statement.billing_location)}}
+      </a>
+    </div>
     <div class="col-lg-2" i18n>Total Billed</div>
     <div class="col-lg-1">{{statement.summary.billing_total | currency}}</div>
     <div class="col-lg-2" i18n>Title</div>
-    <div class="col-lg-3">{{statement.title}}</div>
+    <div class="col-lg-3">
+      <ng-container *ngIf="statement.title_id">
+        <a target="_blank" routerLink="/staff/catalog/record/{{statement.title_id}}">
+          {{statement.title}}
+        </a>
+      </ng-container>
+      <ng-container *ngIf="!statement.title_id">{{statement.title}}</ng-container>
+    </div>
   </div>
   <div class="row mt-1 p-1">
     <div class="col-lg-2" i18n>Type</div>
index 4a26b2c..54ca7b1 100644 (file)
     [required]="true" label="Last Payment Type" i18n-label></eg-grid-column>
 
   <eg-grid-column name="last_payment_ts" path="summary.last_payment_ts" 
-    [required]="true" label="Last Payment Time" i18n-label></eg-grid-column>
+    [required]="true" [datePlusTime]="true" label="Last Payment Time" i18n-label>
+  </eg-grid-column>
 
   <eg-grid-column name="billingLocation"
     label="Billing Location" i18n-label></eg-grid-column>
   <eg-grid-column path="circulation.target_copy.call_number.suffix.label" 
     i18n-label label="CN Suffix" [hidden]="true"></eg-grid-column>
 
+  <eg-grid-column i18n-label label="Owning Library" [hidden]="true"
+    path="circulation.target_copy.call_number.owning_lib.shortname">
+  </eg-grid-column>
+
+  <eg-grid-column i18n-label label="Checkout/Renewal Library" [hidden]="true"
+    path="circulation.circ_lib.shortname">
+  </eg-grid-column>
+
   <eg-grid-column name="copy_barcode" label="Item Barcode" i18n-label
     path="circulation.target_copy.barcode" [cellTemplate]="barcodeTemplate">
   </eg-grid-column>
index b4288a1..6331551 100644 (file)
@@ -498,7 +498,7 @@ export class BillsComponent implements OnInit, AfterViewInit {
         this.billingDialog.newXact = true;
         this.billingDialog.open().subscribe(data => {
             if (data) {
-                this.billGrid.reload();
+                this.context.refreshPatron().then(_ => this.billGrid.reload());
             }
         });
     }
@@ -566,7 +566,9 @@ export class BillsComponent implements OnInit, AfterViewInit {
 
             this.sessionVoided = (this.sessionVoided * 100 + cents) / 100;
             this.voidAmount = 0;
-            this.billGrid.reload();
+
+            this.context.refreshPatron()
+            .then(_ => this.billGrid.reload());
         });
     }
 
@@ -584,7 +586,10 @@ export class BillsComponent implements OnInit, AfterViewInit {
                 'open-ils.circ.money.billable_xact.adjust_to_zero',
                 this.auth.token(), xactIds
             ).subscribe(resp => {
-                if (!this.reportError(resp)) { this.billGrid.reload(); }
+                if (!this.reportError(resp)) {
+                    this.context.refreshPatron()
+                    .then(_ => this.billGrid.reload());
+                }
             });
         });
     }
index 975479f..88d72ad 100644 (file)
@@ -1378,12 +1378,14 @@ sub retrieve_statement {
 
     my $title;
     my $billing_location;
+    my $title_id;
     if ($xact->circulation) {
         $billing_location = $xact->circulation->circ_lib;
         my $copy = $xact->circulation->target_copy;
         if ($copy->call_number->id == -1) {
             $title = $copy->dummy_title;
         } else {
+            $title_id = $copy->call_number->record->id;
             $title = OpenSRF::Utils::JSON->JSON2perl(
                 $copy->call_number->record->wide_display_entry->title);
         }
@@ -1396,6 +1398,7 @@ sub retrieve_statement {
         xact_id => $xact_id,
         xact => $xact,
         title => $title,
+        title_id => $title_id,
         billing_location => $billing_location,
         summary => {
             balance_due => $totals{billing} - ($totals{payment} + $totals{account_adjustment} + $totals{void}),