{
  "header": {
    "id": "POC_Having",
    "modelType": "document",
    "modelVersion": "27.1.0",
    "locales": [
      {
        "code": "en"
      }
    ],
    "annotations": [
      {
        "name": "roles",
        "value": "admin"
      }
    ],
    "modelReferences": []
  },
  "content": {
    "modelInfo": {
      "name": "POC_Having"
    },
    "modelConfig": {
      "decimalSeparator": ".",
      "timeZone": "UTC",
      "conditionLanguage": {
        "code": "en_US"
      }
    },
    "modelRoot": {
      "rootGroups": [
        {
          "type": "Group",
          "id": "group_6a537",
          "name": "VZR",
          "Group": {
            "label": [
              {
                "locale": "en",
                "text": "VZR"
              }
            ],
            "repeatability": 1,
            "elements": [
              {
                "type": "Group",
                "id": "group_adc60",
                "name": "Abrechnung",
                "Group": {
                  "label": [
                    {
                      "locale": "en",
                      "text": "Abrechnung"
                    }
                  ],
                  "repeatability": 1,
                  "elements": [
                    {
                      "type": "Field",
                      "id": "field_23ede",
                      "name": "POC",
                      "Field": {
                        "fieldType": {
                          "type": "DateType",
                          "DateType": {
                            "format": "yyyy-MM-dd"
                          }
                        },
                        "label": [
                          {
                            "locale": "en",
                            "text": "POC: date of latest entry satisfying the filter"
                          }
                        ]
                      }
                    },
                    {
                      "type": "Computation",
                      "id": "computation_c230b",
                      "name": "POCComp",
                      "Computation": {
                        "computedFieldId": "field_23ede",
                        "computationAlternatives": [
                          {
                            "operation": "MaxValue(../ZerlB*/RtKStZB \r\n    Having [../ZerlB/Status] == \"offen\" \r\n    and [../ZerlB/Storno] == False \r\n)"
                          }
                        ],
                        "errorMessage": [
                          {
                            "locale": "en",
                            "text": "error text for computation of POCComp"
                          }
                        ]
                      }
                    },
                    {
                      "type": "Field",
                      "id": "field_91e2b",
                      "name": "POC2",
                      "Field": {
                        "fieldType": {
                          "type": "NumberType"
                        },
                        "label": [
                          {
                            "locale": "en",
                            "text": "POC2: value of SomeValue for latest entry satisfiying filtering"
                          }
                        ]
                      }
                    },
                    {
                      "type": "Computation",
                      "id": "computation_1da11",
                      "name": "POC2Comp",
                      "Computation": {
                        "computedFieldId": "field_91e2b",
                        "computationAlternatives": [
                          {
                            "operation": "FirstFilledValue(../ZerlB*/SomeValue\r\n    Having [../ZerlB/helperLatestFiltered] == True\r\n)"
                          }
                        ],
                        "errorMessage": [
                          {
                            "locale": "en",
                            "text": "error text for computation of POC2Comp"
                          }
                        ]
                      }
                    }
                  ]
                }
              },
              {
                "type": "Group",
                "id": "group_184fc",
                "name": "ZerlB",
                "Group": {
                  "label": [
                    {
                      "locale": "en",
                      "text": "ZerlB"
                    }
                  ],
                  "repeatability": 10,
                  "elements": [
                    {
                      "type": "Field",
                      "id": "field_2b829",
                      "name": "RtKStZB",
                      "Field": {
                        "fieldType": {
                          "type": "DateType",
                          "DateType": {
                            "format": "yyyy-MM-dd"
                          }
                        },
                        "label": [
                          {
                            "locale": "en",
                            "text": "RtKStZB"
                          }
                        ]
                      }
                    },
                    {
                      "type": "Field",
                      "id": "field_20a15",
                      "name": "Status",
                      "Field": {
                        "fieldType": {
                          "type": "EnumerationType",
                          "EnumerationType": {
                            "values": [
                              {
                                "value": "offen",
                                "label": [
                                  {
                                    "locale": "en",
                                    "text": "offen"
                                  }
                                ]
                              },
                              {
                                "value": "notoffen",
                                "label": [
                                  {
                                    "locale": "en",
                                    "text": "not offen"
                                  }
                                ]
                              }
                            ],
                            "categories": []
                          }
                        },
                        "label": [
                          {
                            "locale": "en",
                            "text": "Status"
                          }
                        ]
                      }
                    },
                    {
                      "type": "Field",
                      "id": "field_309e5",
                      "name": "Storno",
                      "Field": {
                        "fieldType": {
                          "type": "BooleanType"
                        },
                        "label": [
                          {
                            "locale": "en",
                            "text": "Storno"
                          }
                        ]
                      }
                    },
                    {
                      "type": "Field",
                      "id": "field_555f9",
                      "name": "SomeValue",
                      "Field": {
                        "fieldType": {
                          "type": "NumberType"
                        },
                        "label": [
                          {
                            "locale": "en",
                            "text": "SomeValue"
                          }
                        ]
                      }
                    },
                    {
                      "type": "Field",
                      "id": "field_4b24f",
                      "name": "helperLatestFiltered",
                      "Field": {
                        "fieldType": {
                          "type": "BooleanType"
                        },
                        "label": [
                          {
                            "locale": "en",
                            "text": "helperLatestFiltered"
                          }
                        ]
                      }
                    },
                    {
                      "type": "Computation",
                      "id": "computation_5dea1",
                      "name": "helperLatestFilteredComp",
                      "Computation": {
                        "computedFieldId": "field_4b24f",
                        "computationAlternatives": [
                          {
                            "precondition": "[RtKStZB] == MaxValue(../ZerlB*/RtKStZB \r\n    Having [../ZerlB/Status] == \"offen\" \r\n    and [../ZerlB/Storno] == False\r\n)",
                            "operation": "True"
                          },
                          {
                            "precondition": "[RtKStZB] != MaxValue(../ZerlB*/RtKStZB \r\n    Having [../ZerlB/Status] == \"offen\" \r\n    and [../ZerlB/Storno] == False\r\n)",
                            "operation": "False"
                          }
                        ],
                        "errorMessage": [
                          {
                            "locale": "en",
                            "text": "error text for computation of helperLatestFilteredComp"
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  }
}