Fix Cash account subtype missing from debit-normal balance check

AccountSubType.Cash was not included in IsNormalDebitBalance in both
AccountBalanceService and LedgerService, causing Cash accounts to be
treated as credit-normal. Payments deposited to a Cash account were
debited in the wrong direction, producing a negative balance.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-08 23:13:24 -04:00
parent 2694863d07
commit bc9de38da3
2 changed files with 4 additions and 2 deletions
@@ -117,7 +117,8 @@ public class AccountBalanceService : IAccountBalanceService
/// </summary>
private static bool IsNormalDebitBalance(AccountSubType subType) => subType switch
{
AccountSubType.Checking
AccountSubType.Cash
or AccountSubType.Checking
or AccountSubType.Savings
or AccountSubType.AccountsReceivable
or AccountSubType.Inventory
@@ -349,7 +349,8 @@ public class LedgerService : ILedgerService
private static bool IsNormalDebitBalance(AccountSubType subType) => subType switch
{
// Asset subtypes → normal debit balance
AccountSubType.Checking
AccountSubType.Cash
or AccountSubType.Checking
or AccountSubType.Savings
or AccountSubType.AccountsReceivable
or AccountSubType.Inventory