V6Finish.cs 942 B

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