| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System;
- using System.Collections.Generic;
- using InABox.Integration.V6;
- namespace PRSDesktop.Integrations.V6
- {
- public class V6Labour : V6Object, IV6Labour
- {
- public string Code { get; set; }
- public string Description { get; set; }
- public double Quantity { get; set; }
- public double Cost { get; set; }
-
- public override void ValidateQuery(string sql, List<string> errors)
- {
- ValidateField(sql,nameof(Code), errors);
- ValidateField(sql,nameof(Description), errors);
- ValidateField(sql, nameof(Quantity), errors);
- ValidateField(sql, nameof(Cost), errors);
- }
- public static String SQL = $@"
- select
- la.Descr as {nameof(Code)},
- la.Descr as {nameof(Description)},
- bl.Cost * 60 as {nameof(Cost)},
- sum(bl.lab_time/60.0) as {nameof(Quantity)}
- from
- bom_labour bl
- left outer join
- quote_item qi on qi.quote_item_id = bl.quote_item_id
- left outer join
- quote q on q.quote_id = qi.quote_id
- left outer join
- lab_area la on la.lab_area_lib_id = bl.lab_area_lib_id and la.lab_area_id = bl.lab_area_id
- where
- 1=1
- and
- qi.quote_vers_start <= q.quote_vers and qi.quote_vers_stop >= q.quote_vers
- group by
- la.Descr, bl.Cost";
-
- }
- }
|