From 1a388c1485738837a358ec4921c27e077d0b3d3c Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 9 Nov 2021 10:56:36 -0500 Subject: [PATCH] LP1904036 Improve patron reg billing/mailing checkboxes Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts index 0affa88c2d..92b7763ef2 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.ts @@ -1293,12 +1293,20 @@ export class EditComponent implements OnInit, AfterViewInit { // select another address to fill that role. Select the // first address in the list (that does not match the // modifed address) + let found = false; this.patron.addresses().some(a => { if (a.id() !== addr.id()) { this.patron[addrType + '_address'](a); - return true; + return found = true; } }); + + if (!found) { + // No alternate address was found. Clear the value. + this.patron[addrType + '_address'](null); + } + + this.patron.ischanged(true); } } -- 2.11.0