(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"
>
</eg-fm-record-editor>
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());
});
}
refresh() {
this.providerRecord.refreshCurrent().then(() => {
this.provider = this.providerRecord.current();
+ this._deflesh();
});
}
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();