add bank (überweisen, einzahlen, auszahlen, Fraktionskasse)

This commit is contained in:
Michael
2020-07-03 22:24:44 +02:00
parent 4179651790
commit cffcc5659a
9 changed files with 471 additions and 6 deletions

View File

@@ -76,7 +76,7 @@ namespace ReallifeGamemode.Server.Finance
float propertyTax = GetPropertyTaxation(client);
int vehicleTaxation = GetVehicleTaxation(client);
int rentalFees = GetRentalFees(client);
int healthInsurance = (int)(user.BankAccount.Balance * 0.001);
if (healthInsurance < 0)
{
@@ -89,10 +89,10 @@ namespace ReallifeGamemode.Server.Finance
{
factionMoney = user.FactionRank.Order * 1000;
}
int otheramount = user.otheramount;
int amount = wage - (int)(wage * financialInterest) - vehicleTaxation - (int)propertyTax + (int)financialHelp - rentalFees - healthInsurance + (factionMoney ?? 0) + otheramount;
int amount = wage - (int)(wage * financialInterest) - vehicleTaxation - (int)propertyTax + (int)financialHelp - rentalFees - healthInsurance + (factionMoney ?? 0);
Paycheck paycheck = new Paycheck(financialHelp, financialInterest, vehicleTaxation, propertyTax, wage, amount, rentalFees, healthInsurance, factionMoney);
Paycheck paycheck = new Paycheck(financialHelp, financialInterest, vehicleTaxation, propertyTax, wage, amount, rentalFees, healthInsurance, factionMoney, otheramount);
Paychecks[user.Id] = paycheck;
ReleasePayDay(client, paycheck, minusJail);
}
@@ -136,7 +136,7 @@ namespace ReallifeGamemode.Server.Finance
u.BankAccount.Balance += paycheck.Amount;
u.Wage = 0;
u.otheramount = 0;
u.PaydayTimer = 60;
var rentals = dbContext.HouseRentals

View File

@@ -31,7 +31,10 @@ namespace ReallifeGamemode.Server.Finance
[JsonProperty("factionMoney")]
public int? FactionMoney { get; set; } = 0;
public Paycheck(float FinancialHelp, float FinancialInterest, int VehicleTaxation, float PropertyTaxation, int Wage, int Amount, int RentalFees, int HealthInsurance, int? FactionMoney)
[JsonProperty("otheramount")]
public int? otheramount { get; set; } = 0;
public Paycheck(float FinancialHelp, float FinancialInterest, int VehicleTaxation, float PropertyTaxation, int Wage, int Amount, int RentalFees, int HealthInsurance, int? FactionMoney, int? otheramount)
{
this.FinancialHelp = FinancialHelp;
this.FinancialInterest = FinancialInterest;
@@ -42,6 +45,7 @@ namespace ReallifeGamemode.Server.Finance
this.RentalFees = RentalFees;
this.HealthInsurance = HealthInsurance;
this.FactionMoney = FactionMoney;
this.otheramount = otheramount;
}
}
}