123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- using System;
- using System.Collections.Generic;
- using System.Linq.Expressions;
- using InABox.Core;
- namespace Comal.Classes
- {
- public class QuoteContractExTax : CoreAggregate<QuoteContract, QuoteContractProposal, double>
- {
- public override Expression<Func<QuoteContractProposal, double>> Aggregate => x => x.Proposal.ProposalExTax;
- public override AggregateCalculation Calculation => AggregateCalculation.Sum;
- public override Dictionary<Expression<Func<QuoteContractProposal, object>>, Expression<Func<QuoteContract, object>>> Links =>
- new Dictionary<Expression<Func<QuoteContractProposal, object>>, Expression<Func<QuoteContract, object>>>()
- {
- { QuoteContractProposal => QuoteContractProposal.Contract.ID, QuoteContract => QuoteContract.ID }
- };
- }
- public class QuoteContractTax : CoreAggregate<QuoteContract, QuoteContractProposal, double>
- {
- public override Expression<Func<QuoteContractProposal, double>> Aggregate => x => x.Proposal.ProposalTax;
- public override AggregateCalculation Calculation => AggregateCalculation.Sum;
- public override Dictionary<Expression<Func<QuoteContractProposal, object>>, Expression<Func<QuoteContract, object>>> Links =>
- new Dictionary<Expression<Func<QuoteContractProposal, object>>, Expression<Func<QuoteContract, object>>>()
- {
- { QuoteContractProposal => QuoteContractProposal.Contract.ID, QuoteContract => QuoteContract.ID }
- };
- }
- public class QuoteContractIncTax : CoreAggregate<QuoteContract, QuoteContractProposal, double>
- {
- public override Expression<Func<QuoteContractProposal, double>> Aggregate => x => x.Proposal.ProposalIncTax;
- public override AggregateCalculation Calculation => AggregateCalculation.Sum;
- public override Dictionary<Expression<Func<QuoteContractProposal, object>>, Expression<Func<QuoteContract, object>>> Links =>
- new Dictionary<Expression<Func<QuoteContractProposal, object>>, Expression<Func<QuoteContract, object>>>()
- {
- { QuoteContractProposal => QuoteContractProposal.Contract.ID, QuoteContract => QuoteContract.ID }
- };
- }
- [UserTracking(typeof(Quote))]
- public class QuoteContract : Entity, IRemotable, IPersistent, IQuoteContract, ILicense<QuotesManagementLicense>, IOneToMany<Quote>
- {
- [NullEditor]
- [EntityRelationship(DeleteAction.Cascade)]
- public QuoteLink Quote { get; set; }
- [TextBoxEditor]
- public string Description { get; set; }
- [CurrencyEditor(Editable = Editable.Hidden, Summary = Summary.Sum)]
- [Aggregate(typeof(QuoteContractExTax))]
- public double ExTax { get; set; }
- [CurrencyEditor(Editable = Editable.Hidden, Summary = Summary.Sum)]
- [Aggregate(typeof(QuoteContractTax))]
- public double Tax { get; set; }
- [CurrencyEditor(Visible = Visible.Default, Editable = Editable.Hidden, Summary = Summary.Sum)]
- [Aggregate(typeof(QuoteContractIncTax))]
- public double IncTax { get; set; }
- }
- }
|