From 5a2f427e02f357b51e61780a2f1668b87b35b116 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Mon, 29 Aug 2022 07:38:42 -0400 Subject: [PATCH] LP1859701 follow-up fixes for Cash Report * restore totals to area outside of grid * add Debit Card Payments * relabel Credit Payment to Patron Credit Payment in outside-grid area * relabel User Payments to Staff User Payments in outside-grid area * relabel "patron" columns in Staff User Payments grid to "staff" Signed-off-by: Jason Etheridge Signed-off-by: Jane Sandberg Signed-off-by: Michele Morgan --- .../local/cash-reports/cash-reports.component.html | 20 +++++++++++++------- .../local/cash-reports/cash-reports.component.ts | 7 +++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.html index 1cf4c64686..37023f2fc5 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.html @@ -47,6 +47,10 @@
Total Credit Card Payments
{{deskTotals.credit_card_payment | currency}}
+
+
Total Debit Card Payments
+
{{deskTotals.debit_card_payment | currency}}
+
+
  • - User Payments + Staff User Payments
    -
    Total Credit Payments
    +
    Total Patron Credit Payments
    {{userTotals.credit_payment | currency}}
    @@ -94,14 +99,15 @@ [sortable]="false"> + - - - - - + + + + +
    diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.ts index f77a147ad2..5ec63b0375 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.ts @@ -11,6 +11,7 @@ class DeskTotals { cash_payment = 0; check_payment = 0; credit_card_payment = 0; + debit_card_payment = 0; } class UserTotals { @@ -78,13 +79,17 @@ export class CashReportsComponent implements OnInit { } fillGridData(idlClass, dataSource, data) { + let dataForTotal; data.subscribe((result) => { if (idlClass === this.userIdlClass) { + dataForTotal = this.getUserTotal(result); result.forEach((userObject, index) => { result[index].user = userObject.usr(); result[index].usr(userObject.usr().usrname()); console.log('USER IS', userObject); }); + } else if(idlClass === this.deskIdlClass) { + dataForTotal = this.getDeskTotal(result); } this[dataSource].data = result; this.eraseUserGrid(); @@ -104,10 +109,12 @@ export class CashReportsComponent implements OnInit { this.deskTotals['cash_payment'] += parseFloat(idlObject.cash_payment()); this.deskTotals['check_payment'] += parseFloat(idlObject.check_payment()); this.deskTotals['credit_card_payment'] += parseFloat(idlObject.credit_card_payment()); + this.deskTotals['debit_card_payment'] += parseFloat(idlObject.debit_card_payment()); }); idlObjectFormat.cash_payment(this.deskTotals['cash_payment']); idlObjectFormat.check_payment(this.deskTotals['check_payment']); idlObjectFormat.credit_card_payment(this.deskTotals['credit_card_payment']); + idlObjectFormat.debit_card_payment(this.deskTotals['debit_card_payment']); return idlObjectFormat; } } -- 2.11.0