V6Gasket.cs 1010 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using InABox.Integration.V6;
  4. namespace PRSDesktop.Integrations.V6;
  5. public class V6Gasket : V6BOMItem, IV6Gasket
  6. {
  7. public double Length { get; set; }
  8. public override void ValidateQuery(string sql, List<string> errors)
  9. {
  10. base.ValidateQuery(sql, errors);
  11. ValidateField(sql, nameof(Length), errors);
  12. }
  13. public static String SQL = $@"select
  14. g.GASKET_CODE as {nameof(Code)},
  15. g.DESCR as {nameof(Description)},
  16. round(coalesce(g.rolllength, 0.0) * 0.0254, 2) as {nameof(Length)},
  17. sum(round(coalesce(bg.gasket_units, 0.0) * 0.0254, 2)) as {nameof(Quantity)},
  18. sum(coalesce(bg.cost, 0.0)) as {nameof(Cost)}
  19. from
  20. bom_gasket bg
  21. left outer join
  22. gasket g on g.gasket_lib_id = bg.GASKET_LIB_ID and g.gasket_id = bg.GASKET_ID
  23. left outer join
  24. quote_item qi on bg.quote_item_id = qi.quote_item_id
  25. where
  26. 1=1
  27. group by
  28. g.GASKET_CODE,
  29. g.DESCR,
  30. round(coalesce(g.rolllength, 0.0) * 0.0254, 2)";
  31. }