From: Bill Erickson Date: Tue, 9 Nov 2021 15:56:36 +0000 (-0500) Subject: LP1904036 Improve patron reg billing/mailing checkboxes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1a388c1485738837a358ec4921c27e077d0b3d3c;p=working%2FEvergreen.git LP1904036 Improve patron reg billing/mailing checkboxes Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- 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); } }