Billing: Add possibility to automatically add business shares
This commit is contained in:
@ -62,12 +62,8 @@ namespace Elwig.Models.Entities {
|
||||
|
||||
[NotMapped]
|
||||
public DateOnly? EntryDate {
|
||||
get {
|
||||
return EntryDateString != null ? DateOnly.ParseExact(EntryDateString, "yyyy-MM-dd") : null;
|
||||
}
|
||||
set {
|
||||
EntryDateString = value?.ToString("yyyy-MM-dd");
|
||||
}
|
||||
get => EntryDateString != null ? DateOnly.ParseExact(EntryDateString, "yyyy-MM-dd") : null;
|
||||
set => EntryDateString = value?.ToString("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
[Column("exit_date")]
|
||||
@ -75,12 +71,8 @@ namespace Elwig.Models.Entities {
|
||||
|
||||
[NotMapped]
|
||||
public DateOnly? ExitDate {
|
||||
get {
|
||||
return ExitDateString != null ? DateOnly.ParseExact(ExitDateString, "yyyy-MM-dd") : null;
|
||||
}
|
||||
set {
|
||||
ExitDateString = value?.ToString("yyyy-MM-dd");
|
||||
}
|
||||
get => ExitDateString != null ? DateOnly.ParseExact(ExitDateString, "yyyy-MM-dd") : null;
|
||||
set => ExitDateString = value?.ToString("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
[Column("business_shares")]
|
||||
|
31
Elwig/Models/Entities/MemberHistory.cs
Normal file
31
Elwig/Models/Entities/MemberHistory.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Elwig.Models.Entities {
|
||||
[Table("member_history"), PrimaryKey("MgNr", "DateString")]
|
||||
public class MemberHistory {
|
||||
[Column("mgnr")]
|
||||
public int MgNr { get; set; }
|
||||
|
||||
[Column("date")]
|
||||
public string DateString { get; set; }
|
||||
[NotMapped]
|
||||
public DateOnly Date {
|
||||
get => DateOnly.ParseExact(DateString, "yyyy-MM-dd");
|
||||
set => value.ToString("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
[Column("business_shares")]
|
||||
public int BusinessShares { get; set; }
|
||||
|
||||
[Column("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
[Column("comment")]
|
||||
public string? Comment { get; set; }
|
||||
|
||||
[ForeignKey("MgNr")]
|
||||
public virtual Member Member { get; private set; }
|
||||
}
|
||||
}
|
@ -55,6 +55,14 @@ namespace Elwig.Models.Entities {
|
||||
set => PenaltyNoneValue = value != null ? DecToDb(value.Value) : null;
|
||||
}
|
||||
|
||||
[Column("bs_value")]
|
||||
public long? BusinessShareValueValue { get; set; }
|
||||
[NotMapped]
|
||||
public decimal? BusinessShareValue {
|
||||
get => BusinessShareValueValue != null ? DecFromDb(BusinessShareValueValue.Value) : null;
|
||||
set => BusinessShareValueValue = value != null ? DecToDb(value.Value) : null;
|
||||
}
|
||||
|
||||
[Column("start_date")]
|
||||
public string? StartDateString { get; set; }
|
||||
|
||||
|
Reference in New Issue
Block a user