{
  "eventsAndFunctions": [
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "Set",
            "expression": "[]",
            "variableName": "data"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "planId",
            "variableName": "planId"
          },
          {
            "children": [
              {
                "command": "Set",
                "expression": "ExtStrategicPlanMng.PlanRetrieve(^planId)",
                "variableName": "plan"
              },
              {
                "command": "SetValue",
                "expression": "^plan",
                "widgetName": "forecastTitle"
              }
            ],
            "command": "If",
            "expression": "IsNotNull(^planId)"
          },
          {
            "command": "Refresh",
            "widgetName": "forecastGrid"
          },
          {
            "command": "Set",
            "expression": "GetForecastData()",
            "variableName": "data"
          },
          {
            "command": "OpenInContainer",
            "expressionIcon": "\"\"",
            "expressionStartModel": "{data: ^data}",
            "expressionTitle": "\"\"",
            "expressionUiComponentName": "\"CmpForecastGraph\"",
            "widgetNameContainer": "graphContainer"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "planId",
            "type": "string"
          },
          {
            "name": "plan",
            "type": "ExtStrategicPlanMng.Plan"
          },
          {
            "name": "data",
            "type": "list(ForecastGraphData)"
          }
        ]
      },
      "name": "main_init"
    },
    {
      "algorithm": {
        "parameters": [
          {
            "name": "args",
            "type": "ArgsLoadRecords"
          }
        ],
        "statements": [
          {
            "command": "Return",
            "expression": "getOpportunitiesRecords(^args)"
          }
        ],
        "typeReturn": "any",
        "variables": []
      },
      "name": "forecastGrid_loadRecords"
    },
    {
      "algorithm": {
        "parameters": [
          {
            "name": "args",
            "type": "ArgsLoadRecords"
          }
        ],
        "statements": [
          {
            "command": "Set",
            "expression": "[]",
            "variableName": "returnList"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "filterName",
            "variableName": "filterName"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "filterLetter",
            "variableName": "filterLetter"
          },
          {
            "command": "Set",
            "expression": "{ limit:5,offset:^args.offset, sortBy:[\"Desc(OpportunityId)\"], fields:[\"AccountRef\", \"Currency\", \"InteractionRef\", \"ExecutionInstance\", \"SalesTeamPath\"] }",
            "variableName": "args"
          },
          {
            "children": [
              {
                "command": "Set",
                "expression": "^filterName",
                "variableName": "args.name"
              }
            ],
            "command": "If",
            "expression": "!IsNull(^filterName)"
          },
          {
            "children": [
              {
                "command": "Set",
                "expression": "^filterLetter",
                "variableName": "args.name"
              }
            ],
            "command": "If",
            "expression": "!IsNull(^filterLetter)"
          },
          {
            "command": "Set",
            "expression": "ExtPresales.ListOpportunities(^args)",
            "variableName": "opportunities"
          },
          {
            "command": "Return",
            "expression": "^opportunities"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "args",
            "type": "ExtPresales.ArgsListOpportunities"
          },
          {
            "name": "argsGet",
            "type": "ExtPresales.ArgsListOpportunities"
          },
          {
            "name": "filterName",
            "type": "string"
          },
          {
            "name": "filterLetter",
            "type": "string"
          },
          {
            "name": "opportunities",
            "type": "list(ExtPresales.Opportunity)"
          },
          {
            "name": "opportunity",
            "type": "any"
          },
          {
            "name": "instance",
            "type": "ExtInteractionEngine.ExecutionInstance"
          },
          {
            "name": "returnList",
            "type": "any"
          }
        ]
      },
      "name": "getOpportunitiesRecords"
    }
  ],
  "model": [
    {
      "name": "planId",
      "required": true,
      "type": "string"
    }
  ],
  "root": {
    "children": [
      {
        "children": [
          {
            "cssClass": "blz-padding-top blz-padding-bottom",
            "htmlTemplate": "<div class=\"blz-toolbar-container blz-header\">\n        <div class=\"blz-toolbar-left-side\"><div id=\"blz-toolbar-title-10047-57\" class=\"blz-toolbar-title blz-title-default blz-toolbar-element\">\n        <div class=\"blz-icon-container blz-header-icon\" style=\"display: none\">\n            <span id=\"blz-toolbar-title-10047-57-icon\" class=\"blz-toolbar-icon\"></span>\n        </div>\n        <span id=\"blz-toolbar-title-10047-57-title\" class=\"blz-panel-title blz-header-title blz-color-default\">\n           [[SalesForecast]] {{name}}\n        </span>\n</div></div>\n        <div class=\"blz-flex-filler\"></div>\n        <div class=\"blz-toolbar-right-side\"></div>\n    </div>",
            "name": "forecastTitle",
            "widget": "HtmlRenderer"
          },
          {
            "children": [
              {
                "dataFormat": "KeyValueList",
                "label": "[[Category]]",
                "name": "cboCategory",
                "widget": "ComboBox"
              },
              {
                "dataFormat": "KeyValueList",
                "label": "[[Period]]",
                "name": "cboPeriod",
                "widget": "ComboBox"
              },
              {
                "dataFormat": "KeyValueList",
                "label": "[[Status]]",
                "name": "cboStatus",
                "widget": "ComboBox"
              },
              {
                "dataFormat": "KeyValueList",
                "label": "[[ProductLine]]",
                "name": "cboProductLine",
                "widget": "ComboBox"
              },
              {
                "dataFormat": "KeyValueList",
                "label": "[[CustomerSegment]]",
                "name": "cboCustomerSegment",
                "widget": "ComboBox"
              },
              {
                "dataFormat": "KeyValueList",
                "label": "[[SalesVolume]]",
                "name": "cboSalesVolume",
                "widget": "ComboBox"
              },
              {
                "icon": "search-glass.svg",
                "name": "btnSearch",
                "text": "[[Search]]",
                "widget": "Button"
              }
            ],
            "layout": "form"
          },
          {
            "children": [
              {
                "cssClass": "blz-area-default",
                "name": "graphContainer",
                "widget": "FixedContainer"
              }
            ],
            "layout": "fit"
          },
          {
            "children": [
              {
                "columns": [
                  {
                    "align": "left",
                    "bindText": "name",
                    "header": "[[Opportunity]]",
                    "key": "opportunity"
                  },
                  {
                    "align": "left",
                    "bindText": "marketSegment.name",
                    "header": "[[Segment]]",
                    "key": "segment"
                  },
                  {
                    "align": "left",
                    "bindText": "estimatedCloseDate",
                    "format": "Date",
                    "header": "[[EstimatedClosingDate]]",
                    "key": "estimatedClosingDate "
                  },
                  {
                    "align": "left",
                    "bindText": "productLine.name",
                    "header": "[[Product]]"
                  },
                  {
                    "align": "left",
                    "bindText": "probability",
                    "header": "[[Probability]]"
                  },
                  {
                    "align": "left",
                    "bindText": "currentStage",
                    "header": "[[Status]]"
                  },
                  {
                    "align": "left",
                    "bindText": "estimatedRevenue",
                    "format": "Currency",
                    "header": "[[Revenue]]",
                    "key": "revenue"
                  }
                ],
                "name": "forecastGrid",
                "pageSize": 15,
                "typeName": "ExtPresales.Opportunity",
                "widget": "Grid",
                "withPaging": true
              }
            ],
            "layout": "fit"
          }
        ],
        "cssClass": "blz-area-default blz-padding-top blz-padding-right blz-padding-left blz-padding-bottom blz-border-top blz-border-right blz-border-left blz-border-bottom blz-border-radius blz-cast-shadow",
        "layout": "responsive"
      }
    ],
    "cssClass": "blz-padding-top-large blz-padding-right-large blz-padding-left-large blz-padding-bottom-large",
    "layout": "responsive"
  },
  "routing": {
    "path": "/sf-plan/{planId}/forecast"
  },
  "unused": []
}