Skip to content

Commit

Permalink
Wage terminal (#514)
Browse files Browse the repository at this point in the history
* Done

* Merge branch 'master' into Wage-Terminal

* Update wage.yml

* make it safety

* Update WageManagerSystem.cs

* Update WageManagerSystem.cs
  • Loading branch information
KayzelW authored Mar 14, 2024
1 parent 834fc25 commit f81bfba
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Content.Server/Backmen/Economy/Wage/WageManagerSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Shared.Backmen.Economy;
using System.Linq;
using Content.Shared.Backmen.Economy;
using Content.Shared.FixedPoint;
using Content.Shared.GameTicking;
using Content.Shared.Roles;
Expand Down Expand Up @@ -62,7 +63,7 @@ public override void Shutdown()

public void OnPayday(WagePaydayEvent ev)
{
foreach (var payout in PayoutsList)
foreach (var payout in PayoutsList.ToArray())
{
// бонусная зп на отдел?
if (ev.WhiteListTo.Count > 0 && !ev.WhiteListTo.Contains(payout.ToAccountNumber))
Expand All @@ -71,6 +72,12 @@ public void OnPayday(WagePaydayEvent ev)
}
var val = ev.Value ?? payout.PayoutAmount;

if (TerminatingOrDeleted(payout.ToAccountNumber) || TerminatingOrDeleted(payout.FromAccountNumber))
{
PayoutsList.Remove(payout);
continue;
}

_bankManagerSystem.TryTransferFromToBankAccount(
payout.FromAccountNumber,
payout.ToAccountNumber,
Expand Down

0 comments on commit f81bfba

Please sign in to comment.