ProductLink.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. using System;
  2. using InABox.Core;
  3. namespace Comal.Classes
  4. {
  5. public class ProductLink : EntityLink<Product>, IProduct
  6. {
  7. [CodePopupEditor(typeof(Product), "TaxCode.ID", "PurchaseGL.ID")]
  8. public override Guid ID { get; set; }
  9. [CodeEditor(Visible = Visible.Default)]
  10. public string Code { get; set; }
  11. [TextBoxEditor(Visible = Visible.Optional, Editable = Editable.Hidden)]
  12. public string Name { get; set; }
  13. [NullEditor]
  14. [Obsolete("Replaced with Dimensions", true)]
  15. // [DoubleEditor(Visible = Visible.Optional, Editable = Editable.Hidden)]
  16. public double UnitSize { get; set; }
  17. [NullEditor]
  18. [Obsolete("Replaced with Dimensions", true)]
  19. // [DoubleEditor(Visible = Visible.Optional, Editable = Editable.Hidden)]
  20. public double Weight { get; set; }
  21. [NullEditor]
  22. [Obsolete("Replaced with Dimensions", false)]
  23. public ProductUOMLink Units { get; set; }
  24. public ProductGroupLink Group { get; set; }
  25. public ProductSupplierLink Supplier { get; set; }
  26. [NullEditor]
  27. [RequiredColumn]
  28. public ProductInstanceLink DefaultInstance { get; set; }
  29. public ProductDimensionUnitLink UnitOfMeasure { get; set; }
  30. [NullEditor]
  31. [RequiredColumn]
  32. public StockLocationLink DefaultLocation { get; set; }
  33. [NullEditor]
  34. public StockWarehouseLink Warehouse { get; set; }
  35. [CurrencyEditor(Visible = Visible.Optional, Editable = Editable.Hidden)]
  36. public double BaseCost { get; set; }
  37. [CurrencyEditor(Visible = Visible.Optional, Editable = Editable.Hidden)]
  38. public double NettCost { get; set; }
  39. [Obsolete("Replaced with ProductInstance.AverageCost", true)]
  40. [CurrencyEditor(Visible = Visible.Optional, Editable = Editable.Hidden)]
  41. public double AverageCost { get; set; }
  42. [NullEditor]
  43. [RequiredColumn]
  44. public TaxCodeLink TaxCode { get; set; }
  45. [NullEditor]
  46. [RequiredColumn]
  47. public PurchaseGLCodeLink PurchaseGL { get; set; }
  48. [NullEditor]
  49. [RequiredColumn]
  50. public SalesGLCodeLink SellGL { get; set; }
  51. [NullEditor]
  52. public bool NonStock { get; set; } = true;
  53. [NullEditor]
  54. public ImageDocumentLink Image { get; set; }
  55. [CheckBoxEditor(Visible = Visible.Optional, Editable = Editable.Hidden)]
  56. public bool UseDefaultSupplierPricing { get; set; }
  57. [EnumLookupEditor(typeof(ProductPricingStrategy), Visible = Visible.Optional, Editable = Editable.Hidden)]
  58. public ProductPricingStrategy PricingStrategy { get; set; }
  59. [EnumLookupEditor(typeof(SupplierProductOrderStrategy), Visible = Visible.Optional, Editable = Editable.Hidden)]
  60. public SupplierProductOrderStrategy OrderStrategy { get; set; }
  61. [NullEditor]
  62. [RequiredColumn]
  63. public CostCentreLink CostCentre { get; set; }
  64. [NullEditor]
  65. public ProductCharge Charge { get; set; }
  66. [NullEditor]
  67. public DigitalFormLink DigitalForm { get; set; }
  68. [DoubleEditor(Visible=Visible.Optional, Editable = Editable.Hidden, Summary=Summary.Sum)]
  69. public double UnitQty { get; set; }
  70. [DoubleEditor(Visible=Visible.Optional, Editable = Editable.Hidden, Summary=Summary.Sum)]
  71. public double RemnantQty { get; set; }
  72. [DoubleEditor(Visible=Visible.Optional, Editable = Editable.Hidden, Summary=Summary.Sum)]
  73. public double OnOrder { get; set; }
  74. [DoubleEditor(Visible=Visible.Optional, Editable = Editable.Hidden, Summary=Summary.Sum)]
  75. public double TotalStock { get; set; }
  76. [DoubleEditor(Visible=Visible.Optional, Editable = Editable.Hidden, Summary=Summary.Sum)]
  77. public double ReservedStock { get; set; }
  78. [DoubleEditor(Visible=Visible.Optional, Editable = Editable.Hidden, Summary=Summary.Sum)]
  79. public double FreeStock { get; set; }
  80. [NullEditor]
  81. [RequiredColumn]
  82. [Obsolete]
  83. public ProductDimensions Dimensions { get; set; }
  84. [NullEditor]
  85. [RequiredColumn]
  86. [Obsolete]
  87. public ProductStyleLink DefaultStyle { get; set; }
  88. [NullEditor]
  89. [Obsolete]
  90. public int MinimumStockLevel { get; set; }
  91. [NullEditor]
  92. public string Issues { get; set; }
  93. public override string ToString()
  94. {
  95. return string.Format("{0}: {1}", Code, Name);
  96. }
  97. }
  98. }