Added missing field to display price of products on quotation and purchase order

This commit is contained in:
2026-05-25 11:44:18 +01:00
parent 1ae8072219
commit b59a8b6c3d
8 changed files with 2086 additions and 6 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,50 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PyroFetes.Migrations
{
/// <inheritdoc />
public partial class AddedMissingFieldForSupplierInDocuments : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "SupplierId",
table: "Quotations",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateIndex(
name: "IX_Quotations_SupplierId",
table: "Quotations",
column: "SupplierId");
migrationBuilder.AddForeignKey(
name: "FK_Quotations_Suppliers_SupplierId",
table: "Quotations",
column: "SupplierId",
principalTable: "Suppliers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Quotations_Suppliers_SupplierId",
table: "Quotations");
migrationBuilder.DropIndex(
name: "IX_Quotations_SupplierId",
table: "Quotations");
migrationBuilder.DropColumn(
name: "SupplierId",
table: "Quotations");
}
}
}
@@ -744,10 +744,15 @@ namespace PyroFetes.Migrations
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<int>("SupplierId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CustomerId");
b.HasIndex("SupplierId");
b.ToTable("Quotations");
});
@@ -1553,7 +1558,7 @@ namespace PyroFetes.Migrations
modelBuilder.Entity("PyroFetes.Models.PurchaseOrder", b =>
{
b.HasOne("PyroFetes.Models.Supplier", "Supplier")
.WithMany()
.WithMany("PurchaseOrders")
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -1588,7 +1593,15 @@ namespace PyroFetes.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PyroFetes.Models.Supplier", "Supplier")
.WithMany("Quotations")
.HasForeignKey("SupplierId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Customer");
b.Navigation("Supplier");
});
modelBuilder.Entity("PyroFetes.Models.QuotationProduct", b =>
@@ -1957,6 +1970,10 @@ namespace PyroFetes.Migrations
modelBuilder.Entity("PyroFetes.Models.Supplier", b =>
{
b.Navigation("Prices");
b.Navigation("PurchaseOrders");
b.Navigation("Quotations");
});
modelBuilder.Entity("PyroFetes.Models.Truck", b =>