V6Style.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using InABox.Integration.Awg;
  4. using InABox.Integration.V6;
  5. namespace PRSDesktop.Integrations.V6;
  6. public class V6Style : V6Object, IV6Style
  7. {
  8. public String Code { get; set; }
  9. public String Description { get; set; }
  10. public double Cost { get; set; }
  11. public AwgStyleType StyleType { get; }
  12. public override void ValidateQuery(string sql, List<string> errors)
  13. {
  14. ValidateField(sql, nameof(Code), errors);
  15. ValidateField(sql, nameof(Description), errors);
  16. }
  17. public static String SQL = $@"
  18. select distinct
  19. fc.FINCOL_CODE as [{nameof(Code)}],
  20. fc.DESCR as [{nameof(Description)}],
  21. 0.00 as [{nameof(Cost)}],
  22. 0 as [{nameof(StyleType)}]
  23. from
  24. bom_piece bp
  25. join
  26. fincol fc on bp.FINCOL_LIB_ID = fc.FINCOL_LIB_ID and bp.FINCOL_ID = fc.FINCOL_ID
  27. join
  28. quote_item qi on bp.QUOTE_ITEM_ID = qi.QUOTE_ITEM_ID
  29. join
  30. quote q on qi.QUOTE_ID = q.QUOTE_ID
  31. where
  32. 1=1
  33. and
  34. qi.quote_vers_start <= q.quote_vers and qi.quote_vers_stop >= q.quote_vers
  35. and
  36. bp.QUOTE_ITEM_ID is not null";
  37. }