| 1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- using System.Collections.Generic;
- using InABox.Integration.V6;
- namespace PRSDesktop.Integrations.V6;
- public class V6Gasket : V6BOMItem, IV6Gasket
- {
- public double Length { get; set; }
- public override void ValidateQuery(string sql, List<string> errors)
- {
- base.ValidateQuery(sql, errors);
- ValidateField(sql, nameof(Length), errors);
- }
- public static String SQL = $@"select
- g.GASKET_CODE as {nameof(Code)},
- g.DESCR as {nameof(Description)},
- round(coalesce(g.rolllength, 0.0) * 0.0254, 2) as {nameof(Length)},
- sum(round(coalesce(bg.gasket_units, 0.0) * 0.0254, 2)) as {nameof(Quantity)},
- sum(coalesce(bg.cost, 0.0)) as {nameof(Cost)}
- from
- bom_gasket bg
- left outer join
- gasket g on g.gasket_lib_id = bg.GASKET_LIB_ID and g.gasket_id = bg.GASKET_ID
- left outer join
- quote_item qi on bg.quote_item_id = qi.quote_item_id
- where
- 1=1
- group by
- g.GASKET_CODE,
- g.DESCR,
- round(coalesce(g.rolllength, 0.0) * 0.0254, 2)";
- }
|