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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user