12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System;
- using System.Collections.Generic;
- using InABox.Integration.V6;
- namespace PRSDesktop.Integrations.V6
- {
- public class V6Component : V6BOMItem, IV6Component
- {
- public double PackSize { get; set; }
- public override void ValidateQuery(string sql, List<string> errors)
- {
- base.ValidateQuery(sql, errors);
- ValidateField(sql, nameof(PackSize), errors);
- }
- public static String SQL = $@"
- select
- bc.Part_Code as {nameof(Code)},
- c.descr as {nameof(Description)},
- 1.0 as {nameof(PackSize)},
- sum(bc.comp_qty) as {nameof(Quantity)},
- bc.cost as {nameof(Cost)}
- from
- bom_comp bc
- left outer join
- quote_item qi on qi.quote_item_id = bc.quote_item_id
- left outer join
- quote q on q.quote_id = qi.quote_id
- left outer join
- componentry c on c.comp_lib_id = bc.comp_lib_id and c.comp_id = bc.comp_id
- where
- 1=1
- and
- qi.quote_vers_start <= q.quote_vers and qi.quote_vers_stop >= q.quote_vers
- group by
- bc.Part_Code, c.descr, bc.cost
- ";
- }
- }
|