{
  "info": "",
  "field": {
      "update": [
        ["RELATE_ONE", ["wpe_work_load_group_id"]],
        [
          "if", ["wlg_subcontract"],
          [
            ["wpe_subc_profit_multiplier", "=", ["wlg_profit_multiplier"]]
          ],
          "else",
          [
            ["wpe_profit_multiplier", "=", ["wlg_profit_multiplier"]]
          ]
        ],
        ["wpe_C_TUNTIPALKA"],
        ["wpe_C_HINTAKENTA"]
      ],
      "_fii_SingleClick": [
        [
          "if", ["_fii_SingleClick", "=", "true"],
          [
            ["IDLE"]
          ]
        ]
      ],
      "_fii_fullpageafter": [
        [
          "if", ["_fii_fullpageafter", "=", "true"],
          ["w_ltC_KENTAT ---- ??, ei ole wpe_ -alkuinen"],
          ["w_laC_KENTAT ---- ??, ei ole wpe_ -alkuinen"]
        ]
      ],
      "_fii_recnew": [
        [
          "if", ["_fii_recnew", "=", "true"],
          [
            ["wpe_work_position_num_id", "=", ["w_work_position_num_id"]],
            ["_long", "=", "0"],
            ["_qry_DESTINATION_SET", ["wpe", "Into_variable", "_long"]],
            ["_txt", "=", ["wpe_work_position_num_id"]],
            ["_qry_Fld", ["0", "wpe_work_position_num_id", "=", "_txt", "", "false"]],
            ["_qry_DESTINATION_SET", ["wpe", "Into_current_selection", ""]],
            ["wpe_phase_number", "=", ["_long", "+", "1"]],
            ["wpe_employee_id", "=", ["g.wpe_tyontek"]],
            ["wpe_purchase_multiplier", "=", ["pr_purchase_multiplier"]],
            ["wpe_hourly_salary", "=", ["g.wpe_ontunti"]],
            ["wpe_contract_salary", "=", ["g.wpe_onurakk"]],
            ["wpe_pieces_unit", "=", "1"],
            ["wpe_link_target", "=", ["wpe_phase_number", "-", "1"]],
            ["wpe_rest_time_hour", "=", ["g.wpe_lepoaik"]],
            ["wpe_contract_default_salary", "=", ["g.wpe_urperpa"]],
            ["wpe_run_amount", "=", "1"],
            ["wpe_setup_amount", "=", "1"],
            ["wpe_work_load_group_id", "=", ["g.wpe_kuormit"]]
          ]
        ],
        [
          "if", ["wpe_work_load_group_id", "<>", ""],
          ["RELATE_ONE", ["wpe_work_load_group_id"]],
          ["wpe_work_description", "=", ["wlg_name"]],
          [
            "if", ["wlf_subcontract"],
            [
              ["wpe_subc_profit_multiplier", "=", ["wlg_profit_multiplier"]],
              ["wpe_subcontract", "=", "true"]
            ],
            "else",
            [
              ["wpe_profit_multiplier", "=", ["wlg_profit_multiplier"]]
            ]
          ],
          ["wpe_supplier_id", "=", "wlg_supplier_id"],
          [
            "if", ["g.wpe_worktimefromlgminimum", "=", "true"],
            [
              ["wpe_work_time_lot", "=", ["wlg_minimum_work_time"]]
            ],
            "else",
            [
              ["wpe_work_time_unit", "=", ["wlg_default_work_time"]]
            ]
          ]
        ],
        ["wpe_C_TUNTIPALKA"],
        ["wpe_C_KENTAT", ["wpe_work_time_unit"]],
        ["wpe_LOAD_MULTIPLIER_FROM_LG"],
        ["wpe__TRACK_TIME_VALUES_SET", ["wpe_work_load_group_id"]]
      ],
      "wpe": [
        ["w_ltC_KENTAT ---- ??, ei ole wpe_ -alkuinen"],
        ["w_laC_KENTAT ---- ??, ei ole wpe_ -alkuinen"]
      ],
      "wpe_work_position_num_id": [],
      "wpe_work_load_group_id": [
        ["wpe_scKUORMITUSR"]
      ],
      "wpe_employee_id": [
        ["wpe_scTYONTEKIJA"]
      ],
      "wpe_phase_number": [
        ["wpe_scVAIHENUMERO"]
      ],
      "wpe_units_hour": [
        ["wpe_scKPL_TUNTI"]
      ],
      "wpe_work_time_unit": [
        ["wpe_scTYOAIKA_KP"]
      ],
      "wpe_work_time_lot": [
        ["wpe_scTYOAIKA_MR"]
      ],
      "wpe_setup_time_lot": [
        ["wpe_scASAIKA_MRA"]
      ],
      "wpe_setup_salary_hour": [
        ["wpe_scASTUNTIPAL"]
      ],
      "wpe_salary_hour": [
        ["wpe_scTUNTIPALKK"]
      ],
      "wpe_machine_setup_cost_hour": [
        ["wpe_scKONEAST_OK"]
      ],
      "wpe_machine_work_cost_hour": [
        ["wpe_scKONETYOT_OK"]
      ],
      "wpe_profit_multiplier": [
        ["wpe_scKATEKERROI"]
      ],
      "wpe_contract_price_unit": [
        ["wpe_scURAKKA_KPL"]
      ],
      "wpe_work_salary_unit": [
        ["wpe_scTYOPAL_KPL"]
      ],
      "wpe_work_cost_unit": [
        ["wpe_scTYO_OK_KPL"]
      ],
      "wpe_work_sales_price_unit": [
        ["wpe_scTYO_MH_KPL"]
      ],
      "wpe_hourly_salary": [
        ["wpe_scON_TUNTITY"]
      ],
      "wpe_work_description": [
        ["aaFORMAT", ["wpe_work_description", "1"]]
      ],
      "wpe_info": [],
      "wpe_speed_unit": [
        ["wpe_scKONEEN_NOPE"]
      ],
      "wpe_pieces_unit": [
        ["wpe_scKPL_YKS"]
      ],
      "wpe_production_lot": [],
      "wpe_contract_salary": [
        ["wpe_scON_URAKKATY"]
      ],
      "wpe_linking_hours": [],
      "wpe_link_target": [],
      "wpe_special_extra_hours": [],
      "wpe_rest_time_hour": [
        ["wpe_scLEPOAIKA_T"]
      ],
      "wpe_contract_default_salary": [
        ["wpe_scURAKAN_PER"]
      ],
      "wpe_subcontract": [
        ["wpe_scON_ALIHANK"],
        ["wpe_C_KENTAT"],
        ["wpe_C_MUUTTUJAT"]
      ],
      "wpe_supplier_id": [],
      "wpe_subcont_purc_price_unit": [
        ["wpe_scALIH_OSTOH"]
      ],
      "wpe_purchase_multiplier": [
        ["wpe_scPURCHASE_MULTIPLIER"]
      ],
      "wpe_subcont_cost_unit": [
        ["wpe_scALIH_OK"]
      ],
      "wpe_subcont_sales_price_unit": [
        ["wpe_scALIH_MH"]
      ],
      "wpe_work_cost_total": [],
      "wpe_work_sales_price_total": [],
      "wpe_subcont_cost_total": [
        ["wpe_scALIH_OK_YH"]
      ],
      "wpe_subcont_sales_price_total": [
        ["wpe_scALIH_MH_YH"]
      ],
      "wpe_kind": [],
      "wpe_setup_amount": [],
      "wpe_run_amount": [
        ["wpe_scRUN_AMOUNT"]
      ],
      "wpe_cover_inside": [],
      "wpe_previous_phase": [],
      "wpe_next_phase": [],
      "wpe_subc_profit_multiplier": [
        ["wpe_scSUBC_PROFIT_MULTIPLIER"]
      ],
      "wpe_bonus_work_time_unit": [],
      "wpe_transfer_id": [],
      "wpe_load_multiplier": [],
      "wpe_tag": [],
      "wpe_track_time": [
        ["wos__TRACK_TIME_UPDATE", ["wpe", "wpe_work_position_num_id","wpe_phase_number", "true"]]
      ],
      "wpe_track_time_status": [],
      "wpe_target_extra_time_unit": [],
      "wpe_target_extra_time": [],
      "wpe_delivery_to_customer": [
        ["wpe_ff_delivery_to_customer", "=", ["_fld_ValueLong", ["wpe_delivery_to_customer"]]]
      ]
  },
  "function": {
    "wpe_C_TUNTIPALKA": [
      [
        "if", [["wpe_employee_id", "=", ["g.hlsEI_TYONT"]], "or", ["wpe_employee_id", "=", ""]],
        [
          ["wpe_salary_hour", "=", ["wlg_work_salary_hour"]],
          ["wpe_setup_salary_hour", "=", ["wlg_setup_salary_hour"]]
        ],
        "else",
        [
          ["wpe_salary_hour", "=", ["em_salary_hour"]],
          ["wpe_setup_salary_hour", "=", ["em_setup_salary_hour"]]
        ]
      ],
      ["wpe_machine_setup_cost_hour", "=", ["wlg_machine_setup_cost_hour"]],
      ["wpe_machine_work_cost_hour", "=", ["wlg_machine_work_cost_hour"]]
    ],
    "wpe_C_HINTAKENTA": [
      ["wpe_scON_ALIHANK"],
      ["wpe_work_salary_unit", "=", "0"],
      [
        "if", ["wpe_subcontract"],
        [
          ["wpe_work_salary_unit", "=", "0"],
          ["wpe_work_cost_unit", "=", "0"],
          ["wpe_work_sales_price_unit", "=", "0"],
          ["wpe_work_cost_total", "=", "0"],
          ["wpe_work_sales_price_total", "=", "0"]
        ],
        "else",
        [
          [
            "if", ["true"],
            [
              [
                "if", ["w_calculation_lot", "<>", "0"],
                [
                  ["wpe_work_salary_unit", "=", [["wpe_setup_time_lot", "*", "wpe_setup_salary_hour"], "/", "w_calculation_lot"]]
                ]
              ],
              [
                "if", ["wpe_hourly_salary"],
                [
                  ["wpe_work_salary_unit", "=", ["wpe_work_salary_unit", "+", ["wpe_work_time_unit", "*", "wpe_salary_hour"]]]
                ]
              ],
              [
                "if", ["wpe_contract_salary"],
                [
                  ["wpe_work_salary_unit", "=", ["wpe_work_salary_unit", "+", "wpe_contract_price_unit"]]
                ]
              ],
              ["wpe_work_salary_unit", "=", ["Round", ["wpe_work_salary_unit", "g.wpe_iPyorDes"]]],
              ["wpe_work_cost_unit", "=", ["wpe_work_cost_unit", "*", "W_social_cost_multiplier"]],
              ["wpe_work_cost_unit", "=", ["wpe_work_cost_unit", "+", ["wpe_work_time_unit", "*", "wpe_machine_work_cost_hour"]]],
              [
                "if", ["w_calculation_lot", "<>", "0"],
                [
                  ["wpe_work_cost_unit", "=", ["wpe_work_cost_unit", "+", [["wpe_setup_time_lot", "*", "wpe_machine_setup_cost_hour"], "/", "w_calculation_lot"]]]
                ]
              ],
              ["wpe_work_cost_unit", "=", ["Round", ["wpe_work_cost_unit", "g.wpe_iPyorDes"]]]
            ],
            "else",
            [
              [
                "if", ["w_calculation_lot", "<>", "0"],
                [
                  ["wpe_work_salary_unit", "=", ["wpe_work_salary_unit", "+", ["Round", [[["wpe_work_time_lot", "*", "wpe_salary_hour"], "/", "w_calculation_lot"], "g.wpe_iPyorDes"]]]],
                  [
                    "if", ["wpe_hourly_salary"],
                    [
                      ["wpe_work_salary_unit", "=", ["wpe_work_salary_unit", "+", ["Round",  [[["wpe_work_time_lot", "*", "wpe_salary_hour"], "/", "w_calculation_lot"], "g.wpe_iPyorDes"]]]]
                    ]
                  ],
                  [
                    "if", ["wpe_contract_salary"],
                    [
                      ["wpe_work_salary_unit", "=", ["wpe_work_salary_unit", "+", ["Round", ["wpe_contract_price_unit", "g.wpe_iPyorDes"]]]]
                    ]
                  ]
                ]
              ],
              [
                "if", ["w_calculation_lot", "<>", "0"],
                [
                  ["wpe_work_cost_unit", "=", ["Round", [[["wpe_work_time_lot", "*", "wpe_machine_work_cost_hour"], "+", [["wpe_setup_time_lot", "*", "wpe_machine_work_cost_hour"], "/", ["w_calculation_lot"]], "+", ["wpe_work_salary_unit", "*", "W_social_cost_multiplier"]], "g.wpe_iPyorDes"]]]
                ],
                "else",
                [
                  ["wpe_work_cost_unit", "=", "0"]
                ]
              ]
            ]
          ],
          ["wpe_work_sales_price_unit", "=", ["Round", [["wpe_work_cost_unit", "*", "wpe_profit_multiplier"], "g.wpe_iPyorDes"]]],
          ["wpe_work_cost_unit", "=", ["Round", [["wpe_work_cost_unit", "*", "w_calculation_lot"], "2"]]],
          ["wpe_work_sales_price_unit", "=", ["Round", [["wpe_work_sales_price_unit", "*", "w_calculation_lot"], "2"]]],
          ["wpe_subcont_cost_unit", "=", "0"],
          ["wpe_subcont_sales_price_unit", "=", "0"],
          ["wpe_subcont_cost_total", "=", "0"],
          ["wpe_subcont_sales_price_total", "=", "0"]
        ]
      ]
    ],
    "wpe_LOAD_MULTIPLIER_FROM_LG": [
      [
        "if", ["g.wpe_load_multiplier", "=", "1"],
        [
          [
            "if", [["_fld_ValueReal", ["wpe_load_multiplier"]], "=", "0"],
            [
              ["_fld__VALUE_COPY", ["wlg_kLoad_Multiplier", "wpe_load_multiplier"]]
            ]
          ]
        ],
        "elseif", ["g.wpe_loadmultiplierlgupdate", "=", "2"],
        [
          ["_fld__VALUE_COPY", ["wlg_load_multiplier", "wpe_load_multiplier"]]
        ],
        "else",
        [
          ["IDLE"]
        ]
      ]
    ],
    "wpe_scKUORMITUSR": [
      ["RELATE_ONE", ["wpe_work_load_group_id"]],
      ["wpe_LOAD_MULTIPLIER_FROM_LG"],
      ["wpe__TRACK_TIME_VALUES_SET", ["wpe_work_load_group_id"]],
      [
        "if", ["wpe_work_description", "=", ""],
        [
          ["wpe_work_description", "=", ["wlg_name"]]
        ]
      ],
      [
        "if", ["wlg_subcontract"],
        [
          ["wpe_subc_profit_multiplier", "=", ["wlg_profit_multiplier"]],
          ["wpe_subcontract", "=", "true"],
          ["wpe_employee_id", "=", ["g.hlsEI_TYONT"]],
          ["wpe_supplier_id", "=", ["wlg_supplier_id"]]
        ],
        "else",
        [
          ["wpe_profit_multiplier", "=", ["wlg_profit_multiplier"]],
          ["wpe_subcontract", "=", "false"],
          [
            "if", ["wpe_work_time_lot", "<=", "0"],
            [
              [
                "if", ["wlg_minimum_work_time", ">", "0"],
                [
                  ["wpe_work_time_lot", "=", ["wlg_minimum_work_time"]],
                  ["wpe_C_KENTAT", ["wpe_work_time_lot"]]
                ]
              ]
            ],
            "else",
            [
              [
                "if", ["wlg_default_work_time", ">", "0"],
                [
                  ["wpe_work_time_unit", ["wlg_default_work_time"]],
                  ["wpe_C_KENTAT", ["wpe_work_time_unit"]]
                ]
              ]
            ]
          ]
        ]
      ],
      ["wpe_C_TUNTIPALKA"],
      ["wpe_C_KONENOPEUS"],
      ["wpe_setup_time_lot", "=", ["wlg_setup_time"]],
      [
        "if", ["wpe_speed_unit", ">", "0"],
        [
          ["wpe_C_KENTAT", ["wpe_speed_unit"]]
        ]
      ],
      ["wpe_C_HINTAKENTA"],
      ["wpe_C_MUUTTUJAT"],
      ["w_ltC_KENTAT ---- ??, ei ole wpe_ -alkuinen"],
      ["w_laC_KENTAT ---- ??, ei ole wpe_ -alkuinen"],
      [
        "if", ["wlg_loading_type", "=", ["g.wlg_lType_NotLoaded"]],
        [
          [
            "if", ["g.wpe_lSetNotLoadedToLockPrevious", "=", "true"],
            [
              ["wpe_previous_phase", "=", ""]
            ]
          ]
        ]
      ],
      ["wpe_info", "=", ["wlg_info"]]
    ],
    "wpe_C_KONENOPEUS": [
      ["w_RELATE_TUOTE ---- ??, ei ole wpe_ -alkuinen"],
      [
        "if", [["pr_unit", "=", ["wlg_speed_unit"]], "or", ["wlg_speed_unit", "=", ""]],
        [
          ["wpe_speed_unit", "=", ["wlg_machine_speed"]]
        ],
        "else",
        [
          [
            "if", ["pr_unit2", "=", ["wlg_speed_unit"]],
            [
              ["wpe_speed_unit", "=", ["pr_KerVarMuutosk", ["wlg_machine_speed", "5"]]]
            ],
            "else",
            [
              [
                "if", ["pr_design_unit", "=", ["wlg_speed_unit"]],
                [
                  ["wpe_speed_unit", "=", ["pr_KerV1_S1Muuto", ["wlg_machine_speed", "5"]]]
                ],
                "else",
                [
                  [
                    "if", ["pr_design_unit2", "=", ["wlg_speed_unit"]],
                    [
                      ["wpe_speed_unit", "=", ["pr_KerV1_S1Muuto", ["pr_KerSuunnMuuto", ["wlg_machine_speed", "5"], "5"]]]
                    ]
                  ]
                ]
              ]
            ]
          ]
        ]
      ]
    ],
    "wpe_scTYONTEKIJA": [
      ["wpe_C_TUNTIPALKA"],
      ["wpe_C_KENTAT"]
    ],
    "wpe_scVAIHENUMERO": [
      [
        "if", ["Before"],
        [
          ["wpe_work_position_num_id", "=", ["w_work_position_num_id"]],
          ["wpe_phase_number", "=", ["Records_in_selection", ["wpe"]]],
          ["wpe_employee_id", "=", ["g.wpe_sTyontek"]],
          ["wpe_work_load_group_id", "=", ["g.wpe_sKuormit"]],
          ["wpe_work_description", "=", ["wlg_name"]],
          ["wpe_hourly_salary", "=", ["g.wpe_fOnTunti"]],
          ["wpe_contract_salary", "=", ["g.wpe_fOnUrakk"]],
          ["wpe_pieces_unit", "=", "1"],
          ["wpe_link_target", "=", ["wpe_phase_number", "-", "1"]],
          ["wpe_rest_time_hour", "=", ["g.wpe_rLepoaik"]],
          ["wpe_contract_default_salary", "=", ["g.wpe_rUrPerPa"]],
          ["RELATE_ONE", ["wpe_work_load_group_id"]],
          [
            "if", ["wlg_subcontract"],
            [
              ["wpe_subc_profit_multiplier", "=", ["wlg_profit_multiplier"]],
              ["wpe_subcontract", "=", "true"]
            ],
            "else",
            [
              ["wpe_profit_multiplier", "=", ["wlg_profit_multiplier"]],
              ["wpe_subcontract", "=", "false"]
            ]
          ],
          ["wpe_supplier_id", "=", ["wlg_supplier_id"]],
          ["wpe_C_TUNTIPALKA"],
          ["wpe_C_KENTAT"]
        ]
      ]
    ],
    "wpe_scKPL_TUNTI": [
      ["wpe_C_KENTAT", ["wpe_units_hour"]]
    ],
    "wpe_scTYOAIKA_KP": [
      ["wpe_C_KENTAT", ["wpe_work_time_unit"]]
    ],
    "wpe_scTYOAIKA_MR": [
      ["wpe_C_KENTAT", ["wpe_work_time_lot"]]
    ],
    "wpe_scASAIKA_MRA": [
      ["wpe_C_KENTAT"]
    ],
    "wpe_scASTUNTIPAL": [
      ["wpe_C_KENTAT"]
    ],
    "wpe_scTUNTIPALKK": [
      ["wpe_C_KENTAT"]
    ],
    "wpe_scKONEAST_OK": [
      ["wpe_C_KENTAT"]
    ],
    "wpe_scKONETYOT_OK": [
      ["wpe_C_KENTAT"]
    ],
    "wpe_scKATEKERROI": [
      [
        "if", ["wpe_subcontract"],
        [
          ["wpe_subcont_sales_price_unit", "=", ["Round", [["wpe_subcont_cost_unit", "*", "wpe_subc_profit_multiplier"], "g.pr_iPyorAHin"]]],
          ["wpe_subcont_sales_price_total", "=", ["Round", [["wpe_subcont_sales_price_unit", "*", "w_calculation_lot"], "g.pr_iPyorYHin"]]]
        ]
      ],
      ["wpe_C_KENTAT"]
    ],
    "wpe_scURAKKA_KPL": [
      ["wpe_C_MUUTTUJAT"]
    ],
    "wpe_scTYOPAL_KPL": [
      [
        "if", ["wpe_salary_hour", "<>", "0"],
        [
          [
            "if", ["wpe_hourly_salary"],
            [
              [
                "if", [["w_calculation_lot", "*", "wpe_salary_hour"], "<>", "0"],
                [
                  ["wpe_work_time_lot", "=", ["Round", [[[[["wpe_work_salary_unit", "*", "w_calculation_lot"], "-", ["wpe_setup_time_lot", "*", "wpe_setup_salary_hour"]], "/", ["w_calculation_lot", "*", "wpe_salary_hour"]], "*", "w_calculation_lot"], "4"]]],
                  [
                    "if", ["wpe_work_time_unit", "<", "0"],
                    [
                      ["wpe_work_time_lot", "=", "0"]
                    ]
                  ]
                ],
                "else",
                [
                  ["wpe_work_time_lot", "=", "0"]
                ]
              ],
              ["wpe_C_KENTAT", ["wpe_work_time_lot"]]
            ]
          ]
        ],
        "else",
        [
          ["wpe_C_KENTAT"]
        ]
      ]
    ],
    "wpe_scTYO_OK_KPL": [
      ["wpe_work_sales_price_unit", "=", ["Round", [["wpe_work_cost_unit", "*", "wpe_profit_multiplier"], "2"]]],
      ["wpe_C_MUUTTUJAT"],
      ["w_ltC_KENTAT ---- ??, ei ole wpe_ -alkuinen"]
    ],
    "wpe_scTYO_MH_KPL": [
      [
        "if", ["wpe_work_cost_unit", "<>", "0"],
        [
          ["wpe_profit_multiplier", "=", ["Round", [["wpe_work_sales_price_unit", "/", "wpe_work_cost_unit"], "3"]]]
        ],
        "else",
        [
          ["wpe_profit_multiplier", "=", "0"]
        ]
      ],
      ["wpe_C_MUUTTUJAT"],
      ["w_ltC_KENTAT ---- ??, ei ole wpe_ -alkuinen"]
    ],
    "wpe_scON_TUNTITY": [
      ["wpe_C_KENTAT"]
    ],
    "wpe_scKONEEN_NOPE": [
      ["wpe_C_KENTAT", ["wpe_speed_unit"]]
    ],
    "wpe_scKPL_YKS": [
      ["wpe_C_KENTAT", ["wpe_pieces_unit"]]
    ],
    "wpe_scON_URAKKATY": [
      ["wpe_C_KENTAT"]
    ],
    "wpe_scLEPOAIKA_T": [
      ["wpe_C_KENTAT", ["wpe_rest_time_hour"]]
    ],
    "wpe_scURAKAN_PER": [
      ["wpe_C_KENTAT", ["wpe_contract_default_salary"]]
    ],
    "wpe_scON_ALIHANK": [
      [
        "if", ["wpe_subcont_purc_price_unit", "=", "0"], "and", ["wpe_subcont_cost_unit", "<>", "0"],
        [
          ["wpe_subcont_purc_price_unit", "=", ["wpe_subcont_cost_unit"]],
          ["wpe_purchase_multiplier", "=", "1"]
        ]
      ],
      [
        "if", ["wpe_purchase_multiplier", "=", "0"],
        [
          ["wpe_purchase_multiplier", "=", "1"]
        ]
      ],
      [
        "if", ["wpe_subcontract"],
        [
          [
            "if", ["wpe_subc_profit_multiplier", "=", "0"],
            [
              ["_sel_RELATE_ONE", ["wlg_work_load_group_id", "wpe_work_load_group_id"]],
              ["wpe_subc_profit_multiplier", "=", ["wlg_profit_multiplier"]]
            ]
          ]
        ],
        "else",
        [
          [
            "if", ["wpe_profit_multiplier", "=", "0"],
            [
              ["_sel_RELATE_ONE", ["wlg_work_load_group_id", ["wpe_work_load_group_id"]]],
              ["wpe_profit_multiplier", "=", ["wlg_profit_multiplier"]]
            ]
          ]
        ]
      ],
      ["wpe_subcont_cost_unit", "=", ["Round", ["wpe_subcont_purc_price_unit", "*", "wpe_purchase_multiplier", "g.pr_pyorahin"]]],
      ["wpe_subcont_sales_price_unit", "=", ["Round", ["wpe_subcont_cost_unit", "*", "wpe_subc_profit_multiplier", "g.pr_pyorahin"]]],
      ["wpe_subcont_cost_total", "=", ["Round", ["wpe_subcont_cost_unit", "*", "w_calculation_lot", "g.pr_pyoryhin"]]],
      ["wpe_subcont_sales_price_total", "=", ["Round", ["wpe_subcont_sales_price_unit", "*", "w_calculation_lot", "g.pr_pyoryhin"]]]
    ],
    "wpe_C_KENTAT": [
      [
        "if", ["Count_parameters", "=", "1"],
        [
          ["wpe_C_MAARAKENTA", ["arg1"]]
        ],
        "else",
        [
          ["wpe_C_MAARAKENTA"]
        ]
      ],
      ["wpe_C_HINTAKENTA"],
      ["wpe_C_MUUTTUJAT"],
      ["w_ltC_KENTAT ---- ??, ei ole wpe_ -alkuinen"],
      ["w_laC_KENTAT ---- ??, ei ole wpe_ -alkuinen"]
    ],
    "wpe_C_MUUTTUJAT": [
      [
        "if", ["w_calculation_lot", "<>", "0"],
        [
          ["wpe_asa_kpl", "=", ["wpe_setup_time_lot", "/", ["w_calculation_lot"]]]
        ],
        "else",
        [
          ["wpe_l_urakk", "=", "0"]
        ],
        ["wpe_tyo_yht", "=", ["wpe_work_salary_unit", "*", "w_calculation_lot"]],
        ["wpe_tok_yht", "=", ["wpe_work_cost_unit", "*", "w_calculation_lot"]],
        ["wpe_tmh_yht", "=", ["wpe_work_sales_price_unit", "*", "w_calculation_lot"]]
      ]
    ],
    "wpe_scALIH_OSTOH":[
      [
        "if", ["wpe_subc_profit_multiplier", "=", "0"],
        [
          ["wpe_subc_profit_multiplier", "=", "wpe_profit_multiplier"]
        ]
      ],
      ["wpe_subcont_cost_unit", "=", ["Round", [["wpe_subcont_purc_price_unit", "*", "wpe_purchase_multiplier"], "g.pr_iPyorAHin"]]],
      ["wpe_subcont_sales_price_unit", "=", ["Round", [["wpe_subcont_cost_unit", "*", "wpe_subc_profit_multiplier"], "g.pr_iPyorAHin"]]],
      ["wpe_subcont_cost_total", "=", ["Round", [["wpe_subcont_cost_unit", "w_calculation_lot"], "g.pr_iPyorYHin"]]],
      ["wpe_subcont_sales_price_total", "=", ["Round", [["wpe_subcont_sales_price_unit", "*", "w_calculation_lot"], "g.pr_iPyorYHin"]]],
      ["wpe_C_KENTAT"],
      ["wpe_C_MUUTTUJAT"]
    ],
    "wpe_scPURCHASE_MULTIPLIER": [
      ["wpe_C_KENTAT"],
      ["wpe_C_MUUTTUJAT"]
    ],
    "wpe_scALIH_OK": [
      [
        "if", ["wpe_subcont_purc_price_unit", "<>", "0"],
        [
          ["wpe_purchase_multiplier", "=", ["wpe_subcont_cost_unit", "/", "wpe_subcont_purc_price_unit"]]
        ]
      ],
      ["wpe_subcont_sales_price_unit", "=", ["Round", [["wpe_subcont_cost_unit", "*", "wpe_subc_profit_multiplier"], "g.pr_iPyorAHin"]]],
      ["wpe_subcont_cost_total", "=", ["Round", [["wpe_subcont_cost_unit", "*", "w_calculation_lot"], "g.pr_iPyorYHin"]]],
      ["wpe_subcont_sales_price_total", "=", ["Round", ["wpe_subcont_sales_price_total", "*", "w_calculation_lot"], "g.pr_iPyorYHin"]],
      ["wpe_C_KENTAT"],
      ["wpe_C_MUUTTUJAT"]
    ],
    "wpe_scALIH_MH": [
      [
        "if", ["wpe_subcont_cost_unit", ">", "0"],
        [
          ["wpe_subc_profit_multiplier", "=", ["wpe_subcont_sales_price_unit", "/", "wpe_subcont_cost_unit"]]
        ],
        "elseif",
        [
          [
            "if", ["wpe_subc_profit_multiplier", "<>", "0"],
            [
              ["wpe_subcont_cost_unit", "=", ["wpe_subcont_sales_price_unit", "*", "wpe_subc_profit_multiplier"]]
            ],
            "else",
            [
              ["wpe_subcont_cost_unit", "=", ["wpe_subcont_sales_price_unit"]]
            ]
          ]
        ]
      ],
      ["wpe_C_KENTAT"],
      ["wpe_C_MUUTTUJAT"]
    ],
    "wpe_scALIH_OK_YH": [
      [
        "if", ["w_calculation_lot", "<>", "0"],
        [
          ["wpe_subcont_cost_unit", "=", ["Round", [["wpe_subcont_cost_total", "/", "w_calculation_lot"], "g.pr_iPyorAHin"]]]
        ]
      ]
    ],
    "wpe_scALIH_MH_YH": [
      [
        "if", ["w_calculation_lot", "<>", "0"],
        [
          ["wpe_subcont_sales_price_unit", "=", ["Round", [["wpe_subcont_sales_price_total", "/", "w_calculation_lot"], "g.pr_iPyorAHin"]]],
          ["wpe_scALIH_MH"]
        ]
      ]
    ],
    "wpe_scRUN_AMOUNT": [
      ["IDLE"]
    ],
    "wpe_scSUBC_PROFIT_MULTIPLIER": [
      ["wpe_scALIH_OSTOH"]
    ]
  }
}
