Criar ou editar Variable

@if (true || editForm.controls.id.value == null) { } @else { }
@if (true || editForm.controls.id.value == null) { } @else { }
@if (editForm.controls.id.value == null) { } @else { } @if (editForm.get('code')!.invalid && (editForm.get('code')!.dirty || editForm.get('code')!.touched)) {
@if (editForm.get('code')?.errors?.required) { O campo é obrigatório. } @if (editForm.get('code')?.errors?.pattern) { Este campo deve estar dentro do seguinte padrão Code. }
}
@if (editForm.get('name')!.invalid && (editForm.get('name')!.dirty || editForm.get('name')!.touched)) {
@if (editForm.get('name')?.errors?.required) { O campo é obrigatório. }
}
@if (editForm.get('description')!.invalid && (editForm.get('description')!.dirty || editForm.get('description')!.touched)) {
@if (editForm.get('description')?.errors?.required) { O campo é obrigatório. }
}
@if (editForm.get('input')!.invalid && (editForm.get('input')!.dirty || editForm.get('input')!.touched)) {
@if (editForm.get('input')?.errors?.required) { O campo é obrigatório. }
}
@if (editForm.get('hiddenForMain')!.invalid && (editForm.get('hiddenForMain')!.dirty || editForm.get('hiddenForMain')!.touched)) {
@if (editForm.get('hiddenForMain')?.errors?.required) { O campo é obrigatório. }
}
@if (editForm.get('inputMode')!.invalid && (editForm.get('inputMode')!.dirty || editForm.get('inputMode')!.touched)) {
@if (editForm.get('inputMode')?.errors?.required) { O campo é obrigatório. }
}
@if (editForm.get('output')!.invalid && (editForm.get('output')!.dirty || editForm.get('output')!.touched)) {
@if (editForm.get('output')?.errors?.required) { O campo é obrigatório. }
}
{{ '' // Add fa-icon 'faCaretDown' to /app/config/font-awesome-icons.ts }} {{ '' // Add fa-icon 'faCaretUp' to /app/config/font-awesome-icons.ts }} {{ 'resilientApp.variable.outputFormulaHelp' | translate : { default: 'help' } }}
Formula helper

Formula fields provide a powerfull way of configuration and calculation. Use any of SpEL language and funtions.

In this context, the following variables are added:

  • variable - the Variable
  • period - the Period
  • periodVersion - the Period Version
  • owner - the Owner of the information, this is an Organization level

In this context, the following functions are added:

  • fe(EmissionFactorCode) - Searches for the emission factor by its code, and the closest to the Year of the current Period (<=Period.Year).
  • fe(EmissionFactorCode, Year) - Searches for the emission factor by its code, and the closest to the given Year (<=Year).
  • in(VariableCode) - Searches for inputs for this variable code, without class restriction. Restricted by the current Period.
  • in(VariableCode, ClassCode) - Searches for inputs for this variable code, restricted by class. Restricted by the current Period.
  • in(VariableCode, ClassCode, OwnerCode) - Searches for inputs for this variable code, restricted by class and Owner code. Restricted by the current Period.
  • NOTE: the ClassCode can be filled with the value "*ALL", this will ignore the class code restriction. Usefull when using the function: in(VariableCode, ClassCode, OwnerCode), to get all values for a OwnerCode without Class restriction.
  • out(VariableCode) - Searches for calculated outputs for this variable code. Restricted by the current Owner and Period Version.
  • out(VariableCode, OwnerCode) - Searches for calculated outputs for this variable code, for the given Owner Code. Restricted by the current Period Version.
  • outByUnit(UnitCode) - Searches for calculated outputs for this unit code. Restricted by the current Owner and Period Version.
  • outByUnit(UnitCode, OwnerCode) - Searches for calculated outputs for this unit code, for the given Owner Code. Restricted by the current Period Version.
@if (editForm.get('variableClassLabel')!.invalid && (editForm.get('variableClassLabel')!.dirty || editForm.get('variableClassLabel')!.touched)) {
@if (editForm.get('variableClassLabel')?.errors?.required) { O campo é obrigatório. }
}
@if (editForm.get('variableClassMandatory')!.invalid && (editForm.get('variableClassMandatory')!.dirty || editForm.get('variableClassMandatory')!.touched)) {
@if (editForm.get('variableClassMandatory')?.errors?.required) { O campo é obrigatório. }
}
Unit Converter
{{i+1}}