LogikalLabour.cs 901 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 TimeSpan Duration { get; set; }
  9. public override void ValidateQuery(string sql, List<string> errors)
  10. {
  11. base.ValidateQuery(sql, errors);
  12. }
  13. public static String SQL = $@"select
  14. cast(t.[timetype] as text) as [{nameof(Code)}],
  15. t.[name] as [{nameof(Description)}],
  16. sum(t.[totalminutes]/60.0) as [{nameof(Quantity)}],
  17. c.[price] as [{nameof(Cost)}]
  18. from
  19. labourtimes t
  20. join
  21. labourcosts c on t.[timetype] = c.[type]
  22. join
  23. elevations e on t.[elevationid] = e.[elevationid]
  24. where
  25. t.[totalminutes] > 0.0
  26. and
  27. t.[ismain] = 1
  28. group by
  29. t.[timetype],
  30. t.[Name],
  31. c.[price]";
  32. }
  33. }