[#20][#80] Elwig: Update member_history and add different types of shares
Test / Run tests (push) Successful in 2m0s
Test / Run tests (push) Successful in 2m0s
This commit is contained in:
@@ -29,7 +29,7 @@ namespace Elwig.Models.Dtos {
|
||||
("Gross", "Brutto", "€", 20),
|
||||
("Penalties", "Pönalen FB", "€", 20),
|
||||
("Penalty", "Unterl. GA", "€", 20),
|
||||
("AutoBs", "GA Nachz.", "€", 20),
|
||||
("AutoShares", "GA Nachz.", "€", 20),
|
||||
("Custom", "Weitere", "€", 20),
|
||||
("Others", "Sonstige", "€", 20),
|
||||
("Considered", "Berückstgt.", "€", 20),
|
||||
@@ -56,9 +56,9 @@ namespace Elwig.Models.Dtos {
|
||||
p.plz, o.name AS ort, m.address, m.iban, c.tgnr, s.year, s.precision,
|
||||
p.amount - p.net_amount AS surcharge,
|
||||
c.net_amount, c.prev_net_amount, c.vat, c.vat_amount, c.gross_amount, c.modifiers, c.prev_modifiers, c.amount,
|
||||
ROUND(b.total_penalty / POW(10, s.precision - 2)) AS bs_penalty,
|
||||
ROUND(u.total_penalty / POW(10, 4 - 2)) AS fb_penalty,
|
||||
ROUND(-a.total_amount / POW(10, s.precision - 2)) AS auto_bs,
|
||||
ROUND(b.total_penalty / POW(10, s.precision - 2)) AS shares_penalty,
|
||||
ROUND(u.total_penalty / POW(10, 4 - 2)) AS ac_penalty,
|
||||
-a.total_amount AS auto_shares,
|
||||
x.amount AS custom_mod
|
||||
FROM credit c
|
||||
LEFT JOIN member m ON m.mgnr = c.mgnr
|
||||
@@ -94,7 +94,7 @@ namespace Elwig.Models.Dtos {
|
||||
public decimal Gross;
|
||||
public decimal? Penalties;
|
||||
public decimal? Penalty;
|
||||
public decimal? AutoBs;
|
||||
public decimal? AutoShares;
|
||||
public decimal? Custom;
|
||||
public decimal? Others;
|
||||
public decimal? Considered;
|
||||
@@ -122,14 +122,14 @@ namespace Elwig.Models.Dtos {
|
||||
}
|
||||
decimal mod = (row.Modifiers == null) ? 0 : Utils.DecFromDb((long)row.Modifiers, prec1);
|
||||
if (data.ConsiderContractPenalties)
|
||||
Penalties = (row.FbPenalty == null) ? null : Utils.DecFromDb((long)row.FbPenalty, prec1);
|
||||
Penalties = (row.AcPenalty == null) ? null : Utils.DecFromDb((long)row.AcPenalty, prec1);
|
||||
if (data.ConsiderTotalPenalty)
|
||||
Penalty = (row.BsPenalty == null) ? null : Utils.DecFromDb((long)row.BsPenalty, prec1);
|
||||
Penalty = (row.SharesPenalty == null) ? null : Utils.DecFromDb((long)row.SharesPenalty, prec1);
|
||||
if (data.ConsiderAutoBusinessShares)
|
||||
AutoBs = (row.AutoBs == null) ? null : Utils.DecFromDb((long)row.AutoBs, prec1);
|
||||
AutoShares = (row.AutoShares == null) ? null : Utils.DecFromDb((long)row.AutoShares, prec1);
|
||||
if (data.ConsiderCustomModifiers)
|
||||
Custom = (row.CustomMod == null) ? null : Utils.DecFromDb((long)row.CustomMod, prec1);
|
||||
mod -= (Penalties ?? 0) + (Penalty ?? 0) + (AutoBs ?? 0) + (Custom ?? 0);
|
||||
mod -= (Penalties ?? 0) + (Penalty ?? 0) + (AutoShares ?? 0) + (Custom ?? 0);
|
||||
Others = (mod == 0) ? null : mod;
|
||||
Gross = Utils.DecFromDb(row.GrossAmount, prec1);
|
||||
Considered = (row.PrevModifiers == null || row.PrevModifiers == 0) ? null : -Utils.DecFromDb((long)row.PrevModifiers, prec1);
|
||||
@@ -179,12 +179,12 @@ namespace Elwig.Models.Dtos {
|
||||
public long? PrevModifiers { get; set; }
|
||||
[Column("amount")]
|
||||
public long Amount { get; set; }
|
||||
[Column("bs_penalty")]
|
||||
public long? BsPenalty { get; set; }
|
||||
[Column("fb_penalty")]
|
||||
public long? FbPenalty { get; set; }
|
||||
[Column("auto_bs")]
|
||||
public long? AutoBs { get; set; }
|
||||
[Column("shares_penalty")]
|
||||
public long? SharesPenalty { get; set; }
|
||||
[Column("ac_penalty")]
|
||||
public long? AcPenalty { get; set; }
|
||||
[Column("auto_shares")]
|
||||
public long? AutoShares { get; set; }
|
||||
[Column("custom_mod")]
|
||||
public long? CustomMod { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user