Fix GRN pricing

This commit is contained in:
2026-10-08 10:37:19 +05:30
parent ff6f3d3218
commit 9908a552d1
11 changed files with 9171 additions and 30 deletions
+9
View File
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Distribution.Models
{
@@ -27,6 +28,14 @@ namespace Distribution.Models
public DateTime ReceivedAt { get; set; } = DateTime.Now;
/// <summary>GRN-wide default discount %, applied to any line that doesn't set its own.</summary>
[Precision(5, 2)]
public decimal DiscountPercent { get; set; }
/// <summary>GRN-wide default VAT %, applied to any line that doesn't set its own.</summary>
[Precision(5, 2)]
public decimal VatPercent { get; set; }
public ICollection<GoodsReceiptItem> Items { get; set; } = [];
}
}
+17
View File
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Distribution.Models
{
@@ -24,6 +25,22 @@ namespace Distribution.Models
/// <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; } = [];