|
@@ -20,6 +20,9 @@ namespace Comal.Classes
|
|
|
[EditorSequence(1)]
|
|
|
public PurchaseOrderItemLink OrderItem { get; set; }
|
|
|
|
|
|
+ [EditorSequence(2)]
|
|
|
+ public ProductLink Product { get; set; }
|
|
|
+
|
|
|
[MemoEditor]
|
|
|
[EditorSequence(2)]
|
|
|
public string Description { get; set; }
|
|
@@ -83,6 +86,30 @@ namespace Comal.Classes
|
|
|
|
|
|
LinkedProperties.Register<BillLine, TaxCodeLink, double>(x => x.TaxCode, x => x.Rate, x => x.TaxRate);
|
|
|
|
|
|
- }
|
|
|
+ LinkedProperties.Register<BillLine, PurchaseGLCodeLink, Guid>(x => x.Product.PurchaseGL, x => x.ID, x => x.PurchaseGL.ID);
|
|
|
+ LinkedProperties.Register<BillLine, CostCentreLink, Guid>(x => x.Product.CostCentre, x => x.ID, x => x.CostCentre.ID);
|
|
|
+ LinkedProperties.Register<BillLine, TaxCodeLink, Guid>(x => x.Product.TaxCode, x => x.ID, x => x.TaxCode.ID);
|
|
|
+ LinkedProperties.Register<BillLine, TaxCodeLink, string>(x => x.Product.TaxCode, x => x.Code, x => x.TaxCode.Code);
|
|
|
+ LinkedProperties.Register<BillLine, TaxCodeLink, string>(x => x.Product.TaxCode, x => x.Description, x => x.TaxCode.Description);
|
|
|
+ LinkedProperties.Register<BillLine, TaxCodeLink, double>(x => x.Product.TaxCode, x => x.Rate, x => x.TaxCode.Rate);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static readonly Column<BillLine> OrderItemColumn = new Column<BillLine>(x => x.OrderItem.ID);
|
|
|
+ private static readonly Column<BillLine> ProductColumn = new Column<BillLine>(x => x.Product.ID);
|
|
|
+
|
|
|
+ protected override void DoPropertyChanged(string name, object? before, object? after)
|
|
|
+ {
|
|
|
+ base.DoPropertyChanged(name, before, after);
|
|
|
+ if (OrderItemColumn.IsEqualTo(name) && after is Guid orderItemID && orderItemID != Guid.Empty)
|
|
|
+ {
|
|
|
+ Product.ID = Guid.Empty;
|
|
|
+ Product.Clear();
|
|
|
+ }
|
|
|
+ else if(ProductColumn.IsEqualTo(name) && after is Guid productID && productID != Guid.Empty)
|
|
|
+ {
|
|
|
+ OrderItem.ID = Guid.Empty;
|
|
|
+ OrderItem.Clear();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|