InvoiceLine.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using InABox.Core;
  2. namespace Comal.Classes
  3. {
  4. [UserTracking(typeof(Invoice))]
  5. public class InvoiceLine : Entity, IPersistent, IRemotable, ISequenceable, IOneToMany<Invoice>, ITaxable, ILicense<AccountsReceivableLicense>
  6. {
  7. [EntityRelationship(DeleteAction.Cascade)]
  8. public InvoiceLink InvoiceLink { get; set; }
  9. public JobFinancialLink Financial { get; set; }
  10. [MemoEditor]
  11. public string Description { get; set; }
  12. [CurrencyEditor(Editable = Editable.Hidden)]
  13. public double Amount { get; set; }
  14. public TaxCodeLink TaxCode { get; set; }
  15. [NullEditor]
  16. public long Sequence { get; set; }
  17. [DoubleEditor(Summary = Summary.Sum)]
  18. public double ExTax { get; set; }
  19. [DoubleEditor(Editable = Editable.Hidden)]
  20. public double TaxRate { get; set; }
  21. [DoubleEditor(Editable = Editable.Hidden, Summary = Summary.Sum)]
  22. public double Tax { get; set; }
  23. [DoubleEditor(Summary = Summary.Sum)]
  24. public double IncTax { get; set; }
  25. protected override void Init()
  26. {
  27. base.Init();
  28. InvoiceLink = new InvoiceLink();
  29. TaxCode = new TaxCodeLink(() => this);
  30. Financial = new JobFinancialLink();
  31. }
  32. static InvoiceLine()
  33. {
  34. LinkedProperties.Register<InvoiceLine, TaxCodeLink, double>(x => x.TaxCode, x => x.Rate, x => x.TaxRate);
  35. }
  36. }
  37. }