This commit is contained in:
2026-01-19 18:02:55 +01:00
parent 87044adcb0
commit 30f87f26da
19 changed files with 10631 additions and 3773 deletions

View File

@@ -77,6 +77,10 @@ namespace EveryThing.Models.Invoice
[Display(Name = "Partner")]
public int? IdPartnerFk { get; set; }
[ForeignKey("Projekt")]
[Display(Name = "Projekt")]
public int? IdProjectFk { get; set; }
[Required]
public int InvoiceNumber { get; set; }
@@ -133,13 +137,29 @@ namespace EveryThing.Models.Invoice
[NotMapped]
public string InvoiceNumberFull => $"{InvoiceTypeString}-{InvoiceNumberFormatted}";
[NotMapped] public string InvoiceTypeHeaderString => GetInvoiceTypeHeaderString(Type);
// ForeignKey
public CodeTableCompany Company { get; set; }
public CodeTablePartner Partner { get; set; }
public Project.Project Project{ get; set; }
// InvoicePart
[InverseProperty("Invoice")]
public virtual ICollection<InvoiceItem> InvoiceInvoiceItem { get; set; }
public static string GetInvoiceTypeHeaderString(InvoiceType iType)
{
return iType switch
{
InvoiceType.Order => "Naročila dobaviteljem",
0 => "Računi",
InvoiceType.DeliveryNote => "Dobavnice",
InvoiceType.BuyersOrder => "Naročila kupcev",
InvoiceType.Cooperation => "Kooperacije",
_ => "Fakture"
};
}
}
}