LogikalLabour.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using InABox.Integration.Logikal;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace PRSDesktop.Integrations.Logikal
  5. {
  6. public class LogikalLabour : LogikalBOMItem, ILogikalLabour
  7. {
  8. public override void ValidateQuery(string sql, List<string> errors)
  9. {
  10. base.ValidateQuery(sql, errors);
  11. }
  12. public static String SQL =
  13. "select \n" +
  14. $" cast(t.[timetype] as text) as {nameof(Code)}, \n" +
  15. $" t.[name] as {nameof(Description)}, \n" +
  16. $" sum(t.[totalminutes]/60.0) as {nameof(Quantity)}, \n" +
  17. $" c.[price] as {nameof(Cost)} \n" +
  18. "from \n" +
  19. " labourtimes t \n" +
  20. "join \n" +
  21. " labourcosts c on t.[timetype] = c.[type] \n" +
  22. "left outer join \n" +
  23. " elevations e on t.[elevationid] = e.[elevationid] \n" +
  24. "where \n" +
  25. " t.[totalminutes] > 0.0 \n" +
  26. "and \n" +
  27. " t.[ismain] = 1 \n" +
  28. "group by \n" +
  29. " t.[timetype], \n" +
  30. " t.[name], \n" +
  31. " c.[price]";
  32. }
  33. }