LP1904036 Billing history payments fix date filter
authorBill Erickson <berickxx@gmail.com>
Wed, 25 Aug 2021 16:28:18 +0000 (12:28 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:37 +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 37ad704..a3f4998 100644 (file)
         </div>
         <div class="col-lg-4 form-inline">
           <span class="mr-2" i18n>Start Date:</span>
-          <eg-date-select [initialIso]="xactsStart"
-            (onChangeAsIso)="dateChange('xactsStart', $event)"></eg-date-select>
+          <eg-date-select [initialIso]="paymentsStart"
+            (onChangeAsDate)="dateChange('paymentsStart', $event)"></eg-date-select>
         </div>
         <div class="col-lg-4 form-inline">
           <span class="mr-2" i18n>End Date:</span>
-          <eg-date-select [initialIso]="xactsEnd"
-            (onChangeAsIso)="dateChange('xactsEnd', $event)"></eg-date-select>
+          <eg-date-select [initialIso]="paymentsEnd"
+            (onChangeAsDate)="dateChange('paymentsEnd', $event)"></eg-date-select>
         </div>
       </div>
 
index 41d4527..b36bd0e 100644 (file)
@@ -118,9 +118,15 @@ export class BillingHistoryComponent implements OnInit {
         };
     }
 
-    dateChange(which: string, iso: string) {
+    dateChange(which: string, d: Date) {
 
-        this[which] = iso;
+        if (which.match(/End/)) {
+            // Add a day to the end date so the DB query includes all of
+            // the selected date.
+            d.setDate(d.getDate() + 1);
+        }
+
+        this[which] = DateUtil.localYmdFromDate(d);
 
         if (which.match(/xacts/)) {
             this.xactsGrid.reload();