12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System;
- using System.Collections.Generic;
- using System.Linq.Expressions;
- using InABox.Core;
- namespace Comal.Classes
- {
- public class QuoteCostSheetExTax : CoreAggregate<QuoteCostSheet, QuoteCostSheetItem, double>
- {
- public override Expression<Func<QuoteCostSheetItem, double>> Aggregate => x => x.ExTax;
- public override AggregateCalculation Calculation => AggregateCalculation.Sum;
- public override Dictionary<Expression<Func<QuoteCostSheetItem, object>>, Expression<Func<QuoteCostSheet, object>>> Links =>
- new Dictionary<Expression<Func<QuoteCostSheetItem, object>>, Expression<Func<QuoteCostSheet, object>>>()
- {
- { QuoteCostSheetItem => QuoteCostSheetItem.CostSheet.ID, QuoteCostSheet => QuoteCostSheet.ID }
- };
- }
- public class QuoteCostSheetTax : CoreAggregate<QuoteCostSheet, QuoteCostSheetItem, double>
- {
- public override Expression<Func<QuoteCostSheetItem, double>> Aggregate => x => x.Tax;
- public override AggregateCalculation Calculation => AggregateCalculation.Sum;
- public override Dictionary<Expression<Func<QuoteCostSheetItem, object>>, Expression<Func<QuoteCostSheet, object>>> Links =>
- new Dictionary<Expression<Func<QuoteCostSheetItem, object>>, Expression<Func<QuoteCostSheet, object>>>()
- {
- { QuoteCostSheetItem => QuoteCostSheetItem.CostSheet.ID, QuoteCostSheet => QuoteCostSheet.ID }
- };
- }
- public class QuoteCostSheetIncTax : CoreAggregate<QuoteCostSheet, QuoteCostSheetItem, double>
- {
- public override Expression<Func<QuoteCostSheetItem, double>> Aggregate => x => x.IncTax;
- public override AggregateCalculation Calculation => AggregateCalculation.Sum;
- public override Dictionary<Expression<Func<QuoteCostSheetItem, object>>, Expression<Func<QuoteCostSheet, object>>> Links =>
- new Dictionary<Expression<Func<QuoteCostSheetItem, object>>, Expression<Func<QuoteCostSheet, object>>>()
- {
- { QuoteCostSheetItem => QuoteCostSheetItem.CostSheet.ID, QuoteCostSheet => QuoteCostSheet.ID }
- };
- }
- [UserTracking(typeof(Quote))]
- public class QuoteCostSheet : Entity, IRemotable, IPersistent, IQuoteCostSheet, ILicense<QuotesManagementLicense>
- {
- [NullEditor]
- [EntityRelationship(DeleteAction.Cascade)]
- public QuoteLink Quote { get; set; }
- [EntityRelationship(DeleteAction.SetNull)]
- public CostSheetLink CostSheet { get; set; }
- [CurrencyEditor(Visible = Visible.Default, Editable = Editable.Hidden, Summary = Summary.Sum)]
- [Aggregate(typeof(QuoteCostSheetExTax))]
- public double ExTax { get; set; }
- [CurrencyEditor(Visible = Visible.Optional, Editable = Editable.Hidden, Summary = Summary.Sum)]
- [Aggregate(typeof(QuoteCostSheetTax))]
- public double Tax { get; set; }
- [CurrencyEditor(Visible = Visible.Optional, Editable = Editable.Hidden, Summary = Summary.Sum)]
- [Aggregate(typeof(QuoteCostSheetIncTax))]
- public double IncTax { get; set; }
- [TextBoxEditor(Visible = Visible.Default)]
- public string Description { get; set; }
- [NullEditor]
- public long Sequence { get; set; }
- protected override void Init()
- {
- base.Init();
- Quote = new QuoteLink();
- CostSheet = new CostSheetLink();
- }
- }
- }
|