123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using System.Linq.Expressions;
- using InABox.Core;
- namespace Comal.Classes
- {
- public class QuoteProposalCostSheetExTax : IFormula<QuoteProposalCostSheet, double>
- {
- public Expression<Func<QuoteProposalCostSheet, double>> Value => x => x.CostSheet.ExTax;
- public Expression<Func<QuoteProposalCostSheet, double>>[] Modifiers => new Expression<Func<QuoteProposalCostSheet, double>>[] { x => x.Qty };
- public FormulaOperator Operator => FormulaOperator.Multiply;
- public FormulaType Type => FormulaType.Virtual;
- }
- public class QuoteProposalCostSheetTax : IFormula<QuoteProposalCostSheet, double>
- {
- public Expression<Func<QuoteProposalCostSheet, double>> Value => x => x.CostSheet.Tax;
- public Expression<Func<QuoteProposalCostSheet, double>>[] Modifiers => new Expression<Func<QuoteProposalCostSheet, double>>[] { x => x.Qty };
- public FormulaOperator Operator => FormulaOperator.Multiply;
- public FormulaType Type => FormulaType.Virtual;
- }
- public class QuoteProposalCostSheetIncTax : IFormula<QuoteProposalCostSheet, double>
- {
- public Expression<Func<QuoteProposalCostSheet, double>> Value => x => x.CostSheet.IncTax;
- public Expression<Func<QuoteProposalCostSheet, double>>[] Modifiers => new Expression<Func<QuoteProposalCostSheet, double>>[] { x => x.Qty };
- public FormulaOperator Operator => FormulaOperator.Multiply;
- public FormulaType Type => FormulaType.Virtual;
- }
- [UserTracking(typeof(Quote))]
- public class QuoteProposalCostSheet : Entity, IRemotable, IPersistent, IQuoteProposalCostSheet, ILicense<QuotesManagementLicense>
- {
- [NullEditor]
- [EntityRelationship(DeleteAction.Cascade)]
- public QuoteProposalLink Proposal { get; set; }
- [EntityRelationship(DeleteAction.Cascade)]
- public QuoteCostSheetLink CostSheet { get; set; }
- [IntegerEditor]
- public int Qty { get; set; }
- [CurrencyEditor(Editable = Editable.Hidden, Summary = Summary.Sum)]
- [Formula(typeof(QuoteProposalCostSheetExTax))]
- public double ExTax { get; set; }
- [CurrencyEditor(Editable = Editable.Hidden, Summary = Summary.Sum)]
- [Formula(typeof(QuoteProposalCostSheetTax))]
- public double Tax { get; set; }
- [CurrencyEditor(Visible = Visible.Default, Editable = Editable.Hidden, Summary = Summary.Sum)]
- [Formula(typeof(QuoteProposalCostSheetIncTax))]
- public double IncTax { get; set; }
- [NullEditor]
- public long Sequence { get; set; }
- protected override void Init()
- {
- base.Init();
- Proposal = new QuoteProposalLink();
- CostSheet = new QuoteCostSheetLink();
- }
- }
- }
|