dev
This commit is contained in:
@@ -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"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,5 +81,8 @@ namespace EveryThing.Models.Project
|
||||
[InverseProperty("Project")]
|
||||
public virtual ICollection<ProjectPart> ProjectProjectPart { get; set; }
|
||||
|
||||
[InverseProperty("Project")]
|
||||
public virtual ICollection<Invoice.Invoice> Invoices { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user