LP1904036 Bills wireframing
authorBill Erickson <berickxx@gmail.com>
Fri, 5 Mar 2021 16:22:42 +0000 (11:22 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:25 +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/bills.component.css [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.html [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/patron.module.ts

diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.css b/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.css
new file mode 100644 (file)
index 0000000..9b8b24f
--- /dev/null
@@ -0,0 +1,6 @@
+
+
+.payment-form input[type="text"], .payment-form input[type="number"] {
+  width: 8em;
+}
+
diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.html b/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.html
new file mode 100644 (file)
index 0000000..5b80429
--- /dev/null
@@ -0,0 +1,102 @@
+
+<ng-container *ngIf="summary">
+  <div class="row border-bottom pb-2 pt-2 mb-4 border border-secondary rounded">
+    <div class="col-lg-3 pr-0 mr-0 border-right">
+      <div class="d-flex">
+        <div class="flex-4" i18n>Total Owed:</div>
+        <div class="flex-1">{{(summary.total_paid() || 0) | currency}}</div>
+      </div>
+      <div class="d-flex">
+        <div class="flex-4" i18n>Total Billed:</div>
+        <div class="flex-1">{{(summary.total_owed() || 0) | currency}}</div>
+      </div>
+      <div class="d-flex">
+        <div class="flex-4" i18n>Total Paid/Credited:</div>
+        <div class="flex-1">{{(summary.total_paid() || 0) | currency}}</div>
+      </div>
+    </div>
+
+    <div class="col-lg-3 pr-0 mr-0 border-right">
+      <div class="d-flex">
+        <div class="flex-4" i18n>Owed for Selected:</div>
+        <div class="flex-1">{{owedSelected() | currency}}</div>
+      </div>
+      <div class="d-flex">
+        <div class="flex-4" i18n>Billed for Selected:</div>
+        <div class="flex-1">{{billedSelected() | currency}}</div>
+      </div>
+      <div class="d-flex">
+        <div class="flex-4" i18n>Paid/Credited for Selected:</div>
+        <div class="flex-1">{{paidSelected() | currency}}</div>
+      </div>
+    </div>
+
+    <div class="col-lg-3 pr-0 mr-0 border-right">
+      <div class="d-flex">
+        <div class="flex-4" i18n>Refunds Available:</div>
+        <div class="flex-1">{{refundsAvailable() | currency}}</div>
+      </div>
+      <div class="d-flex">
+        <div class="flex-4" i18n>Credit Available:</div>
+        <div class="flex-1">{{patron().credit_forward_balance() | currency}}</div>
+      </div>
+      <div class="d-flex">
+        <div class="flex-4" i18n>Session Voided:</div>
+        <div class="flex-1">{{sessionVoided | currency}}</div>
+      </div>
+    </div>
+
+    <div class="col-lg-3 pr-0 mr-0">
+      <div class="d-flex">
+        <div class="flex-4">&nbsp;</div>
+        <div class="flex-1">&nbsp;</div>
+      </div>
+      <div class="d-flex">
+        <div class="flex-4" i18n>Pending Payment:</div>
+        <div class="flex-1 font-weight-bold">{{pendingPayment() | currency}}</div>
+      </div>
+      <div class="d-flex">
+        <div class="flex-4" i18n>Pending Change:</div>
+        <div class="flex-1 font-weight-bold">{{pendingChange() | currency}}</div>
+      </div>
+    </div>
+  </div>
+</ng-container>
+
+<div class="row bg-light border border-dark rounded pt-2 pb-2 mt-2 mb-2 payment-form">
+  <div class="col-lg-12 d-flex form-inline form-validated">
+    <div class="font-weight-bold" i18n>Pay Bill:</div>
+    <div class="ml-4"><label for="payment-type" i18n>Payment Type:</label></div>
+    <div class="ml-2">
+      <select [(ngModel)]="paymentType" class="form-control ml-2" id="payment-type">
+        <option value="cash_payment" i18n>Cash</option>
+        <option value="check_payment" i18n>Check</option>
+        <option value="credit_card_payment" i18n>Credit Card</option>
+        <option value="debit_card_payment" i18n>Debit Card</option>
+        <option value="credit_payment" i18n>Patron Credit</option>
+        <option value="work_payment" i18n>Work</option>
+        <option value="forgive_payment" i18n>Forgive</option>
+        <option value="goods_payment" i18n>Goods</option>
+      </select>
+    </div>
+    <div class="ml-4"><label for="check-number" i18n>Check Number:</label></div>
+    <div class="ml-2">
+      <input type="text" class="form-control" [(ngModel)]="checkNumber"
+        id="check-number" [disabled]="paymentType !== 'check_payment'"/>
+    </div>
+    <div class="ml-4"><label for="pay-amount" i18n>Payment Received:</label></div>
+    <div class="ml-2">
+      <input type="number" class="form-control" [(ngModel)]="payAmount"
+        id="pay-amount" [min]="0"/>
+    </div>
+    <div class="ml-4 form-check form-check-inline">
+      <input class="form-check-input" type="checkbox" id="annotate" [(ngModel)]="annotatePayment"/>
+      <label class="form-check-label" for="annotate" i18n>Annotate</label>
+    </div>
+    <div class="ml-4">
+      <button class="btn btn-outline-dark" (click)="applyPayment()" i18n>Apply Payment</button>
+    </div>
+  </div>
+</div>
+
+
diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.ts
new file mode 100644 (file)
index 0000000..6f60f61
--- /dev/null
@@ -0,0 +1,85 @@
+import {Component, Input, OnInit, AfterViewInit} from '@angular/core';
+import {Router, ActivatedRoute, ParamMap} from '@angular/router';
+import {NgbNav, NgbNavChangeEvent} from '@ng-bootstrap/ng-bootstrap';
+import {IdlObject} from '@eg/core/idl.service';
+import {NetService} from '@eg/core/net.service';
+import {PcrudService} from '@eg/core/pcrud.service';
+import {AuthService} from '@eg/core/auth.service';
+import {ServerStoreService} from '@eg/core/server-store.service';
+import {PatronService} from '@eg/staff/share/patron/patron.service';
+import {PatronContextService} from './patron.service';
+
+@Component({
+  templateUrl: 'bills.component.html',
+  selector: 'eg-patron-bills',
+  styleUrls: ['bills.component.css']
+})
+export class BillsComponent implements OnInit, AfterViewInit {
+
+    @Input() patronId: number;
+    summary: IdlObject;
+    sessionVoided = 0;
+    paymentType = 'cash_payment';
+    checkNumber: string;
+    annotatePayment = false;
+
+    constructor(
+        private router: Router,
+        private route: ActivatedRoute,
+        private net: NetService,
+        private pcrud: PcrudService,
+        private auth: AuthService,
+        private store: ServerStoreService,
+        public patronService: PatronService,
+        public context: PatronContextService
+    ) {}
+
+    ngOnInit() {
+        this.load();
+    }
+
+    ngAfterViewInit() {
+        const node = document.getElementById('pay-amount');
+        if (node) { node.focus(); }
+    }
+
+    load() {
+
+        this.pcrud.retrieve('mous', this.patronId, {}, {authoritative : true})
+        .subscribe(sum => this.summary = sum);
+    }
+
+    patron(): IdlObject {
+        return this.context.patron;
+    }
+
+    // TODO
+    refundsAvailable(): number {
+        return 0;
+    }
+
+    // TODO
+    paidSelected(): number {
+        return 0;
+    }
+
+    // TODO
+    owedSelected(): number {
+        return 0;
+    }
+
+    // TODO
+    billedSelected(): number {
+        return 0;
+    }
+
+    pendingPayment(): number {
+        return 0;
+    }
+
+    pendingChange(): number {
+        return 0;
+    }
+
+}
+
index 8ccfd34..53024df 100644 (file)
@@ -74,8 +74,7 @@
         <li ngbNavItem="bills" [disabled]="!context.patron">
           <a ngbNavLink i18n>Bills</a>
           <ng-template ngbNavContent>
-            <div class="">
-            </div>
+            <eg-patron-bills [patronId]="patronId"></eg-patron-bills>
           </ng-template>
         </li>
 
index 8f4ed17..dc451b2 100644 (file)
@@ -19,6 +19,7 @@ import {EditToolbarComponent} from './edit-toolbar.component';
 import {BcSearchComponent} from './bcsearch.component';
 import {BarcodesModule} from '@eg/staff/share/barcodes/barcodes.module';
 import {ItemsComponent} from './items.component';
+import {BillsComponent} from './bills.component';
 
 @NgModule({
   declarations: [
@@ -30,7 +31,8 @@ import {ItemsComponent} from './items.component';
     EditComponent,
     EditToolbarComponent,
     BcSearchComponent,
-    ItemsComponent
+    ItemsComponent,
+    BillsComponent
   ],
   imports: [
     StaffCommonModule,