From: Galen Charlton Date: Thu, 28 Jul 2022 19:20:09 +0000 (+0000) Subject: LP#1942220: (follow-up) fix handling of item count in batch LID update X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d6e50037fe05e5017e8117dc4488afdeba237834;p=working%2FEvergreen.git LP#1942220: (follow-up) fix handling of item count in batch LID update It can be omitted if the user wants to update LIDs but not change their numbers. Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/lineitem/batch-update-copies-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/lineitem/batch-update-copies-dialog.component.ts index fb60ffc580..0ca7575463 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/lineitem/batch-update-copies-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/lineitem/batch-update-copies-dialog.component.ts @@ -17,7 +17,7 @@ export class BatchUpdateCopiesDialogComponent extends DialogComponent { @Input() ids: number[]; - copyCount = 0; + copyCount = ''; selectedFormula: ComboboxEntry; formulaFilter = {owner: []}; templateCopy: IdlObject; @@ -35,7 +35,7 @@ export class BatchUpdateCopiesDialogComponent extends DialogComponent { args = {}; } - this.copyCount = 1; + this.copyCount = ''; this.selectedFormula = null; this.formulaFilter.owner = this.org.fullPath(this.auth.user().ws_ou(), true); @@ -46,7 +46,8 @@ export class BatchUpdateCopiesDialogComponent extends DialogComponent { canApply(): boolean { if (!this.templateCopy) { return false; } - if (this.copyCount > 0 || + const _copyCount = parseInt(this.copyCount, 10); + if ((_copyCount && _copyCount > 0) || this.selectedFormula?.id || this.templateCopy.owning_lib() || this.templateCopy.location() || @@ -61,9 +62,12 @@ export class BatchUpdateCopiesDialogComponent extends DialogComponent { compileBatchChange(): any { const changes = { - item_count: this.copyCount, _dist_formula: this.selectedFormula?.id }; + const _copyCount = parseInt(this.copyCount, 10); + if (_copyCount && _copyCount > 0) { + changes['item_count'] = _copyCount; + } if (this.templateCopy.owning_lib()) { changes['owning_lib'] = this.templateCopy.owning_lib(); }