{
  "eventsAndFunctions": [
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "ReadModel",
            "modelVariableName": "sales",
            "variableName": "sales"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "planId",
            "variableName": "planId"
          },
          {
            "command": "Load",
            "expression": "Select(ExtStrategicPlanMng.PlanList(),[id,name])",
            "widgetName": "cmbCiclo"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "sales",
            "type": "ExtStrategicPlanMng.Period"
          },
          {
            "name": "planId",
            "type": "string"
          }
        ]
      },
      "name": "main_init"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "Execute",
            "expression": "updateSales()"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "sales",
            "variableName": "sales"
          },
          {
            "command": "ReadModel",
            "modelVariableName": "planId",
            "variableName": "planId"
          },
          {
            "command": "Execute",
            "expression": "ExtStrategicPlanMng.PlanUpdate(^planId, ^sales)"
          },
          {
            "command": "AlertMessage",
            "expressionMessage": "\"[[SuccessfulUpdateMessage]]\"",
            "expressionTitle": "\"[[SuccessfulUpdate]]\"",
            "severity": "information"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "sales",
            "type": "ExtStrategicPlanMng.Period"
          },
          {
            "name": "planId",
            "type": "string"
          }
        ]
      },
      "name": "buttonSave_click"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "Navigate",
            "expressionStartModel": "{ contactType: \"sales\" }",
            "uiComponentName": "CmpSpSalesCrud"
          }
        ],
        "typeReturn": "any",
        "variables": []
      },
      "name": "buttonCancel_click"
    },
    {
      "algorithm": {
        "parameters": [],
        "statements": [
          {
            "command": "ReadModel",
            "modelVariableName": "sales",
            "variableName": "sales"
          },
          {
            "command": "GetValue",
            "variableName": "sales.fromDate",
            "widgetName": "dateboxInicio"
          },
          {
            "command": "GetValue",
            "variableName": "sales.toDate",
            "widgetName": "dateboxCierre"
          },
          {
            "command": "GetValue",
            "variableName": "sales.index",
            "widgetName": "comboboxCiclo"
          },
          {
            "command": "WriteModel",
            "expression": "^sales",
            "modelVariableName": "sales"
          }
        ],
        "typeReturn": "any",
        "variables": [
          {
            "name": "sales",
            "type": "ExtStrategicPlanMng.Period"
          }
        ]
      },
      "name": "updateSales"
    }
  ],
  "model": [
    {
      "name": "sales",
      "required": false,
      "type": "ExtStrategicPlanMng.Period"
    },
    {
      "name": "planId",
      "required": false,
      "type": "string"
    }
  ],
  "root": {
    "children": [
      {
        "children": [
          {
            "children": [
              {
                "children": [
                  {
                    "cssClass": "blz-padding-top-large blz-padding-right-large blz-padding-left-large blz-padding-bottom-large",
                    "icon": "calendar.png",
                    "name": "spVentasTitle",
                    "title": "[[StrategicSalesPlanPeriods]]",
                    "typeName": "ExtStrategicPlanMng.Period",
                    "widget": "HtmlRepeater"
                  }
                ],
                "cssClass": "blz-area-default blz-responsive-col-6 blz-padding-top-large blz-padding-bottom-large",
                "layout": "fit"
              }
            ],
            "cssClass": "blz-border-top blz-border-right blz-border-left blz-border-bottom blz-border-radius blz-cast-shadow",
            "layout": "responsive"
          }
        ],
        "cssClass": "blz-padding-top blz-padding-bottom-small",
        "layout": "responsive"
      },
      {
        "children": [
          {
            "children": [
              {
                "children": [
                  {
                    "name": "spVentasSpace1",
                    "widget": "FixedContainer"
                  }
                ],
                "layout": "fit",
                "size": 3
              },
              {
                "children": [
                  {
                    "children": [
                      {
                        "children": [
                          {
                            "label": "[[Inicio]]",
                            "name": "dateboxInicio",
                            "size": 2,
                            "widget": "DateBox"
                          },
                          {
                            "label": "[[Cierre]]",
                            "last": true,
                            "name": "dateboxCierre",
                            "size": 2,
                            "widget": "DateBox"
                          }
                        ],
                        "cssClass": "blz-padding-top-large blz-padding-bottom-large",
                        "layout": "form"
                      },
                      {
                        "children": [
                          {
                            "dataFormat": "DirectList",
                            "label": "[[CiclodeControl]]",
                            "last": true,
                            "name": "comboboxCiclo",
                            "size": 2,
                            "widget": "ComboBox"
                          }
                        ],
                        "cssClass": "blz-padding-top-large blz-padding-bottom-large",
                        "layout": "form"
                      },
                      {
                        "children": [
                          {
                            "icon": "save.svg",
                            "name": "buttonSave",
                            "text": "[[Save]]",
                            "widget": "Button"
                          },
                          {
                            "icon": "remove.svg",
                            "name": "buttonCancel",
                            "text": "[[Cancel]]",
                            "widget": "Button"
                          }
                        ],
                        "cssClass": "blz-padding-top-large blz-padding-bottom-large",
                        "layout": "form"
                      }
                    ],
                    "cssClass": "blz-padding-top-large blz-padding-right-large blz-padding-left-large blz-padding-bottom-large",
                    "layout": "fit",
                    "title": "[[ConfigurationPeriod]]"
                  }
                ],
                "cssClass": "blz-area-default blz-responsive-col-6 blz-padding-top-large blz-padding-right-large blz-padding-left-large blz-padding-bottom-large blz-border-top blz-border-right blz-border-left blz-border-bottom blz-border-radius blz-cast-shadow",
                "layout": "fit",
                "size": 6
              },
              {
                "children": [
                  {
                    "name": "spVentasSpace2",
                    "widget": "FixedContainer"
                  }
                ],
                "layout": "fit",
                "size": 3
              }
            ],
            "cssClass": "blz-padding-top blz-padding-right-small blz-padding-left-small blz-padding-bottom",
            "layout": "responsive"
          }
        ],
        "cssClass": "blz-padding-top-small blz-padding-bottom-small",
        "layout": "responsive"
      }
    ],
    "layout": "responsive"
  },
  "routing": {
    "path": "/sp-sales-crud"
  },
  "unused": [
    {
      "cssClass": "blz-padding-top-large blz-padding-right-large blz-padding-left-large blz-padding-bottom-large",
      "name": "spVentasCrud",
      "title": "[[ConfigurationPeriod]]",
      "widget": "HtmlRenderer"
    },
    {
      "label": "[[Inicio]]",
      "mandatory": true,
      "name": "dtbInicio",
      "size": 2,
      "widget": "DateBox"
    },
    {
      "label": "[[Cierre]]",
      "last": true,
      "mandatory": true,
      "name": "dtbCierre",
      "size": 2,
      "widget": "DateBox"
    },
    {
      "dataFormat": "DirectList",
      "label": "[[Ciclodecontrol]]",
      "last": true,
      "name": "cmbCiclo",
      "size": 2,
      "widget": "ComboBox"
    },
    {
      "icon": "save.svg",
      "name": "btnSave",
      "text": "[[Save]]",
      "widget": "Button"
    },
    {
      "icon": "remove.svg",
      "name": "btnCancel",
      "text": "[[Cancel]]",
      "widget": "Button"
    }
  ]
}