51 lines
2.0 KiB
C#
51 lines
2.0 KiB
C#
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Distribution.Models
|
|
{
|
|
public class GoodsReceiptItem : Template
|
|
{
|
|
public Guid FK_GoodsReceiptId { get; set; }
|
|
[ForeignKey("FK_GoodsReceiptId")]
|
|
public GoodsReceipt GoodsReceipt { get; set; }
|
|
|
|
/// <summary>Null for a direct receipt line (no purchase order); FK_ItemId is set instead.</summary>
|
|
public Guid? FK_PurchaseOrderItemId { get; set; }
|
|
[ForeignKey("FK_PurchaseOrderItemId")]
|
|
public PurchaseOrderItem? PurchaseOrderItem { get; set; }
|
|
|
|
/// <summary>Set for direct receipt lines. PO-based lines resolve the item through PurchaseOrderItem.</summary>
|
|
public Guid? FK_ItemId { get; set; }
|
|
[ForeignKey("FK_ItemId")]
|
|
public Item? Item { get; set; }
|
|
|
|
/// <summary>Added to warehouse stock.</summary>
|
|
public int AcceptedQuantity { get; set; }
|
|
|
|
/// <summary>Damaged/short at receipt, not added to stock.</summary>
|
|
public int RejectedQuantity { get; set; } = 0;
|
|
|
|
/// <summary>
|
|
/// Units the supplier gave at no charge. Received into stock like accepted units, but never
|
|
/// costed and never counted against the purchase order's ordered quantity.
|
|
/// </summary>
|
|
public int FreeQuantity { get; set; } = 0;
|
|
|
|
/// <summary>Cost per base-UOM unit. Only accepted units are costed.</summary>
|
|
[Precision(18, 2)]
|
|
public decimal UnitCost { get; set; }
|
|
|
|
[Precision(5, 2)]
|
|
public decimal DiscountPercent { get; set; }
|
|
|
|
[Precision(5, 2)]
|
|
public decimal VatPercent { get; set; }
|
|
|
|
/// <summary>Populated when the received item tracks batches and/or expiry dates.</summary>
|
|
public ICollection<GoodsReceiptItemBatch> Batches { get; set; } = [];
|
|
|
|
/// <summary>Populated when the received item tracks serial numbers.</summary>
|
|
public ICollection<GoodsReceiptItemSerial> Serials { get; set; } = [];
|
|
}
|
|
}
|