{"Actions":[{"ActionID":"A1","OrderIndex":1,"Active":true,"Name":"Letzte Mietzahlungen","Description":"Die letzten Mietzahlungen pro Vertrag anzeigen","RequiresClusterWriteRights":true,"RequiresWriteRights":true,"Condition":"[[\"Level\",\"=\",\"ProductLine\"],\"and\",[\"FactoryID\",\"=\",\"1\"]]","ListSQL":"SELECT\r\n    CONCAT(LEFT(TimeID, 4), '\/', RIGHT(LEFT(TimeID, 6), 2)) AS Monat,\r\n    ProductName AS Mietvertrag,\r\n    CAST(KM AS money) \/ 100 AS Kaltmiete,\r\n    CAST(NK AS money) \/ 100 AS Nebenkosten,\r\n    CAST(KAU AS money) \/ 100 AS Kaution,\r\n    CAST(GKM AS money) \/ 100 AS \"Miete Garage\",\r\n    CAST(GNK AS money) \/ 100 AS \"NK Garage\",\r\n    CAST(SK AS money) \/ 100 AS Sonstiges\r\nFROM (\r\n    SELECT\r\n        v.FactoryID,\r\n        v.ProductLineID,\r\n        v.ProductID,\r\n        p.NameShort AS ProductName,\r\n        TimeID,\r\n        ValueSeriesID,\r\n        ValueInt\r\n    FROM planning.tfValues AS v\r\n    JOIN planning.tdProducts AS p\r\n    ON p.ProductKey = v.ProductKey\r\n    WHERE\r\n        v.TimeID = (\r\n            SELECT MAX(TimeID)\r\n            FROM planning.tfValues AS v2\r\n            WHERE\r\n                v2.FactoryID = v.FactoryID\r\n                AND v2.ProductLineID = v.ProductLineID\r\n                AND v2.ProductID = v.ProductID\r\n        )\r\n        AND v.FactoryID = '1'\r\n        AND v.ProductLineID = '1'\r\n) AS SourceTable\r\nPIVOT (\r\n    MAX(ValueInt) \r\n    FOR ValueSeriesID IN (KM, NK, KAU, GKM, GNK, SK)  \r\n) AS PivotTable","ListLayout":"[{\"FieldName\":\"Monat\",\"DataType\":\"string\",\"DataFormat\":\"\",\"Alignment\":\"left\",\"Width\":\"80\",\"isCustomField\":false},{\"FieldName\":\"Mietvertrag\",\"DataType\":\"string\",\"DataFormat\":\"\",\"Alignment\":\"left\",\"Width\":\"100%\",\"isCustomField\":false},{\"FieldName\":\"Kaltmiete\",\"DataType\":\"number\",\"DataFormat\":\"#,###.00 €\",\"Alignment\":\"right\",\"Width\":\"150\",\"isCustomField\":false},{\"FieldName\":\"Nebenkosten\",\"DataType\":\"number\",\"DataFormat\":\"#,###.00 €\",\"Alignment\":\"right\",\"Width\":\"150\",\"isCustomField\":false},{\"FieldName\":\"Kaution\",\"DataType\":\"number\",\"DataFormat\":\"#,###.00 €\",\"Alignment\":\"right\",\"Width\":\"150\",\"isCustomField\":false},{\"FieldName\":\"Miete Garage\",\"DataType\":\"number\",\"DataFormat\":\"#,###.00 €\",\"Alignment\":\"right\",\"Width\":\"150\",\"isCustomField\":false},{\"FieldName\":\"NK Garage\",\"DataType\":\"number\",\"DataFormat\":\"#,###.00 €\",\"Alignment\":\"right\",\"Width\":\"150\",\"isCustomField\":false},{\"FieldName\":\"Sonstiges\",\"DataType\":\"number\",\"DataFormat\":\"#,###.00 €\",\"Alignment\":\"right\",\"Width\":\"150\",\"isCustomField\":false}]","SetCellValueAsFilter":false,"ReloadListAfterChangingFilter":false,"ActionSQL":"","ApplyFromField":"","SaveBeforeAction":false,"SaveAfterAction":false,"ReloadTreeAfterAction":false,"ReloadDetailsAfterAction":false},{"ActionID":"A2","OrderIndex":2,"Active":true,"Name":"Betrag aus Vormonat übernehmen (FlexSearch)","Description":"","RequiresClusterWriteRights":false,"RequiresWriteRights":false,"Condition":"[[\"Level\",\"=\",\"Product\"],\"and\",[\"FactoryID\",\"=\",\"1\"],\"and\",[\"ValueSeriesID\",\"<>\",null],\"and\",[\"Area\",\"=\",\"Cell\"]]","ListSQL":"SELECT\r\n    FORMAT(CONVERT(DATE, CAST(TimeID AS CHAR(8)), 112), 'MMMM yyyy', 'de-DE') AS Monat,\r\n    CAST(ValueInt AS money) \/ 100 AS Betrag\r\nFROM planning.tfValues AS v\r\nJOIN planning.tdProducts AS p\r\nON p.ProductKey = v.ProductKey\r\nWHERE\r\n    v.FactoryID = '{FactoryID}'\r\n    AND v.ProductLineID = '{ProductLineID}'\r\n    AND v.ProductID = '{ProductID}'\r\n    AND v.ValueSeriesID = '{ValueSeriesID}'\r\nORDER BY TimeID DESC","ListLayout":"[{\"FieldName\":\"Monat\",\"DataType\":\"string\",\"DataFormat\":\"\",\"Alignment\":\"right\",\"Width\":\"100%\",\"isCustomField\":false},{\"FieldName\":\"Betrag\",\"DataType\":\"number\",\"DataFormat\":\"#,###.00 €\",\"Alignment\":\"left\",\"Width\":\"100%\",\"isCustomField\":false}]","SetCellValueAsFilter":true,"ReloadListAfterChangingFilter":false,"ActionSQL":"","ApplyFromField":"Betrag","SaveBeforeAction":false,"SaveAfterAction":false,"ReloadTreeAfterAction":false,"ReloadDetailsAfterAction":false},{"ActionID":"A3","OrderIndex":3,"Active":true,"Name":"Vertrag archivieren (FlexAction klassisch)","Description":"Einen Vertrag in einer Liste auswählen und dann archivieren.","RequiresClusterWriteRights":true,"RequiresWriteRights":true,"Condition":"[[\"Level\",\"=\",\"ProductLine\"],\"and\",[\"FactoryID\",\"=\",\"1\"],\"and\",[\"Area\",\"=\",\"Tree\"]]","ListSQL":"SELECT\r\n    ProductID,\r\n    NameShort AS Mietvertrag\r\nFROM planning.tdProducts\r\nWHERE\r\n    FactoryID = '{FactoryID}'\r\n    AND ProductLineID = '{ProductLineID}'","ListLayout":"[{\"FieldName\":\"ProductID\",\"DataType\":\"string\",\"DataFormat\":\"\",\"Alignment\":\"left\",\"Width\":\"100%\",\"isCustomField\":false},{\"FieldName\":\"Mietvertrag\",\"DataType\":\"string\",\"DataFormat\":\"\",\"Alignment\":\"left\",\"Width\":\"100%\",\"isCustomField\":false}]","SetCellValueAsFilter":true,"ReloadListAfterChangingFilter":false,"ActionSQL":"EXEC dbo.sx_pf_MOVE_Product\r\n    @Username = 'SQL',\r\n    @SourceFactoryID = '{FactoryID}',\r\n    @SourceProductLineID = '{ProductLineID}',\r\n    @SourceProductID = '{LIST_ProductID}',\r\n    @TargetFactoryID = '{FactoryID}',\r\n    @TargetProductLineID = '999',\r\n    @TargetProductID = '{ProductID}'","ApplyFromField":"","SaveBeforeAction":false,"SaveAfterAction":false,"ReloadTreeAfterAction":true,"ReloadDetailsAfterAction":false},{"ActionID":"A4","OrderIndex":4,"Active":true,"Name":"Diesen Vertrag archivieren (FlexAction ohne Liste)","Description":"","RequiresClusterWriteRights":true,"RequiresWriteRights":true,"Condition":"[[\"Level\",\"=\",\"Product\"],\"and\",[\"FactoryID\",\"=\",\"1\"],\"and\",[\"Area\",\"=\",\"Tree\"]]","ListSQL":"","ListLayout":"","SetCellValueAsFilter":false,"ReloadListAfterChangingFilter":false,"ActionSQL":"EXEC dbo.sx_pf_MOVE_Product\r\n    @Username = 'SQL',\r\n    @SourceFactoryID = '{FactoryID}',\r\n    @SourceProductLineID = '{ProductLineID}',\r\n    @SourceProductID = '{ProductID}',\r\n    @TargetFactoryID = '{FactoryID}',\r\n    @TargetProductLineID = '999',\r\n    @TargetProductID = '{ProductID}'","ApplyFromField":"","SaveBeforeAction":false,"SaveAfterAction":false,"ReloadTreeAfterAction":true,"ReloadDetailsAfterAction":false}]}
