33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Distribution.Models
|
|
{
|
|
public class PurchaseOrderItem : Template
|
|
{
|
|
public Guid FK_PurchaseOrderId { get; set; }
|
|
[ForeignKey("FK_PurchaseOrderId")]
|
|
public PurchaseOrder PurchaseOrder { get; set; }
|
|
|
|
public Guid FK_ItemId { get; set; }
|
|
[ForeignKey("FK_ItemId")]
|
|
public Item Item { get; set; }
|
|
|
|
public int Quantity { get; set; }
|
|
|
|
/// <summary>Agreed cost per unit at the time the PO was issued.</summary>
|
|
public decimal UnitCost { get; set; }
|
|
|
|
/// <summary>Running total, incremented by createGoodsReceipt; drives PurchaseOrder.Status.</summary>
|
|
public int ReceivedQuantity { get; set; } = 0;
|
|
|
|
/// <summary>
|
|
/// Set by cancelPurchaseOrderLine. Outstanding qty for receiving purposes is
|
|
/// Quantity - ReceivedQuantity - CancelledQuantity.
|
|
/// </summary>
|
|
public int CancelledQuantity { get; set; } = 0;
|
|
|
|
/// <summary>True once this line is individually cancelled.</summary>
|
|
public bool IsCancelled { get; set; } = false;
|
|
}
|
|
}
|