feat(procurement): enhance purchase order and GRN functionalities
- Updated purchase order descriptions for clarity on draft and submission processes. - Implemented submit and delete functionalities for draft purchase orders, allowing users to manage their orders more effectively. - Added discount and VAT fields to GRN lines, enabling better cost tracking and reporting. - Enhanced validation for GRN lines to ensure discount and VAT percentages are within acceptable ranges. - Updated API to support new functionalities, including submitting and deleting purchase orders. - Improved UI components for better user experience in managing purchase orders and GRNs. - Documented changes in security and backend phase documentation to reflect new processes and requirements.
This commit is contained in:
@@ -37,7 +37,13 @@ public sealed class GrnLineConfiguration : IEntityTypeConfiguration<GrnLine>
|
||||
|
||||
builder.Property(l => l.Qty).HasPrecision(18, 4);
|
||||
builder.Property(l => l.UnitCost).HasPrecision(18, 6);
|
||||
builder.Property(l => l.PoUnitPrice).HasPrecision(18, 6);
|
||||
builder.Property(l => l.DiscountPct).HasPrecision(9, 4);
|
||||
builder.Property(l => l.NetUnitCost).HasPrecision(18, 6);
|
||||
builder.Property(l => l.VatPct).HasPrecision(9, 4);
|
||||
builder.Property(l => l.VatAmount).HasPrecision(18, 4);
|
||||
builder.Property(l => l.ReceivedValue).HasPrecision(18, 4);
|
||||
builder.Property(l => l.LineTotal).HasPrecision(18, 4);
|
||||
builder.Property(l => l.HoldStatus).HasConversion<string>().HasMaxLength(20).IsRequired();
|
||||
|
||||
builder.HasOne(l => l.Grn).WithMany(g => g.Lines).HasForeignKey(l => l.GrnId).OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
@@ -41,7 +41,11 @@ public sealed class PermissionConfiguration : IEntityTypeConfiguration<Permissio
|
||||
new Permission { PermissionId = 15, Code = "NAV:products.uom", SubNavItemId = 5 },
|
||||
new Permission { PermissionId = 16, Code = "NAV:products.configuration", SubNavItemId = 6 },
|
||||
new Permission { PermissionId = 17, Code = "NAV:settings.roles", SubNavItemId = 7 },
|
||||
new Permission { PermissionId = 18, Code = "NAV:settings.users", SubNavItemId = 8 }
|
||||
new Permission { PermissionId = 18, Code = "NAV:settings.users", SubNavItemId = 8 },
|
||||
new Permission { PermissionId = 19, Code = "NAV:procurement.requisitions", SubNavItemId = 9 },
|
||||
new Permission { PermissionId = 20, Code = "NAV:procurement.rfqs", SubNavItemId = 10 },
|
||||
new Permission { PermissionId = 21, Code = "NAV:procurement.purchase-orders", SubNavItemId = 11 },
|
||||
new Permission { PermissionId = 22, Code = "NAV:procurement.purchase-returns", SubNavItemId = 12 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,12 @@ public sealed class SubNavItemConfiguration : IEntityTypeConfiguration<SubNavIte
|
||||
new SubNavItem { SubNavItemId = 5, NavItemId = 2, Code = "products.uom", Label = "UOM", Href = "/dashboard/products/uoms", SortOrder = 5 },
|
||||
new SubNavItem { SubNavItemId = 6, NavItemId = 2, Code = "products.configuration", Label = "Configuration", Href = "/dashboard/products/settings", SortOrder = 6 },
|
||||
new SubNavItem { SubNavItemId = 7, NavItemId = 9, Code = "settings.roles", Label = "Roles", Href = "/dashboard/settings/roles", SortOrder = 1 },
|
||||
new SubNavItem { SubNavItemId = 8, NavItemId = 9, Code = "settings.users", Label = "Users", Href = "/dashboard/settings/users", SortOrder = 2 }
|
||||
new SubNavItem { SubNavItemId = 8, NavItemId = 9, Code = "settings.users", Label = "Users", Href = "/dashboard/settings/users", SortOrder = 2 },
|
||||
// Procurement (NavItemId 4) children — mirror the hub page order.
|
||||
new SubNavItem { SubNavItemId = 9, NavItemId = 4, Code = "procurement.requisitions", Label = "Requisitions", Href = "/dashboard/procurement/requisitions", SortOrder = 1 },
|
||||
new SubNavItem { SubNavItemId = 10, NavItemId = 4, Code = "procurement.rfqs", Label = "RFQs", Href = "/dashboard/procurement/rfqs", SortOrder = 2 },
|
||||
new SubNavItem { SubNavItemId = 11, NavItemId = 4, Code = "procurement.purchase-orders", Label = "Purchase Orders", Href = "/dashboard/procurement/purchase-orders", SortOrder = 3 },
|
||||
new SubNavItem { SubNavItemId = 12, NavItemId = 4, Code = "procurement.purchase-returns", Label = "Purchase Returns", Href = "/dashboard/procurement/purchase-returns", SortOrder = 4 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,6 +277,10 @@ namespace ERPCore.Infra.Persistence.Migrations
|
||||
b.Property<int?>("BinId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<decimal>("DiscountPct")
|
||||
.HasPrecision(9, 4)
|
||||
.HasColumnType("numeric(9,4)");
|
||||
|
||||
b.Property<int>("GrnId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@@ -288,9 +292,21 @@ namespace ERPCore.Infra.Persistence.Migrations
|
||||
b.Property<int>("ItemId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<decimal>("LineTotal")
|
||||
.HasPrecision(18, 4)
|
||||
.HasColumnType("numeric(18,4)");
|
||||
|
||||
b.Property<decimal>("NetUnitCost")
|
||||
.HasPrecision(18, 6)
|
||||
.HasColumnType("numeric(18,6)");
|
||||
|
||||
b.Property<int?>("PoLineId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<decimal?>("PoUnitPrice")
|
||||
.HasPrecision(18, 6)
|
||||
.HasColumnType("numeric(18,6)");
|
||||
|
||||
b.Property<decimal>("Qty")
|
||||
.HasPrecision(18, 4)
|
||||
.HasColumnType("numeric(18,4)");
|
||||
@@ -306,6 +322,14 @@ namespace ERPCore.Infra.Persistence.Migrations
|
||||
b.Property<int>("UomId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<decimal>("VatAmount")
|
||||
.HasPrecision(18, 4)
|
||||
.HasColumnType("numeric(18,4)");
|
||||
|
||||
b.Property<decimal>("VatPct")
|
||||
.HasPrecision(9, 4)
|
||||
.HasColumnType("numeric(9,4)");
|
||||
|
||||
b.HasKey("GrnLineId");
|
||||
|
||||
b.HasIndex("BatchId");
|
||||
@@ -828,6 +852,30 @@ namespace ERPCore.Infra.Persistence.Migrations
|
||||
PermissionId = 18,
|
||||
Code = "NAV:settings.users",
|
||||
SubNavItemId = 8
|
||||
},
|
||||
new
|
||||
{
|
||||
PermissionId = 19,
|
||||
Code = "NAV:procurement.requisitions",
|
||||
SubNavItemId = 9
|
||||
},
|
||||
new
|
||||
{
|
||||
PermissionId = 20,
|
||||
Code = "NAV:procurement.rfqs",
|
||||
SubNavItemId = 10
|
||||
},
|
||||
new
|
||||
{
|
||||
PermissionId = 21,
|
||||
Code = "NAV:procurement.purchase-orders",
|
||||
SubNavItemId = 11
|
||||
},
|
||||
new
|
||||
{
|
||||
PermissionId = 22,
|
||||
Code = "NAV:procurement.purchase-returns",
|
||||
SubNavItemId = 12
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1916,6 +1964,46 @@ namespace ERPCore.Infra.Persistence.Migrations
|
||||
NavItemId = 9,
|
||||
SortOrder = 2,
|
||||
Status = "Active"
|
||||
},
|
||||
new
|
||||
{
|
||||
SubNavItemId = 9,
|
||||
Code = "procurement.requisitions",
|
||||
Href = "/dashboard/procurement/requisitions",
|
||||
Label = "Requisitions",
|
||||
NavItemId = 4,
|
||||
SortOrder = 1,
|
||||
Status = "Active"
|
||||
},
|
||||
new
|
||||
{
|
||||
SubNavItemId = 10,
|
||||
Code = "procurement.rfqs",
|
||||
Href = "/dashboard/procurement/rfqs",
|
||||
Label = "RFQs",
|
||||
NavItemId = 4,
|
||||
SortOrder = 2,
|
||||
Status = "Active"
|
||||
},
|
||||
new
|
||||
{
|
||||
SubNavItemId = 11,
|
||||
Code = "procurement.purchase-orders",
|
||||
Href = "/dashboard/procurement/purchase-orders",
|
||||
Label = "Purchase Orders",
|
||||
NavItemId = 4,
|
||||
SortOrder = 3,
|
||||
Status = "Active"
|
||||
},
|
||||
new
|
||||
{
|
||||
SubNavItemId = 12,
|
||||
Code = "procurement.purchase-returns",
|
||||
Href = "/dashboard/procurement/purchase-returns",
|
||||
Label = "Purchase Returns",
|
||||
NavItemId = 4,
|
||||
SortOrder = 4,
|
||||
Status = "Active"
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user