-<b>I have {{recentCircs.length}} recent circs</b>
+<eg-add-billing-dialog #billingDialog></eg-add-billing-dialog>
+
+<eg-string key="staff.cat.item.circs.billing" i18n-text text="Billing Added">
+</eg-string>
+
+<div class="row" *ngFor="let circ of recentCircs">
+ <div class="col-lg-12 well-table">
+ <div class="well-row">
+ <div class="well-value">
+ <a i18n
+ routerLink="/staff/circ/patron/{{circ.usr().id()}}">
+ {{circ.usr().family_name()}},
+ {{circ.usr().first_given_name()}},
+ {{circ.usr().second_given_name()}} :
+ {{circ.usr().card().barcode()}}
+ </a>
+ <span class="pl-3" i18n>Circulation ID: {{circ.id()}}</span>
+ </div>
+ <div class="mt-2">
+ <button class="btn btn-outline-dark" (click)="addBilling(circ.id())" i18n>
+ Add Billing
+ </button>
+ </div>
+ </div>
+ <div class="well-row">
+ <div class="well-label" i18n>Check Out Date</div>
+ <div class="well-value">
+ {{circ.xact_start() | formatValue:'timestamp'}}
+ </div>
+ <div class="well-label" i18n>Due Date</div>
+ <div class="well-value">
+ {{circ | egDueDate}}
+ </div>
+ <div class="well-label" i18n>Stop Fines Time</div>
+ <div class="well-value">
+ {{circ.stop_fines_time() | formatValue:'timestamp'}}
+ </div>
+ <div class="well-label" i18n>Checkin Time</div>
+ <div class="well-value">
+ {{circ.checkin_time() | formatValue:'timestamp'}}
+ </div>
+ </div>
+ <div class="well-row">
+ <div class="well-label" i18n>Check Out Library</div>
+ <div class="well-value">
+ {{circ.circ_lib().shortname()}}
+ </div>
+ <div class="well-label" i18n>Renewal?</div>
+ <div class="well-value">
+ <eg-bool [value]="circ.parent_circ() != null"></eg-bool>
+ </div>
+ <div class="well-label" i18n>Stop Fines Reason</div>
+ <div class="well-value">
+ {{circ.stop_fines()}}
+ </div>
+ <div class="well-label" i18n>Check In Library</div>
+ <div class="well-value">
+ <ng-container *ngIf="circ.checkin_lib()">
+ {{circ.checkin_lib().shortname()}}
+ </ng-container>
+ </div>
+ </div>
+ </div>
+</div>
import {CopyAlertsDialogComponent
} from '@eg/staff/share/holdings/copy-alerts-dialog.component';
import {FormatService} from '@eg/core/format.service';
+import {AddBillingDialogComponent} from '@eg/staff/share/billing/billing-dialog.component';
+import {ToastService} from '@eg/share/toast/toast.service';
+import {StringService} from '@eg/share/string/string.service';
@Component({
selector: 'eg-item-circ-history',
recentCircs: IdlObject[] = [];
loading = false;
+ @ViewChild('billingDialog') private billingDialog: AddBillingDialogComponent;
constructor(
private router: Router,
private cat: CatalogService,
private holdings: HoldingsService,
private circs: CircService,
+ private toast: ToastService,
+ private strings: StringService,
public format: FormatService
) { }
ngOnInit() {
+ this.load();
+ }
+
+ load(): Promise<any> {
this.loading = true;
- this.circs.getRecentCircs(this.item)
- .then(circs => this.recentCircs = circs)
+ return this.circs.getRecentCircs(this.item)
+ .then(circs => {
+ circs.forEach(circ => {
+ circ.circ_lib(this.org.get(circ.circ_lib()));
+ circ.checkin_lib(this.org.get(circ.checkin_lib()));
+ });
+ this.recentCircs = circs;
+ })
.then(_ => this.loading = false);
}
+
+ addBilling(circId: number) {
+ this.billingDialog.xactId = circId;
+ this.billingDialog.open().subscribe(data => {
+ // No need to reload the data since money is not displayed.
+ if (data) {
+ this.strings.interpolate('staff.cat.item.circs.billing')
+ .then(str => this.toast.success(str));
+ }
+ });
+ }
}
import {ItemRoutingModule} from './routing.module';
import {HoldingsModule} from '@eg/staff/share/holdings/holdings.module';
import {PatronModule} from '@eg/staff/share/patron/patron.module';
+import {BillingModule} from '@eg/staff/share/billing/billing.module';
import {MarkItemMissingPiecesComponent} from './missing-pieces.component';
import {ItemStatusComponent} from './status.component';
import {BarcodesModule} from '@eg/staff/share/barcodes/barcodes.module';
HoldingsModule,
BarcodesModule,
CircModule,
- PatronModule
+ PatronModule,
+ BillingModule
],
providers: [
]
<div class="well-row">
<div class="well-label" i18n>Last Renewed On</div>
<div class="well-value">
- {{circInfo.prevCircSummary.last_renewal_time() | formatValue:'timestamp'}}
+ {{circInfo.prevCircSummary.last_renewal_time() | formatValue:'timestamp'}}
</div>
</div>
<div class="well-row">
<div class="well-label" i18n>Checkout Date</div>
<div class="well-value">
- {{circInfo.circSummary.start_time() | formatValue:'timestamp'}}
+ {{circInfo.circSummary.start_time() | formatValue:'timestamp'}}
</div>
</div>
<div class="well-row">
<div class="well-label" i18n>Last Renewed On</div>
<div class="well-value">
- {{circInfo.circSummary.last_renewal_time() | formatValue:'timestamp'}}
+ {{circInfo.circSummary.last_renewal_time() | formatValue:'timestamp'}}
</div>
</div>