From: Galen Charlton Date: Thu, 9 Jul 2020 16:22:34 +0000 (-0400) Subject: improve handling of currency type (LH#30) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c00a0e98de3f1ce9f18a663afd24eb298f116462;p=working%2FEvergreen.git improve handling of currency type (LH#30) - display currency label in the summary - fix ability to edit it in the details fm-editor - preload the currency drop-down Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-details.component.html b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-details.component.html index 97266f7fd3..a8a384e7f9 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-details.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-details.component.html @@ -11,6 +11,7 @@ (recordSaved)="updateProvider($event)" readonlyFields="id" hiddenFields="holding_tag" + [fieldOptions]="{currency_type:{preloadLinkedValues:true}}" fieldOrder="active,name,code,id,currency_type,default_claim_policy,default_copy_count,edi_default,owner,phone,fax_phone,email,url,san,prepayment_required" > diff --git a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-details.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-details.component.ts index 3846cf9510..e60d12110c 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-details.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/provider/provider-details.component.ts @@ -41,9 +41,19 @@ export class ProviderDetailsComponent implements OnInit { this.refresh(); } + _deflesh() { + // unflesh the currency type field so that the record editor + // can display it + // TODO: make fm-editor be able to handle fleshed linked fields + if (this.provider.currency_type()) { + this.provider.currency_type(this.provider.currency_type().code()); + } + } + updateProvider(providerId: any) { this.providerRecord.refreshCurrent().then(() => { this.provider = this.providerRecord.current(); + this._deflesh(); this.summarize.emit(this.provider.id()); }); } @@ -51,6 +61,7 @@ export class ProviderDetailsComponent implements OnInit { refresh() { this.providerRecord.refreshCurrent().then(() => { this.provider = this.providerRecord.current(); + this._deflesh(); }); } diff --git a/Open-ILS/src/eg2/src/app/staff/acq/provider/summary-pane.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/provider/summary-pane.component.ts index 38de105ef7..e2d6965de6 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/provider/summary-pane.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/provider/summary-pane.component.ts @@ -136,7 +136,7 @@ export class AcqProviderSummaryPaneComponent implements OnInit, AfterViewInit { this.provider_name = provider.name(); this.provider_code = provider.code(); this.provider_owner = this.org.get(provider.owner()).shortname(); - this.provider_currency_type = provider.currency_type(); + this.provider_currency_type = provider.currency_type() ? provider.currency_type().label() : ''; this.provider_holding_tag = provider.holding_tag(); this.provider_addresses = provider.addresses(); this.provider_san = provider.san();